File: unchuck.ck

package info (click to toggle)
chuck 1.5.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 40,904 kB
  • sloc: cpp: 120,943; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 456; python: 174; perl: 86
file content (41 lines) | stat: -rw-r--r-- 752 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// noise generator, biquad filter, dac (audio output) 
Noise n => BiQuad f => dac;
// set biquad pole radius
.99 => f.prad;
// set biquad gain
.025 => f.gain;
// set equal zeros 
1 => f.eqzs;
// our float
0.0 => float t;

3::second + now => time later;
// time-loop
while( now < later )
{
    // sweep the filter resonant frequency
    100.0 + Std.fabs(Math.sin(t)) * 1000.0 => f.pfreq;
    t + .05 => t;
    // advance time
    100::ms => now;
}

// unlink the ugen f from dac
f =< dac;

// let more time pass
3::second => now;

// relink
f => dac;

// time-loop
3::second + now => later;
while( now < later )
{
    // resume sweep
    100.0 + Std.fabs(Math.sin(t)) * 1000.0 => f.pfreq;
    t + .05 => t;
    // advance time
    100::ms => now;    
}