[][src]Enum lv2rs_midi::MidiMessage

pub enum MidiMessage {
    NoteOff {
        channel: u4,
        note: u7,
        velocity: u7,
    },
    NoteOn {
        channel: u4,
        note: u7,
        velocity: u7,
    },
    PolyKeyPressure {
        channel: u4,
        pressure: u7,
    },
    ControlChange {
        channel: u4,
        control_number: u7,
        control_value: u7,
    },
    ProgramChange {
        channel: u4,
        program_number: u7,
    },
    ChannelPressure {
        channel: u4,
        pressure: u7,
    },
    PitchBendChange {
        channel: u4,
        value: u14,
    },
    TimeCodeQuarterFrame {
        message_type: u3,
        value: u4,
    },
    SongPositionPointer {
        position: u14,
    },
    SongSelect {
        song: u7,
    },
    TuneRequest,
    TimingClock,
    Start,
    Continue,
    Stop,
    ActiveSensing,
    SystemReset,
}

A MIDI message.

Please consult the MIDI reference for information on how to use these messages.

Variants

NoteOff

Stop playing a note.

Fields of NoteOff

channel: u4note: u7velocity: u7
NoteOn

Start playing a note.

Fields of NoteOn

channel: u4note: u7velocity: u7
PolyKeyPressure

Change the pressure on a key.

Fields of PolyKeyPressure

channel: u4pressure: u7
ControlChange

Change the value of a controlled number.

Fields of ControlChange

channel: u4control_number: u7control_value: u7
ProgramChange

Change the active program.

Fields of ProgramChange

channel: u4program_number: u7
ChannelPressure

Change the pressure of the channel.

Fields of ChannelPressure

channel: u4pressure: u7
PitchBendChange

Change the pitch bend.

Fields of PitchBendChange

channel: u4value: u14
TimeCodeQuarterFrame

Synchronisation message.

Fields of TimeCodeQuarterFrame

message_type: u3value: u4
SongPositionPointer

Change the current position in a song.

Fields of SongPositionPointer

position: u14
SongSelect

Select another song.

Fields of SongSelect

song: u7
TuneRequest

Tune analog oscillators.

TimingClock

A step of the timing clock.

Start

Start the playback.

Continue

Continue the playback.

Stop

Stop the playback.

ActiveSensing

Active sensing message.

SystemReset

Reset the system.

Methods

impl MidiMessage[src]

pub fn try_from(slice: &[u8]) -> Result<Self, TryFromError>[src]

Try create a MidiMessage from a slice of bytes.

This is pretty straight forward: Try to parse the data and create a MidiMessage object for it. Please note that this method does not support system-exclusive message due to their unorthodox nature. These are handled by the SystemExclusiveMessage struct.

The error cases are described in the TryFromError enum.

Auto Trait Implementations

impl Send for MidiMessage

impl Sync for MidiMessage

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]