Trait kira::modulator::Modulator

source ·
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§

source

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).

source

fn value(&self) -> f64

Returns the current output of the modulator.

source

fn finished(&self) -> bool

Whether the modulator can be removed from the audio context.

Provided Methods§

source

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.

Trait Implementations§

source§

impl Default for Box<dyn Modulator>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Implementors§