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,
},
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.
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 more