pub struct Note { /* private fields */ }Expand description
Struct representing musical note.
Implementations§
Source§impl Note
impl Note
Sourcepub fn new(
letter: Letter,
octave: Octave,
accidental: Accidental,
) -> Result<Self, Error>
pub fn new( letter: Letter, octave: Octave, accidental: Accidental, ) -> Result<Self, Error>
Create new note.
Sourcepub fn accidental(&self) -> Accidental
pub fn accidental(&self) -> Accidental
Get note accidental (sharp - ♯ or flat - ♭).
Sourcepub fn enharmonic(self) -> Note
pub fn enharmonic(self) -> Note
Get note with the same pitch but different accidental (or exactly the same note if there isn’t one).
For example: for C♯ - D♭ is returned.
Trait Implementations§
Source§impl Ord for Note
impl Ord for Note
Source§impl PartialOrd for Note
impl PartialOrd for Note
impl Copy for Note
impl Eq for Note
impl StructuralPartialEq 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