Struct SynthProcessor
pub struct SynthProcessor { /* private fields */ }Expand description
A complete monophonic synth voice combining VCO, VCF, VCA, and ADSR.
This provides a ready-to-use synth processor that can be controlled via CV/gate signals (from MIDI or other sources).
Implementations§
§impl SynthProcessor
impl SynthProcessor
pub fn new(sample_rate: f64) -> SynthProcessor
pub fn new(sample_rate: f64) -> SynthProcessor
Create a new synth processor at the given sample rate.
pub fn note_off(&mut self)
pub fn note_off(&mut self)
Set note off.
pub fn set_cv_pitch(&mut self, cv: f64)
pub fn set_cv_pitch(&mut self, cv: f64)
Set CV pitch directly (1V/octave, 0V = 440Hz).
pub fn set_filter_cutoff(&mut self, freq: f64)
pub fn set_filter_cutoff(&mut self, freq: f64)
Set filter cutoff frequency in Hz.
pub fn set_filter_resonance(&mut self, res: f64)
pub fn set_filter_resonance(&mut self, res: f64)
Set filter resonance (0.0 - 1.0).
pub fn set_filter_env_amount(&mut self, octaves: f64)
pub fn set_filter_env_amount(&mut self, octaves: f64)
Set filter envelope amount in octaves.
pub fn set_attack(&mut self, time: f64)
pub fn set_attack(&mut self, time: f64)
Set amplitude envelope attack time in seconds.
pub fn set_sustain(&mut self, level: f64)
pub fn set_sustain(&mut self, level: f64)
Set amplitude envelope sustain level (0.0 - 1.0).
pub fn set_release(&mut self, time: f64)
pub fn set_release(&mut self, time: f64)
Set amplitude envelope release time in seconds.
pub fn set_output_level(&mut self, level: f64)
pub fn set_output_level(&mut self, level: f64)
Set output level (0.0 - 1.0).
pub fn set_waveform(&mut self, waveform: usize)
pub fn set_waveform(&mut self, waveform: usize)
Set waveform (0=saw, 1=tri, 2=pulse).
pub fn set_pulse_width(&mut self, pw: f64)
pub fn set_pulse_width(&mut self, pw: f64)
Set pulse width (0.0 - 1.0, only affects pulse wave).
pub fn process_audio(&mut self, input: f64) -> f64
pub fn process_audio(&mut self, input: f64) -> f64
Process audio input through the synth (for external audio processing). The synth VCF and VCA will process the input.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the synth state.
pub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Update sample rate.
pub fn set_control(&mut self, label: &str, value: f64)
pub fn set_control(&mut self, label: &str, value: f64)
Set a control by label (for compatibility with pedal interface).
Trait Implementations§
§impl Clone for SynthProcessor
impl Clone for SynthProcessor
§fn clone(&self) -> SynthProcessor
fn clone(&self) -> SynthProcessor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more