Skip to main content

Midi2ChannelVoice

Enum Midi2ChannelVoice 

Source
pub enum Midi2ChannelVoice {
    NoteOff {
        channel: u8,
        note: u8,
        velocity: u16,
        attribute_type: u8,
        attribute_data: u16,
    },
    NoteOn {
        channel: u8,
        note: u8,
        velocity: u16,
        attribute_type: u8,
        attribute_data: u16,
    },
    PolyPressure {
        channel: u8,
        note: u8,
        pressure: u32,
    },
    ControlChange {
        channel: u8,
        index: u8,
        value: u32,
    },
    ProgramChange {
        channel: u8,
        program: u8,
        bank_valid: bool,
        bank_msb: u8,
        bank_lsb: u8,
    },
    ChannelPressure {
        channel: u8,
        pressure: u32,
    },
    PitchBend {
        channel: u8,
        value: u32,
    },
}
Expand description

A MIDI 2.0 channel-voice message (MT 0x4 payload), decoded into fields. Values are at MIDI 2.0 resolution (16-bit velocity, 32-bit controllers/bend).

Variants§

§

NoteOff

Note Off. attribute_type/attribute_data carry the optional attribute.

Fields

§channel: u8

Channel 0..=15.

§note: u8

Note number 0..=127.

§velocity: u16

16-bit release velocity.

§attribute_type: u8

Attribute type (0 = none).

§attribute_data: u16

16-bit attribute data.

§

NoteOn

Note On.

Fields

§channel: u8

Channel 0..=15.

§note: u8

Note number 0..=127.

§velocity: u16

16-bit attack velocity.

§attribute_type: u8

Attribute type (0 = none).

§attribute_data: u16

16-bit attribute data.

§

PolyPressure

Polyphonic Key Pressure.

Fields

§channel: u8

Channel 0..=15.

§note: u8

Note number 0..=127.

§pressure: u32

32-bit pressure.

§

ControlChange

Control Change.

Fields

§channel: u8

Channel 0..=15.

§index: u8

Controller index 0..=127.

§value: u32

32-bit controller value.

§

ProgramChange

Program Change (with optional bank).

Fields

§channel: u8

Channel 0..=15.

§program: u8

Program number 0..=127.

§bank_valid: bool

Whether the bank fields are valid.

§bank_msb: u8

Bank MSB 0..=127.

§bank_lsb: u8

Bank LSB 0..=127.

§

ChannelPressure

Channel Pressure.

Fields

§channel: u8

Channel 0..=15.

§pressure: u32

32-bit pressure.

§

PitchBend

Pitch Bend.

Fields

§channel: u8

Channel 0..=15.

§value: u32

32-bit bend value (0x8000_0000 = center).

Trait Implementations§

Source§

impl Clone for Midi2ChannelVoice

Source§

fn clone(&self) -> Self

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 Midi2ChannelVoice

Source§

impl Debug for Midi2ChannelVoice

Source§

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

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

impl Eq for Midi2ChannelVoice

Source§

impl PartialEq for Midi2ChannelVoice

Source§

fn eq(&self, other: &Self) -> 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 Midi2ChannelVoice

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.