pub enum Note {
C,
CS,
D,
DS,
E,
F,
FS,
G,
GS,
A,
AS,
B,
}Expand description
Represents 1 note of the chromatic scale.
Variants§
Implementations§
Source§impl Note
impl Note
Sourcepub fn add_semitone(self, octave: u8, semi: i8) -> (Self, u8)
pub fn add_semitone(self, octave: u8, semi: i8) -> (Self, u8)
Add semitones to a Note and an octave. Returns the new note and octave. Works with negative semitones.
§Example
use mseq_core::Note;
let note = Note::G;
let octave = 4;
let (new_note, new_octave) = note.add_semitone(octave, 5);
assert!(new_note == Note::C);
assert!(new_octave == 5);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Note
impl<'de> Deserialize<'de> for Note
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
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 UnsafeUnpin 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> 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.