Created
June 2, 2011 03:35
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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