Skip to main content

Tuplet

Struct Tuplet 

Source
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

Source

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.

Source

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.

Source

pub fn normal_duration_type(&self) -> DurationType

The written value the normal count is counted in.

Source

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.

Source

pub fn duration_normal(&self) -> (DurationType, u32)

The written value the normal count is counted in, with its dots: music21’s durationNormal.

Source

pub fn tuplet_actual(&self) -> (u32, (DurationType, u32))

The actual count beside the value it is written in: music21’s tupletActual.

Source

pub fn tuplet_normal(&self) -> (u32, (DurationType, u32))

The normal count beside the value it is counted in: music21’s tupletNormal.

Source

pub fn set_duration_type(&mut self, duration_type: DurationType, dots: u32)

Writes both sides of the tuplet in one value: music21’s setDurationType.

Source

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.

Source

pub fn normal_dots(&self) -> u32

The dots on that value.

Source

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.

Source

pub fn actual(&self) -> u32

How many notes are played: music21’s numberNotesActual.

Source

pub fn normal(&self) -> u32

How many notes they are played in the time of: numberNotesNormal.

Source

pub fn duration_type(&self) -> DurationType

The note value each one is written as.

Source

pub fn dots(&self) -> u32

How many augmentation dots that written value carries.

Source

pub fn multiplier(&self) -> FractionType

What the written length is multiplied by inside the tuplet: music21’s tupletMultiplier, normal / actual.

Source

pub fn full_name(&self) -> String

music21’s Tuplet.fullName: the familiar name for the ratios that have one, and Tuplet of 17/14ths for the ones that do not.

Trait Implementations§

Source§

impl Clone for Tuplet

Source§

fn clone(&self) -> Tuplet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Tuplet

Source§

impl Debug for Tuplet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Tuplet

Available on crate feature serde only.
Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Tuplet

Source§

impl Hash for Tuplet

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Tuplet

Source§

fn eq(&self, other: &Tuplet) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Tuplet

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Tuplet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.