Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created June 2, 2011 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordanorelli/1003884 to your computer and use it in GitHub Desktop.
Save jordanorelli/1003884 to your computer and use it in GitHub Desktop.
helps determine WiiMote sampling rate as seen by ChucK for the user's system.
OscRecv recv;
6449 => recv.port;
recv.listen();
// osc message path used is the Osculator default.
recv.event("/wii/1/accel/pry/3,f") @=> OscEvent e;
time ti;
float dt;
1000000.0 => float smallest;
while(true) {
now => ti;
e => now;
(now - ti) / 1::ms => dt;
while(e.nextMsg() != 0);
if(dt > 0 && dt < smallest) {
dt => smallest;
chout <= smallest <= IO.newline();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment