MetaMessage (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Cloneable](../../../../java.base/java/lang/Cloneable.html "interface in java.lang")


public class MetaMessage extends MidiMessage

A MetaMessage is a MidiMessage that is not meaningful to synthesizers, but that can be stored in a MIDI file and interpreted by a sequencer program. (See the discussion in the MidiMessage class description.) The Standard MIDI Files specification defines various types of meta-events, such as sequence number, lyric, cue point, and set tempo. There are also meta-events for such information as lyrics, copyrights, tempo indications, time and key signatures, markers, etc. For more information, see the Standard MIDI Files 1.0 specification, which is part of the Complete MIDI 1.0 Detailed Specification published by the MIDI Manufacturer's Association (http://www.midi.org).

When data is being transported using MIDI wire protocol, aShortMessage with the status value 0xFF represents a system reset message. In MIDI files, this same status value denotes aMetaMessage. The types of meta-message are distinguished from each other by the first byte that follows the status byte 0xFF. The subsequent bytes are data bytes. As with system exclusive messages, there are an arbitrary number of data bytes, depending on the type ofMetaMessage.

See Also:

MetaEventListener

Fields

Modifier and Type Field Description
static int META Status byte for MetaMessage (0xFF, or 255), which is used in MIDI files.

Constructors

Modifier Constructor Description
MetaMessage() Constructs a new MetaMessage.
protected MetaMessage​(byte[] data) Constructs a new MetaMessage.
MetaMessage​(int type, byte[] data, int length) Constructs a new MetaMessage and sets the message parameters.
Modifier and Type Method Description
Object clone() Creates a new object of the same class and with the same contents as this object.
byte[] getData() Obtains a copy of the data for the meta message.
int getType() Obtains the type of the MetaMessage.
void setMessage​(int type, byte[] data, int length) Sets the message parameters for a MetaMessage.