AUDIO
Source snapshot · 12 October 2026

API reference / ravet_foundation::Midi2Kind

Enum Midi2Kind 

pub enum Midi2Kind {
    PerNoteController {
        registered: bool,
        key: u8,
        index: u8,
        value: u32,
    },
    Controller {
        registered: bool,
        bank: u8,
        index: u8,
        value: u32,
    },
    RelativeController {
        registered: bool,
        bank: u8,
        index: u8,
        delta: i32,
    },
    PerNotePitchBend {
        key: u8,
        value: u32,
    },
    NoteOff {
        key: u8,
        velocity: u16,
        attribute_type: u8,
        attribute: u16,
    },
    NoteOn {
        key: u8,
        velocity: u16,
        attribute_type: u8,
        attribute: u16,
    },
    PolyPressure {
        key: u8,
        value: u32,
    },
    ControlChange {
        controller: u8,
        value: u32,
    },
    ProgramChange {
        program: u8,
        bank: Option<(u8, u8)>,
    },
    ChannelPressure {
        value: u32,
    },
    PitchBend {
        value: u32,
    },
    PerNoteManagement {
        key: u8,
        detach: bool,
        reset: bool,
    },
}
Expand description

MIDI 2.0 channel voice data. No resolution scaling or protocol conversion.

Controller meanings, attributes, per-note ownership and negotiated profiles belong to the consumer. Receivers ignore reserved bits; encoding sets them to zero. Unknown note attribute types are retained for future interpretation.

Variants§

§

PerNoteController

Registered (true) or assignable (false) per-note controller; index is eight bits.

Fields

§registered: bool
§key: u8
§index: u8
§value: u32
§

Controller

Registered (true) or assignable (false) absolute controller.

Fields

§registered: bool
§bank: u8
§index: u8
§value: u32
§

RelativeController

Signed two’s-complement relative controller change.

Fields

§registered: bool
§bank: u8
§index: u8
§delta: i32
§

PerNotePitchBend

Unsigned bipolar per-note bend, centered at 0x80000000.

Fields

§key: u8
§value: u32
§

NoteOff

Release velocity and uninterpreted attribute type/data.

Fields

§key: u8
§velocity: u16
§attribute_type: u8
§attribute: u16
§

NoteOn

Zero velocity remains Note On, unlike MIDI 1.0.

Fields

§key: u8
§velocity: u16
§attribute_type: u8
§attribute: u16
§

PolyPressure

Per-key pressure at full 32-bit resolution.

Fields

§key: u8
§value: u32
§

ControlChange

Seven-bit channel controller index and full 32-bit value.

Fields

§controller: u8
§value: u32
§

ProgramChange

Program and optional (MSB, LSB) bank selection, all seven-bit.

Fields

§program: u8
§bank: Option<(u8, u8)>
§

ChannelPressure

Channel pressure at full 32-bit resolution.

Fields

§value: u32
§

PitchBend

Unsigned bipolar channel bend, centered at 0x80000000.

Fields

§value: u32
§

PerNoteManagement

Detach previous notes’ controllers and/or reset controllers to defaults.

Fields

§key: u8
§detach: bool
§reset: bool

Trait Implementations§

§

impl Clone for Midi2Kind

§

fn clone(&self) -> Midi2Kind

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

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

Performs copy-assignment from source. Read more
§

impl Copy for Midi2Kind

§

impl Debug for Midi2Kind

§

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

Formats the value using the given formatter. Read more
§

impl Eq for Midi2Kind

§

impl PartialEq for Midi2Kind

§

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

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

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

Inequality operator !=. Read more
§

impl StructuralPartialEq for Midi2Kind

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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

Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.