0 => int deviceNum; Hid hi; HidMsg msg; if( !hi.openMouse( deviceNum ) ) me.exit(); Step s => dac; .4 => s.gain; 0 => int i; 0 => int re; 4 => int remax; Std.rand2f(80, 20000) => float freq; (44100 / freq)$int => float steps; fun void sound() { while (1::samp => now) { if (i < steps) { Math.sin((i / steps) * Math.PI * 2) => s.next; i++; } else { 0 => i; if (re > remax) { 0 => re; Std.rand2f(20, 20000) => freq; (44100 / freq)$int => steps; } else re++; } } } spork ~ sound(); while(true) { hi => now; while( hi.recv( msg ) ) { if( msg.isMouseMotion() ) { if( msg.deltaX ) { <<>>; // move the mouse fast from left to right to modify repeat remax + Math.sgn(msg.deltaX/3)$int => remax; if (remax < 1) 1 => remax; if (remax > 70) 70 => remax; <<<"remax", remax>>>; } } else if( msg.isButtonDown() ) { // left button resets repeat to 10 if (msg.which == 0) 10 => remax; } } }