pub struct Note(/* private fields */);
Expand description
A musical note represented as midi.
Implementations§
Source§impl Note
impl Note
Sourcepub fn from_midi(val: u8, natural: bool) -> Option<Self>
pub fn from_midi(val: u8, natural: bool) -> Option<Self>
Attempts to construct a new note from a raw midi value, failing if the value is out of range.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Attempts to construct a new note from the name of a note, accepting a range of valid formats.
Sourcepub fn get_frequency(self) -> Number
pub fn get_frequency(self) -> Number
Computes the frequency of the note in Hz.
Sourcepub fn get_name(self, prefer_sharps: bool) -> CompactString
pub fn get_name(self, prefer_sharps: bool) -> CompactString
Gets the (English) name of the note.
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