// (launch with recveive.ck) // host name and port "127.0.0.1" => string hostname; // use 7000 to test with receive.ck // or 6998 to test with the c++ couterpart 7000 => int port; // send object OscSend xmit; // aim the transmitter xmit.setHost( hostname, port ); // the scale [60,62,64,67,69] @=> int scale[]; // infinite time loop while( true ) { if( maybe ) { // start the message... xmit.startMsg( "/sndbuf/buf/rates", "f, f" ); // a message is kicked as soon as it is complete // - type string is satisfied and bundles are closed Std.rand2f( .5, 2.0 ) => float r1 => xmit.addFloat; Std.mtof(scale[Std.rand2( 0, scale.size()-1)]) => float r2 => xmit.addFloat; <<< "sent (via OSC):", r1, r2 >>>; } else { // start the message... xmit.startMsg( "/message", "s" ); // a message is kicked as soon as it is complete // - type string is satisfied and bundles are closed string str; if( maybe ) "hello" => str; else "goodbye" => str; str => xmit.addString; <<< "sent (via OSC):", str >>>; } // advance time .22::second => now; }