How to deal with MPE in SC?

Hi, is there a class jus for dealing with MPE? I just started studying about it and would like to know how to handle it in SC and also kinda how it really works in gereral


I don’t know if there’s a class, but MPE is a fairly simple idea, it shouldn’t be hard to do.

MPE uses the MIDI channel to distinguish polyphonic voices. So I think you could start with the example in the MIDI usage help file. This example distinguishes polyphonic voices based on note number (so the array has 128 elements). I’d define the array with 16 elements, and then index into the array based on the received channel number.

  • Note on: If there is already a note playing on the channel, then set the new frequency (don’t retrigger). If there isn’t a note on this channel, play a new synth.
  • Note off: If there is a note playing on the channel and its note number matches the received note number, release the synth (and clear the array entry).

Probably the array entries should be something like (num: theNoteNumber, synth: theSynth).