examples/basic/blit.ck
raw| 1 | // patch |
| 2 | Blit s => JCRev r => dac; |
| 3 | .5 => s.gain; |
| 4 | .05 => r.mix; |
| 5 | |
| 6 | // an array |
| 7 | [ 0, 2, 4, 7, 9, 11 ] @=> int hi[]; |
| 8 | // <<< hi.size() >>>; |
| 9 | // <<< hi[0], hi[1], hi[2], hi[3], hi[4], hi[5] >>>; |
| 10 | |
| 11 | // infinite time loop |
| 12 | while( true ) |
| 13 | { |
| 14 | // frequency |
| 15 | Std.mtof( 33 + Math.random2(0,3) * 12 + |
| 16 | hi[Math.random2(0,hi.size()-1)] ) => s.freq; |
| 17 | |
| 18 | // harmonics |
| 19 | Math.random2( 1, 5 ) => s.harmonics; |
| 20 | |
| 21 | // advance time |
| 22 | 120::ms => now; |
| 23 | } |