AUDIO
Source snapshot · 11 November 2026

API reference / ravet_foundation

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§

AudioBuffer
Borrowed planar f32/f64 samples, with separate or in-place ownership.
AudioLayout
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::NoteEnd is a completion notification: its offset only orders delivery and carries no exact termination time.
Midi2Error
Invalid group/channel, seven-bit field or unsupported message type/status.
Midi2Message
Validated group/channel and channel-voice fields, using zero-based addressing.
MidiDecoder
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.
MidiMessage
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.
NoteTarget
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.
OutputEvents
Caller-owned, bounded output events. Construct a fresh writer per callback.
ParameterDescriptor
Product metadata; IDs are permanent, names and units are display text.
ParameterId
A permanent product-defined identity, independent of names and field order.
ParameterProgram
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.
ParameterRange
A finite nonempty range. Discrete ranges have equally spaced physical steps.
ParameterSchema
Validated immutable descriptors, borrowed from product-owned storage.
ParameterState
Complete validated physical values tied to their schema. No DSP history.
ProcessBlock
A callback’s borrowed storage and event slice; no allocation is required.
ProcessConfig
Validated capacities; preparation may allocate up to these limits.
ProgramBank
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::state does. 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.
ProgramId
Permanent product-owned identifier. Host indices are separate and may change.
SnapshotMailbox
Fixed-size, allocation-free coherent snapshots with bounded attempts.
SysExAssembler
Single selected stream assembler backed entirely by caller storage.
Transport
Optional host context; absence does not imply a stopped transport.
TransportDetails
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.
UmpSysExChunk
One SysEx7 or SysEx8 payload chunk; payload excludes F0/F7 and stream ID. None stream means SysEx7; Some(id) means SysEx8.
WordSnapshot
A coherent snapshot and its publication generation.

Enums§

BufferError
A channel’s backing storage is too short for the requested active frames.
EventData
Borrowed events never own heap data. Parameter values use physical units.
EventError
Malformed event streams are rejected as a whole before processing.
Midi2Kind
MIDI 2.0 channel voice data. No resolution scaling or protocol conversion.
MidiError
Small errors for invalid messages or byte-stream state.
MidiKind
Decoded channel voice data uses zero-based channels and unscaled MIDI units.
NoteExpression
Standard voice-expression units. Values replace the preceding expression; receiver DSP owns application relative to its voice defaults and smoothing.
NotePhase
ParameterError
Invalid schemas, values, or complete persisted records are rejected.
ParameterGesturePhase
Raw parameter edit boundaries. Pairing, ownership, cancellation and recording are receiver policy; these events carry no scalar value or implicit state edit.
ParameterScale
Mapping between normalized host/editor values and physical processor values.
PrepareError
Small, nonallocating preparation errors.
ProcessError
ProcessStatus
Faults require initialized silence; Continue makes no silence/tail claim.
ProgramError
PublishError
A publication failed without changing any word.
SysExAssembly
Assembly result, distinguishing explicit abort from incomplete input.
SysExForm
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.
UmpSysExError
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.