Open momo-the-monster opened 7 years ago
Thank you for this!
This PR didn't work for me (on Oculus Quest 2), but by adding some crude changes on top of it I was able to make it work - via the bluetooth API. See here.
Anybody interested in continuing this PR, or basing some better designed API off it should probably look into state observation on bluetooth, and fix the USB MIDI connection. I had no time so far.
This fork includes support for Android 6 (Marshmallow) devices and above.
The project includes an Android Studio project for building the plugin, as well as the plugin itself. The plugin will build directly into the Assets/MidiJack/Android/Plugins folder.
I tried to make it work the same as the Windows plugin using the Dequeue system but wound up with stuck notes and incorrect buffer order issues. So I instead use a Callback system, where MidiDriver can directly register for events happening on the plugin and respond to them. It would make sense to refactor MidiDriver to have NoteOn, NoteOff, ControlChange handlers that both this callback method and the Update while() loop method could use but I didn't want to change so much of your architecture right off the bat.
This is tested and working on my Pixel, untested on any other phones but should work as I'm using OS-level MIDI functions.