pub struct MidiNote {
pub note: Note,
pub octave: u8,
pub vel: u8,
}Expand description
Note that can be sent through a MIDI message.
Fields§
§note: NoteThe chromatic note (A to G)
octave: u8The octave of the note
vel: u8The velocity of the note (0 to 127)
Implementations§
Source§impl MidiNote
impl MidiNote
Sourcepub fn from_midi_value(midi_value: u8, vel: u8) -> Self
pub fn from_midi_value(midi_value: u8, vel: u8) -> Self
Convert a MIDI note value into a MidiNote.
Sourcepub fn transpose(&self, transpose: i8) -> Self
pub fn transpose(&self, transpose: i8) -> Self
Transpose the MidiNote.
The transpose parameter corresponds to the number of semitones to add to the note.
Sourcepub fn midi_value(&self) -> u8
pub fn midi_value(&self) -> u8
Retrieve the MIDI value of the MidiNote, which can be sent through a MIDI message.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MidiNote
impl<'de> Deserialize<'de> for MidiNote
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 MidiNote
impl Eq for MidiNote
impl StructuralPartialEq for MidiNote
Auto Trait Implementations§
impl Freeze for MidiNote
impl RefUnwindSafe for MidiNote
impl Send for MidiNote
impl Sync for MidiNote
impl Unpin for MidiNote
impl UnsafeUnpin for MidiNote
impl UnwindSafe for MidiNote
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.