pub struct Note {
pub pitch_class: PitchClass,
/* private fields */
}Expand description
A note such a C, C# and so on.
Fields§
§pitch_class: PitchClassImplementations§
Source§impl Note
impl Note
pub fn new(pitch_class: PitchClass, staff_position: StaffPosition) -> Self
Sourcepub fn is_white_note(&self) -> bool
pub fn is_white_note(&self) -> bool
Return true if this note is a “white note”, i.e. a note represented
by a white key on the piano (i.e. the note is part of the C major scale).
Trait Implementations§
Source§impl From<PitchClass> for Note
impl From<PitchClass> for Note
Source§fn from(pitch_class: PitchClass) -> Self
fn from(pitch_class: PitchClass) -> Self
Convert a pitch class into a note. For notes that can be sharp or flat use the sharp version.
Source§impl Ord for Note
impl Ord for Note
Source§impl PartialEq for Note
impl PartialEq for Note
Source§impl PartialOrd for Note
impl PartialOrd for Note
impl Copy for Note
impl Eq for Note
Auto Trait Implementations§
impl Freeze for Note
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnwindSafe for Note
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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