The base MidiMessage
class provides access to three types of information about a MIDI message:
MidiMessage
includes methods to get, but not set, these values. Setting them is a subclass responsibility. The MIDI standard expresses MIDI data in bytes. However, because JavaTM uses signed bytes, the Java Sound API uses integers instead of bytes when expressing MIDI data. For example, the {@link #getStatus()} method ofMidiMessage
returns MIDI status bytes as integers. If you are processing MIDI data that originated outside Java Sound and now is encoded as signed bytes, the bytes can can be converted to integers using this conversion:
If you simply need to pass a known MIDI byte value as a method parameter, it can be expressed directly as an integer, using (for example) decimal or hexadecimal notation. For instance, to pass the "active sensing" status byte as the first argument to ShortMessage's {@link ShortMessage#setMessage(int) setMessage(int)}method, you can express it as 254 or 0xFE. @see Track @see Sequence @see Receiver @author David Rivas @author Kara Kytle
|
|
|
|