LiSa SndBuf multichan.ck

From CSWiki
Revision as of 23:23, 28 May 2010 by Dtrueman (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
//this is broken in current release 1.2.1.4-dev-1 (dracula); something changed in SndBuf
//will be fixed in next release.

//ugens
SndBuf buf;
LiSa lisa => dac;

//change this path to your own sample
"/Applications/Max5/examples/sounds/cello-f2.aif" => buf.read;

//set lisa buffer size to sample size
buf.samples()::samp => lisa.duration;
//buf.samples() returns frames now!

//transfer values from SndBuf to LiSa
for ( 0 => int i; i < buf.samples(); i++ ) {
    
    (buf.valueAt(i * buf.channels()), i::samp) => lisa.valueAt;
    
}

//party on...
1  => lisa.play;
2. => lisa.rate;

//hang on until it's done...
lisa.duration() / lisa.rate() => now;