pub struct Oscillator<T> { /* private fields */ }Implementations§
source§impl Oscillator<f32>
impl Oscillator<f32>
sourcepub fn sine(sample_rate: f32) -> Oscillator<f32>
pub fn sine(sample_rate: f32) -> Oscillator<f32>
Construct a sine generator
source§impl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn new_with_sample_rate(
sample_rate: f32,
generator_fn: fn(_: T) -> T
) -> Oscillator<T>
pub fn new_with_sample_rate( sample_rate: f32, generator_fn: fn(_: T) -> T ) -> Oscillator<T>
Construct a new oscillator with a given sample rate
sourcepub fn new(generator_fn: fn(_: T) -> T) -> Oscillator<T>
pub fn new(generator_fn: fn(_: T) -> T) -> Oscillator<T>
Construct an oscillator with 44.1Hz default sample rate
source§impl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn set_generator(&mut self, generator_fn: fn(_: T) -> T)
pub fn set_generator(&mut self, generator_fn: fn(_: T) -> T)
Set the generator function
source§impl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn set_sample_rate(&mut self, sample_rate: f32)
pub fn set_sample_rate(&mut self, sample_rate: f32)
Set the sample rate
source§impl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn get_frequency(&self) -> f32
pub fn get_frequency(&self) -> f32
Get the oscillator frequency
sourcepub fn set_frequency(&mut self, frequency: f32)
pub fn set_frequency(&mut self, frequency: f32)
Set the oscillator frequency
Trait Implementations§
source§impl<T> Clone for Oscillator<T>where
T: Clone,
impl<T> Clone for Oscillator<T>where T: Clone,
source§fn clone(&self) -> Oscillator<T>
fn clone(&self) -> Oscillator<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more