bbx_midi
MIDI message parsing and streaming utilities for audio applications.
Features
- MIDI message parsing: Parse raw MIDI bytes into structured messages
- Message type helpers: Extract note, velocity, pitch wheel, control data
- Real-time buffer: Pre-allocated buffer for use in audio callbacks
- Input streaming: Real-time MIDI input via
midir - FFI compatible:
#[repr(C)]types for C interop
Message Types
NoteOn/NoteOff- Note events with velocityControlChange- CC messages (mod wheel, sustain, etc.)PitchWheel- Pitch bend with 14-bit resolutionProgramChange- Instrument/patch changesPolyphonicAftertouch- Per-note pressureChannelAftertouch- Channel-wide pressure
Usage
use ;
// Parse raw MIDI bytes
let msg = new; // Note On, C4, velocity 100
if msg.get_status == NoteOn
// Pre-allocated buffer for real-time use
let mut buffer = new;
buffer.push;
for message in buffer.iter
buffer.clear; // Reset without deallocation
License
MIT