pub struct Tuning { /* private fields */ }Expand description
Equal-tempered phase increments and sample period for a device’s clock. One table can be shared by all voices running at the same rate.
Implementations§
Source§impl Tuning
impl Tuning
Sourcepub const fn new(numerator: u32, denominator: u32) -> Option<Self>
pub const fn new(numerator: u32, denominator: u32) -> Option<Self>
Construct a table for numerator / denominator frames per second,
with MIDI note 69 at 440 Hz. Returns None for a zero clock component.
Pitches at or above Nyquist are silent.
Sourcepub const fn phase_step(&self, note: u8) -> u32
pub const fn phase_step(&self, note: u8) -> u32
Phase advance per output frame in units of 2⁻³² turns. Returns zero for notes outside the MIDI range or at or above the output Nyquist limit.
Sourcepub const fn sample_period(&self) -> f32
pub const fn sample_period(&self) -> f32
Duration of one output frame in seconds.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Tuning
impl Freeze for Tuning
impl Move for Tuning
impl RefUnwindSafe for Tuning
impl Send for Tuning
impl Sync for Tuning
impl Unpin for Tuning
impl UnsafeUnpin for Tuning
impl UnwindSafe for Tuning
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