Hi. I’m sort of creating a MIDI Interface class so the AudioProcessor class stays untouched. I have created my own MIDI scheduling system, but I don’t to add too many methods in the main processor class. Want to use an abstraction so I might reuse it easily for other projects.
I’m programming MIDI only plugins, no audio. I wonder if there’s any risk in passing a reference to the MIDIBuffer and Playhead to this new class.
I know there’s a warning in AudioPlayHead::getCurrentPosition that is only has context within processorBlock(). But it will be instantly passed by reference to the MIDI interface class so I can set some variables based in its content (BPM, PPQ, etc).
The same with MidiBuffer. My idea is to manipulate a copy of the MidiBuffer and exchange received midiBuffer with the edited MidiBuffer (with swap).
After some initial tests, i could see no problem whatsoever, but I ask if I might be overlooking something. My Midi processing is light enough to fit 100s of times in a single block.