https://github.com/RustAudio/dsp-chain
A library for chaining together multiple audio dsp processors/generators, written in Rust!
https://github.com/RustAudio/dsp-chain
Last synced: 8 months ago
JSON representation
A library for chaining together multiple audio dsp processors/generators, written in Rust!
- Host: GitHub
- URL: https://github.com/RustAudio/dsp-chain
- Owner: RustAudio
- License: mit
- Created: 2014-06-20T10:40:24.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-02-19T18:02:47.000Z (almost 4 years ago)
- Last Synced: 2025-05-02T06:03:39.471Z (9 months ago)
- Language: Rust
- Homepage:
- Size: 1.74 MB
- Stars: 302
- Watchers: 28
- Forks: 19
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dsp-chain [](https://travis-ci.org/RustAudio/dsp-chain) [](https://crates.io/crates/dsp-chain) [](https://github.com/RustAudio/dsp-chain/blob/master/LICENSE)
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!](http://RustAudio.github.io/dsp-chain/dsp)
Usage
-----
Here's what it looks like:
```Rust
// 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](https://github.com/PistonDevelopers/dsp-chain/blob/master/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 = "*"
```