Enum Message

Source
pub enum Message {
Show 23 variants Start, TimingClock, Continue, Stop, ActiveSensing, SystemReset, AllSoundOff(Channel), ResetAllControllers(Channel), LocalControlOff(Channel), LocalControlOn(Channel), AllNotesOff(Channel), NoteOff(Channel, U7, U7), ProgramChange(Channel, U7), ControlChange(Channel, U7, U7), RPN7(Channel, U14, U7), RPN14(Channel, U14, U14), NRPN7(Channel, U14, U7), NRPN14(Channel, U14, U14), SysEx(Manufacturer, Vec<U7>), NoteOn(Channel, U7, U7), PitchBend(Channel, U14), PolyphonicPressure(Channel, U7, U7), ChannelPressure(Channel, U7),
}
Expand description

Defines the various Midi messages that can be sent

The variants are ordered such that they may be sorted and sent in a sensible order when they occur at the same time, thus NoteOff before NoteOn, Start before TimingClock, ControlChange and ProgramChange before NoteOn, etc, etc

Variants§

§

Start

Start. Start the current sequence playing. (This message will be followed with Timing Clocks).

§

TimingClock

Timing Clock. Sent 24 times per quarter note when synchronization is required.

§

Continue

Continue. Continue at the point the sequence was Stopped

§

Stop

Stop. Stop the current sequence.

§

ActiveSensing

Active Sensing. This message is intended to be sent repeatedly to tell the receiver that a connection is alive. Use of this message is optional. When initially received, the receiver will expect to receive another Active Sensing message each 300ms (max), and if it does not then it will assume that the connection has been terminated. At termination, the receiver will turn off all voices and return to normal (non- active sensing) operation.

§

SystemReset

Reset. Reset all receivers in the system to power-up status. This should be used sparingly, preferably under manual control. In particular, it should not be sent on power-up.

§

AllSoundOff(Channel)

All Sound Off. When All Sound Off is received all oscillators will turn off, and their volume envelopes are set to zero as soon as possible.

§

ResetAllControllers(Channel)

Reset All Controllers. When Reset All Controllers is received, all controller values are reset to their default values. (See specific Recommended Practices for defaults).

§

LocalControlOff(Channel)

When Local Control is Off, all devices on a given channel will respond only to data received over MIDI. Played data, etc. will be ignored.

§

LocalControlOn(Channel)

Local Control On restores the functions of the normal controllers.

§

AllNotesOff(Channel)

All Notes Off. When an All Notes Off is received, all oscillators will turn off.

(if you need to use one of the more obsure all notes off modes, send the direct ControlChange message

§

NoteOff(Channel, U7, U7)

Note Off event. This message is sent when a note is released (ended). The second argument is the key (note) number. The third argument is the velocity.

§

ProgramChange(Channel, U7)

Program Change. This message sent when the patch number changes. The second argument is the new program number.

§

ControlChange(Channel, U7, U7)

Control Change. This message is sent when a controller value changes. The second argument is the controller number (0-119, though 0-127 is allowed). The third argument is the controller value (0-127).

§

RPN7(Channel, U14, U7)

7-bit RPN. This message is sent when a 7-bit RPN changes. The second argument is the RPN. The third argument is the value.

§

RPN14(Channel, U14, U14)

14-bit RPN. This message is sent when a 14-bit RPN changes. The second argument is the RPN. The third argument is the value.

§

NRPN7(Channel, U14, U7)

7-bit NRPN. This message is sent when a 7-bit NRPN changes. The second argument is the NRPN. The third argument is the value.

§

NRPN14(Channel, U14, U14)

14-bit NRPN. This message is sent when a 14-bit NRPN changes. The second argument is the NRPN. The third argument is the value.

§

SysEx(Manufacturer, Vec<U7>)

System Exclusive. This message type allows manufacturers to create their own messages (such as bulk dumps, patch parameters, and other non-spec data) and provides a mechanism for creating additional MIDI Specification messages. The first argument indicates the manufacturer. The second argument contains the data (without the F0 header, or F7 terminator).

§

NoteOn(Channel, U7, U7)

Note On event. This message is sent when a note is depressed (start). The second argument is the key (note) number. The third is the velocity.

§

PitchBend(Channel, U14)

Pitch Bend Change. This message is sent to indicate a change in the pitch bender (wheel or lever, typically). The pitch bender is measured by a fourteen bit value. Center (no pitch change) is 2000H.

§

PolyphonicPressure(Channel, U7, U7)

Polyphonic Key Pressure (Aftertouch). This message is most often sent by pressing down on the key after it “bottoms out”. The second argument is the key (note) number. The third argument is the pressure value.

§

ChannelPressure(Channel, U7)

Channel Pressure (Aftertouch). This message is most often sent by pressing down on the key after it “bottoms out”. This message is different from polyphonic after-touch. Use this message to send the single greatest pressure value (of all the current depressed keys). The second argument is the pressure value.

Trait Implementations§

Source§

impl Clone for Message

Source§

fn clone(&self) -> Message

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Message

Source§

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

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

impl Ord for Message

Source§

fn cmp(&self, other: &Message) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Message

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Message

Source§

fn partial_cmp(&self, other: &Message) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToRawMessages for Message

Source§

impl Eq for Message

Source§

impl StructuralPartialEq for Message

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.