Opening a single MIDI input stream from multiple applications simultaneously

610 views Asked by At

We are adding support for accessing various MIDI controller devices within our application. From our own trials using midiInOpen, it seems that only one application can access a MIDI input device using midiInOpen. The second application that attempts to open the MIDI device fails with an error MMSYSERR_NOMEM.

However, I have an example of a commercial application (3rd party) which manages to access a MIDI input stream at the same time as our application (which uses midiInOpen). This suggests that there is another way of accessing the MIDI stream.

I used an API sniffer to see the API calls, and this application doesn't use midiInOpen. It uses midiInMessage and midiOutMessage, and from the API docs, these appear to be communicating directly with the driver.

I see from documentation that new support for MIDI is provided in Windows 10; I haven't experimented yet with how it works alongside an app that uses midiInOpen, but if possible, I need to find a solution which works with Windows 7 and above.

I have contacted the third party app developer to see if they can help. Currently. our app works alongside their app, but there are other apps that use midiInOpen to access MIDI data, and our app cannot co-exist with theirs. The first app that calls midiInOpen gets the MIDI stream; the second call fails.

All this testing has been done with Windows 7. We need to support 7 and above.

Our mac version of the application works fine in this regard.

1

There are 1 answers

0
CL. On

Some devices have non-standard WinMM drivers with multi-client support. But this is obviously not the case here.

Currently, Microsoft provides three MIDI APIs in Windows:

Apparently, that 3rd-party application uses DirectMusic.