devela::_dep::kira::modulator

Trait Modulator

pub trait Modulator: Send {
    // Required methods
    fn update(&mut self, dt: f64, info: &Info<'_>);
    fn value(&self) -> f64 ;
    fn finished(&self) -> bool;

    // Provided method
    fn on_start_processing(&mut self) { ... }
}
Available on crate feature dep_kira only.
Expand description

Produces a stream of values that a parameter can be linked to.

Required Methods§

fn update(&mut self, dt: f64, info: &Info<'_>)

Updates the modulator.

dt is the time that’s elapsed since the previous round of processing (in seconds).

fn value(&self) -> f64

Returns the current output of the modulator.

fn finished(&self) -> bool

Whether the modulator can be removed from the audio context.

Provided Methods§

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§

§

impl Default for Box<dyn Modulator>

§

fn default() -> Box<dyn Modulator>

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

Implementors§