Forgot to say,<br>so your problem was probably that some input instrument values got mapped to the sparse-values, i.e. &quot;0&quot;, of the sparse-array $genMIDIMap; hence the same drum-sample &quot;Dope~&quot;, as $waveNames[0] got called, <br>
which used to be exactly my problem as well. <br><br>If you don&#39;t want to play with the non-linear mapping, you could change the sparse-array so that other drum-sound will have greater &quot;probability&quot; 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">&lt;<a href="mailto:rcompton@math.ucla.edu">rcompton@math.ucla.edu</a>&gt;</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&#39;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-&gt;noteOn(220.0 , .7); //play a note<br>
guitar-&gt;noteOff(.01); //unplay a note<br>
guitar-&gt;tick(*sound); //tick the frame into *sound<br>
output.tick( *sound); //tick the *sound into output<br>
<br>
This code makes a &quot;d&#39;oh!&quot;:<br>
<br>
Drummer *whack = new Drummer(); //build a drum<br>
StkFrames *sound(22050,1); //setup a half second of noise<br>
whack-&gt;noteOn(42 , .7); //play a note<br>
whack-&gt;noteOff(.01); //unplay a note<br>
whack-&gt;tick(*sound); //tick the frame into *sound<br>
output.tick( *sound); //tick the *sound into output<br>
<br>
I know I&#39;m supposed to use MIDI numbers to specify which drum, but<br>
whatever MIDI number I use will just produce a &quot;d&#39;oh!&quot;.<br>
<br>
Thanks and d&#39;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>