//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; 3.0 :: second => now; // play a bit // myDur :: samp => now; // or play the whole length 2.0 => lisa.rate; 0 :: samp => lisa.playPos; 3.0 :: second => now; // play a bit // (myDur/2.0) :: samp => now; // or play the whole length -1.0 => lisa.rate; (myDur - 1.0) :: samp => lisa.playPos; 4.0 :: second => now; // play a bit // (myDur) :: samp => now; // or play the whole length while (1) { Std.rand2f(0.01,0.2) :: second => now; Std.rand2f(0.5,2.0) => lisa.rate; Std.rand2f(0.0,myDur) :: samp => lisa.playPos; }