Enum midly::MidiMessage

source ·
pub enum MidiMessage {
    NoteOff {
        key: u7,
        vel: u7,
    },
    NoteOn {
        key: u7,
        vel: u7,
    },
    Aftertouch {
        key: u7,
        vel: u7,
    },
    Controller {
        controller: u7,
        value: u7,
    },
    ProgramChange {
        program: u7,
    },
    ChannelAftertouch {
        vel: u7,
    },
    PitchBend {
        bend: PitchBend,
    },
}
Expand description

Represents a MIDI message, usually associated to a MIDI channel.

If you wish to parse a MIDI message from a slice of raw MIDI bytes, use the LiveEvent::parse method instead and ignore all variants except for LiveEvent::Midi.

Variants§

§

NoteOff

Fields

§key: u7

The MIDI key to stop playing.

§vel: u7

The velocity with which to stop playing it.

Stop playing a note.

§

NoteOn

Fields

§key: u7

The key to start playing.

§vel: u7

The velocity (strength) with which to press it.

Note that by convention a NoteOn message with a velocity of 0 is equivalent to a NoteOff.

Start playing a note.

§

Aftertouch

Fields

§key: u7

The key for which to modify its velocity.

§vel: u7

The new velocity for the key.

Modify the velocity of a note after it has been played.

§

Controller

Fields

§controller: u7

The controller to modify.

See the MIDI spec for the meaning of each index.

§value: u7

The value to set it to.

Modify the value of a MIDI controller.

§

ProgramChange

Fields

§program: u7

The new program (instrument) to use for the channel.

Change the program (also known as instrument) for a channel.

§

ChannelAftertouch

Fields

§vel: u7

The new velocity for all notes currently playing in the channel.

Change the note velocity of a whole channel at once, without starting new notes.

§

PitchBend

Fields

§bend: PitchBend

The new pitch-bend value.

Set the pitch bend value for the entire channel.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.