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§
- Midi
Input Statistics - Relaxed snapshots may contain counts from adjacent packets; counters wrap.
- Midi
Input Stream - Owned native connection. Close/drop outside callbacks; no implicit reconnect.
- Midi
Output Stream - Output sends are native backend calls on control/worker threads.
- Midi
Packet - Owned stack packet returned from the ring; only
as_bytes()is initialized data. - Midi
Port Info - Backend-local identifiers; names need not be unique and IDs can change.
- Midi
Receiver - Unique consumer. Pop preserves FIFO packets and their unconverted timestamps.
- Prepared
Midi Input - Unique callback producer. Prepare and destroy outside callbacks.
- Prepared
UmpInput - 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.
- Timed
Ump - 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§
- Capture
Status - Midi
Device Error - Rejected preparation, packet, device selection or native backend operation.
- UmpInput
Error - 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.