uk.org.toot.midi.message
Class PitchMsg

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
              extended by uk.org.toot.midi.message.PitchMsg
Direct Known Subclasses:
NoteMsg

public class PitchMsg
extends ChannelMsg

This class provides methods to simplify client handling of pitched messages. POLY_PRESSURE is accepted since it contains pitch data which also needs to be e.g. transposed.


Field Summary
 
Fields inherited from class uk.org.toot.midi.message.ChannelMsg
CHANNEL_PRESSURE, CONTROL_CHANGE, NOTE_OFF, NOTE_ON, PITCH_BEND, POLY_PRESSURE, PROGRAM_CHANGE
 
Constructor Summary
PitchMsg()
           
 
Method Summary
static int getPitch(javax.sound.midi.MidiMessage msg)
          Get the Pitch byte of the specified MidiMessage.
static boolean isPitch(int status)
           
static boolean isPitch(javax.sound.midi.MidiMessage msg)
          Determine whether the specified MidiMessage can be handled by this class.
static javax.sound.midi.MidiMessage setPitch(javax.sound.midi.MidiMessage msg, int pitch)
          Set the Pitch byte for the specified MidiMessage.
static javax.sound.midi.MidiMessage transpose(javax.sound.midi.MidiMessage msg, int semitones)
          Transpose the specified MidiMessage by the specified number of semitones.
 
Methods inherited from class uk.org.toot.midi.message.ChannelMsg
createChannel, createChannel, getChannel, getChannel, getCommand, getCommand, isChannel, isChannel, setChannel, setChannel
 
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
 

Constructor Detail

PitchMsg

public PitchMsg()
Method Detail

isPitch

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


isPitch

public static boolean isPitch(int status)

transpose

public static javax.sound.midi.MidiMessage transpose(javax.sound.midi.MidiMessage msg,
                                                     int semitones)
                                              throws javax.sound.midi.InvalidMidiDataException
Transpose the specified MidiMessage by the specified number of semitones.

Throws:
javax.sound.midi.InvalidMidiDataException

getPitch

public static int getPitch(javax.sound.midi.MidiMessage msg)
Get the Pitch byte of the specified MidiMessage.


setPitch

public static javax.sound.midi.MidiMessage setPitch(javax.sound.midi.MidiMessage msg,
                                                    int pitch)
                                             throws javax.sound.midi.InvalidMidiDataException
Set the Pitch byte for the specified MidiMessage.

Throws:
javax.sound.midi.InvalidMidiDataException


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