I am making an app that needs to play multiple midi tracks. It’s not exactly a sequencer, but it’s similar in the way that it needs to play multiple midi tracks. Each track might be played through a different collection of VST instruments and effects.
For each track I’m creating an AudioDeviceManager, an AudioProcessorGraph and an AudioProcessorPlayer. I then add VST plugins to the graph, and play one track of the midi through it by calling getMidiMessageCollector().addMessageToQueue(midiMessage) on the AudioProcessorPlayer.
Is this the right thing to do? Or should I be sharing some of these objects across multiple tracks? If I should be sharing them, could you give me some tips about how to route different midi tracks through the different chains of instruments and effects?