pub struct ControlChange {
pub channel: MidiChannel,
pub controller: u8,
pub value: f32,
}Expand description
Control Change (CC) message.
Fields§
§channel: MidiChannelMIDI channel (0-15).
controller: u8Controller number (0-127).
value: f32Controller value (0.0 to 1.0, normalized from 0-127).
Implementations§
Source§impl ControlChange
impl ControlChange
Sourcepub const fn is_mod_wheel(&self) -> bool
pub const fn is_mod_wheel(&self) -> bool
Check if this is a modulation wheel CC (CC1).
Sourcepub const fn is_sustain_pedal(&self) -> bool
pub const fn is_sustain_pedal(&self) -> bool
Check if this is a sustain pedal CC (CC64).
Sourcepub const fn is_expression(&self) -> bool
pub const fn is_expression(&self) -> bool
Check if this is an expression pedal CC (CC11).
Sourcepub fn is_sustain_on(&self) -> bool
pub fn is_sustain_on(&self) -> bool
Check if sustain is pressed (value >= 0.5).
Sourcepub const fn is_bank_select_msb(&self) -> bool
pub const fn is_bank_select_msb(&self) -> bool
Check if this is a Bank Select MSB (CC0).
Sourcepub const fn is_bank_select_lsb(&self) -> bool
pub const fn is_bank_select_lsb(&self) -> bool
Check if this is a Bank Select LSB (CC32).
Sourcepub const fn is_bank_select(&self) -> bool
pub const fn is_bank_select(&self) -> bool
Check if this is any Bank Select message (CC0 or CC32).
Sourcepub const fn is_14bit_msb(&self) -> bool
pub const fn is_14bit_msb(&self) -> bool
Check if this controller is an MSB (CC 0-31) that has a corresponding LSB.
MIDI defines CC 0-31 as MSB controllers with CC 32-63 as their LSB pairs.
Sourcepub const fn is_14bit_lsb(&self) -> bool
pub const fn is_14bit_lsb(&self) -> bool
Check if this controller is an LSB (CC 32-63) that pairs with an MSB.
MIDI defines CC 32-63 as LSB controllers that pair with CC 0-31.
Sourcepub const fn lsb_pair(&self) -> Option<u8>
pub const fn lsb_pair(&self) -> Option<u8>
Returns the LSB controller number for this MSB (CC 0-31 → CC 32-63).
Returns None if this isn’t an MSB controller.
Sourcepub const fn msb_pair(&self) -> Option<u8>
pub const fn msb_pair(&self) -> Option<u8>
Returns the MSB controller number for this LSB (CC 32-63 → CC 0-31).
Returns None if this isn’t an LSB controller.
Sourcepub const fn is_rpn_msb(&self) -> bool
pub const fn is_rpn_msb(&self) -> bool
Check if this is an RPN MSB (CC 101).
Sourcepub const fn is_rpn_lsb(&self) -> bool
pub const fn is_rpn_lsb(&self) -> bool
Check if this is an RPN LSB (CC 100).
Sourcepub const fn is_rpn_select(&self) -> bool
pub const fn is_rpn_select(&self) -> bool
Check if this is any RPN selection message (CC 100 or 101).
Sourcepub const fn is_nrpn_msb(&self) -> bool
pub const fn is_nrpn_msb(&self) -> bool
Check if this is an NRPN MSB (CC 99).
Sourcepub const fn is_nrpn_lsb(&self) -> bool
pub const fn is_nrpn_lsb(&self) -> bool
Check if this is an NRPN LSB (CC 98).
Sourcepub const fn is_nrpn_select(&self) -> bool
pub const fn is_nrpn_select(&self) -> bool
Check if this is any NRPN selection message (CC 98 or 99).
Sourcepub const fn is_data_entry_msb(&self) -> bool
pub const fn is_data_entry_msb(&self) -> bool
Check if this is a Data Entry MSB (CC 6).
Sourcepub const fn is_data_entry_lsb(&self) -> bool
pub const fn is_data_entry_lsb(&self) -> bool
Check if this is a Data Entry LSB (CC 38).
Sourcepub const fn is_data_entry(&self) -> bool
pub const fn is_data_entry(&self) -> bool
Check if this is any Data Entry message (CC 6 or 38).
Sourcepub const fn is_data_increment(&self) -> bool
pub const fn is_data_increment(&self) -> bool
Check if this is a Data Increment (CC 96).
Sourcepub const fn is_data_decrement(&self) -> bool
pub const fn is_data_decrement(&self) -> bool
Check if this is a Data Decrement (CC 97).
Check if this CC is part of an RPN/NRPN sequence.
Returns true for CC 6, 38, 96-101.
Trait Implementations§
Source§impl Clone for ControlChange
impl Clone for ControlChange
Source§fn clone(&self) -> ControlChange
fn clone(&self) -> ControlChange
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more