examples/book/digital-artists/chapter9/Listing9.6.ck
raw| 1 | // Listing 9.6 Make a BPM; setting tempo here affects all others |
| 2 | // This lives in file UseBPM.ck |
| 3 | SinOsc s => dac; |
| 4 | BPM t; // Define t Object of Class BPM |
| 5 | t.tempo(300); // set tempo in BPM |
| 6 | 0.3 => s.gain; |
| 7 | |
| 8 | 400 => int freq; |
| 9 | while (freq < 800) |
| 10 | { |
| 11 | freq => s.freq; |
| 12 | t.quarterNote => now; |
| 13 | 50 +=> freq; |
| 14 | } |
| 15 |