Forgot to say,<br>so your problem was probably that some input instrument values got mapped to the sparse-values, i.e. "0", of the sparse-array $genMIDIMap; hence the same drum-sample "Dope~", as $waveNames[0] got called, <br>
which used to be exactly my problem as well. <br><br>If you don't want to play with the non-linear mapping, you could change the sparse-array so that other drum-sound will have greater "probability" to get called. <br>
<br>Hope this helps.<br><br>Beinan<br><br><div class="gmail_quote">On Sat, Apr 11, 2009 at 6:46 PM, Ryan Compton <span dir="ltr"><<a href="mailto:rcompton@math.ucla.edu">rcompton@math.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I started using STK the other day and can't seem to figure out how to<br>
use the noteOn for a Drummer.<br>
<br>
The following code plays a guitar just fine:<br>
<br>
Plucked *guitar = new Plucked(220.0); //build a guitar<br>
StkFrames *sound(22050,1); //setup a half second of noise<br>
guitar->noteOn(220.0 , .7); //play a note<br>
guitar->noteOff(.01); //unplay a note<br>
guitar->tick(*sound); //tick the frame into *sound<br>
output.tick( *sound); //tick the *sound into output<br>
<br>
This code makes a "d'oh!":<br>
<br>
Drummer *whack = new Drummer(); //build a drum<br>
StkFrames *sound(22050,1); //setup a half second of noise<br>
whack->noteOn(42 , .7); //play a note<br>
whack->noteOff(.01); //unplay a note<br>
whack->tick(*sound); //tick the frame into *sound<br>
output.tick( *sound); //tick the *sound into output<br>
<br>
I know I'm supposed to use MIDI numbers to specify which drum, but<br>
whatever MIDI number I use will just produce a "d'oh!".<br>
<br>
Thanks and d'oh,<br>
Ryan<br>
<br>
_______________________________________________<br>
Stk mailing list<br>
<a href="mailto:Stk@ccrma.stanford.edu">Stk@ccrma.stanford.edu</a><br>
<a href="http://ccrma-mail.stanford.edu/mailman/listinfo/stk" target="_blank">http://ccrma-mail.stanford.edu/mailman/listinfo/stk</a><br>
</blockquote></div><br>