pub enum MidiMessage {
NoteOff {
channel: u8,
note: MidiNote,
},
NoteOn {
channel: u8,
note: MidiNote,
},
CC {
channel: u8,
controller: u8,
value: u8,
},
PC {
channel: u8,
value: u8,
},
PitchBend {
channel: u8,
value: u16,
},
Clock,
Start,
Continue,
Stop,
}Expand description
Represents a parsed MIDI instruction.
This enum defines all supported MIDI messages used for input handling.
Variants§
NoteOff
Note Off event. This message is sent when a note is released.
NoteOn
Note On event. This message is sent when a note is pressed.
CC
A MIDI Control Change (CC) message.
Fields
PC
A MIDI Program Change (PC) message.
PitchBend
A MIDI Pitch Bend message.
Clock
Timing Clock. Sent 24 times per quarter note when synchronisation is required.
Intercepted internally for transport synchronization.
Start
Start. Start the current sequence playing.
Intercepted internally for transport synchronization.
Continue
Continue. Continue at the point the sequence was Stopped.
Intercepted internally for transport synchronization.
Stop
Stop. Stop the current sequence.
Intercepted internally for transport synchronization.
Implementations§
Source§impl MidiMessage
impl MidiMessage
Sourcepub fn parse(bytes: &[u8]) -> Option<MidiMessage>
pub fn parse(bytes: &[u8]) -> Option<MidiMessage>
Parses a byte slice into a MidiMessage struct.
This function is not intended to be called directly by end users.
It is used internally to ensure consistent MIDI message parsing logic across platforms.
Returns Some(MidiMessage) if the byte slice represents a known and valid MIDI message,
or None if the data does not match any recognized MIDI message format.
Trait Implementations§
Source§impl Clone for MidiMessage
impl Clone for MidiMessage
Source§fn clone(&self) -> MidiMessage
fn clone(&self) -> MidiMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MidiMessage
impl Debug for MidiMessage
Source§impl PartialEq for MidiMessage
impl PartialEq for MidiMessage
impl Copy for MidiMessage
impl StructuralPartialEq for MidiMessage
Auto Trait Implementations§
impl Freeze for MidiMessage
impl RefUnwindSafe for MidiMessage
impl Send for MidiMessage
impl Sync for MidiMessage
impl Unpin for MidiMessage
impl UnsafeUnpin for MidiMessage
impl UnwindSafe for MidiMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more