libremidi icon indicating copy to clipboard operation
libremidi copied to clipboard

MIDI 2.0 support

Open jcelerier opened this issue 5 years ago • 1 comments

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.

jcelerier avatar Nov 16 '20 11:11 jcelerier

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.

frink avatar Sep 01 '22 01:09 frink

it's starting to get there, at least midi_in works on macOS, I also have a tentative implementation on ALSA UMP rawmidi

jcelerier avatar Jul 28 '23 03:07 jcelerier

basic UMP support now works in ALSA sequencer too. only Win remains!

jcelerier avatar Oct 01 '23 13:10 jcelerier

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

jcelerier avatar Feb 07 '24 19:02 jcelerier

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

jcelerier avatar Feb 11 '24 18:02 jcelerier

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

jcelerier avatar Feb 11 '24 18:02 jcelerier