pub trait Modulator: Send {
// Required methods
fn update(
&mut self,
dt: f64,
clock_info_provider: &ClockInfoProvider<'_>,
modulator_value_provider: &ModulatorValueProvider<'_>,
);
fn value(&self) -> f64;
fn finished(&self) -> bool;
// Provided method
fn on_start_processing(&mut self) { ... }
}
Expand description
Produces a stream of values that a parameter can be linked to.
Required Methods§
fn update(
&mut self,
dt: f64,
clock_info_provider: &ClockInfoProvider<'_>,
modulator_value_provider: &ModulatorValueProvider<'_>,
)
fn update( &mut self, dt: f64, clock_info_provider: &ClockInfoProvider<'_>, modulator_value_provider: &ModulatorValueProvider<'_>, )
Updates the modulator.
dt
is the time that’s elapsed since the previous round of
processing (in seconds).
Provided Methods§
fn on_start_processing(&mut self)
fn on_start_processing(&mut self)
Called whenever a new batch of audio samples is requested by the backend.
This is a good place to put code that needs to run fairly frequently, but not for every single audio sample.