[chuck-users] Communicating with external processes

Tom Lieber lieber at princeton.edu
Wed Jan 21 08:25:17 EST 2009


2009/1/21 Andrew McPherson <apm at alum.mit.edu>:
> 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?

OSC is what you want to use. Like Gregory Brown said, you can check
the ChucK examples directory for code that receives multiple values in
one message. You can use that to get around the problem of waiting on
multiple OSC messages (by encoding the type in the data instead of the
name), although there's no way to wait on two different events like in
the code in your P.S.

> Thanks much,
> Andrew
>
> 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

-- 
Tom Lieber
http://AllTom.com/


More information about the chuck-users mailing list