pub struct Lfo { /* private fields */ }Expand description
An Lfo (Low-frequency oscillation) is used to modulate sounds in a Synth with a function.
Implementations§
Source§impl Lfo
impl Lfo
Sourcepub fn new_with_fixed_function(
lfo_type: LfoFixedFunction,
rate: f32,
phase: f32,
center: f32,
depth: f32,
) -> Self
pub fn new_with_fixed_function( lfo_type: LfoFixedFunction, rate: f32, phase: f32, center: f32, depth: f32, ) -> Self
Constructs a new LFO with the given shape. See set_fixed_function().
Sourcepub fn new_with_arpeggiation(steps: &[f32]) -> Self
pub fn new_with_arpeggiation(steps: &[f32]) -> Self
Constructs a new LFO with an arpeggio. See set_arpeggiation().
Sourcepub fn new_with_user_function(
&mut self,
interpolate: bool,
f: impl FnMut() -> f32 + Send + 'static,
) -> Self
pub fn new_with_user_function( &mut self, interpolate: bool, f: impl FnMut() -> f32 + Send + 'static, ) -> Self
Constructs a new LFO with a custom function. See set_user_function().
Sourcepub fn set_fixed_function(
&mut self,
lfo_type: LfoFixedFunction,
rate: f32,
phase: f32,
center: f32,
depth: f32,
)
pub fn set_fixed_function( &mut self, lfo_type: LfoFixedFunction, rate: f32, phase: f32, center: f32, depth: f32, )
Sets the LFO to the given fixed function shape.
The rate is in cycles per second.
Sourcepub fn set_arpeggiation(&mut self, steps: &[f32])
pub fn set_arpeggiation(&mut self, steps: &[f32])
Sets the LFO type to arpeggio, where the given values are in half-steps from the center note.
For example, the sequence (0, 4, 7, 12) plays the notes of a major chord.
Sourcepub fn set_user_function(
&mut self,
interpolate: bool,
f: impl FnMut() -> f32 + Send + 'static,
)
pub fn set_user_function( &mut self, interpolate: bool, f: impl FnMut() -> f32 + Send + 'static, )
Provides a custom function for LFO values.
TODO: What does interpolate mean for this function?
Sourcepub fn set_delay(&mut self, holdoff: TimeTicks, ramp_time: TimeTicks)
pub fn set_delay(&mut self, holdoff: TimeTicks, ramp_time: TimeTicks)
Sets an initial holdoff time for the LFO where the LFO remains at its center value, and a ramp time where the value increases linearly to its maximum depth.
Sourcepub fn set_retrigger(&mut self, retrigger: bool)
pub fn set_retrigger(&mut self, retrigger: bool)
If retrigger is on, the LFO’s phase is reset to 0 when a synth using the LFO starts playing a note.
Sourcepub fn set_global(&mut self, global: bool)
pub fn set_global(&mut self, global: bool)
If global is set, the LFO is continuously updated whether or not it’s currently in use.