// (launch with send.ck) // to be able to play the snare file in miniAudicle you'll need // to set the current directory (Preferences->Miscellaneous) to // the directory containing the file // the drums SndBuf buf => dac; "snare.wav" => buf.read; 0.2 => buf.gain; 0 => buf.play; // the instrument Noise n => OneZero lpf => BiQuad f => JCRev rev => dac; .99999 => f.prad; .001 => f.gain; 1 => f.eqzs; 0.1 => rev.mix; -1 => lpf.zero; // create our OSC receiver OscRecv recv; 7000 => recv.port; // start listening (launch thread) recv.listen(); // create an address in the receiver, store in new variable recv.event( "/sndbuf/buf/rates, f, f" ) @=> OscEvent rates; recv.event( "/message, s" ) @=> OscEvent text; // rates OSC messages callback function void processRates() { // infinite event loop while ( true ) { // wait for event to arrive rates => now; // grab the next message from the queue. while ( rates.nextMsg() != 0 ) { // read the expected floats rates.getFloat() => float r1 => buf.play; rates.getFloat() => float r2 => f.pfreq; // print <<< "rates received:", r1, r2 >>>; // set play pointer to beginning 0 => buf.pos; } } } // test OSC messages callback function void processText() { // infinite event loop while ( true ) { // wait for event to arrive text => now; // grab the next message from the queue. while ( text.nextMsg() != 0 ) { // read expected string text.getString() => string str; <<< "message received:", str >>>; } } } spork ~ processRates(); spork ~ processText(); // loop for ever while( 0.1::second => now );