Best way to handle MPE and classic MIDI input for a polysynth?

Diemo Schwarz's icon

I have a polyphonic synth that takes MPE (channel per note) using

  • main patch: midiin --> mpeeparse --[right outlet's mpeevent messages]--> poly~

  • poly voice: polymidiin -> midiparse

For it to accept non-MPE input (all notes on same channel), it needs a different path:

  • main patch: midiin --> midiparse --[right outlet's midievent messages]--> poly~

(otherwise it turns into a mono synth)

What's would be the easiest way to accept all types of controllers through the same midiin, e.g. by converting non-MPE to MPE, using channel rotation (borax?).

Or would it be better to route the non-MPE controller's MIDI events by channel, but how to do that on the raw MIDI stream / reconverting mpeevent to midievent?

Bonus fun fact: The poly voice's polymidiin seems to kind of usurp [in 1] and blocks all other messages to poly~'s first inlet. You need [in 2] if you want to send anything else into the poly voices.

Roman Thilenius's icon

what about skipping polymidiin and do custom processing of the mpe data in the main patch instead, before going into the poly~? so that mpe and non-mpe will work the same inside.

Diemo Schwarz's icon

The sorry code below is what works. What is missing here is a kind of "@channelinclude/@channelexclude" filter for midiparse and mpeparse.

do custom processing of the mpe data

Too time consuming and bug prone for me...

tyler mazaika's icon

[midiselect @note all @ctl all <etc> @ch <N>]

This would select out all the notes on the "main" channel (whichever channel that is). Last I checked though the right outlet wasn't passing Release Velocity correctly (and yes I submitted a ticket about that), but otherwise you can just feed the right outlet of [midiselect] into mpeparse -> poly~.