Debian Codegraph @

examples/basic/larry++.ck

raw
1 // run each stooge, or run three stooges concurrently
2 // %> chuck moe++ larry++ curly++
3
4 // impulse to filter to dac
5 SndBuf i => BiQuad f => Gain g => JCRev r => dac;
6 // second formant
7 i => BiQuad f2 => g;
8 // third formant
9 i => BiQuad f3 => g;
10
11 // set the filter's pole radius
12 0.800 => f.prad; .995 => f2.prad; .995 => f3.prad;
13 // set equal gain zeroes
14 1 => f.eqzs; 1 => f2.eqzs; 1 => f3.eqzs;
15 // initialize float variable
16 0.0 => float v => float v2;
17 // set filter gain
18 .1 => f.gain; .1 => f2.gain; .01 => f3.gain;
19 0.05 => r.mix;
20 // load glottal pop
21 "special:glot_pop" => i.read;
22 // play
23 1.0 => i.rate;
24
25 // infinite time-loop
26 while( true )
27 {
28 // set the current sample/impulse
29 0 => i.pos;
30 // sweep the filter resonant frequency
31 250.0 + Math.sin(v*100.0)*20.0 => v2 => f.pfreq;
32 2290.0 + Math.sin(v*200.0)*50.0 => f2.pfreq;
33 3010.0 + Math.sin(v*300.0)*80.0 => f3.pfreq;
34 // increment v
35 v + .05 => v;
36 // gain
37 0.2 + Math.sin(v)*.1 => g.gain;
38 // advance time
39 (1000.0 + Math.random2f(-100.0, 100.0))::ms => now;
40 }