audio_graph 0.1.0

DAG audio processing graph for DAW — typed ports, topological scheduling, parallel execution
Documentation
  • Coverage
  • 45.54%
    51 out of 112 items documented2 out of 68 items with examples
  • Size
  • Source code size: 33.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.24 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ggmaldo

audio_graph

DAG-based audio processing graph for DAW applications in Rust. Connects instruments, effects and buses with typed ports and automatic topological scheduling.

Features

  • Typed ports — Audio, MIDI and Control ports per node, validated at connection time
  • DAG scheduling — Kahn's algorithm computes the correct processing order automatically
  • Parallel groups — independent nodes are grouped for concurrent execution (rayon-ready)
  • Cycle detection — connecting nodes that would create a feedback loop returns an error
  • Dynamic graph — add and remove nodes and connections at runtime
  • Lock-free routing — buffer routing between nodes uses no allocations per block

Usage

use audio_graph::{AudioGraph, Node, ProcessContext};
use audio_graph::port::{Port, PortType};
use audio_graph::port::PortId;

struct MySynth;

impl Node for MySynth {
    fn ports(&self) -> Vec<Port> {
        vec![
            Port::midi_in(0, "midi_in"),
            Port::audio_out(0, "out_l"),
            Port::audio_out(1, "out_r"),
        ]
    }

    fn process(&mut self, ctx: &mut ProcessContext) {
        // read MIDI, write audio
    }
}

let mut graph = AudioGraph::new(44100.0, 512);

let synth = graph.add_node(Box::new(MySynth));
let filter = graph.add_node(Box::new(MyFilter));

graph.connect(synth, PortId(0), filter, PortId(0), PortType::Audio)?;

graph.process_block(); // executes in correct topological order

Signal types

Port type Buffer type Use for
Audio AudioBuffer (f32, non-interleaved) Instrument and effect audio
Midi MidiBuffer (events with sample offset) Note and CC events
Control ControlBuffer (f32 per frame) Parameter automation

Part of the DAW crate ecosystem

audio_core_dsp
midi_clock_sync
audio_graph      ← you are here
event_queue
mixer
piano_roll
plugin_host
project_io

License

MIT