godot icon indicating copy to clipboard operation
godot copied to clipboard

Add support for MiDi output

Open basicer opened this issue 4 months ago • 4 comments

Work in Progress

Implements https://github.com/godotengine/godot-proposals/issues/2321

Currently the API is very simple, a new method is created OS.send_midi that accepts a InputEventMIDI and sends it to the midi device specified in the event. Output device IDs can be found in OS.get_connected_midi_outputs. To use this API you first need to open MIDI with OS.open_midi_inputs which now opens both inputs and outputs.

I've tested the code on OSX and Windows, but haven't been able to find a linux machine with ALSA set up in a way Godot seems to be able to see the midi devices for, so the ALSA code is just my best guess currently.

TODO

  • [ ] Test on Linux
  • [ ] Discuss API, especially wrt (https://github.com/godotengine/godot-proposals/issues/8761)
  • [ ] Should open_midi_inputs only open inputs, and open_midi_outputs be added. If so, figure out the best way to refactor the MIDI driver open(). (Maybe add open_inputs and open_outputs, and open() stays as a deprecated alias of open_inputs()
  • [ ] Additional testing on OSX and Windows

basicer avatar Oct 13 '24 09:10 basicer