pub struct WavetableVoice<'a> { /* private fields */ }Expand description
Tier A wavetable oscillator (256-byte table, linear interpolation).
Implementations§
Source§impl<'a> WavetableVoice<'a>
impl<'a> WavetableVoice<'a>
Sourcepub const fn new(table: &'a [u8]) -> Self
pub const fn new(table: &'a [u8]) -> Self
table must hold at least 256 samples (unsigned 8-bit, centered at 128).
pub const fn sine() -> Self
pub const fn triangle() -> Self
pub const fn saw() -> Self
pub const fn square() -> Self
pub fn start(&mut self, freq_hz: u32, sample_rate_hz: u32)
pub fn stop(&mut self)
pub fn is_active(&self) -> bool
pub fn next_sample(&mut self) -> Option<i8>
Trait Implementations§
Source§impl<'a> Clone for WavetableVoice<'a>
impl<'a> Clone for WavetableVoice<'a>
Source§fn clone(&self) -> WavetableVoice<'a>
fn clone(&self) -> WavetableVoice<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for WavetableVoice<'a>
Auto Trait Implementations§
impl<'a> Freeze for WavetableVoice<'a>
impl<'a> RefUnwindSafe for WavetableVoice<'a>
impl<'a> Send for WavetableVoice<'a>
impl<'a> Sync for WavetableVoice<'a>
impl<'a> Unpin for WavetableVoice<'a>
impl<'a> UnsafeUnpin for WavetableVoice<'a>
impl<'a> UnwindSafe for WavetableVoice<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more