pub struct CtRule { /* private fields */ }Expand description
One rule of a song: music21’s CTRule, a line of the text.
Implementations§
Source§impl CtRule
impl CtRule
Sourcepub fn left_hand_side(&self) -> &str
pub fn left_hand_side(&self) -> &str
The name in front of the colon: music21’s LHS.
Sourcepub fn music_text(&self) -> &str
pub fn music_text(&self) -> &str
The chords alone, without the name or the comment: music21’s
musicText.
Sourcepub fn section_name(&self) -> String
pub fn section_name(&self) -> String
The section the name stands for, as music21 spells the six it knows:
In is an introduction, Br a bridge, Vr a verse, Ch a chorus,
Tg a tag, S the song and Fadeout itself, with whatever follows
the abbreviation kept.
Sourcepub fn measure_groups(&self) -> Vec<MeasureGroup>
pub fn measure_groups(&self) -> Vec<MeasureGroup>
The rule’s text as the groups it is read in: music21’s
_measureGroups, where each group is a measure or the expansion of
another rule, with how many times it is played.
Sourcepub fn expand(&self) -> Result<Vec<Stream>>
pub fn expand(&self) -> Result<Vec<Stream>>
The measures the rule expands to on its own, in four-four and C
major unless it says otherwise: music21’s expand on a rule with no
song behind it, which writes the key and the meter into every
measure it makes.
§Errors
A rule expanding another, which only a song can answer, a dot with no chord before it, or a key, a meter or a figure the crate cannot read.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CtRule
Available on crate feature serde only.
impl<'de> Deserialize<'de> for CtRule
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 CtRule
impl StructuralPartialEq for CtRule
Auto Trait Implementations§
impl Freeze for CtRule
impl RefUnwindSafe for CtRule
impl Send for CtRule
impl Sync for CtRule
impl Unpin for CtRule
impl UnsafeUnpin for CtRule
impl UnwindSafe for CtRule
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