pub struct Tuplet { /* private fields */ }Expand description
A length written as a tuplet: actual notes of one written value in the
time of normal of them.
This is the naming half of music21’s Tuplet. A Duration here is a
quarter length, so a tuplet is something a length is read as rather
than something a duration carries — what it is for is being able to say
that two thirds of a quarter is a quarter triplet.
Implementations§
Source§impl Tuplet
impl Tuplet
Sourcepub fn new(
actual: u32,
normal: u32,
duration_type: DurationType,
dots: u32,
) -> Self
pub fn new( actual: u32, normal: u32, duration_type: DurationType, dots: u32, ) -> Self
A tuplet of actual notes of a written value in the time of
normal of them.
Sourcepub fn with_normal(self, duration_type: DurationType, dots: u32) -> Self
pub fn with_normal(self, duration_type: DurationType, dots: u32) -> Self
The same tuplet counting the normal side in a different written
value: music21’s durationNormal apart from its durationActual.
Sourcepub fn normal_duration_type(&self) -> DurationType
pub fn normal_duration_type(&self) -> DurationType
The written value the normal count is counted in.
Sourcepub fn duration_actual(&self) -> (DurationType, u32)
pub fn duration_actual(&self) -> (DurationType, u32)
The written value the actual notes are written as, with its dots:
music21’s durationActual, in the pair Duration::components
writes a value as.
Sourcepub fn duration_normal(&self) -> (DurationType, u32)
pub fn duration_normal(&self) -> (DurationType, u32)
The written value the normal count is counted in, with its dots:
music21’s durationNormal.
Sourcepub fn tuplet_actual(&self) -> (u32, (DurationType, u32))
pub fn tuplet_actual(&self) -> (u32, (DurationType, u32))
The actual count beside the value it is written in: music21’s
tupletActual.
Sourcepub fn tuplet_normal(&self) -> (u32, (DurationType, u32))
pub fn tuplet_normal(&self) -> (u32, (DurationType, u32))
The normal count beside the value it is counted in: music21’s
tupletNormal.
Sourcepub fn set_duration_type(&mut self, duration_type: DurationType, dots: u32)
pub fn set_duration_type(&mut self, duration_type: DurationType, dots: u32)
Writes both sides of the tuplet in one value: music21’s
setDurationType.
Sourcepub fn set_ratio(&mut self, actual: u32, normal: u32)
pub fn set_ratio(&mut self, actual: u32, normal: u32)
Changes how many notes are played in the time of how many: music21’s
setRatio.
Sourcepub fn normal_dots(&self) -> u32
pub fn normal_dots(&self) -> u32
The dots on that value.
Sourcepub fn total_tuplet_length(&self) -> FloatType
pub fn total_tuplet_length(&self) -> FloatType
How long the whole tuplet lasts: music21’s totalTupletLength, the
normal count of the value it is counted in.
Sourcepub fn duration_type(&self) -> DurationType
pub fn duration_type(&self) -> DurationType
The note value each one is written as.
Sourcepub fn multiplier(&self) -> FractionType
pub fn multiplier(&self) -> FractionType
What the written length is multiplied by inside the tuplet:
music21’s tupletMultiplier, normal / actual.
Trait Implementations§
impl Copy for Tuplet
Source§impl<'de> Deserialize<'de> for Tuplet
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Tuplet
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Tuplet
impl StructuralPartialEq for Tuplet
Auto Trait Implementations§
impl Freeze for Tuplet
impl RefUnwindSafe for Tuplet
impl Send for Tuplet
impl Sync for Tuplet
impl Unpin for Tuplet
impl UnsafeUnpin for Tuplet
impl UnwindSafe for Tuplet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more