#midi #sysex #music #mpd226 #akai

midilab

Sysex deserialization and midi controller programming library

15 releases

Uses new Rust 2024

new 0.2.6 Mar 10, 2026
0.2.5 Mar 2, 2026
0.2.4 Feb 25, 2026
0.1.7 Feb 3, 2026
0.1.0 Jan 31, 2026

#405 in Audio

36 downloads per month
Used in 4 crates

MIT/Apache

205KB
5.5K SLoC

midilab

Software library for programming midi controllers via Sysex messages

Device definitions by manufacturer and APIs for sysex message de/serialiation

Library usage:

Add midilab to your Cargo.toml:

cargo add midilab

Examples

Parse raw bytes into a Sysex message:

use midilab::sysex::Sysex;

let bytes: &[u8] = &[0xf0, 0x47, 0x00, 0x35, 0xf7];
let sysex = Sysex::try_from(bytes).unwrap();
assert_eq!(sysex.payload(), &[0x47, 0x00, 0x35]);

Deserialize an Akai MPD226 preset acknowledgment:

use midilab::sysex::Sysex;
use midilab::manufacturer::akai::mpd226::DeviceStatus;

// Deserialize an Akai Mpd226's raw PresetAck bytes into Sysex
let bytes: &[u8] = &[0xf0, 0x47, 0x00, 0x35, 0x11, 0x00, 0x01, 0x00, 0x00, 0xf7];
let sysex = Sysex::try_from(bytes).unwrap();
// Deserialize the Sysex into a DeviceStatus variant
let status = DeviceStatus::try_from(sysex).unwrap();

Re-exports

midilab re-exports strum::IntoEnumIterator as midilab::IntoEnumIterator so consumers of this library can take advantage of derived EnumIter features in many of midilab's enums.

License

Licensed under either of

at your option.

Dependencies

~3–7MB
~125K SLoC