Crate ravet_ foundation
Expand description
Shared processor contracts, borrowed audio buffers, events, and transport.
Safe, planar f32/f64 processing with bounded main/auxiliary buses and
borrowed input/output events. Individual processors declare their support.
Borrowed parameter schemas and fixed-size versioned state are also provided.
Default features retain desktop std math. Disable default features for
allocation-free no_std contracts with pure-Rust libm parameter mappings.
Snapshot mailboxes are available only with native 64-bit atomics.
This crate is independent of editors, plug-in formats, and device backends.
Processing implementations must avoid allocation, deallocation, blocking,
and I/O. See Processor for the lifecycle and failure contract.
Structs§
- Audio
Buffer - Borrowed planar f32/f64 samples, with separate or in-place ownership.
- Audio
Layout - A bus channel layout; zero inputs/outputs permit instrument/sidechain buses. At least one direction must be nonempty, with at most 64 channels per direction.
- Event
- Applied before the sample at
frame_offset, preserving same-frame order.EventData::NoteEndis a completion notification: its offset only orders delivery and carries no exact termination time. - Midi2
Error - Invalid group/channel, seven-bit field or unsupported message type/status.
- Midi2
Message - Validated group/channel and channel-voice fields, using zero-based addressing.
- Midi
Decoder - Incremental MIDI 1.0 byte decoder; no allocation, clock or event scheduling. Channel messages retain running status. System common cancels it; real-time bytes are emitted immediately without disturbing a partial message. A new non-real-time status discards any incomplete message. Undefined real-time statuses reject without changing state; other invalid statuses clear state. SysEx start reports UnsupportedSysEx once, then skips its data until EOX or another non-real-time status. Real-time messages within SysEx still emit.
- Midi
Message - Validated MIDI 1.0 message with at most two data bytes, preserving wire bytes. SysEx and MIDI 2.0 UMP require separate storage/protocols and are not accepted.
- NoteId
- Product-local note identity. The complete u32 range is portable; adapters validate their narrower native limits. No automatic uniqueness/lifetime policy.
- Note
Target - Matching scope within a routed note endpoint. None is a wildcard, not an unknown field. IDs retain the full portable u32 range; backends check limits.
- Output
Events - Caller-owned, bounded output events. Construct a fresh writer per callback.
- Parameter
Descriptor - Product metadata; IDs are permanent, names and units are display text.
- Parameter
Id - A permanent product-defined identity, independent of names and field order.
- Parameter
Program - Consumer-owned complete physical values in schema order. The bank constructor validates all entries before exposing any selection. MIDI bank/number are zero-based 0..16383/0..127; names are nonblank UTF-8 <=255 bytes without NUL.
- Parameter
Range - A finite nonempty range. Discrete ranges have equally spaced physical steps.
- Parameter
Schema - Validated immutable descriptors, borrowed from product-owned storage.
- Parameter
State - Complete validated physical values tied to their schema. No DSP history.
- Process
Block - A callback’s borrowed storage and event slice; no allocation is required.
- Process
Config - Validated capacities; preparation may allocate up to these limits.
- Program
Bank - Borrowed 1..128-program bank with 1..1024 parameters and <=65536 values total.
Preparation rejects duplicate IDs/addresses and strictly validates every
complete state; no partial registration, clamping or default-filled programs.
Lookup/state copying uses bounded linear work without allocation, locks or I/O.
Returned states remain tied to this schema and normalize signed zero just as
ParameterSchema::statedoes. A bank has no mutable current index: the consumer decides when/where to apply a complete state and how edits affect its identity. No file loading, MIDI routing, host registration/notifications, undo, voice reset, DSP history migration or click-free switching is synthesized. - Program
Id - Permanent product-owned identifier. Host indices are separate and may change.
- Snapshot
Mailbox - Fixed-size, allocation-free coherent snapshots with bounded attempts.
- SysEx
Assembler - Single selected stream assembler backed entirely by caller storage.
- Transport
- Optional host context; absence does not imply a stopped transport.
- Transport
Details - Explicit recording/loop/pre-roll state with independently available metadata. No field changes DSP state or advances a timeline automatically. Adapters validate the public raw values before crossing their backend boundary.
- UmpDecoder
- Incremental nonallocating framing of numeric UMP words.
- UmpMidi1
- MIDI 1.0 short messages carried by UMP MT=1 (system) or MT=2 (channel). This changes packet representation only; it does not convert MIDI protocols.
- UmpPacket
- One complete Universal MIDI Packet, retaining every bit including reserved data.
- UmpSys
ExChunk - One SysEx7 or SysEx8 payload chunk; payload excludes F0/F7 and stream ID.
Nonestream means SysEx7;Some(id)means SysEx8. - Word
Snapshot - A coherent snapshot and its publication generation.
Enums§
- Buffer
Error - A channel’s backing storage is too short for the requested active frames.
- Event
Data - Borrowed events never own heap data. Parameter values use physical units.
- Event
Error - Malformed event streams are rejected as a whole before processing.
- Midi2
Kind - MIDI 2.0 channel voice data. No resolution scaling or protocol conversion.
- Midi
Error - Small errors for invalid messages or byte-stream state.
- Midi
Kind - Decoded channel voice data uses zero-based channels and unscaled MIDI units.
- Note
Expression - Standard voice-expression units. Values replace the preceding expression; receiver DSP owns application relative to its voice defaults and smoothing.
- Note
Phase - Parameter
Error - Invalid schemas, values, or complete persisted records are rejected.
- Parameter
Gesture Phase - Raw parameter edit boundaries. Pairing, ownership, cancellation and recording are receiver policy; these events carry no scalar value or implicit state edit.
- Parameter
Scale - Mapping between normalized host/editor values and physical processor values.
- Prepare
Error - Small, nonallocating preparation errors.
- Process
Error - Process
Status - Faults require initialized silence; Continue makes no silence/tail claim.
- Program
Error - Publish
Error - A publication failed without changing any word.
- SysEx
Assembly - Assembly result, distinguishing explicit abort from incomplete input.
- SysEx
Form - Position of a payload chunk in a SysEx message.
- Tail
- A processor’s declared tail; this does not cause the framework to drain audio.
- UmpError
- Malformed framing, incomplete input, capacity or short-message semantics.
- UmpSys
ExError - Invalid chunk fields, stream ordering or destination capacity.
Constants§
- MAXIMUM_
AUXILIARY_ BUSES - Maximum additional buses, excluding the main bus.
- MAXIMUM_
CHANNELS - Maximum channels per portable bus; processors may support a smaller subset.
Traits§
- Processor
- A portable processor, exclusively owned by the processing thread.
- Sample
- Native sample precision supported by borrowed portable audio views.
Functions§
- parameter_
record_ version - Read the version of a complete parameter record without decoding it.