Opening Multiple MidiInput's of Same Index Ok?

midi
#1

Hi everybody,

I’m wondering if it’s ok to open the same Midi Device by index more than once in an application? For example, my main audio engine code opens input index 0 for sending events to plugins etc etc. Then somewhere else in the code, I open it again to handle a MIDI mapping feature.

Is this ok to do, or should I try to open a device index only once?

Hope that makes sense. Thanks

0 Likes

#2

I think the win32 MIDI classes will give you trouble with this as they don’t support multi-client access. Why not use a shared AudioDeviceManager in your app which opens the MIDI device and can be passed around or have listeners attached to it?

0 Likes

#3

Ok, I’ll find a way to use a shared input. Audio device manager would be ok, but I can see limitations there as well. e.g. the case where MIDI mapping only is desired, but the other messages aren’t really wanted in the rest of the app. No biggie, I knew this day would come!

0 Likes