// Slork 2013 // Week 1 ChucK Tutorial - Part 3 // Spencer Salazar - spencer@ccrma.stanford.edu // set up synthesis graph SawOsc s => NRev reverb => dac; // set reverb level (0-1) 0.1 => reverb.mix; // duration of individual note 0.125::second => dur myDur; // set gain/volume (usually 0-1) 0.1 => s.gain; // a longer scale //[60, 62, 63, 59, 56, 55, 60, 67, 68, 65, 67] // our scale [60, 62, 63, 59] @=> int notes[]; // loop through each note in the array for(0 => int myNote; myNote < notes.cap(); myNote++) { // descending octaves for(int i; i < 4; i++) { // convert MIDI note to freq notes[myNote]-i*12 => Std.mtof => s.freq; // allow time to pass myDur => now; } // randomly (50% probability) add a note to the end // either one octave up or one octave down if(Std.rand2(0,1)) notes << notes[myNote] - 12; else notes << notes[myNote] + 12; }