javax.sound.midi
Class ShortMessage

java.lang.Object
  extended by javax.sound.midi.MidiMessage
      extended by javax.sound.midi.ShortMessage
All Implemented Interfaces:
java.lang.Cloneable

public class ShortMessage
extends MidiMessage

Simple MIDI message. This class is used to represent channel voice, control change, channel mode, system real time and system common messages. These are the messages that can be represented in at most three bytes (the status byte plus two data bytes). System exclusive and meta messages are stored in SysexMessage and MetaMessage, respective.

The way these messages are separated into bytes for storing in data is the same as specified in the MIDI wire protocol.


Field Summary
static int ACTIVE_SENSING
          Status byte for active sensing messages (value 254, 0xFE).
static int CHANNEL_PRESSURE
          Status byte for channel key pressure (aftertouch) messages (value 208, 0xD0).
static int CONTINUE
          Status byte for continue messages (value 251, 0xFB).
static int CONTROL_CHANGE
          Status byte for controller cange messages (value 176, 0xB0).
static int END_OF_EXCLUSIVE
          Status byte for end of system excusive messages (value 247, 0xF7).
static int MIDI_TIME_CODE
          Status byte for MIDI time code quarter frame messages (value 241, 0xF1).
static int NOTE_OFF
          Status byte for note off messages (value 128, 0x80).
static int NOTE_ON
          Status byte for note on messages (value 144, 0x90).
static int PITCH_BEND
          Status byte for pitch bend messages (value 224, 0xE0).
static int POLY_PRESSURE
          Status byte for polyphonic key pressure (aftertouch) messages (value 160, 0xA0).
static int PROGRAM_CHANGE
          Status byte for program change messages (value 192, 0xC0).
static int SONG_POSITION_POINTER
          Status byte for song position pointer messages (value 242, 0xF2).
static int SONG_SELECT
          Status byte for song select messages (value 243, 0xF3).
static int START
          Status byte for start messages (value 250, 0xFA).
static int STOP
          Status byte for stop messages (value 252, 0xFC).
static int SYSTEM_RESET
          Status byte for system reset messages (value 255, 0xFF).
static int TIMING_CLOCK
          Status byte for timing clock messages (value 248, 0xF8).
static int TUNE_REQUEST
          Status byte for tune request messages (value 246, 0xF6).
 
Constructor Summary
ShortMessage()
          Create a container for a "short" MIDI message.
 
Method Summary
 java.lang.Object clone()
          TODO:
 int getChannel()
          TODO:
 int getCommand()
          TODO:
 int getData1()
          TODO:
 int getData2()
          TODO:
 void setMessage(int nStatus)
          TODO:
 void setMessage(int nStatus, int nData1, int nData2)
          TODO:
 void setMessage(int nCommand, int nChannel, int nData1, int nData2)
          TODO:
 
Methods inherited from class javax.sound.midi.MidiMessage
getLength, getMessage, getStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTE_OFF

public static final int NOTE_OFF
Status byte for note off messages (value 128, 0x80).

See Also:
Constant Field Values

NOTE_ON

public static final int NOTE_ON
Status byte for note on messages (value 144, 0x90).

See Also:
Constant Field Values

POLY_PRESSURE

public static final int POLY_PRESSURE
Status byte for polyphonic key pressure (aftertouch) messages (value 160, 0xA0).

See Also:
Constant Field Values

CONTROL_CHANGE

public static final int CONTROL_CHANGE
Status byte for controller cange messages (value 176, 0xB0).

See Also:
Constant Field Values

PROGRAM_CHANGE

public static final int PROGRAM_CHANGE
Status byte for program change messages (value 192, 0xC0).

See Also:
Constant Field Values

CHANNEL_PRESSURE

public static final int CHANNEL_PRESSURE
Status byte for channel key pressure (aftertouch) messages (value 208, 0xD0).

See Also:
Constant Field Values

PITCH_BEND

public static final int PITCH_BEND
Status byte for pitch bend messages (value 224, 0xE0).

See Also:
Constant Field Values

MIDI_TIME_CODE

public static final int MIDI_TIME_CODE
Status byte for MIDI time code quarter frame messages (value 241, 0xF1).

See Also:
Constant Field Values

SONG_POSITION_POINTER

public static final int SONG_POSITION_POINTER
Status byte for song position pointer messages (value 242, 0xF2).

See Also:
Constant Field Values

SONG_SELECT

public static final int SONG_SELECT
Status byte for song select messages (value 243, 0xF3).

See Also:
Constant Field Values

TUNE_REQUEST

public static final int TUNE_REQUEST
Status byte for tune request messages (value 246, 0xF6).

See Also:
Constant Field Values

END_OF_EXCLUSIVE

public static final int END_OF_EXCLUSIVE
Status byte for end of system excusive messages (value 247, 0xF7).

See Also:
Constant Field Values

TIMING_CLOCK

public static final int TIMING_CLOCK
Status byte for timing clock messages (value 248, 0xF8).

See Also:
Constant Field Values

START

public static final int START
Status byte for start messages (value 250, 0xFA).

See Also:
Constant Field Values

CONTINUE

public static final int CONTINUE
Status byte for continue messages (value 251, 0xFB).

See Also:
Constant Field Values

STOP

public static final int STOP
Status byte for stop messages (value 252, 0xFC).

See Also:
Constant Field Values

ACTIVE_SENSING

public static final int ACTIVE_SENSING
Status byte for active sensing messages (value 254, 0xFE).

See Also:
Constant Field Values

SYSTEM_RESET

public static final int SYSTEM_RESET
Status byte for system reset messages (value 255, 0xFF).

See Also:
Constant Field Values
Constructor Detail

ShortMessage

public ShortMessage()
Create a container for a "short" MIDI message. This constructor does not create an object containing a legal MIDI message. You have to use one of the setMessage() methods. Before calling one of these methods, calling retrieval methods (getLength(), getMessage(), getStatus(), getChannel(), getCommand(), getData1(), getData2()) may have undesired results.

See Also:
setMessage(int), setMessage(int, int, int), setMessage(int, int, int, int)
Method Detail

clone

public java.lang.Object clone()
TODO:

Specified by:
clone in class MidiMessage
Returns:
A new MidiMessage object that is a copy of this one.

setMessage

public void setMessage(int nStatus)
                throws InvalidMidiDataException
TODO:

Throws:
InvalidMidiDataException

setMessage

public void setMessage(int nStatus,
                       int nData1,
                       int nData2)
                throws InvalidMidiDataException
TODO:

Throws:
InvalidMidiDataException

setMessage

public void setMessage(int nCommand,
                       int nChannel,
                       int nData1,
                       int nData2)
                throws InvalidMidiDataException
TODO:

Throws:
InvalidMidiDataException

getChannel

public int getChannel()
TODO:


getCommand

public int getCommand()
TODO:


getData1

public int getData1()
TODO:


getData2

public int getData2()
TODO: