Expand description
Note abstraction with letter and octave
Fields
letter: Letter
octave: i8
Implementations
sourceimpl Note
impl Note
sourcepub fn new(letter: Letter, octave: i8) -> Self
pub fn new(letter: Letter, octave: i8) -> Self
Construct Note from Letter
and octave
.
The Letter
are all letter from A to G with only flat b
variations.
Octaves can be negatives.
Examples
Basic usage:
use mumuse::music::{note::Note, common::Letter};
let n = Note::new(Letter::A, 4);
Trait Implementations
sourceimpl MidiSend for Note
impl MidiSend for Note
fn send_midi_with_duration(
&self,
conn_out: &mut MidiOutputConnection,
duration: u64,
velocity: u8
)
fn send_midi(&self, status: Status, conn_out: &mut MidiOutputConnection)
sourceimpl TryFrom<&'_ Data> for Note
impl TryFrom<&'_ Data> for Note
Conversion from Data::KeyNumber
.
Examples
Basic usage:
use mumuse::messages::Data;
use mumuse::music::note::Note;
let kn = Data::KeyNumber(44);
let n = Note::try_from(&kn);
sourceimpl TryFrom<&'_ str> for Note
impl TryFrom<&'_ str> for Note
Conversion from &str
.
Examples
Basic usage:
use mumuse::music::note::Note;
let n = Note::try_from("A3"); // Is a Result
impl Copy for Note
Auto Trait Implementations
impl RefUnwindSafe for Note
impl Send for Note
impl Sync for Note
impl Unpin for Note
impl UnwindSafe for Note
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more