pub struct MpeEngine { /* private fields */ }Expand description
MPE engine for managing per-note expression.
Implementations§
Source§impl MpeEngine
impl MpeEngine
Sourcepub fn with_config(config: MpeConfig) -> Self
pub fn with_config(config: MpeConfig) -> Self
Creates a new MPE engine with custom configuration.
Sourcepub fn set_config(&mut self, config: MpeConfig)
pub fn set_config(&mut self, config: MpeConfig)
Sets the MPE configuration.
Sourcepub fn note_on(&mut self, note: u8, velocity: u8) -> NoteExpression
pub fn note_on(&mut self, note: u8, velocity: u8) -> NoteExpression
Sourcepub fn note_off(&mut self, note: u8) -> Option<NoteExpression>
pub fn note_off(&mut self, note: u8) -> Option<NoteExpression>
Sourcepub fn pitch_bend(&mut self, channel: u8, value: u16)
pub fn pitch_bend(&mut self, channel: u8, value: u16)
Handles a pitch bend event for a specific channel.
§Arguments
channel- MIDI channel (1-16)value- Pitch bend value (0-16383, 8192 = center)
Sourcepub fn channel_pressure(&mut self, channel: u8, value: u8)
pub fn channel_pressure(&mut self, channel: u8, value: u8)
Handles a channel pressure (aftertouch) event.
§Arguments
channel- MIDI channel (1-16)value- Pressure value (0-127)
Sourcepub fn timbre(&mut self, channel: u8, value: u8)
pub fn timbre(&mut self, channel: u8, value: u8)
Handles a CC74 (timbre/brightness) event.
§Arguments
channel- MIDI channel (1-16)value- CC74 value (0-127)
Sourcepub fn get_note_expression(&self, note: u8) -> Option<&NoteExpression>
pub fn get_note_expression(&self, note: u8) -> Option<&NoteExpression>
Sourcepub fn active_notes(&self) -> impl Iterator<Item = &NoteExpression>
pub fn active_notes(&self) -> impl Iterator<Item = &NoteExpression>
Gets all active note expressions.
Sourcepub fn active_note_count(&self) -> usize
pub fn active_note_count(&self) -> usize
Gets the number of active notes.
Sourcepub fn clear_all_notes(&mut self)
pub fn clear_all_notes(&mut self)
Clears all active notes (panic button / all notes off).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MpeEngine
impl RefUnwindSafe for MpeEngine
impl Send for MpeEngine
impl Sync for MpeEngine
impl Unpin for MpeEngine
impl UnsafeUnpin for MpeEngine
impl UnwindSafe for MpeEngine
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