Add Web MIDI support
This PR adds support for web exports by using webmidi.
Note: webmidi is not supported on all browsers
PS: It seems
OS.get_connected_midi_inputs()will not work on the Web platform if I'm reading the code right. It might be worth documenting this explicitly in its description as well.
Kind of. OS.get_connected_midi_inputs() will be populated asynchronously. https://github.com/godotengine/godot/pull/95928/files#r1726105863
Happy to rename any variables, or make any other changes. Just let me know!
It's been a while, but I am still interested in getting this merged! Just rebased to fix merge conflicts.
@ryanbraganza Sorry for the delay! I'm reviewing this PR right now!
I'm currently investigating why it fails on the proxy_to_thread=yes build.
PROXY_TO_PTHREAD_ENABLED is essentially telling emscripten to put most of the logic not on the main thread. But as Godot expects some events to happen on the main thread, we essentially use callable_mp_static() to call deferred on the main thread if the event isn't received on it.
applied the changes and rebased
cc. @AThousandShips and @Mickeon for my suggested doc changes.
Applied all suggested changes, squashed, & rebased
Thanks!