//Examples on how to use STK instrument objects Mandolin m => dac; //All STK instruments are sound generators that can be patched to the dac 440 => m.freq; //All STK instruments allow you to set the frequency using .freq //All STK instruments support .noteOn to start making sound //For percussive instruments, this triggers a strike of the instrument //For wind instruments, this triggers a breath into the instrument //The value sent to noteOn should be between 0 and 1, and corresponds to onset "strength" 1.0 => m.noteOn; 1::second => now; //Percussive instruments like mandolin will naturally decay, so you don't need to call noteOff //You do need to call noteOn again if you want sound to keep happening (i.e., keep plucking it) 880 => m.freq; 0.3 => m.noteOn; 3::second => now; Clarinet c => dac; 220 => c.freq; 1.0 => c.noteOn; 1::second => now; 260 => c.freq; 3::second => now; //non-percussive instruments like the clarinet don't require you to keep calling noteOn //you'll keep blowing/playing with the same intensity until noteOff is called 1.0 => c.noteOff; 3::second => now; //a bit of time after noteOff is called allows for a nice smooth release