uk.org.toot.midi.message
Class ChannelMsg

java.lang.Object
  extended by uk.org.toot.midi.message.MidiMsg
      extended by uk.org.toot.midi.message.ShortMsg
          extended by uk.org.toot.midi.message.ChannelMsg
Direct Known Subclasses:
PitchMsg

public class ChannelMsg
extends ShortMsg

The class for creating accessing and mutating 1, 2 and 3 bytes MidiMessages representing Channel Voice and Channel Mode messages without knowledge of the implementation class. Channel Voice and Mode messages are not distinguished.


Field Summary
static int CHANNEL_PRESSURE
          Command value for Channel Pressure (Aftertouch) message (0xD0, or 208)
static int CONTROL_CHANGE
          Command value for Control Change message (0xB0, or 176)
static int NOTE_OFF
          Command value for Note Off message (0x80, or 128)
static int NOTE_ON
          Command value for Note On message (0x90, or 144)
static int PITCH_BEND
          Command value for Pitch Bend message (0xE0, or 224)
static int POLY_PRESSURE
          Command value for Polyphonic Key Pressure (Aftertouch) message (0xA0, or 128)
static int PROGRAM_CHANGE
          Command value for Program Change message (0xC0, or 192)
 
Constructor Summary
ChannelMsg()
           
 
Method Summary
static javax.sound.midi.MidiMessage createChannel(int status, int chan, int data1)
          Create a 2 byte MidiMessage with the specifed channel.
static javax.sound.midi.MidiMessage createChannel(int status, int chan, int data1, int data2)
          Create a 3 byte MidiMessage with the specifed channel.
static int getChannel(int status)
           
static int getChannel(javax.sound.midi.MidiMessage msg)
          Get the Channel nybble from the status byte for this MidiMessage.
static int getCommand(int status)
           
static int getCommand(javax.sound.midi.MidiMessage msg)
          Get the Command nybble of the status byte for the specified MidiMessage.
static boolean isChannel(int status)
           
static boolean isChannel(javax.sound.midi.MidiMessage msg)
          Determine whether the specified MidiMessage can be handled by this class.
static int setChannel(int status, int chan)
           
static javax.sound.midi.MidiMessage setChannel(javax.sound.midi.MidiMessage msg, int chan)
          Set the Channel nybble in the status byte for the specified MidiMessage.
 
Methods inherited from class uk.org.toot.midi.message.ShortMsg
createShort, createShort, createShort, getData1, getData1and2, getData1and2, getData2, isShort, isShort, setData1, setData2, setMessage, setMessage
 
Methods inherited from class uk.org.toot.midi.message.MidiMsg
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
Command value for Note Off message (0x80, or 128)

See Also:
Constant Field Values

NOTE_ON

public static final int NOTE_ON
Command value for Note On message (0x90, or 144)

See Also:
Constant Field Values

POLY_PRESSURE

public static final int POLY_PRESSURE
Command value for Polyphonic Key Pressure (Aftertouch) message (0xA0, or 128)

See Also:
Constant Field Values

CONTROL_CHANGE

public static final int CONTROL_CHANGE
Command value for Control Change message (0xB0, or 176)

See Also:
Constant Field Values

PROGRAM_CHANGE

public static final int PROGRAM_CHANGE
Command value for Program Change message (0xC0, or 192)

See Also:
Constant Field Values

CHANNEL_PRESSURE

public static final int CHANNEL_PRESSURE
Command value for Channel Pressure (Aftertouch) message (0xD0, or 208)

See Also:
Constant Field Values

PITCH_BEND

public static final int PITCH_BEND
Command value for Pitch Bend message (0xE0, or 224)

See Also:
Constant Field Values
Constructor Detail

ChannelMsg

public ChannelMsg()
Method Detail

isChannel

public static boolean isChannel(javax.sound.midi.MidiMessage msg)
Determine whether the specified MidiMessage can be handled by this class.


isChannel

public static boolean isChannel(int status)

createChannel

public static javax.sound.midi.MidiMessage createChannel(int status,
                                                         int chan,
                                                         int data1,
                                                         int data2)
                                                  throws javax.sound.midi.InvalidMidiDataException
Create a 3 byte MidiMessage with the specifed channel.

Throws:
javax.sound.midi.InvalidMidiDataException

createChannel

public static javax.sound.midi.MidiMessage createChannel(int status,
                                                         int chan,
                                                         int data1)
                                                  throws javax.sound.midi.InvalidMidiDataException
Create a 2 byte MidiMessage with the specifed channel.

Throws:
javax.sound.midi.InvalidMidiDataException

getCommand

public static int getCommand(javax.sound.midi.MidiMessage msg)
Get the Command nybble of the status byte for the specified MidiMessage.


getCommand

public static int getCommand(int status)

getChannel

public static int getChannel(javax.sound.midi.MidiMessage msg)
Get the Channel nybble from the status byte for this MidiMessage.


getChannel

public static int getChannel(int status)

setChannel

public static javax.sound.midi.MidiMessage setChannel(javax.sound.midi.MidiMessage msg,
                                                      int chan)
                                               throws javax.sound.midi.InvalidMidiDataException
Set the Channel nybble in the status byte for the specified MidiMessage.

Throws:
javax.sound.midi.InvalidMidiDataException

setChannel

public static int setChannel(int status,
                             int chan)


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.