#[repr(C)]pub struct MidiMessage { /* private fields */ }Expand description
A parsed MIDI message with channel, status, and data bytes.
Uses #[repr(C)] for C-compatible memory layout, enabling FFI usage.
Implementations§
Source§impl MidiMessage
impl MidiMessage
Source§impl MidiMessage
impl MidiMessage
Sourcepub fn get_status(&self) -> MidiMessageStatus
pub fn get_status(&self) -> MidiMessageStatus
Get the message status type.
Sourcepub fn get_channel(&self) -> u8
pub fn get_channel(&self) -> u8
Get the MIDI channel (1-16).
Sourcepub fn get_note(&self) -> Option<String>
pub fn get_note(&self) -> Option<String>
Get the note name (e.g., “C4”, “F#3”) for note messages.
Sourcepub fn get_note_frequency(&self) -> Option<f32>
pub fn get_note_frequency(&self) -> Option<f32>
Get the note frequency in Hz (A4 = 440 Hz) for note messages.
Sourcepub fn get_note_number(&self) -> Option<u8>
pub fn get_note_number(&self) -> Option<u8>
Get the MIDI note number (0-127) for note messages.
Sourcepub fn get_velocity(&self) -> Option<u8>
pub fn get_velocity(&self) -> Option<u8>
Get the velocity (0-127) for note messages.
Sourcepub fn get_pressure(&self) -> Option<u8>
pub fn get_pressure(&self) -> Option<u8>
Get the pressure value (0-127) for polyphonic aftertouch.
Sourcepub fn get_control_change_data(&self) -> Option<u8>
pub fn get_control_change_data(&self) -> Option<u8>
Get the control value (0-127) for control change messages.
Sourcepub fn get_pitch_wheel_data(&self) -> Option<(u8, u8)>
pub fn get_pitch_wheel_data(&self) -> Option<(u8, u8)>
Get the pitch wheel data (LSB, MSB) for pitch bend messages.
Trait Implementations§
Source§impl Clone for MidiMessage
impl Clone for MidiMessage
Source§fn clone(&self) -> MidiMessage
fn clone(&self) -> MidiMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MidiMessage
impl Debug for MidiMessage
Source§impl Display for MidiMessage
impl Display for MidiMessage
Source§impl From<&[u8]> for MidiMessage
impl From<&[u8]> for MidiMessage
impl Copy 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 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
Mutably borrows from an owned value. Read more