uk.org.toot.midi.core.channel
Interface MidiChannelReader

All Known Implementing Classes:
DefaultMidiChannelReader

public interface MidiChannelReader


Method Summary
 void decode(int command, int data1, int data2)
           
 int getChannelPressure()
          Obtains the channel's keyboard pressure.
 int getControl(int control)
          Get the value of the controller with the specified index.
 int getController(int controller)
          Obtains the current value of the specified controller.
 int getIndex()
          Get the channel index number.
 boolean getMono()
          Obtains the current mono/poly mode.
 boolean getMute()
          Obtains the current mute state for this channel.
 boolean getOmni()
          Obtains the current omni mode status.
 int getPan()
           
 int getPitchBend()
          Obtains the upward or downward pitch offset for this channel.
 int getPolyPressure(int noteNumber)
          Obtains the pressure with which the specified key is being depressed.
 int getProgram()
          Obtains the current program number for this channel.
 boolean getSolo()
          Obtains the current solo state for this channel.
 int getVolume()
           
 

Method Detail

getIndex

int getIndex()
Get the channel index number.

Returns:
int - the zero-based index of the channel (0..15)

getControl

int getControl(int control)
Get the value of the controller with the specified index. This method determines whether the specified controller is 7 bit or 14 bit and results in one or two getController() calls as appropriate.


getChannelPressure

int getChannelPressure()
Obtains the channel's keyboard pressure.

Returns:
the pressure with which the keyboard is being depressed, from 0 to 127 (127 = maximum pressure)
See Also:
#setChannelPressure(int)

getProgram

int getProgram()
Obtains the current program number for this channel.

Returns:
the program number of the currently selected patch
See Also:
Patch.getProgram(), Synthesizer.loadInstrument(javax.sound.midi.Instrument), #programChange(int)

getPitchBend

int getPitchBend()
Obtains the upward or downward pitch offset for this channel.

Returns:
bend amount, as a nonnegative 14-bit value (8192 = no bend)
See Also:
#setPitchBend(int)

getVolume

int getVolume()

getPan

int getPan()

getMono

boolean getMono()
Obtains the current mono/poly mode.

Returns:
true if mono mode is on, otherwise false (meaning poly mode is on).
See Also:
#setMono(boolean)

getOmni

boolean getOmni()
Obtains the current omni mode status.

Returns:
true if omni mode is on, otherwise false.
See Also:
#setOmni(boolean)

getMute

boolean getMute()
Obtains the current mute state for this channel.

Returns:
true the channel is muted, false if not
See Also:
#setMute(boolean)

getSolo

boolean getSolo()
Obtains the current solo state for this channel.

Returns:
true if soloed, false if not
See Also:
#setSolo(boolean)

getPolyPressure

int getPolyPressure(int noteNumber)
Obtains the pressure with which the specified key is being depressed.

Parameters:
noteNumber - the MIDI note number, from 0 to 127 (60 = Middle C)
Returns:
the amount of pressure for that note, from 0 to 127 (127 = maximum pressure)
See Also:
#setPolyPressure(int, int)

getController

int getController(int controller)
Obtains the current value of the specified controller. The return value is represented with 7 bits. For 14-bit controllers, the MSB and LSB controller value needs to be obtained separately. For example, the 14-bit value of the volume controller can be calculated by multiplying the value of controller 7 (0x07, channel volume MSB) with 128 and adding the value of controller 39 (0x27, channel volume LSB).

Parameters:
controller - the number of the controller whose value is desired. The allowed range is 0-127; see the MIDI 1.0 Specification for the interpretation.
Returns:
the current value of the specified controller (0 to 127)
See Also:
#controlChange(int, int)

decode

void decode(int command,
            int data1,
            int data2)


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