Expand description
§glicol_synth: a graph-based audio DSP library written in Rust
glicol_synth is the audio engine of glicol computer music language.
It can be used as a standalone audio library, with quite intuitive APIs:
use glicol_synth::{AudioContextBuilder, signal::ConstSig, Message};
fn main() {
let mut context = AudioContextBuilder::<16>::new()
.sr(44100).channels(1).build();
let node_a = context.add_mono_node(ConstSig::new(42.));
context.connect(node_a, context.destination);
println!("first block {:?}", context.next_block());
context.send_msg(node_a, Message::SetToNumber(0, 100.) );
println!("second block, after msg {:?}", context.next_block());
}§Overview
glicol_synth begins with a fork of the dasp_graph crate, written by @mitchmindtree.
many features and contents are added:
- use const generics for a customisable buffer size
- replace the input from vec to a map, so users can use a node id to select input
- users can send message to each node in real-time for interaction
- add a higher level audiocontext for easier APIs
- many useful audio nodes from oscillators, filters, etc.
See the examples on GitHub for the basic usage.
Re-exports§
pub use crate::BoxedNodeSend;pub use crate::Message;pub use crate::NodeData;pub use crate::Pass;pub use crate::Processor;pub use crate::Sum2;
Modules§
Macros§
Structs§
- Audio
Context - The audio context that holds a destination and the graph connection
- Audio
Context Builder - The builder to build
AudioContext - Audio
Context Config - Another option for building
AudioContext - Boxed
Node - A wrapper around a
Box<dyn Node>. - Boxed
Node Send - A wrapper around a
Box<dyn Node>. - Buffer
- The fixed-size buffer used for processing the graph.
- Input
- An important part of the
Nodetrait; eachInputcontains the relevant node id asusize - Node
Data - For use as the node weight within a dasp graph. Contains the node and its buffers.
- Pass
- A simple node that passes an input directly to the output.
- Processor
- Sum
- A stateless node that sums each of the inputs onto the output.
- Sum2