javax.sound.midi

Interface MidiChannel

public interface MidiChannel

A MIDI channel.

Since: 1.3

Method Summary
voidallNotesOff()
Stop playing all notes.
voidallSoundOff()
Stop all sound.
voidcontrolChange(int controller, int value)
Set a change in a controller's value.
intgetChannelPressure()
Get the key pressure for the channel.
intgetController(int controller)
Get a controller's value.
booleangetMono()
Get the current mono mode.
booleangetMute()
Get the current mute mode.
booleangetOmni()
Get the current omni mode.
intgetPitchBend()
Get the pitch bend for this channel as a positive 14-bit value.
intgetPolyPressure(int noteNumber)
Get the key pressure for a note.
intgetProgram()
Get the current patch for this channel.
booleangetSolo()
Get the current solo mode.
booleanlocalControl(boolean on)
Set whether or not local controls are on or off.
voidnoteOff(int noteNumber, int velocity)
Stop playing a note.
voidnoteOff(int noteNumber)
Stop playing a note.
voidnoteOn(int noteNumber, int velocity)
Start playing a note.
voidprogramChange(int program)
Change the patch for this channel.
voidprogramChange(int bank, int program)
Change the bank and patch for this channel.
voidresetAllControllers()
Reset all MIDI controllers to their default values.
voidsetChannelPressure(int pressure)
Set the key pressure for the channel.
voidsetMono(boolean on)
Turns mono mode on or off.
voidsetMute(boolean mute)
Turns mute mode on or off.
voidsetOmni(boolean on)
Turns omni mode on or off.
voidsetPitchBend(int bend)
Change the pitch bend for this channel using a positive 14-bit value.
voidsetPolyPressure(int noteNumber, int pressure)
Change in a key pressure for a note.
voidsetSolo(boolean solo)
Turns solo mode on or off.

Method Detail

allNotesOff

public void allNotesOff()
Stop playing all notes. Sound may not stop.

allSoundOff

public void allSoundOff()
Stop all sound.

controlChange

public void controlChange(int controller, int value)
Set a change in a controller's value.

Parameters: controller the MIDI controller number (0 to 127) value the new value (0 to 127)

getChannelPressure

public int getChannelPressure()
Get the key pressure for the channel.

Returns: the key pressure

getController

public int getController(int controller)
Get a controller's value.

Parameters: controller the MIDI controller number (0 to 127)

Returns: the controller's value (0 to 127)

getMono

public boolean getMono()
Get the current mono mode.

Returns: true if mono is enabled, false otherwise

getMute

public boolean getMute()
Get the current mute mode.

Returns: true if mute is enabled, false otherwise

getOmni

public boolean getOmni()
Get the current omni mode.

Returns: true if omni is enabled, false otherwise

getPitchBend

public int getPitchBend()
Get the pitch bend for this channel as a positive 14-bit value.

Returns: the current patch bend value

getPolyPressure

public int getPolyPressure(int noteNumber)
Get the key pressure for a note.

Parameters: noteNumber the MIDI note number

Returns: the key pressure

getProgram

public int getProgram()
Get the current patch for this channel.

Returns: current patch (0 to 127)

getSolo

public boolean getSolo()
Get the current solo mode.

Returns: true is solo is enabled, false otherwise.

localControl

public boolean localControl(boolean on)
Set whether or not local controls are on or off. They are on by default.

Parameters: on true to enable local controls, false to disable

Returns: the new value

noteOff

public void noteOff(int noteNumber, int velocity)
Stop playing a note.

Parameters: noteNumber the MIDI note number velocity the volcity at which the ket was released

noteOff

public void noteOff(int noteNumber)
Stop playing a note.

Parameters: noteNumber the MIDI note number

noteOn

public void noteOn(int noteNumber, int velocity)
Start playing a note.

Parameters: noteNumber the MIDI note number velocity the velocity at which the key was pressed

programChange

public void programChange(int program)
Change the patch for this channel.

Parameters: program the patch number to switch to (0 to 127)

programChange

public void programChange(int bank, int program)
Change the bank and patch for this channel.

Parameters: bank the bank to switch to (0 to 16383) program the patch to switch to (0 to 127)

resetAllControllers

public void resetAllControllers()
Reset all MIDI controllers to their default values.

setChannelPressure

public void setChannelPressure(int pressure)
Set the key pressure for the channel.

Parameters: pressure the key pressure

setMono

public void setMono(boolean on)
Turns mono mode on or off.

Parameters: on true to enable mono mode, false to disable

setMute

public void setMute(boolean mute)
Turns mute mode on or off.

Parameters: mute true to enable mute mode, false to disable

setOmni

public void setOmni(boolean on)
Turns omni mode on or off.

Parameters: on true to enable omni mode, false to disable

setPitchBend

public void setPitchBend(int bend)
Change the pitch bend for this channel using a positive 14-bit value.

Parameters: bend the new pitch bend value

setPolyPressure

public void setPolyPressure(int noteNumber, int pressure)
Change in a key pressure for a note.

Parameters: noteNumber the MIDI note number pressure the key pressure

setSolo

public void setSolo(boolean solo)
Turns solo mode on or off. If any channels are soloed, then only those channels make sounds, otherwise all channels will make sound.

Parameters: solo true to enable solo mode, false to disable