|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
package javax.sound.midi; |
|
|
|
|
|
/** |
|
* A <code>MidiChannel</code> object represents a single MIDI channel. |
|
* Generally, each <code>MidiChannel</code> method processes a like-named MIDI |
|
* "channel voice" or "channel mode" message as defined by the MIDI specification. However, |
|
* <code>MidiChannel</code> adds some "get" methods that retrieve the value |
|
* most recently set by one of the standard MIDI channel messages. Similarly, |
|
* methods for per-channel solo and mute have been added. |
|
* <p> |
|
* A <code>{@link Synthesizer}</code> object has a collection |
|
* of <code>MidiChannels</code>, usually one for each of the 16 channels |
|
* prescribed by the MIDI 1.0 specification. The <code>Synthesizer</code> |
|
* generates sound when its <code>MidiChannels</code> receive |
|
* <code>noteOn</code> messages. |
|
* <p> |
|
* See the MIDI 1.0 Specification for more information about the prescribed |
|
* behavior of the MIDI channel messages, which are not exhaustively |
|
* documented here. The specification is titled <code>MIDI Reference: |
|
* The Complete MIDI 1.0 Detailed Specification</code>, and is published by |
|
* the MIDI Manufacturer's Association (<a href = http://www.midi.org> |
|
* http://www.midi.org</a>). |
|
* <p> |
|
* MIDI was originally a protocol for reporting the gestures of a keyboard |
|
* musician. This genesis is visible in the <code>MidiChannel</code> API, which |
|
* preserves such MIDI concepts as key number, key velocity, and key pressure. |
|
* It should be understood that the MIDI data does not necessarily originate |
|
* with a keyboard player (the source could be a different kind of musician, or |
|
* software). Some devices might generate constant values for velocity |
|
* and pressure, regardless of how the note was performed. |
|
* Also, the MIDI specification often leaves it up to the |
|
* synthesizer to use the data in the way the implementor sees fit. For |
|
* example, velocity data need not always be mapped to volume and/or brightness. |
|
* |
|
* @see Synthesizer#getChannels |
|
* |
|
* @author David Rivas |
|
* @author Kara Kytle |
|
*/ |
|
|
|
public interface MidiChannel { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void noteOn(int noteNumber, int velocity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void noteOff(int noteNumber, int velocity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void noteOff(int noteNumber); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setPolyPressure(int noteNumber, int pressure); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int getPolyPressure(int noteNumber); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setChannelPressure(int pressure); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int getChannelPressure(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void controlChange(int controller, int value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int getController(int controller); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void programChange(int program); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void programChange(int bank, int program); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int getProgram(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setPitchBend(int bend); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public int getPitchBend(); |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void resetAllControllers(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void allNotesOff(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void allSoundOff(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean localControl(boolean on); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setMono(boolean on); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean getMono(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setOmni(boolean on); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean getOmni(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setMute(boolean mute); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean getMute(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public void setSolo(boolean soloState); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
public boolean getSolo(); |
|
} |