Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect, that a MIDI-IN is already used by another app? #313

Closed
MidimasterSoft opened this issue Apr 2, 2023 · 4 comments
Closed

Comments

@MidimasterSoft
Copy link

pre-information:
Hi, I'm working with RT-MIDI via a BlitzMax-Wrapper. At the moment we use V 4.0.0. The BlitzMax-Wrapper is made by Bruce A Henderson (https://github.com/bmx-ng).

Today we come to the problem, that we have a MIDI-IN-Device, but it is used by another app. The question is now: How can we find out, that this Port is not aviable for us. Does RT-MIDI offer a way to detect this? by the way... is there a forum where we can ask qusetions like this to the RT-MIDI community?

@keinstein
Copy link

Do I understand it right: You have an existing MIDI Port on your system and want to read that MIDI stream with RtMidi. This doesn't work because the device is in use. This probably implies that you are using Windows as other systems usually have an intermediate layer that duplicates the stream to both applications. Both MacOS and ALSA have a device based API that allows exclusive access to the devices but usually the midi daemon (MacOS) or the sequencer API (ALSA) are used if exclusive access is necessary.

Whenever a port is not available while RtMidi tries to connect to it, an eception will be thrown. You should ask the BlitzMax people how to catch it.

@insolace
Copy link
Contributor

insolace commented Apr 2, 2023 via email

@GWRon
Copy link

GWRon commented Apr 3, 2023

(am a BlitzMax NG user and contributor)

The Exception - if thrown - is catched by BlitzMax NG (so you can try-catch in your BlitzMax-code too). Just verified it. As I am a Linux user (and for Windows: am lacking midi devices) I am not sure how to test if midiOutOpen() (respectively midiInOpen()) returns an error or not. Yet I doubt it fails to do so. Most likely the issue lays in the way the user interacts with rtMidi (via the BlitzMax wrapper module)

@MidimasterSoft
Copy link
Author

Thanks for the answers. I was able to receive the Exception with a Try/Catch-Block in BlitzMax (Window 10). The BlitzMax wrapper was already prepaired for handle the exception, but the manual did not say anything about it.

Now I'm able to find out, when a port is already used by another app or when the port is not avaiable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants