AUDIO
Source snapshot · 11 November 2026

API reference / ravet_midi_device

Crate ravet_midi_device 

Expand description

Explicit MIDI 1.0 device connections outside the portable umbrella.

Enumerate/connect/send/close on control or worker threads. Prepared packet handoff copies bounded messages without framework allocation or locks; native backend callbacks and output sends do not carry an audio-deadline guarantee. Timestamp origins are connection-local microseconds, not audio sample time. Packet capture and pop never panic or allocate; see decision 0295.

Re-exports§

pub use midir;

Structs§

MidiInputStatistics
Relaxed snapshots may contain counts from adjacent packets; counters wrap.
MidiInputStream
Owned native connection. Close/drop outside callbacks; no implicit reconnect.
MidiOutputStream
Output sends are native backend calls on control/worker threads.
MidiPacket
Owned stack packet returned from the ring; only as_bytes() is initialized data.
MidiPortInfo
Backend-local identifiers; names need not be unique and IDs can change.
MidiReceiver
Unique consumer. Pop preserves FIFO packets and their unconverted timestamps.
PreparedMidiInput
Unique callback producer. Prepare and destroy outside callbacks.
PreparedUmpInput
Unique prepared producer. Construction/drop belong outside callbacks. Capacity is 1..4096 packets. No allocation/locks/I/O on push; its native producer callback must obey single-producer ownership. No deadline guarantee.
TimedUmp
One complete packet and an opaque timestamp in the producer’s declared clock. This does not interpret timestamps as microseconds or audio sample positions.
UmpDelivery
Generated batch delivery prefix. A refused suffix is discarded, never replayed.
UmpReceiver
Unique consumer; pop is nonblocking and allocates nothing. Its endpoint and queued storage must be destroyed outside callbacks, as with the producer.

Enums§

CaptureStatus
MidiDeviceError
Rejected preparation, packet, device selection or native backend operation.
UmpInputError
UmpProtocol
Explicit transport protocol label; framing alone does not prove semantics.

Constants§

MAXIMUM_PACKET_BYTES
Maximum complete MIDI 1.0 packet, including SysEx start/end delimiters.

Functions§

input_ports
open_input
Connect the exact current input ID. All message classes reach validation.
open_output
open_virtual_input
Explicit virtual endpoint for Unix backend validation or consumer routing.
output_ports
validate_packet
Validate one explicit-status short message or a complete seven-bit SysEx. No running status, fragmented SysEx, embedded real-time status, or UMP.