[][src]Struct wavetable::wt_oscillator::WtOsc

pub struct WtOsc {
    pub sample_rate: Float,
    // some fields omitted
}

Fields

sample_rate: Float

Implementations

impl WtOsc[src]

pub fn new(sample_rate: Float, wave: WavetableRef) -> WtOsc[src]

Create a new wavetable oscillator.

\param sample_rate The global sample rate of the synth

pub fn set_wavetable(&mut self, wavetable: WavetableRef)[src]

Set the wavetable to use for sound generation.

pub fn get_sample(
    &mut self,
    frequency: Float,
    sample_clock: i64,
    wave_index: Float,
    reset: bool
) -> Float
[src]

Get the next sample for the given frequency and sample clock.

Frequency is given in Hz, sample_clock is the number of ticks of the sample_rate that elapsed since initializing the oscillator. Usually this value would be incremented by 1 every time this function is called.

Auto Trait Implementations

impl RefUnwindSafe for WtOsc

impl Send for WtOsc

impl Sync for WtOsc

impl Unpin for WtOsc

impl UnwindSafe for WtOsc

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.