Debian Codegraph @

examples/basic/demo3.ck

raw
1 // demo3.ck
2 // super lame
3
4 // global gain
5 Gain g => dac;
6 // set gain
7 .5 => g.gain;
8
9 110.0 => float freq;
10 6 => int x;
11
12 // loop
13 while( x > 0 )
14 {
15 // connect to gain
16 SinOsc s => g;
17 // change frequency
18 freq => s.freq;
19 freq * 2.0 => freq;
20 // decrement x
21 1 -=> x;
22
23 // advance time by 1 second
24 1::second => now;
25 // disconnect the sinosc
26 s =< g;
27 }