SamplerSound note range


#1

I'm a bit confused by the note range in the SamplerSound class. For example I needed one sample on only one key and the only way I could make it work is that:

    oneNote.setRange (0, 127, false);
    oneNote.setRange(36,36,true);
    oneNote.setRange (37, 127, false);

I'm sure there's something I'm missing here...what's the best way of assigning one sample to one key only?


#2

Me again :)

setBit() is your friend.


#3

Thanks again! :)

That worked...and now I understand why I had problems with the range. I thought the second number in setRange was the end point, I just realised it's the number of "steps" in the range.

 


#4

Yes, I stepped over this also a few times.