MPEInstrument - turn off re-trigger behaviour

Hey all,

By default, MPEInstrument will re-trigger a note if one is already playing on the same key:

However, in my case (a piano sampler) this doesn’t make sense when the pedal is held down - imagine playing a loud note, holding the pedal, and playing a quiet note. You wouldn’t expect the first loud note to suddenly stop, with only the new quiet note remaining.

Can this re-trigger behaviour be changed to be a modifiable preference? Ideally I’d like not to have to write my own MPEInstrument & MPESynthesiserBase for this one small feature.

Thanks!

  • August

You can implement this in your (derived) MPESynthesiserVoice class without any kind of modification to MPEInstrument.

A note off here doesn’t mean you have to stop the voice right away, you will get a noteStopped() call, where you can for example decide to keep playing the sample until the end/until the pedal is lifted.

Yep you’re totally right - reminding myself to sleep on things instead of making forum posts after a long day of refactoring :sweat_smile: