pub enum Specifier {
Perfect = 1,
Major = 2,
Minor = 3,
Augmented = 4,
Diminished = 5,
DoubleAugmented = 6,
DoubleDiminished = 7,
TripleAugmented = 8,
TripleDiminished = 9,
QuadrupleAugmented = 10,
QuadrupleDiminished = 11,
}Expand description
An interval quality, numbered as music21 numbers its Specifier enum.
Variants§
Perfect = 1
P
Major = 2
M
Minor = 3
m
Augmented = 4
A
Diminished = 5
d
DoubleAugmented = 6
AA
DoubleDiminished = 7
dd
TripleAugmented = 8
AAA
TripleDiminished = 9
ddd
QuadrupleAugmented = 10
AAAA
QuadrupleDiminished = 11
dddd
Implementations§
Source§impl Specifier
impl Specifier
Sourcepub fn value(self) -> IntegerType
pub fn value(self) -> IntegerType
music21’s number for the specifier, 1 for perfect through 11.
Sourcepub fn from_value(value: IntegerType) -> Result<Self>
pub fn from_value(value: IntegerType) -> Result<Self>
The specifier with music21’s number, if there is one.
Sourcepub fn nice_name(&self) -> String
pub fn nice_name(&self) -> String
Returns a human-friendly name for the specifier, music21’s niceName.
Sourcepub fn from_name(name: &str) -> Result<Self>
pub fn from_name(name: &str) -> Result<Self>
Parses a specifier the way music21’s parseSpecifier does: a prefix
such as "P", "m" or "AA", or a spelled-out name such as
"Perfect" or "Doubly-Augmented".
Case is significant only for m/M: minor and major are the one pair
where both spellings already denote different intervals. Every other
specifier accepts either case, which is exactly the distinction music21
draws — a2/A2, d5/D5, p5/P5 and the doubled and tripled
forms all parse there, while m3 and M3 stay distinct. Lowercasing
the input wholesale would silently turn every major third minor.
Sourcepub fn prefix(self) -> &'static str
pub fn prefix(self) -> &'static str
Returns the prefix music21 writes before the interval number, such as
"P", "m" or "AA".
Sourcepub fn inversion(&self) -> Self
pub fn inversion(&self) -> Self
The specifier of the inverted interval: major becomes minor, augmented becomes diminished, perfect stays perfect.
Sourcepub fn semitones_above_perfect(&self) -> Result<IntegerType>
pub fn semitones_above_perfect(&self) -> Result<IntegerType>
How many semitones above perfect the specifier lies. Major and minor cannot be compared to perfect and are an error, as in music21.
Sourcepub fn semitones_above_major(&self) -> Result<IntegerType>
pub fn semitones_above_major(&self) -> Result<IntegerType>
How many semitones above major the specifier lies. Perfect cannot be compared to major and is an error, as in music21.
Sourcepub fn python_name(self) -> &'static str
pub fn python_name(self) -> &'static str
music21’s enum member name, PERFECT, DBLAUG, QUADDIM.
Trait Implementations§
impl Copy for Specifier
Source§impl<'de> Deserialize<'de> for Specifier
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Specifier
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 Specifier
impl StructuralPartialEq for Specifier
Auto Trait Implementations§
impl Freeze for Specifier
impl RefUnwindSafe for Specifier
impl Send for Specifier
impl Sync for Specifier
impl Unpin for Specifier
impl UnsafeUnpin for Specifier
impl UnwindSafe for Specifier
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