ControlChange

Struct ControlChange 

Source
pub struct ControlChange {
    pub channel: MidiChannel,
    pub controller: u8,
    pub value: f32,
}
Expand description

Control Change (CC) message.

Fields§

§channel: MidiChannel

MIDI channel (0-15).

§controller: u8

Controller number (0-127).

§value: f32

Controller value (0.0 to 1.0, normalized from 0-127).

Implementations§

Source§

impl ControlChange

Source

pub const fn is_mod_wheel(&self) -> bool

Check if this is a modulation wheel CC (CC1).

Source

pub const fn is_sustain_pedal(&self) -> bool

Check if this is a sustain pedal CC (CC64).

Source

pub const fn is_expression(&self) -> bool

Check if this is an expression pedal CC (CC11).

Source

pub const fn is_volume(&self) -> bool

Check if this is a volume CC (CC7).

Source

pub fn is_sustain_on(&self) -> bool

Check if sustain is pressed (value >= 0.5).

Source

pub const fn is_bank_select_msb(&self) -> bool

Check if this is a Bank Select MSB (CC0).

Source

pub const fn is_bank_select_lsb(&self) -> bool

Check if this is a Bank Select LSB (CC32).

Source

pub const fn is_bank_select(&self) -> bool

Check if this is any Bank Select message (CC0 or CC32).

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn is_rpn_msb(&self) -> bool

Check if this is an RPN MSB (CC 101).

Source

pub const fn is_rpn_lsb(&self) -> bool

Check if this is an RPN LSB (CC 100).

Source

pub const fn is_rpn_select(&self) -> bool

Check if this is any RPN selection message (CC 100 or 101).

Source

pub const fn is_nrpn_msb(&self) -> bool

Check if this is an NRPN MSB (CC 99).

Source

pub const fn is_nrpn_lsb(&self) -> bool

Check if this is an NRPN LSB (CC 98).

Source

pub const fn is_nrpn_select(&self) -> bool

Check if this is any NRPN selection message (CC 98 or 99).

Source

pub const fn is_data_entry_msb(&self) -> bool

Check if this is a Data Entry MSB (CC 6).

Source

pub const fn is_data_entry_lsb(&self) -> bool

Check if this is a Data Entry LSB (CC 38).

Source

pub const fn is_data_entry(&self) -> bool

Check if this is any Data Entry message (CC 6 or 38).

Source

pub const fn is_data_increment(&self) -> bool

Check if this is a Data Increment (CC 96).

Source

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

Source§

fn clone(&self) -> ControlChange

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControlChange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ControlChange

Source§

fn eq(&self, other: &ControlChange) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ControlChange

Source§

impl StructuralPartialEq for ControlChange

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.