pub struct RomanNumeral { /* private fields */ }Expand description
A parsed Roman numeral in a key.
Implementations§
Source§impl RomanNumeral
impl RomanNumeral
Sourcepub fn new(figure: impl Into<String>, key: Key) -> Result<Self>
pub fn new(figure: impl Into<String>, key: Key) -> Result<Self>
Parses a Roman numeral figure in a key.
Supports ordinary figures such as V7/V and augmented-sixth figures
such as It+6, Fr+6, Ger+6, and Sw+6.
Sourcepub fn accidental(&self) -> i8
pub fn accidental(&self) -> i8
Returns the chromatic alteration of the scale degree in semitones.
Negative values are flats and positive values are sharps, so bII
returns -1 and #iv returns 1.
Sourcepub fn analyze(chord: &Chord, key: Key) -> Result<Option<Self>>
pub fn analyze(chord: &Chord, key: Key) -> Result<Option<Self>>
Performs functional Roman-numeral analysis in a key.
Sourcepub fn analyze_with_root(
chord: &Chord,
key: Key,
root: &Pitch,
) -> Result<Option<Self>>
pub fn analyze_with_root( chord: &Chord, key: Key, root: &Pitch, ) -> Result<Option<Self>>
Performs Roman-numeral analysis using an explicit harmonic root.
This is useful for pitch-class-set browser views where the caller has already chosen a transposition root and does not want inversion or root inference to pick a different chord member.
Trait Implementations§
Source§impl Clone for RomanNumeral
impl Clone for RomanNumeral
Source§fn clone(&self) -> RomanNumeral
fn clone(&self) -> RomanNumeral
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RomanNumeral
impl Debug for RomanNumeral
Auto Trait Implementations§
impl Freeze for RomanNumeral
impl RefUnwindSafe for RomanNumeral
impl Send for RomanNumeral
impl Sync for RomanNumeral
impl Unpin for RomanNumeral
impl UnsafeUnpin for RomanNumeral
impl UnwindSafe for RomanNumeral
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