pub struct AbcTuplet {
pub src: String,
pub line: usize,
pub note_count: i32,
pub actual: i32,
pub normal: i32,
}Expand description
A tuplet’s opening, (3 or (p:q:r: music21’s ABCTuplet. Its ratio
is unknown until AbcTuplet::update_ratio.
Fields§
§src: StringThe text it was read from.
line: usizeThe line of the text it stands on, counted from one; nought where unknown.
note_count: i32How many notes it still takes; -1 until counted.
actual: i32The notes played: 3 in 3:2; -1 until known.
normal: i32The notes they take the time of: 2 in 3:2.
Implementations§
Source§impl AbcTuplet
impl AbcTuplet
Sourcepub fn update_ratio(&mut self, meter: Option<&TimeSignature>) -> Result<()>
pub fn update_ratio(&mut self, meter: Option<&TimeSignature>) -> Result<()>
music21’s updateRatio: the ratio, which for 5, 7 and 9 depends on
whether the meter in force is compound.
use music21::abc::step::AbcTuplet;
use music21::TimeSignature;
let mut tuplet = AbcTuplet::new("(5");
tuplet.update_ratio(Some(&TimeSignature::new(6, 8)?))?;
assert_eq!((tuplet.actual, tuplet.normal), (5, 3));Sourcepub fn update_note_count(&mut self) -> Result<Tuplet>
pub fn update_note_count(&mut self) -> Result<Tuplet>
music21’s updateNoteCount: how many notes the tuplet takes, and the
tuplet itself.
Trait Implementations§
impl StructuralPartialEq for AbcTuplet
Auto Trait Implementations§
impl Forget for AbcTuplet
impl Freeze for AbcTuplet
impl Move for AbcTuplet
impl RefUnwindSafe for AbcTuplet
impl Send for AbcTuplet
impl Sync for AbcTuplet
impl Unpin for AbcTuplet
impl UnsafeUnpin for AbcTuplet
impl UnwindSafe for AbcTuplet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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 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> ⓘ
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