Skip to main content

seconds_to_ticks

Function seconds_to_ticks 

Source
pub fn seconds_to_ticks(
    seconds: f64,
    ppq: u32,
    bpm: f64,
) -> Result<f64, AudioError>
Expand description

Convert seconds of wall-clock time to a fractional PPQ tick count.

Inverse of ticks_to_seconds. Returns a fractional tick position; callers that need an integer tick can round/floor. Returns AudioError::InvalidParameter if ppq == 0, bpm <= 0, or seconds is not finite/negative.