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
Comments
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. |
Look at the included RtMidi examples and use the try/catch method when opening the port.On Apr 2, 2023, at 7:05 AM, Tobias Schlemmer ***@***.***> wrote:
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.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
(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 |
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. |
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?
The text was updated successfully, but these errors were encountered: