pub struct DurationTuple { /* private fields */ }Expand description
One written value of a duration and how long it lasts: music21’s
DurationTuple.
The length is kept beside the value because the two can disagree. A grace
note is written as an eighth and lasts no time, and a piece cut out of a
longer value may have a length no single note value reaches, which
music21 calls inexpressible and which has no type here.
Implementations§
Source§impl DurationTuple
impl DurationTuple
Sourcepub fn new(duration_type: DurationType, dots: u32) -> Self
pub fn new(duration_type: DurationType, dots: u32) -> Self
A note value with its dots, lasting as long as that is written.
Sourcepub fn from_quarter_length(quarter_length: FloatType) -> Self
pub fn from_quarter_length(quarter_length: FloatType) -> Self
The single written value a length comes to: music21’s
durationTupleFromQuarterLength. Nought is the zero value, and a
length no dotted note value has is one with no type.
Sourcepub fn silenced(self) -> Self
pub fn silenced(self) -> Self
The same written value lasting no time, which is how a grace note keeps what it is written as.
Sourcepub fn duration_type(&self) -> Option<DurationType>
pub fn duration_type(&self) -> Option<DurationType>
The note value, or None for music21’s inexpressible.
Sourcepub fn quarter_length(&self) -> FloatType
pub fn quarter_length(&self) -> FloatType
How long the value lasts, in quarter lengths.
Trait Implementations§
Source§impl Clone for DurationTuple
impl Clone for DurationTuple
impl Copy for DurationTuple
Source§impl Debug for DurationTuple
impl Debug for DurationTuple
Source§impl<'de> Deserialize<'de> for DurationTuple
Available on crate feature serde only.
impl<'de> Deserialize<'de> for DurationTuple
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>,
Source§impl PartialEq for DurationTuple
impl PartialEq for DurationTuple
Source§impl Serialize for DurationTuple
Available on crate feature serde only.
impl Serialize for DurationTuple
serde only.impl StructuralPartialEq for DurationTuple
Auto Trait Implementations§
impl Freeze for DurationTuple
impl RefUnwindSafe for DurationTuple
impl Send for DurationTuple
impl Sync for DurationTuple
impl Unpin for DurationTuple
impl UnsafeUnpin for DurationTuple
impl UnwindSafe for DurationTuple
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