Skip to main content

Module running_status

Module running_status 

Source
Expand description

Canonical MIDI 1.0 message model + a zero-alloc streaming parser with running status.

MidiMessage is the Copy enum every other lane reconciles to. It covers the channel-voice messages, system-common, and system-real-time messages. SysEx payloads are variable-length and are not carried in this Copy enum; the streaming parser consumes SysEx bytes (emitting nothing) so a stream that interleaves SysEx still yields the surrounding channel messages correctly. Use crate::midi::message::sysex to frame/unframe SysEx over buffers.

MessageParser is a byte-at-a-time state machine. It carries running status (a data byte with no preceding status re-uses the last channel-voice status), decodes system-real-time bytes that are interleaved mid-message without disturbing running status, and never allocates.

Structs§

MessageParser
A zero-alloc, byte-at-a-time MIDI 1.0 stream parser with running status.

Enums§

MidiMessage
The canonical MIDI 1.0 message model (excluding SysEx payload bytes).

Functions§

parse_into
Convenience: parse into a caller-provided output buffer, returning the count written. Errors AudioError::OutputBufferTooSmall if more messages are produced than fit. Zero-alloc.
parse_stream
Parse a full byte slice, invoking on_msg for each complete message. Zero-alloc: state lives in a stack MessageParser; no buffers are grown.