libremidi
libremidi copied to clipboard
MIDI 2.0 support
MIDI 2 needs some level of JSON support. What library do we want to use ? I'd propose RapidJSON as it is also header-only and allows reading and writing. simdjson is super efficient but only does parsing, and nlohmann has the better API, but does allocations left and right while rapidjson allows to configure allocatores so that we can have 100% alloc-free behaviour important for real-time systems.
Based on the above RapidJSON sounds like the win. Since this is old it may be implemented. Seems several fof these issues need closing. Enjoying your work. Thanks.
it's starting to get there, at least midi_in works on macOS, I also have a tentative implementation on ALSA UMP rawmidi
basic UMP support now works in ALSA sequencer too. only Win remains!
I think the easiest would just be to provide an example of using this library with https://github.com/midi2-dev/ni-midi2/tree/main as it already has all this work done
done, here's a basic example of it here which initiates communication with MIDI2.0Workbench : https://github.com/jcelerier/libremidi/blob/master/examples/midi2_interop.cpp
I think now with some experience with MIDI-CI and MIDI 2, that it does not make too much sense for this library to provide too specific amenities, in the end every app will use the MIDI CI API differently.
I added built-in support to the basic UMP types provided by ni-midi2 : midi::universal_packet and midi::sysex7 so that it's as easy as possible to send / receive messages and handle them as midi-CI or midi 2-specific-types
In particular for a MIDI-CI workflow one would likely want to involve an external async runtime, e.g. boost.asio, Qt, cobalt ... , so that for instance the initial negociation / communication messages happen with the host app's application logic and with controllable timeouts, etc