Overview of libremidi capabilities
masterlibremidi is a cross-platform C++20 MIDI library designed for both file-based and real-time MIDI I/O. It supports MIDI 2.0 on specific modern platforms and provides several advanced features for high-performance and real-time applications:
- Real-time I/O Support:
- macOS: version 11 or newer.
- Linux: Kernel 6.5 or newer.
- Windows: Windows 11 Insiders builds or Windows 10 with Windows MIDI Services installed.
- Device Management: Uses
libremidi::observerfor device enumeration and hotplug support across all backends. Ports are identified by handles rather than numbers to ensure stability during unplugging/replugging. - High Performance & Real-time Safety:
- Reduced memory allocations and virtual function calls.
- Support for fixed message sizes using
boost::static_vectorfor hard real-time requirements. - Support for
boost::small_vectorfor optimized general use.
- Precision Timing: Uses integer timestamps (defaulting to nanoseconds) to avoid floating-point precision issues. Supports multiple timestamping methods including relative, absolute monotonic clock, sample-based, or custom methods.
- Modern C++ Integration: Utilizes C++20 features like
std::span,std::function, and standard threading primitives (std::thread,std::jthread). - Extensive Backend Support: Includes ALSA RawMidi, PipeWire, Windows UWP, WebMIDI (via Emscripten), JACK, Computer keyboard input, and Network I/O.