pub struct DelayLine { /* private fields */ }Expand description
Delay Line
A multi-sample delay line with feedback and wet/dry mix. Supports CV-controlled delay time for effects like chorus and flanging.
The default maximum delay time is 2 seconds at any sample rate; a longer
buffer can be requested with DelayLine::with_max_delay. Two opt-in
modes cover tape-echo territory: DelayLine::with_unclamped_feedback
permits feedback at and past unity (self-oscillation) with tape-style
saturation in the recirculation path, and DelayLine::with_linear_time
reinterprets the time input as seconds directly instead of the
exponential CV map. DelayLine::tape combines all three.
Implementations§
Source§impl DelayLine
impl DelayLine
pub fn new(sample_rate: f64) -> Self
Sourcepub fn with_max_delay(sample_rate: f64, max_delay_secs: f64) -> Self
pub fn with_max_delay(sample_rate: f64, max_delay_secs: f64) -> Self
A delay line whose buffer holds up to max_delay_secs of signal.
DelayLine::new delegates here with the 2 s default, so existing
patches are unaffected. The exponential time map spans
1 ms..max_delay_secs for whatever maximum is chosen.
Sourcepub fn with_unclamped_feedback(self) -> Self
pub fn with_unclamped_feedback(self) -> Self
Opt in to feedback at and past unity (up to 1.5), with tape-style saturation applied to the recirculated sample so past-unity feedback compresses into mud instead of growing without bound. Hardware delays self-oscillate; with this flag, so does this one. Non-finite input is already sanitised before it can enter the buffer, so a NaN cannot latch.
Sourcepub fn with_linear_time(self) -> Self
pub fn with_linear_time(self) -> Self
Opt in to a linear time input: the time port takes seconds
directly (clamped to 0..max_delay_secs) instead of the exponential
1 ms · (max_ms)^cv map. The 5 ms read-distance slew still applies, so
delay-time changes glide in pitch exactly as in the default mode.
Trait Implementations§
Source§impl GraphModule for DelayLine
impl GraphModule for DelayLine
Source§fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
Source§fn set_sample_rate(&mut self, sample_rate: f64)
fn set_sample_rate(&mut self, sample_rate: f64)
Source§fn breaks_feedback_cycle(&self) -> bool
fn breaks_feedback_cycle(&self) -> bool
Source§fn tick_masked(
&mut self,
inputs: &PortValues,
outputs: &mut PortValues,
wanted: u32,
)
fn tick_masked( &mut self, inputs: &PortValues, outputs: &mut PortValues, wanted: u32, )
Source§fn process_block(
&mut self,
inputs: &BlockPortValues,
outputs: &mut BlockPortValues,
frames: usize,
)
fn process_block( &mut self, inputs: &BlockPortValues, outputs: &mut BlockPortValues, frames: usize, )
Source§fn serialize_state(&self) -> Option<Value>
fn serialize_state(&self) -> Option<Value>
alloc only.Source§fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
alloc only.Source§fn introspect(&self) -> Option<&dyn ModuleIntrospection>
fn introspect(&self) -> Option<&dyn ModuleIntrospection>
alloc only.ModuleIntrospection view, if it exposes one. Read moreSource§fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
alloc only.introspect, used to set internal parameters.Source§impl ModuleIntrospection for DelayLine
Available on crate feature alloc only.
impl ModuleIntrospection for DelayLine
alloc only.