AUDIO
Source snapshot · 11 November 2026

API reference / ravet_graph

Crate ravet_graph 

Expand description

Prepared acyclic native f32/f64 routing over owned portable processors.

Graph editing/preparation allocate on control threads; rendering/reset use prepared scratch and delay storage. This scheduler is not a Processor implementation: a later node’s fault cannot roll back earlier node histories or parameters. Such faults silence host output and disable the graph until reset. Invalid outer blocks reject before any node execution.

Structs§

Connection
Parallel connections add in declaration order. Gains must be finite.
ConvolutionTransition
Audio-owned transition. Between construction and drop, process and reset perform no allocation, deallocation, locking, I/O or panic: every engine handed back first has queue capacity reserved (or the one deferred slot), and a completed fade whose engine has nowhere to go keeps that engine as a silent, unprocessed outgoing owner until a later block boundary can return it.
ConvolutionTransitionControl
Unique control/worker endpoint. Prepare engines, offer them, and take or drop returned engines here, never on the audio thread. Send when the engine is.
CrossfadePolicy
Explicit crossfade between old and new engines. Both engines process the same input for frames frames starting at the block boundary where the transition starts; each output sample is S(old) * y_old + S(new) * y_new evaluated in the native sample type. frames == 0 is an explicit cut: the old engine is retired at that boundary without running. The new engine starts from its own prepared (zero) history; there is no history transfer between engines.
DynamicGraph
Audio-owned active graph with one prepared FIFO replacement per valid block. Process/reset never destroy graphs; retired ownership returns to control. Construct and drop both endpoints only outside callbacks. Each graph keeps its own 64 MiB cap; total in-flight graph/node memory is consumer-budgeted.
DynamicGraphAudioSession
Owner-confined dynamic graph session. Stop/drop before engine transfer/drop; do not forget/leak this guard. Retirement remains control-owned.
DynamicGraphStatus
EventConnection
Directed event connection. Duplicate connections deliberately duplicate events. Equal-time ordering follows connection declaration then source event order.
Graph
Static graph, at most 128 nodes and 4096 connections. No feedback cycles. Preparation bounds total scratch/delay to 64 MiB (16,777,216 f32 or 8,388,608 f64 values), path latency to 65536 samples, maximum block 65536 and events 1024. Events broadcast by default; explicit filtered routes can include generated node/host events. Storage counts audio and event scratch together. Event offsets are not delayed by audio latency compensation.
GraphAudioSession
Borrowed audio-owner graph session; stop/drop before returning the graph to control. Do not forget/leak this guard. Its non-Send/non-Sync marker confines normal Rust rendering/reset/stop to the starting owner. Panics remain caller ABI policy; hooks retain implementor callback obligations.
GraphControl
Unique control endpoint. Prepare/offer graphs and reclaim/drop retired graphs outside audio callbacks. Pending and retired queues each have 1..4 slots.
GraphNode
Node processor ownership, layout and stable product-defined identity.
GraphOfferError
Rejected graph ownership remains on the control thread.
MonoDuplicator
One prepared control object shared by reference and 1..64 separate native histories. The factory returns inactive kernels; successful kernels may own additional caller-defined storage outside the checked 4MiB kernel-Vec payload cap. Effect-only, no events/auxiliary/generated events; construction/preparation are CONTROL. Bypass returns exact dry input and freezes all histories.
MonoFactoryFailure
Original controls/factory, exact successfully constructed kernel prefix and first factory error. Effects already performed by the factory do not roll back.
NodeId
ReturnedEngine
An engine handed back for reuse or disposal on the control thread.
TransitionContinuity
Optional continuity policies for convolution_transition_with_continuity. TransitionContinuity::NONE (also the Default) gives exactly the behaviour of convolution_transition.
TransitionOfferError
Refused offer with ownership of the unchanged engine.
TransitionOptions
Fixed transition configuration.
TransitionReport
One audio-side event delivered to the control owner.
TransitionSetupError
Refused construction with ownership of the unchanged initial engine.
TransitionStatus
Per-block audio-side status.
TypedChain
Typed, effect-only serial Graph with 1..8 sealed concrete stages.
TypedChainAudioSession
Canonical non-Send audio-session guard with typed readonly access and bypass. Finish/drop before CONTROL mutation, extraction or transfer. Do not forget it: a forgotten guard leaves the audio owner live (see TypedChain), which is misuse and not a supported way to hand the chain to another thread.
TypedChainFailure
No processor is prepared or consumed on an ordinary constructor refusal.

Enums§

AlignmentPolicy
Optional latency alignment between the outgoing and incoming engines (see convolution_transition_with_continuity).
CrossfadeLaw
Crossfade gain law. For fade position k in 0..frames (frames since the fade started) let t = (k + 1) as f64 / frames as f64; the last faded frame has t == 1, so its gains are (0, 1) to rounding (cos(pi/2) is about 6.1e-17 in f64). Gains are computed in f64 once per frame and rounded once to the sample type; in f32 the two rounded gains can differ from their f64 sum by one unit in the last place.
Destination
EventEndpoint
Host input/output (according to edge direction), or one stable graph node.
EventFilter
Explicit event selection, without protocol conversion or parameter remapping.
GraphError
GraphOfferFailure
A proposed graph cannot enter the bounded handoff.
GraphStatus
A node failure can follow successful earlier node execution. Outer errors have node=None and do not execute nodes. All faults clear host outputs.
GraphSwapStatus
Result of the block-boundary handoff attempt, separate from graph DSP status.
LatencyPolicy
Whether engines with a different algorithmic latency are accepted.
MidFadePolicy
What happens to a proposal while a fade is in progress.
MonoFactoryError
PrimingPolicy
Optional history priming of the incoming engine (see convolution_transition_with_continuity).
ReturnReason
Why an engine was returned to the control owner.
Source
TransitionEvent
Audio-side transition event.
TransitionOfferFailure
Why an offer was refused. The caller keeps the engine.
TransitionSetupFailure
Why construction was refused.
TypedChainError
Constructor admission failures. The failure retains the exact original tuple.

Constants§

MAXIMUM_GRAPH_EVENTS
Maximum prepared input or generated output events per graph/node block. Queue capacities elsewhere may be larger; they do not raise this render limit.
TRANSITION_MAXIMUM_ALIGNMENT_FRAMES
Largest accepted AlignmentPolicy::DelayLower maximum difference in frames.
TRANSITION_MAXIMUM_CONTINUITY_BYTES
Largest accepted continuity storage (history ring plus both delay lines) in bytes of samples, checked before any allocation.
TRANSITION_MAXIMUM_FADE_FRAMES
Largest accepted crossfade length in frames.
TRANSITION_MAXIMUM_PRIMING_FRAMES
Largest accepted PrimingPolicy::History length in frames.
TRANSITION_REPORT_CAPACITY
Transition report queue capacity.
TRANSITION_RETURN_CAPACITY
Returned-engine queue capacity (retired, refused and superseded engines).

Traits§

GraphSample
Sealed native graph precision through foundation’s Sample contract. Route multiplication and summation retain the selected sample type.
SharedMonoKernel
Foreign mono kernel obligations match Processor: finite work, no callback allocation/locks/I/O, prepare failures inactive.
StageAt
Statically indexed concrete stage type. Unsupported indices do not implement this trait.
StageTuple
Sealed heterogeneous processor tuples of arity 1..8. Private-construction permits keep internal owner/wrapper operations inaccessible even when a generic caller has this public supertrait bound.
TransitionEngine
Sealed set of transitionable engines: Convolver32, Convolver64, ConvolutionBank32 and ConvolutionBank64. A single engine is one channel.
TransitionSample
Sealed native transition precision (f32 or f64).

Functions§

convolution_transition
Construct the control and audio endpoints around a prepared initial engine (CONTROL: allocates three bounded queues, one channel of sample scratch and per-frame gain scratch). maximum_frames (1..=initial maximum) bounds every audio call and every later offer. A refusal returns the initial engine unchanged.
convolution_transition_with_continuity
convolution_transition with explicit TransitionContinuity policies (CONTROL). Additionally prepares, before returning, a history ring of channels * frames samples for PrimingPolicy::History and two delay lines of channels * (maximum_difference + maximum_frames) samples for AlignmentPolicy::DelayLower. All lengths and the total (TRANSITION_MAXIMUM_CONTINUITY_BYTES) are checked before any allocation, storage is reserved fallibly, and a refusal returns the initial engine unchanged. TransitionContinuity::NONE allocates nothing extra and behaves exactly like convolution_transition.