[chuck-users] Communicating with external processes

Andrew McPherson apm at alum.mit.edu
Wed Jan 21 00:29:26 EST 2009

Hi all,

What are the ways to communicate between ChucK and external programs?  Specifically, my code has a lot of parameters to adjust in real time, and a GUI would be a nice way to do that.  I could put the GUI together in PD or Cocoa, but how can I transmit the data to ChucK?

The two ways I have found to receive external data are MIDI and OSC.  MIDI control changes can be a little coarse in terms of resolution (even with 14-bit values), and for most programs it'll need some sort of loopback driver to handle the routing.

OSC seems closer to a generic way of interchanging data, but it looks like I would have to spork a different thread for each parameter I want to receive (since they'd have different addresses), and that I can only receive one value per OSC event.  If I wanted, say, to receive 3 floats as part of one message, is there a way to do that?

Is there a way to read directly from a pipe to another process?  I'm thinking of a setup where an event is signaled when new data is available at the input.  Any other thoughts on how to approach this task?

Thanks much,

P.S. Semi-related to the above: is there a way to wait on 2 events simultaneously?  Thinking of something like these:

midiEvent || oscEvent => now; // wait for whichever comes first
midiEvent || 200::ms => now; // wait with a timeout

More information about the chuck-users mailing list