pub struct RubatoProfile { /* private fields */ }Expand description
Describes how much tempo can stretch for an agent.
A RubatoProfile sets the boundaries of permissible timing flexibility.
An agent with high stretch can borrow a lot of time; one with low stretch
must stay close to the written tempo.
Implementations§
Source§impl RubatoProfile
impl RubatoProfile
Sourcepub fn new(
name: impl Into<String>,
max_compress: f64,
max_stretch: f64,
transition_rate: f64,
) -> Self
pub fn new( name: impl Into<String>, max_compress: f64, max_stretch: f64, transition_rate: f64, ) -> Self
Create a new rubato profile.
Sourcepub fn expressive() -> Self
pub fn expressive() -> Self
Expressive profile: wide tempo flexibility.
Sourcepub fn apply(&self, base_bpm: f64, factor: f64) -> f64
pub fn apply(&self, base_bpm: f64, factor: f64) -> f64
Apply rubato to a base BPM, given a stretch factor.
factor ranges from -1.0 (max stretch/slow) to +1.0 (max compress/fast).
Sourcepub fn is_within_range(&self, base_bpm: f64, actual_bpm: f64) -> bool
pub fn is_within_range(&self, base_bpm: f64, actual_bpm: f64) -> bool
Whether a given BPM is within the rubato range for a base BPM.
pub fn name(&self) -> &str
pub fn max_compress(&self) -> f64
pub fn max_stretch(&self) -> f64
pub fn transition_rate(&self) -> f64
Trait Implementations§
Source§impl Clone for RubatoProfile
impl Clone for RubatoProfile
Source§fn clone(&self) -> RubatoProfile
fn clone(&self) -> RubatoProfile
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 moreSource§impl Debug for RubatoProfile
impl Debug for RubatoProfile
Source§impl PartialEq for RubatoProfile
impl PartialEq for RubatoProfile
Source§fn eq(&self, other: &RubatoProfile) -> bool
fn eq(&self, other: &RubatoProfile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RubatoProfile
Auto Trait Implementations§
impl Freeze for RubatoProfile
impl RefUnwindSafe for RubatoProfile
impl Send for RubatoProfile
impl Sync for RubatoProfile
impl Unpin for RubatoProfile
impl UnsafeUnpin for RubatoProfile
impl UnwindSafe for RubatoProfile
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