Enum wmidi::MidiMessage [−][src]
pub enum MidiMessage<'a> {}Show variants
NoteOff(Channel, Note, Velocity), NoteOn(Channel, Note, Velocity), PolyphonicKeyPressure(Channel, Note, Velocity), ControlChange(Channel, ControlFunction, ControlValue), ProgramChange(Channel, ProgramNumber), ChannelPressure(Channel, Velocity), PitchBendChange(Channel, PitchBend), SysEx(&'a [U7]), OwnedSysEx(Vec<U7>), MidiTimeCode(U7), SongPositionPointer(SongPosition), SongSelect(Song), Reserved(u8), TuneRequest, TimingClock, Start, Continue, Stop, ActiveSensing, Reset,
Expand description
Holds information based on the Midi 1.0 spec.
Variants
Expand description
This message is sent when a note is released (ended).
Expand description
This message is sent when a note is depressed (start).
Expand description
This message is most often sent by pressing down on the key after it “bottoms out”.
ControlChange(Channel, ControlFunction, ControlValue)
Expand description
This message is sent when a controller value changes. Controllers include devices such as pedals and levers.
Controller numbers 120-127 are reserved as “Channel Mode Messages”.
ProgramChange(Channel, ProgramNumber)
Expand description
This message is sent when the patch number changes.
Expand description
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).
Expand description
This message is sent to indicate a change in the pitch bender (wheel or level, typically). The pitch bender is measured by a fourteen bit value. Center is 8192.
Expand description
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.
In the data held by the SysEx message, the Manufacturer’s ID code (assigned by MMA or AMEI) is either 1 byte or 3 bytes. Two of the 1 Byte IDs are reserved for extensions called Universal Exclusive Messages, which are not manufacturer-specific. If a device recognizes the ID code as its own (or as a supported Universal message) it will listen to the rest of the message. Otherwise the message will be ignored.
Expand description
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.
In the data held by the SysEx message, the Manufacturer’s ID code (assigned by MMA or AMEI) is either 1 byte or 3 bytes. Two of the 1 Byte IDs are reserved for extensions called Universal Exclusive Messages, which are not manufacturer-specific. If a device recognizes the ID code as its own (or as a supported Universal message) it will listen to the rest of the message. Otherwise the message will be ignored.
MidiTimeCode(U7)
Expand description
MIDI Time Code Quarter Frame.
The data is in the format 0nnndddd where nnn is the Message Type and dddd is the Value.
TODO: Interpret data instead of providing the raw format.
SongPositionPointer(SongPosition)
Expand description
This is an internal 14 bit value that holds the number of MIDI beats (1 beat = six MIDI clocks) since the start of the song.
SongSelect(Song)
Expand description
The Song Select specifies which sequence or song is to be played.
Reserved(u8)
Expand description
The u8 data holds the status byte.
Expand description
Upon receiving a Tune Request, all analog synthesizers should tune their oscillators.
Expand description
Timing Clock. Sent 24 times per quarter note when synchronization is required.
Expand description
Start the current sequence playing. (This message will be followed with Timing Clocks).
Expand description
Continue at the point the sequence was Stopped.
Expand description
Stop the current sequence.
Expand description
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 idoes 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.
Expand description
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.
Implementations
impl<'a> MidiMessage<'a>
[src]
impl<'a> MidiMessage<'a>
[src]pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
[src]
👎 Deprecated since 2.0.0: Use MidiMessage::try_from instead.
pub fn from_bytes(bytes: &'a [u8]) -> Result<Self, Error>
[src]Use MidiMessage::try_from instead.
Construct a midi message from bytes. Use MidiMessage::try_from(bytes)
instead.
pub fn copy_to_slice(&self, slice: &mut [u8]) -> Result<usize, ToSliceError>
[src]
pub fn copy_to_slice(&self, slice: &mut [u8]) -> Result<usize, ToSliceError>
[src]Copies the message as bytes to slice. If slice does not have enough capacity to fit the
message, then an error is returned. On success, the number of bytes written will be
returned. This should be the same number obtained from self.bytes_size()
.
pub fn drop_unowned_sysex(self) -> Option<MidiMessage<'static>>
[src]
pub fn drop_unowned_sysex(self) -> Option<MidiMessage<'static>>
[src]Return Some(midi_message)
if self
is not a SysEx message, or None
if it is. This expands the lifetime of
the MidiMessage
from 'a
to 'static
.
pub fn to_owned(&self) -> MidiMessage<'static>ⓘNotable traits for MidiMessage<'a>
impl<'a> Read for MidiMessage<'a>
[src]
pub fn to_owned(&self) -> MidiMessage<'static>ⓘNotable traits for MidiMessage<'a>
impl<'a> Read for MidiMessage<'a>
[src]Take ownership of the SysEx data. This expands the lifetime of the message to 'static
. If 'static
lifetime
is needed but SysEx messages can be dropped, consider using self.drop_unowned_sysex()
.
pub fn bytes_size(&self) -> usize
[src]
pub fn bytes_size(&self) -> usize
[src]The number of bytes the MIDI message takes when converted to bytes.
Trait Implementations
impl<'a> Clone for MidiMessage<'a>
[src]
impl<'a> Clone for MidiMessage<'a>
[src]fn clone(&self) -> MidiMessage<'a>ⓘNotable traits for MidiMessage<'a>
impl<'a> Read for MidiMessage<'a>
[src]
fn clone(&self) -> MidiMessage<'a>ⓘNotable traits for MidiMessage<'a>
impl<'a> Read for MidiMessage<'a>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'a> Debug for MidiMessage<'a>
[src]
impl<'a> Debug for MidiMessage<'a>
[src]impl<'a> PartialEq<MidiMessage<'a>> for MidiMessage<'a>
[src]
impl<'a> PartialEq<MidiMessage<'a>> for MidiMessage<'a>
[src]fn eq(&self, other: &MidiMessage<'a>) -> bool
[src]
fn eq(&self, other: &MidiMessage<'a>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &MidiMessage<'a>) -> bool
[src]
fn ne(&self, other: &MidiMessage<'a>) -> bool
[src]This method tests for !=
.
impl<'a> Read for MidiMessage<'a>
[src]
impl<'a> Read for MidiMessage<'a>
[src]fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
1.36.0[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
1.36.0[src]Like read
, except that it reads into a slice of buffers. Read more
fn is_read_vectored(&self) -> bool
[src]
fn is_read_vectored(&self) -> bool
[src]can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
unsafe fn initializer(&self) -> Initializer
[src]
unsafe fn initializer(&self) -> Initializer
[src]read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, appending them to buf
. Read more
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]Read the exact number of bytes required to fill buf
. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]Creates a “by reference” adaptor for this instance of Read
. Read more
impl<'a> Eq for MidiMessage<'a>
[src]
impl<'a> StructuralEq for MidiMessage<'a>
[src]
impl<'a> StructuralPartialEq for MidiMessage<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for MidiMessage<'a>
impl<'a> Send for MidiMessage<'a>
impl<'a> Sync for MidiMessage<'a>
impl<'a> Unpin for MidiMessage<'a>
impl<'a> UnwindSafe for MidiMessage<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more