pub struct ClockSync { /* private fields */ }Expand description
A 24-PPQN clock that both emits pulses over time and estimates incoming BPM.
Generation: ClockSync::advance accumulates elapsed seconds and returns
how many whole clock pulses should be transmitted. Consumption:
ClockSync::on_pulse feeds pulse timestamps and returns the current
smoothed BPM estimate once enough intervals are known.
Implementations§
Source§impl ClockSync
impl ClockSync
Sourcepub fn new(bpm: f64) -> Result<Self, AudioError>
pub fn new(bpm: f64) -> Result<Self, AudioError>
Build a generator/estimator anchored at bpm. Errors on bad tempo.
Sourcepub fn set_bpm(&mut self, bpm: f64) -> Result<(), AudioError>
pub fn set_bpm(&mut self, bpm: f64) -> Result<(), AudioError>
Retune the generator’s tempo. Errors on bad tempo.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClockSync
impl RefUnwindSafe for ClockSync
impl Send for ClockSync
impl Sync for ClockSync
impl Unpin for ClockSync
impl UnsafeUnpin for ClockSync
impl UnwindSafe for ClockSync
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