Enum midly::MetaMessage

source ·
pub enum MetaMessage<'a> {
Show 19 variants TrackNumber(Option<u16>), Text(&'a [u8]), Copyright(&'a [u8]), TrackName(&'a [u8]), InstrumentName(&'a [u8]), Lyric(&'a [u8]), Marker(&'a [u8]), CuePoint(&'a [u8]), ProgramName(&'a [u8]), DeviceName(&'a [u8]), MidiChannel(u4), MidiPort(u7), EndOfTrack, Tempo(u24), SmpteOffset(SmpteTime), TimeSignature(u8u8u8u8), KeySignature(i8bool), SequencerSpecific(&'a [u8]), Unknown(u8, &'a [u8]),
}
Expand description

A “meta message”, as defined by the SMF spec. These events carry metadata about the track, such as tempo, time signature, copyright, etc…

Variants§

§

TrackNumber(Option<u16>)

For Format::Sequential MIDI file types, TrackNumber can be empty, and defaults to the track index.

§

Text(&'a [u8])

Arbitrary text associated to an instant.

§

Copyright(&'a [u8])

A copyright notice.

§

TrackName(&'a [u8])

Information about the name of the track.

§

InstrumentName(&'a [u8])

Information about the name of the current instrument.

§

Lyric(&'a [u8])

Arbitrary lyric information associated to an instant.

§

Marker(&'a [u8])

Arbitrary marker text associated to an instant.

§

CuePoint(&'a [u8])

Arbitrary cue point text associated to an instant.

§

ProgramName(&'a [u8])

Information about the name of the current program.

§

DeviceName(&'a [u8])

Name of the device that this file was intended to be played with.

§

MidiChannel(u4)

Number of the MIDI channel that this file was intended to be played with.

§

MidiPort(u7)

Number of the MIDI port that this file was intended to be played with.

§

EndOfTrack

Obligatory at track end.

§

Tempo(u24)

Amount of microseconds per beat (quarter note).

Usually appears at the beggining of a track, before any midi events are sent, but there are no guarantees.

§

SmpteOffset(SmpteTime)

The MIDI SMPTE offset meta message specifies an offset for the starting point of a MIDI track from the start of a sequence in terms of SMPTE time (hours:minutes:seconds:frames:subframes).

Reference

§

TimeSignature(u8u8u8u8)

In order of the MIDI specification, numerator, denominator, MIDI clocks per click, 32nd notes per quarter

§

KeySignature(i8bool)

As in the MIDI specification, negative numbers indicate number of flats and positive numbers indicate number of sharps. false indicates a major scale, true indicates a minor scale.

§

SequencerSpecific(&'a [u8])

Arbitrary data intended for the sequencer. This data is never sent to a device.

§

Unknown(u8, &'a [u8])

An unknown or malformed meta-message.

The first u8 is the raw meta-message identifier byte. The slice is the actual payload of the meta-message.

Implementations§

Remove any lifetimed data from this event to create a MidiMessage with 'static lifetime that can be stored and moved everywhere, solving borrow checker issues.

WARNING: Any bytestrings in the input will be replaced by empty bytestrings.

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.