Debian Codegraph @

examples/book/digital-artists/chapter7/TryThis.ck

raw
1 // Trying out the Moog parameters
2 Moog mog => dac;
3 200.0 => mog.freq;
4
5 while (1) {
6 Math.random2f(1.0,1.0) => mog.filterQ;
7 Math.random2f(0.01,1.0) => mog.filterSweepRate;
8 1 => mog.noteOn;
9 if (Math.random2(0,10) == 0) {
10 Math.random2f(1.0,20.0) => mog.vibratoFreq;
11 0.5 => mog.vibratoGain;
12 second => now;
13 }
14 else {
15 0.01 => mog.vibratoGain;
16 0.125 :: second => now;
17 }
18 1 => mog.noteOff;
19 0.125 :: second => now;
20 }
21