public class ShortMessage extends MidiMessage
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVE_SENSING |
static int |
BUS_SELECT |
static int |
CHANNEL_PRESSURE |
static int |
CONTINUE |
static int |
CONTROL_CHANGE |
static int |
END_OF_EXCLUSIVE |
static int |
MASK_CHANNEL |
static int |
MASK_EVENT |
static int |
MIDI_TIME_CODE |
static int |
NOTE_OFF |
static int |
NOTE_ON |
static int |
PITCH_BEND |
static int |
POLY_PRESSURE |
static int |
PROGRAM_CHANGE |
static int |
SONG_POSITION_POINTER |
static int |
SONG_SELECT |
static int |
START |
static int |
START_OF_EXCLUSIVE |
static int |
STOP |
static int |
SYSTEM_RESET |
static int |
TIMING_CLOCK |
static int |
TUNE_REQUEST |
data, length
Modifier | Constructor and Description |
---|---|
|
ShortMessage()
Default constructor, set up 'note on' message.
|
protected |
ShortMessage(byte[] data)
Constructor with raw data.
|
|
ShortMessage(int status)
Constructor with the kind of message
|
|
ShortMessage(int status,
int data1,
int data2)
Constructor with the entire information of message
|
|
ShortMessage(int command,
int channel,
int data1,
int data2)
Constructor with the entire information of message
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clone the object
|
int |
getChannel()
Get the channel of this message.
|
int |
getCommand()
Get the kind of command for this message.
|
int |
getData1()
Get the first data for this message.
|
int |
getData2()
Get the second data for this message.
|
protected static int |
getDataLength(int status)
Get data length of MIDI message from MIDI event status
|
void |
setMessage(int status)
Set the kind of message.
|
void |
setMessage(int status,
int data1,
int data2)
Set the entire information of message.
|
void |
setMessage(int command,
int channel,
int data1,
int data2)
Set the entire information of message.
|
getLength, getMessage, getStatus, setMessage, toString
public static final int NOTE_OFF
public static final int NOTE_ON
public static final int POLY_PRESSURE
public static final int CONTROL_CHANGE
public static final int PROGRAM_CHANGE
public static final int CHANNEL_PRESSURE
public static final int PITCH_BEND
public static final int START_OF_EXCLUSIVE
public static final int MIDI_TIME_CODE
public static final int SONG_POSITION_POINTER
public static final int SONG_SELECT
public static final int BUS_SELECT
public static final int TUNE_REQUEST
public static final int END_OF_EXCLUSIVE
public static final int TIMING_CLOCK
public static final int START
public static final int CONTINUE
public static final int STOP
public static final int ACTIVE_SENSING
public static final int SYSTEM_RESET
public static final int MASK_EVENT
public static final int MASK_CHANNEL
public ShortMessage()
protected ShortMessage(@NonNull byte[] data)
data
- the raw datapublic ShortMessage(int status) throws InvalidMidiDataException
status
- the status dataInvalidMidiDataException
public ShortMessage(int status, int data1, int data2) throws InvalidMidiDataException
status
- the status datadata1
- the first datadata2
- the second dataInvalidMidiDataException
public ShortMessage(int command, int channel, int data1, int data2) throws InvalidMidiDataException
command
- the commandchannel
- the channeldata1
- the first datadata2
- the second dataInvalidMidiDataException
public void setMessage(int status) throws InvalidMidiDataException
status
- the status dataInvalidMidiDataException
public void setMessage(int status, int data1, int data2) throws InvalidMidiDataException
status
- the status datadata1
- the first datadata2
- the second dataInvalidMidiDataException
public void setMessage(int command, int channel, int data1, int data2) throws InvalidMidiDataException
command
- the commandchannel
- the channeldata1
- the first datadata2
- the second dataInvalidMidiDataException
public int getChannel()
public int getCommand()
public int getData1()
public int getData2()
public Object clone()
MidiMessage
clone
in class MidiMessage
protected static int getDataLength(int status) throws InvalidMidiDataException
status
- MIDI event statusInvalidMidiDataException