#dsp #graph #modular #io #graph-node #back-end

dsp-chain

Provides a Node trait and a Graph type for chaining together audio generators/processors in a dsp graph

29 releases (11 breaking)

Uses old Rust 2015

0.13.1 Jun 8, 2016
0.12.0 Feb 26, 2016
0.10.0 Dec 28, 2015
0.9.0 Oct 31, 2015
0.4.5 Mar 26, 2015

#48 in #modular

Download history 19/week @ 2024-01-13 8/week @ 2024-01-20 6/week @ 2024-01-27 7/week @ 2024-02-03 22/week @ 2024-02-10 56/week @ 2024-02-17 66/week @ 2024-02-24 36/week @ 2024-03-02 47/week @ 2024-03-09 40/week @ 2024-03-16 33/week @ 2024-03-23 78/week @ 2024-03-30 31/week @ 2024-04-06 38/week @ 2024-04-13 33/week @ 2024-04-20 27/week @ 2024-04-27

133 downloads per month
Used in 7 crates (6 directly)

MIT license

36KB
442 lines

dsp-chain Build Status Crates.io Crates.io

A library for chaining together multiple audio dsp processors/generators, written in Rust!

Use cases for dsp-chain include:

  • Designing effects.
  • Creating an audio mixer.
  • Making a sampler.
  • Writing a dsp backend for a DAW.
  • Any kind of modular audio synthesis/processing.

Documenation

API documentation here!

Usage

Here's what it looks like:

// Construct our dsp graph.
let mut graph = Graph::new();

// Construct our fancy Synth and add it to the graph!
let synth = graph.add_node(DspNode::Synth);

// Add a few oscillators as inputs to the synth.
graph.add_input(DspNode::Oscillator(0.0, A5_HZ, 0.2), synth);
graph.add_input(DspNode::Oscillator(0.0, D5_HZ, 0.1), synth);
graph.add_input(DspNode::Oscillator(0.0, F5_HZ, 0.15), synth);

// Set the synth as the master node for the graph.
// This can be inferred by the graph so calling this is optional, but it's nice to be explicit.
graph.set_master(Some(synth));

// Request audio from our Graph.
graph.audio_requested(&mut buffer, settings);

Here are two working examples of using dsp-chain to create a very basic synth and an oscillating volume.

Add dsp-chain to your Cargo.toml dependencies like so:

[dependencies]
dsp-chain = "*"

Dependencies

~1.5MB
~22K SLoC