pub struct ChordSymbol { /* private fields */ }Expand description
Parsed chord symbol.
Implementations§
Source§impl ChordSymbol
impl ChordSymbol
Sourcepub fn parse(figure: impl Into<String>) -> Result<Self>
pub fn parse(figure: impl Into<String>) -> Result<Self>
Parses a chord symbol such as "Cmaj7", "F#m7b5", or "Bb7#11".
Sourcepub fn kind(&self) -> Option<&str>
pub fn kind(&self) -> Option<&str>
music21’s chordKind: the kind the shorthand names, where it is one
of music21’s abbreviations, so Cmaj7 is major-seventh and CN6
the Neapolitan. None for a shorthand the crate reads on its own.
Sourcepub fn quality(&self) -> ChordQuality
pub fn quality(&self) -> ChordQuality
Returns the parsed chord quality.
Sourcepub fn extensions(&self) -> &[u8] ⓘ
pub fn extensions(&self) -> &[u8] ⓘ
Returns parsed extension degrees.
Sourcepub fn alterations(&self) -> &[ChordAlteration]
pub fn alterations(&self) -> &[ChordAlteration]
Returns parsed alterations.
Sourcepub fn additions(&self) -> &[ChordAlteration]
pub fn additions(&self) -> &[ChordAlteration]
Returns parsed added tones from add(...) groups.
Sourcepub fn find_figure(&self) -> String
pub fn find_figure(&self) -> String
Rebuilds the figure from the parsed parts in one canonical spelling:
music21’s findFigure. Whatever was typed, a half-diminished seventh
comes back as m7b5, an augmented triad as aug, an added ninth as
add(9), and the result parses back to the same chord.
Sourcepub fn transpose(&self, interval: &Interval) -> Result<ChordSymbol>
pub fn transpose(&self, interval: &Interval) -> Result<ChordSymbol>
The same chord on a transposed root and bass, its figure rebuilt by
Self::find_figure: music21’s transpose, so B-/D up a major
second is C/E.
Sourcepub fn inversion_is_valid(&self, inversion: u8) -> bool
pub fn inversion_is_valid(&self, inversion: u8) -> bool
Whether the chord has enough members for the given inversion:
music21’s inversionIsValid, so first and second inversions always
are, a third needs a seventh, a fourth a ninth and a fifth an
eleventh or thirteenth. Root position is not an inversion.
Trait Implementations§
Source§impl Clone for ChordSymbol
impl Clone for ChordSymbol
Source§fn clone(&self) -> ChordSymbol
fn clone(&self) -> ChordSymbol
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChordSymbol
impl Debug for ChordSymbol
Source§impl<'de> Deserialize<'de> for ChordSymbol
Available on crate feature serde only.
impl<'de> Deserialize<'de> for ChordSymbol
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 FromStr for ChordSymbol
impl FromStr for ChordSymbol
Source§impl PartialEq for ChordSymbol
impl PartialEq for ChordSymbol
Source§impl Serialize for ChordSymbol
Available on crate feature serde only.
impl Serialize for ChordSymbol
serde only.impl StructuralPartialEq for ChordSymbol
Source§impl TryFrom<&str> for ChordSymbol
impl TryFrom<&str> for ChordSymbol
Auto Trait Implementations§
impl Freeze for ChordSymbol
impl RefUnwindSafe for ChordSymbol
impl Send for ChordSymbol
impl Sync for ChordSymbol
impl Unpin for ChordSymbol
impl UnsafeUnpin for ChordSymbol
impl UnwindSafe for ChordSymbol
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