Skip to main content

ControlChange

Enum ControlChange 

Source
pub enum ControlChange {
Show 63 variants CC { control: u8, value: u8, }, CCHighRes { control1: u8, control2: u8, value: u16, }, BankSelect(u16), ModWheel(u16), Breath(u16), Foot(u16), Portamento(u16), Volume(u16), Balance(u16), Pan(u16), Expression(u16), Effect1(u16), Effect2(u16), GeneralPurpose1(u16), GeneralPurpose2(u16), GeneralPurpose3(u16), GeneralPurpose4(u16), GeneralPurpose5(u8), GeneralPurpose6(u8), GeneralPurpose7(u8), GeneralPurpose8(u8), Hold(u8), Hold2(u8), TogglePortamento(bool), Sostenuto(u8), SoftPedal(u8), ToggleLegato(bool), SoundVariation(u8), Timbre(u8), ReleaseTime(u8), AttackTime(u8), Brightness(u8), DecayTime(u8), VibratoRate(u8), VibratoDepth(u8), VibratoDelay(u8), SoundControl1(u8), SoundControl2(u8), SoundControl3(u8), SoundControl4(u8), SoundControl5(u8), SoundControl6(u8), SoundControl7(u8), SoundControl8(u8), SoundControl9(u8), SoundControl10(u8), HighResVelocity(u8), PortamentoControl(u8), Effects1Depth(u8), Effects2Depth(u8), Effects3Depth(u8), Effects4Depth(u8), Effects5Depth(u8), ReverbSendLevel(u8), TremoloDepth(u8), ChorusSendLevel(u8), CelesteDepth(u8), PhaserDepth(u8), Parameter(Parameter), DataEntry(u16), DataEntry2(u8, u8), DataIncrement(u8), DataDecrement(u8),
}
Expand description

Used by ChannelVoiceMsg::ControlChange to modify sounds. Each control targets a particular ControlNumber, the meaning of which is given by convention.

When deserializing and complex_cc is false (the default), only ControlChange::CC values are returned. “Simple” CC values represent the control parameter with a number, while “complex” variants capture the semantics of the spec. Simple can be turned into their complex counterparts using the to_complex method, or vis-versa using the to_simple and to_simple_high_res methods.

Variants§

§

CC

“Simple” Control Change message.

Control number may be any valid Midi CC Control number. May not be > 119.

Fields

§control: u8
§value: u8

0-127

§

CCHighRes

“Simple” high-resolution Control Change message.

control1 is associated with the MSB of the value, control2 with the LSB. Neither controls may be > 119.

Fields

§control1: u8
§control2: u8
§value: u16

0-16383

§

BankSelect(u16)

0-16383

§

ModWheel(u16)

0-16383

§

Breath(u16)

0-16383

§

Foot(u16)

0-16383

§

Portamento(u16)

0-16383

§

Volume(u16)

0-16383

§

Balance(u16)

0-16383

§

Pan(u16)

0-16383

§

Expression(u16)

0-16383

§

Effect1(u16)

0-16383

§

Effect2(u16)

0-16383

§

GeneralPurpose1(u16)

0-16383

§

GeneralPurpose2(u16)

0-16383

§

GeneralPurpose3(u16)

0-16383

§

GeneralPurpose4(u16)

0-16383

§

GeneralPurpose5(u8)

0-127

§

GeneralPurpose6(u8)

0-127

§

GeneralPurpose7(u8)

0-127

§

GeneralPurpose8(u8)

0-127

§

Hold(u8)

0-127

§

Hold2(u8)

0-127

§

TogglePortamento(bool)

Turn portamento on or off

§

Sostenuto(u8)

0-127

§

SoftPedal(u8)

0-127

§

ToggleLegato(bool)

Turn legato on or off

§

SoundVariation(u8)

Same as SoundControl1

§

Timbre(u8)

Same as SoundControl2

§

ReleaseTime(u8)

Same as SoundControl3

§

AttackTime(u8)

Same as SoundControl4

§

Brightness(u8)

Same as SoundControl5, and used as the MPE “third dimension” (usually Timbre) control (RP-021, RP-053)

§

DecayTime(u8)

Same as SoundControl6 (RP-021)

§

VibratoRate(u8)

Same as SoundControl7 (RP-021)

§

VibratoDepth(u8)

Same as SoundControl8 (RP-021)

§

VibratoDelay(u8)

Same as SoundControl9 (RP-021)

§

SoundControl1(u8)

0-127

§

SoundControl2(u8)

0-127

§

SoundControl3(u8)

0-127

§

SoundControl4(u8)

0-127

§

SoundControl5(u8)

0-127

§

SoundControl6(u8)

0-127

§

SoundControl7(u8)

0-127

§

SoundControl8(u8)

0-127

§

SoundControl9(u8)

0-127

§

SoundControl10(u8)

0-127

§

HighResVelocity(u8)

Used as the LSB of the velocity for the next note on/off message, 0-127. Defined in CA-031

§

PortamentoControl(u8)

0-127

§

Effects1Depth(u8)

0-127

§

Effects2Depth(u8)

0-127

§

Effects3Depth(u8)

0-127

§

Effects4Depth(u8)

0-127

§

Effects5Depth(u8)

0-127

§

ReverbSendLevel(u8)

Same as Effects1Depth (RP-023)

§

TremoloDepth(u8)

Same as Effects2Depth

§

ChorusSendLevel(u8)

Same as Effects3Depth (RP-023)

§

CelesteDepth(u8)

Same as Effects4Depth

§

PhaserDepth(u8)

Same as Effects5Depth

§

Parameter(Parameter)

Registered and Unregistered Parameters

§

DataEntry(u16)

Set the value of the last-set Parameter. 0-16383

§

DataEntry2(u8, u8)

Set the MSB and LSB of the last-set parameter separately.

§

DataIncrement(u8)

Increment the value of the last-set Parameter. 0-127

§

DataDecrement(u8)

Decrement the value of the last-set Parameter. 0-127

Implementations§

Source§

impl ControlChange

Source

pub fn to_complex(&self) -> Self

Source

pub fn to_simple(&self) -> Self

Source

pub fn to_simple_high_res(&self) -> Self

Source

pub fn control(&self) -> u8

Source

pub fn value(&self) -> u8

The value of the control change, 0-127. Will be 0 for ControlChange::Parameter.

Source

pub fn value_high_res(&self) -> u16

The 14-bit value of the control change. Non-high-res parameters are scaled to 14 bits. Will be 0 for ControlChange::Parameter.

Source

pub fn to_midi_running(&self) -> Vec<u8>

Source

pub fn extend_midi_running(&self, v: &mut Vec<u8>)

Trait Implementations§

Source§

impl Clone for ControlChange

Source§

fn clone(&self) -> ControlChange

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for ControlChange

Source§

impl Debug for ControlChange

Source§

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

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

impl Eq for ControlChange

Source§

impl PartialEq for ControlChange

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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.