pub struct Oscillator<T> { /* private fields */ }
Implementations
sourceimpl 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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<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
sourceimpl<T> Oscillator<T>where
T: From<f32>,
impl<T> Oscillator<T>where
T: From<f32>,
Trait Implementations
sourceimpl<T> Clone for Oscillator<T>where
T: Clone,
impl<T> Clone for Oscillator<T>where
T: Clone,
sourcefn clone(&self) -> Oscillator<T>
fn clone(&self) -> Oscillator<T>
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl<T> RefUnwindSafe for Oscillator<T>
impl<T> Send for Oscillator<T>
impl<T> Sync for Oscillator<T>
impl<T> Unpin for Oscillator<T>
impl<T> UnwindSafe for Oscillator<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more