Debian Codegraph @

examples/special/LiSa-track4.ck

raw
1 //--------------------------------------------------------------------
2 // name: LiSa-track4.ck
3 // desc: live sampling utilities for ChucK
4 // demonstrate using track == 1 mode with LiSa
5 // requires: chuck-1.5.5.6
6 //
7 // author: Dan Trueman, 2007
8 //--------------------------------------------------------------------
9
10 // patch
11 LiSa loopme => dac;
12 // load audio file into LiSa
13 loopme.read( "geetar.wav" );
14
15 //---------------- old method; pre-1.5.5.6 ------------------------
16 // use for loading audio file (also see example: LiSa-load.ck)
17 // SndBuf buf;
18 // change this to your own audio file
19 // me.dir() + "geetar.wav" => buf.read;
20 // set lisa buffer size to sample size
21 // buf.samples()::samp => loopme.duration;
22 // transfer values from SndBuf to LiSa
23 // for( 0 => int i; i < buf.samples(); i++ )
24 // { loopme.valueAt(buf.valueAt(i), i::samp); }
25 //----------------------------------------------------
26
27 // set sync/track mode to 1, where the input chooses playback position
28 1 => loopme.sync;
29
30 // use an oscillator to set playback position
31 SinOsc tracker => loopme;
32 // step signal as offset
33 Step off => loopme;
34
35 // tracker parameters; will determine how far into the buffer
36 // to go (gain), with what offset (off) and with what speed (freq)
37 0.05 => tracker.freq;
38 0.25 => tracker.gain;
39 .5 => off.next;
40
41 // set gain
42 0.5 => loopme.gain;
43 // play it back
44 1 => loopme.play;
45
46 // infinite time-loop
47 while ( true ) { 1::second => now; }