I hope this is OK, but this is a new thread on a subject covered in a thread I created two weeks ago: https://forum.juce.com/t/cannot-open-multiple-midiouts. Not only did I make a typo I cannot correct in the old thread title, I drew conclusions in that thread that have been proven by my subsequent investigations to have been incorrect.
But the problem remains the same. I cannot find a way to open multiple MidiOutput
s, or at least not in a way that I can do any processing with them. I’ve developed this test project, which shows several attempts to solve the problem and documents how they fail:
MidiOutputTest.zip (61.7 KB)
I would appreciate it if anyone would run the project and see if the problem is replicated. I’m developing on Windows, so perhaps my code will behave differently on other operating systems or perhaps even on a different computer.
I hope this does not demonstrate a JUCE bug. Either way I hope someone can show me a way to make this work.
How to use the test project
You will need at least two MIDI output devices to connect to. If you are on Windows and happen to have the internal MIDI ports provided by LoopBe30, you can use the ones that are currently hard-coded. (I hit the same problem with the virtual ports that are available with Bome’s MIDI Translator Pro. So the problem is not specific to the ports. And I need to be able to use virtual/internal MIDI ports.) To change the MIDI output device names, go to the top of MainComponent
's constructor.
The names of the test classes containing the code to open the devices are shown in the application’s Select a Test combo box. When you select a test, some details of the specific test are shown below the combo box.
Click Start to run a test and Stop before running another test or closing the application, though as explained in the test-specific notes, the Stop button only does any real work in the last test. When a test is run, diagnostics are shown below the buttons and, in most tests, one or more error message boxes are shown.