I am recording and replaying midi streams to an external synthesizer. I need to be able to hook multiple tracks to different channels of the same midi port. I am filtering by port in the handleIncomingMidiMessage code, but only the first attempt to connect to the port succeeds. Is it not possible to make multiple connections to the same input and output port? I have multiple instances of a class that wants to connect to any of the 20 ports on my machine and use any of the 16 channels. But some need to use the same port, different channels.
Even if I record on one port and then change ports to another and test by playing it back, I can not connect a different class instance to the first port I recorded through.
I have AudioDeviceManager deviceManager; declared locally in each instance of the class. Whichever one I use for a port first works and others afterwards fail.
Multiple tracks work as long as each is linked to a different midi port, but that is very limiting.
Is there a trick to sharing a midi ports?