pub struct PitchClass { /* private fields */ }Expand description
A normalized pitch-class value.
Pitch classes wrap into the range 0 <= pc < 12. Integer pitch classes
display using music21’s hexadecimal-style spellings: A for 10 and B for
11.
Implementations§
Source§impl PitchClass
impl PitchClass
Sourcepub fn new(specifier: impl Into<PitchClassSpecifier>) -> Result<Self>
pub fn new(specifier: impl Into<PitchClassSpecifier>) -> Result<Self>
Creates a normalized pitch class from a number, string, or existing pitch class.
Sourcepub fn integer(&self) -> Option<IntegerType>
pub fn integer(&self) -> Option<IntegerType>
Returns the integer pitch class if this value is not microtonal.
Trait Implementations§
Source§impl Clone for PitchClass
impl Clone for PitchClass
Source§fn clone(&self) -> PitchClass
fn clone(&self) -> PitchClass
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 PitchClass
impl Debug for PitchClass
Source§impl<'de> Deserialize<'de> for PitchClass
impl<'de> Deserialize<'de> for PitchClass
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
Source§impl Display for PitchClass
impl Display for PitchClass
Source§impl From<PitchClass> for PitchClassSpecifier
impl From<PitchClass> for PitchClassSpecifier
Source§fn from(value: PitchClass) -> Self
fn from(value: PitchClass) -> Self
Converts to this type from the input type.
Source§impl FromStr for PitchClass
impl FromStr for PitchClass
Source§impl PartialEq for PitchClass
impl PartialEq for PitchClass
Source§impl Serialize for PitchClass
impl Serialize for PitchClass
Source§impl TryFrom<&str> for PitchClass
impl TryFrom<&str> for PitchClass
Source§impl TryFrom<String> for PitchClass
impl TryFrom<String> for PitchClass
Source§impl TryFrom<char> for PitchClass
impl TryFrom<char> for PitchClass
Source§impl TryFrom<f64> for PitchClass
impl TryFrom<f64> for PitchClass
Source§impl TryFrom<i32> for PitchClass
impl TryFrom<i32> for PitchClass
Source§impl TryFrom<u8> for PitchClass
impl TryFrom<u8> for PitchClass
impl Copy for PitchClass
impl StructuralPartialEq for PitchClass
Auto Trait Implementations§
impl Freeze for PitchClass
impl RefUnwindSafe for PitchClass
impl Send for PitchClass
impl Sync for PitchClass
impl Unpin for PitchClass
impl UnsafeUnpin for PitchClass
impl UnwindSafe for PitchClass
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