Effectors
Effector blocks process and transform audio signals.
Available Effectors
| Block | Description |
|---|---|
| GainBlock | Level control in dB |
| VcaBlock | Voltage controlled amplifier |
| PannerBlock | Stereo, surround (VBAP), and ambisonic panning |
| OverdriveBlock | Soft-clipping distortion |
| DcBlockerBlock | DC offset removal |
| ChannelRouterBlock | Simple stereo channel routing |
| ChannelSplitterBlock | Split multi-channel to mono outputs |
| ChannelMergerBlock | Merge mono inputs to multi-channel |
| MatrixMixerBlock | NxM mixing matrix |
| MixerBlock | Channel-wise audio mixer |
| AmbisonicDecoderBlock | Ambisonics B-format decoder |
| BinauralDecoderBlock | B-format to stereo binaural |
| LowPassFilterBlock | SVF low-pass filter |
Characteristics
Effectors have:
- 1+ inputs - Audio to process
- 1+ outputs - Processed audio
- No modulation outputs - They produce audio, not control
Effect Chain Order
Order matters for sound quality:
Recommended order:
Source -> Gain (input level)
-> Distortion
-> DC Blocker
-> Filter
-> Panning
-> Gain (output level)
Usage Pattern
#![allow(unused)] fn main() { use bbx_dsp::{ blocks::{DcBlockerBlock, GainBlock, OscillatorBlock, OverdriveBlock}, graph::GraphBuilder, waveform::Waveform, }; let mut builder = GraphBuilder::<f32>::new(44100.0, 512, 2); // Source let osc = builder.add(OscillatorBlock::new(440.0, Waveform::Saw, None)); // Effect chain let drive = builder.add(OverdriveBlock::new(3.0, 1.0, 0.8, 44100.0)); let dc = builder.add(DcBlockerBlock::new(true)); let gain = builder.add(GainBlock::new(-6.0, None)); // Connect in series builder.connect(osc, 0, drive, 0); builder.connect(drive, 0, dc, 0); builder.connect(dc, 0, gain, 0); }
Parallel Processing
Split signal to multiple effects:
#![allow(unused)] fn main() { use bbx_dsp::{ blocks::{GainBlock, OscillatorBlock, OverdriveBlock}, graph::GraphBuilder, waveform::Waveform, }; let mut builder = GraphBuilder::<f32>::new(44100.0, 512, 2); let source = builder.add(OscillatorBlock::new(440.0, Waveform::Saw, None)); // Dry path let dry_gain = builder.add(GainBlock::new(-6.0, None)); // Wet path (distorted) let wet_drive = builder.add(OverdriveBlock::new(5.0, 1.0, 0.5, 44100.0)); // Connect source to both builder.connect(source, 0, dry_gain, 0); builder.connect(source, 0, wet_drive, 0); // Mix back together let mixer = builder.add(GainBlock::new(-3.0, None)); builder.connect(dry_gain, 0, mixer, 0); builder.connect(wet_drive, 0, mixer, 0); }