Opening/Running a Sketch, then closing and Runnning a new Sketch automatically

Hi,

I am an electronic musician. I have been sending OSC messages from my music software to Processing to create pretty awesome interactive visual animations after only a few weeks of learning processing.

I am starting to think about the bigger picture now. For each musical composition I want to run a different Processing sketch. I’d love it if I could Open and Run a sketch, then close it and open and run a new sketch as seamlessly as possible. Is there a way to do this in Processing?

After searching the forum I saw someone mentioned a package manager, but I can’t find much info on that.

I am on a Mac and using that for both audio and processing. Can I run processing sketches in another software format that I can easily open and close sketches with a button press? Or with some sort of command in terminal?

I was even thinking maybe I could use a a raspberry Pi and use bash commands to open and close sketches. and somehow send the OSC messages from the Mac to the Pi over an ethernet cable or network. This would be way more involved, but wondering if that’s possible.

Any guidance, feedback or ideas would be greatly appreciated.

Thank You. Nick

1 Like

Great question.

Is your goal live performance, or is this for the studio, or both? What would “seamless” be for you – is it a fullscreen projection where the sketch window never closes? You mention “one button” – is that for minimal / hands-free triggering, or do you also want something like a playlists interface, with play/pause and chaining of a set list of sketches?

When you say “a button press” there are lots of hotkey-based launchers for Windows, Mac, or Linux that you could map to specific files. Sketches can be exported as applications – then any launcher can run them, so for example you can put each app in a touchbar menu or assign each app a keyboard shortcut.

At some point you may want a single sketch that acts as an interface to all your sub-sketches. That or a livecoding environment that is specifically pre-built to compose sketches and manage transitions between sketches.

1 Like

Hi Jeremy. Wow a lot of useful info in your reply.
So I am creating these for live performances. I am creating fullscreen projections.
I think I will try exporting my sketches as applications (I hope that means they can still receive OSC messages) and setting up some hotkeys to open one application and close another.

I also realized maybe I could get a video mixing program and perhaps use a midi command to fade one movie out while I’m changing sketches and have a screen saver for those couple of seconds, but then I’d need another application open.

Thank you for the reply. I’ll research some of these options.

Nick

PraxisLive is for livecoding, and it takes Processing sketches as patches – so I believe (?) that setting up a simple sketch-switcher should be relatively straightforward in it – including video mixing / cross fading. It has support for MIDI and OSC. You might want to check it out. The developer @neilcsmith is on this forum.

https://www.praxislive.org

1 Like

Thanks @jeremydouglass To an extent, yes - sketches can be converted to PraxisLIVE nodes quite simply, although a little bit of conversion is required as it’s Java syntax, and some things like libraries work slightly differently (because each node actually isn’t a PApplet, but a custom mapper that writes to offscreen PGraphics). And it has it’s own OSC support built in.

Incidentally, it’s not specifically for live coding. It supports it, as I think all IDEs should, but it’s as much a tool and framework for developing fixed and embedded Java and Processing projects. See eg. https://www.praxislive.org/core/

1 Like