thestk / rtmidi

A set of C++ classes that provide a common API for realtime MIDI input/output across Linux (ALSA & JACK), Macintosh OS X (CoreMIDI) and Windows (Multimedia)
Other
995 stars 273 forks source link

Question: is it possible to use a custom driver? #274

Open goofy2k opened 3 years ago

goofy2k commented 3 years ago

I am working on a project where I want to use BLE for MIDI output. I have this running for sending single commands. Now I want to use a library that uses RtMidi for input/output. Is there a way (preferably via an API) to bind a custom driver to RtMidi? I read in the docs about openVirtualPort, but that is probably not what I look for, as I don't see a way to e.g. give a pointer to a callback/custom driver.

keinstein commented 3 years ago

Yes, it is. You just have to write the glue code that supports the RtMidiApi virtual functions.

If you want to make a Operating System driver which fits directly to Windows (probably a fake USB device, ALSA (RAW interface), macOS (OSS), or whatever, you should write a driver for each system separately as you have to deal with BLE also on the OS level.

If you want to make a quick hack, openVirtualPort is exactly what you want (unfortunately it does not work with WinMM).

goofy2k commented 3 years ago

OK, thanks! With these insights, I will give it another try. Do you know/have an example? Preferably with BLE, but in the end the same for any other interface would be perfect.

Fred

Op zo 21 nov. 2021 16:21 schreef Tobias Schlemmer @.***

:

Yes, it is. You just have to write the glue code that supports the RtMidiApi virtual functions.

If you want to make a Operating System driver which fits directly to Windows (probably a fake USB device, ALSA (RAW interface), macOS (OSS), or whatever, you should write a driver for each system separately as you have to deal with BLE also on the OS level.

If you want to make a quick hack, openVirtualPort is exactly what you want (unfortunately it does not work with WinMM).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thestk/rtmidi/issues/274#issuecomment-974836441, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGII3TQYHVKCTXYJCZTYQYLUNEE7RANCNFSM5IOK54XA .

goofy2k commented 3 years ago

I had a closer look at the API. I did not find information on how to create a procedure/driver that will be detected as an available input or output port when scanning for them.....