A modern C++ MIDI 1 / MIDI 2 real-time & file I/O library. Supports Windows, macOS, Linux and WebMIDI.
libremidi is a cross-platform C++20 library for real-time and MIDI file input and output.
This is a fork / rewrite based on two libraries:
Additionnally, for MIDI 2 parsing support we use cmidi2!
Read the documentation here.
libremidi finally supports MIDI 2 on all desktop platforms 🎉!
track_any
flag to track MIDI ports that are not reported as being hardware or software.Custom
timestamping mechanism which allows the user to provide a
custom callback to run timestamping as close as possible to the event's reception.midi_in::absolute_timestamp()
to get the origin timestamp for driver-provided ticks as accurately as possible.
dlopen
. This is necessary for making apps that will run on older Linux versions which do not have the ALSA UMP APIs yet.
Note that to make an app which supports MIDI 2 on recent Linuxes and still runs on older ones, you will need to use the latest ALSA library headers as part of your build on an older distribution, by building alsa-lib yourself (as the old distributions with an old glibc that you want to build against to make compatible software of course also ship an old libasound
which won't have the UMP API...).-DLIBREMIDI_SLIM_MESSAGE=<NBytes>
(in CMake or directly to the compiler)span
when available (C++20) or (uint8_t* bytes, std::size_t size)
pairs whenever possible to reduce copying.std::function
and generally simplified.boost::small_vector
to pass midi bytes instead of std::vector
to reduce allocations.snake_case
.