50 lines · 1.4 KB · Text
RawDownload
//----------------------------------------------------------------------------// name: osc-dump.ck// desc: listen to and print all OSC messages on specified port//       for example, launch this with s.ck//       (make sure port is the same in both sender and receiver)//---------------------------------------------------------------------------- // OSC inOscIn oin; // see if port is supplied on command lineif( me.args() ) me.arg(0) => Std.atoi => oin.port;// default portelse 6449 => oin.port; // printcherr <= "listening for OSC messages over port: " <= oin.port()      <= "..." <= IO.newline();// listen to everything comingoin.listenAll(); // something to shuttle dataOscMsg msg; // infinite time loopwhile( true ){    // wait for OSC input    oin => now;        // drain the message queue    while( oin.recv(msg) )    {        // print address and typetag        cherr <= msg.address <= " " <= msg.typetag <= " ";        // loop over number of arguments by type        for(int n; n < msg.numArgs(); n++)        {            // print by type            if(msg.typetag.charAt(n) == 'i')                cherr <= msg.getInt(n) <= " ";            else if(msg.typetag.charAt(n) == 'f')                cherr <= msg.getFloat(n) <= " ";            else if(msg.typetag.charAt(n) == 's')                cherr <= msg.getString(n) <= " ";        }        // print newline        cherr <= IO.nl();    }}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t