Is there a way to filter out MIDI Channels when using the AudioProcessorPlayer in a way that the plugin only receives messages from MIDI Channel 1 for example?
It’s a common request by iOS users to filter out MIDI channels. This way they can control different instruments with the same MIDI device.
This may not be applicable to your use case, but I’m working on a multi-MidiChannel arpeggiator/plugin host, and what I do (simplified explanation) is take the incoming MIDI buffer, iterate through it and copy messages for a particular MidiChannel to a copyBuffer, then replace the incoming MIDI buffer with my copy and continue:
for (const MidiMessageMetadata meta : midiMessages)
{
const auto msg = meta.getMessage();
if (msg.isForChannel (midiChannel))
copyBuffer.addEvent (msg, meta.samplePosition);
}
// replace the incoming MIDI buffer with a copy of this one
// that only has a certain MIDI channel for passing down the chain
midiMessages = copyBuffer;