| 1 |
// run each stooge, or run three stooges concurrently |
| 2 |
// %> chuck moe++ larry++ curly++ |
| 3 |
|
| 4 |
// source to filter to dac |
| 5 |
SndBuf i => BiQuad f => Gain g => 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 |
.995 => f.prad; .995 => f2.prad; .995 => f3.prad; |
| 13 |
// set equal gain zeros |
| 14 |
1 => f.eqzs; 1 => f2.eqzs; 1 => f3.eqzs; |
| 15 |
// initialize float variable |
| 16 |
1.5 * 3.14 => float v; |
| 17 |
// set filter gain |
| 18 |
.2 => f.gain; .04 => f2.gain; .01 => f3.gain; |
| 19 |
// load glottal pop |
| 20 |
"special:glot_pop" => i.read; |
| 21 |
// play |
| 22 |
1.0 => i.rate; |
| 23 |
|
| 24 |
|
| 25 |
// infinite time-loop |
| 26 |
while( true ) |
| 27 |
{ |
| 28 |
// set the current pos |
| 29 |
0 => i.pos; |
| 30 |
|
| 31 |
// sweep the filter resonant frequency |
| 32 |
660.0 + Math.sin(v)*80.0 => f.pfreq; |
| 33 |
1780.0 + Math.sin(v*.5)*50.0 => f2.pfreq; |
| 34 |
2410.0 + Math.sin(v*.25)*150.0 => f3.pfreq; |
| 35 |
|
| 36 |
// increment v |
| 37 |
v + .05 => v; |
| 38 |
// gain |
| 39 |
0.2 + Math.sin(v)*.2 => g.gain; |
| 40 |
// advance time |
| 41 |
(80.0 + Math.sin(v*2.0)*10.0)::ms => now; |
| 42 |
} |