pub struct TempoMap { /* private fields */ }Expand description
An immutable, prepared tick-to-frame map with 0.001-BPM tempo precision.
Changes must be strictly tick-ordered, start at tick zero, and contain
1..=1024 segments. TPQ is 1..=960; sample rate follows default Limits.
Prefix durations are exact reduced u128 rationals. Every absolute position
is rounded once, nearest frame with halves up, using Music::Transport’s rule.
Invalid tempo/order/TPQ is InvalidArgument; sample-rate limits, segment
count, rational intermediate overflow or frames beyond u64 are LimitExceeded.
This deliberately differs from legacy Score’s integer-tempo floor rounding.
Implementations§
Source§impl TempoMap
impl TempoMap
pub fn new( sample_rate: u32, ticks_per_quarter: u16, changes: &[TempoChange], ) -> Result<Self>
pub fn sample_rate(&self) -> u32
pub fn ticks_per_quarter(&self) -> u16
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TempoMap
impl RefUnwindSafe for TempoMap
impl Send for TempoMap
impl Sync for TempoMap
impl Unpin for TempoMap
impl UnsafeUnpin for TempoMap
impl UnwindSafe for TempoMap
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