//ugens SndBuf buf; LiSa lisa => dac; //change this path to your own sample "TomVega.wav" => buf.read; //set lisa buffer size to sample size buf.samples()::samp => lisa.duration; //transfer values from SndBuf to LiSa //works properly for mono; need to skip samples for multichannel for ( 0 => int i; i < buf.samples(); i++ ) { (buf.valueAt(i), i::samp) => lisa.valueAt; } //party on... 1 => lisa.play; lisa.duration() / (1.0 :: samp) => float myDur; // instantiate a HidIn object and message holder Hid hi; HidMsg msg; if( !hi.openTiltSensor() ) { // open tilt sensor <<< "tilt sensor unavailable", "" >>>; me.exit(); } while (1) { hi.read( 9, 0, msg ); // 9, 0 = zeroeth accelerometer (msg.y) / 128.0 => lisa.rate; (myDur * (msg.x + 256.0) / 512.0) :: samp => lisa.playPos; 0.2 :: second => now; }