Crate auxide

Crate auxide 

Source
Expand description

§Auxide

A real-time-safe, deterministic, block-based audio graph kernel for building audio tools.

§Architecture

The core flow is: Graph → Plan → Runtime.

  • Graph: Define nodes and edges.
  • Plan: Compile the graph into an execution schedule.
  • Runtime: Process audio blocks deterministically.

§Real-Time Safety

RT paths (e.g., Runtime::process_block) avoid allocations and locking. Graph mutation and plan compilation may allocate.

§Determinism

Given the same graph, plan, and inputs, outputs are identical (modulo floating-point precision and any non-deterministic operations like random number generation).

§Invariants

  • Only one edge may write to a given input port (single-writer rule).
  • No cycles unless involving delay nodes.
  • All ports must have compatible rates.

§Example

use auxide::graph::{Graph, NodeType, PortId, Rate};
use auxide::plan::Plan;
use auxide::rt::Runtime;

let mut graph = Graph::new();
let osc = graph.add_node(NodeType::SineOsc { freq: 440.0 });
let sink = graph.add_node(NodeType::OutputSink);
graph.add_edge(auxide::graph::Edge {
    from_node: osc,
    from_port: PortId(0),
    to_node: sink,
    to_port: PortId(0),
    rate: Rate::Audio,
}).unwrap();

let plan = Plan::compile(&graph, 64).unwrap();
let mut runtime = Runtime::new(plan, &graph, 44100.0);
let mut out = vec![0.0; 64];
runtime.process_block(&mut out).unwrap();

Modules§

control
Control message types for main → RT communication.
dsl
DSL module: builder API for graphs.
graph
Graph module for Auxide: correct-by-construction signal graphs.
invariant_ppt
PPT Invariant System: Runtime invariant enforcement with contract tracking.
invariant_rt
RT-safe invariant signaling for real-time audio paths.
node
Trait-based node definitions for external DSP nodes.
plan
Plan module: compile graph into executable plan.
rt
RT module: real-time execution engine.
states
Node state definitions for the RT engine.