A simple 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.
Here's what it looks like:
```Rust // Construct our dsp graph. let mut dsp_graph = Graph::new();
// Construct our fancy Synth and add it to the graph! let synth = dspgraph.addnode(DspNode::Synth);
// Construct a few oscillators, add them to the graph and connect them to the synth. let oscillatora = dspgraph.addnode(DspNode::Oscillator(0.0, A5HZ, 0.2)); let oscillatorb = dspgraph.addnode(DspNode::Oscillator(0.0, D5HZ, 0.1)); let oscillatorc = dspgraph.addnode(DspNode::Oscillator(0.0, F5HZ, 0.15)); dspgraph.addinput(oscillatora, synth).unwrap(); dspgraph.addinput(oscillatorb, synth).unwrap(); dspgraph.addinput(oscillator_c, synth).unwrap();
// Set the synth as the master node for the graph. dspgraph.setmaster(Some(synth));
// Request audio from our Graph. dspgraph.audiorequested(&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:
toml
[dependencies]
dsp-chain = "*"
dsp-chain uses PortAudio as a cross-platform audio backend. The rust-portaudio dependency will first try to find an already installed version on your system before trying to download it and build PortAudio itself.
MIT - Same license as PortAudio.