Skip to content

Instantly share code, notes, and snippets.

@stuntgoat
Created April 21, 2012 20:55
Show Gist options
  • Save stuntgoat/2439549 to your computer and use it in GitHub Desktop.
Save stuntgoat/2439549 to your computer and use it in GitHub Desktop.
OSC receive dot ChucK
// (launch with OSC_send.ck)
// the patch
// create our OSC receiver
OscRecv recv;
// use port 6449
6449 => recv.port;
// start listening (launch thread)
recv.listen();
// create an address in the receiver, store in new variable
recv.event( "/hello, ii" ) @=> OscEvent oe;
// infinite event loop
while ( true )
{
// wait for event to arrive
oe => now;
// grab the next message from the queue.
while ( oe.nextMsg() != 0 )
{
// print
<<< "got (via OSC):", oe.getInt(), oe.getInt() >>>;
// set play pointer to beginning
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment