examples/book/digital-artists/chapter7/Listing7.9.ck
raw| 1 | // Listing 7.9 Trying out the many presets of the ModalBar UGen |
| 2 | |
| 3 | // Demo of modal bar presets |
| 4 | ModalBar bar => dac; |
| 5 | |
| 6 | while (true) { |
| 7 | // pick a random object type |
| 8 | Math.random2(0,8) => bar.preset; |
| 9 | |
| 10 | // and random frequency |
| 11 | Math.random2f(200.0,1000.0) => bar.freq; |
| 12 | |
| 13 | // Then whack it!! |
| 14 | 1 => bar.noteOn; |
| 15 | 0.4 :: second => now; |
| 16 | } |
| 17 |