pub enum HarmonicFunction {
Show 18 variants
TonicMajor,
TonicMajorParallelklangMinor,
TonicMajorGegenklangMinor,
TonicMinor,
TonicMinorParallelklangMajor,
TonicMinorGegenklangMajor,
SubdominantMajor,
SubdominantMajorParallelklangMinor,
SubdominantMajorGegenklangMinor,
SubdominantMinor,
SubdominantMinorParallelklangMajor,
SubdominantMinorGegenklangMajor,
DominantMajor,
DominantMajorParallelklangMinor,
DominantMajorGegenklangMinor,
DominantMinor,
DominantMinorParallelklangMajor,
DominantMinorGegenklangMajor,
}Expand description
One of the eighteen harmonic function labels.
Variants§
TonicMajor
T
TonicMajorParallelklangMinor
Tp
TonicMajorGegenklangMinor
Tg
TonicMinor
t
TonicMinorParallelklangMajor
tP
TonicMinorGegenklangMajor
tG
SubdominantMajor
S
SubdominantMajorParallelklangMinor
Sp
SubdominantMajorGegenklangMinor
Sg
SubdominantMinor
s
SubdominantMinorParallelklangMajor
sP
SubdominantMinorGegenklangMajor
sG
DominantMajor
D
DominantMajorParallelklangMinor
Dp
DominantMajorGegenklangMinor
Dg
DominantMinor
d
DominantMinorParallelklangMajor
dP
DominantMinorGegenklangMajor
dG
Implementations§
Source§impl HarmonicFunction
impl HarmonicFunction
Sourcepub fn music21_name(self) -> &'static str
pub fn music21_name(self) -> &'static str
music21’s member name: TONIC_MAJOR, SUBDOMINANT_MINOR_GEGENKLANG_MAJOR.
Sourcepub fn from_symbol(symbol: &str) -> Result<Self>
pub fn from_symbol(symbol: &str) -> Result<Self>
Sourcepub fn main_function(self) -> Self
pub fn main_function(self) -> Self
The main function alone, the label’s first letter: sP is s.
Sourcepub fn figure(self, mode: &str) -> &'static str
pub fn figure(self, mode: &str) -> &'static str
The Roman numeral figure this function has in a key of mode:
sP is bVI in major and VI in minor.
Sourcepub fn to_roman(self, key: &Key) -> Result<RomanNumeral>
pub fn to_roman(self, key: &Key) -> Result<RomanNumeral>
The Roman numeral this function is in key: music21’s
functionToRoman.
use music21_rs::{Key, analysis::harmonic_function::HarmonicFunction};
let minor = Key::from_tonic_mode("a", "minor")?;
let numeral = HarmonicFunction::SubdominantMinorParallelklangMajor.to_roman(&minor)?;
assert_eq!(numeral.figure(), "VI");§Errors
None in practice: every figure in the tables is one a Roman numeral reads.
Sourcepub fn from_roman(
numeral: &RomanNumeral,
detail: FunctionDetail,
) -> Option<Self>
pub fn from_roman( numeral: &RomanNumeral, detail: FunctionDetail, ) -> Option<Self>
The function a Roman numeral has, read off its numeral and front
alteration alone, so inversions and figures do not count: music21’s
romanToFunction. Where two functions share a numeral, the first in
music21’s table wins: vi is Tp. Nothing for a numeral no function
has.
Trait Implementations§
Source§impl Clone for HarmonicFunction
impl Clone for HarmonicFunction
impl Copy for HarmonicFunction
Source§impl Debug for HarmonicFunction
impl Debug for HarmonicFunction
Source§impl<'de> Deserialize<'de> for HarmonicFunction
Available on crate feature serde only.
impl<'de> Deserialize<'de> for HarmonicFunction
Available on crate feature
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HarmonicFunction
Source§impl Hash for HarmonicFunction
impl Hash for HarmonicFunction
Source§impl PartialEq for HarmonicFunction
impl PartialEq for HarmonicFunction
Source§impl Serialize for HarmonicFunction
Available on crate feature serde only.
impl Serialize for HarmonicFunction
Available on crate feature
serde only.impl StructuralPartialEq for HarmonicFunction
Auto Trait Implementations§
impl Freeze for HarmonicFunction
impl RefUnwindSafe for HarmonicFunction
impl Send for HarmonicFunction
impl Sync for HarmonicFunction
impl Unpin for HarmonicFunction
impl UnsafeUnpin for HarmonicFunction
impl UnwindSafe for HarmonicFunction
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,
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> ⓘ
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