This is an old problem I encountered.<br>The original drum sample mapping in STK is kinda confusing at first glance; <br>Just try to look at the drummer.cpp drum mapping code more closely, <br><br>Three relevant traces to keep in mind:<br>
1. The arrays $genMIDIMap and $waveNames, <br> genMIDIMap[i] refers to an index in waveNames, <br> you can change the mapping to your own scheme.<br>2. Line 88, your input noteOn instrument index is mapped to $noteNumber in a non-linear way<br>
3. Line 126, finally $noteNumber is used as genMIDIMap index to address waveNames, tadah...<br><br>Best,<br>Beinan<br><br><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>