examples/book/digital-artists/chapter7/Listing7.3.ck
raw| 1 | // Listing 7.3 Noodling around with the STK Flute PM UGen |
| 2 | |
| 3 | // Noodling around with the STK Flute UGen |
| 4 | Flute pipe => dac; |
| 5 | |
| 6 | while (true) |
| 7 | { |
| 8 | // pick a random MIDI note to play |
| 9 | Std.mtof(Math.random2(60,80)) => pipe.freq; |
| 10 | 1 => pipe.noteOn; |
| 11 | 0.8 :: second => now; |
| 12 | |
| 13 | // then randomly mess around with the jetDelay |
| 14 | for (0 => int i; i < 4; i++) { |
| 15 | Math.random2f(0.0,1.0) => pipe.jetDelay; |
| 16 | 0.2 :: second => now; |
| 17 | } |
| 18 | |
| 19 | 1 => pipe.noteOff; |
| 20 | 0.1 :: second => now; |
| 21 | } |
| 22 |