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]
/
examples
/
mandolin.ck
blob
1e9cdcede8e48768272b3933d15c9c2a2ae1ab93
1
// patch
2
Mandolin mand => dac;
3
4
// time loop
5
while( true )
6
{
7
// pos
8
std.rand2f ( 0.2, 0.8 ) => mand.pluckPos;
9
// freq
10
220.0 * math.pow( 1.059, (float)std.rand2(0,24) ) => mand.freq;
11
// pluck!
12
std.rand2f( 0.4, 0.9 ) => mand.pluck;
13
14
// advance time
15
if ( std.randf() > 0.0 ) {
16
1::second => now;
17
} else {
18
0.5::second => now;
19
}
20
}