repo.or.cz
/
chuck-blob.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
*** empty log message ***
[chuck-blob.git]
/
v2
/
examples
/
basic
/
alarm.ck
blob
a1daf9500c3c7e543bc65e1f6187ae2888fc132c
1
// how long
2
2::hour => dur T;
3
// frequency
4
880 => float f;
5
6
// remember
7
now => time start;
8
now + T => time later;
9
10
// wait
11
while( now < later )
12
{
13
<<< (T - (now - start)) / second, "left..." >>>;
14
1::second => now;
15
}
16
17
// patch
18
SinOsc s => JCRev r => dac;
19
.025 => r.mix;
20
f => s.freq;
21
22
// infinite while loop
23
while( true )
24
{
25
// go
26
1.0 => s.gain;
27
300::ms => now;
28
// stop
29
0.0 => s.gain;
30
300::ms => now;
31
}