I would like to get the MPE messages directly to the processblock in the audio processor. How do we handle the MPEmessages other then the Midimessages ?
The classical usage is
MidiBuffer::Iterator it(midiMessages); // pasted by the process block
MidiMessage message;
while(it.getNextEvent(message, position))
{…
}
When I replace MidiMessage with MPEMessages, I get an error.
I have turned on the MPE support in the audio processor like this in the header;
bool supportsMPE() const override { return true; }
Have a look at the MPESynthesiser class. In fact, if you look at MPESynthesiserBase::renderNextBlock() function then you can see how it processes the messages.
Yes it should work. I could see that you maybe didn’t want to use MPESynthesiser. If you look in MPESynthesiserBase::renderNextBlock() it does fairly standard iteration of the MIDI messages.
MPE messages ARE normal midi messages. There’s nothing special about them apart from the way you interpret them.
But I’d really strongly suggest that you use MPESynthesiser rather than trying to implement your own parser for it, even if you’re not building a synth. It still took us months of fine-tuning to get our implementation correct, it’s much harder than it looks.