pub struct Note {
pub pitch_class: PitchClass,
/* private fields */
}
Expand description
A note such a C, C# and so on.
Fields§
§pitch_class: PitchClass
Implementations§
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
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl 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<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.