com.sun.media.sound
Class SoftChannel

java.lang.Object
  extended by com.sun.media.sound.SoftChannel
All Implemented Interfaces:
ModelDirectedPlayer, javax.sound.midi.MidiChannel

public class SoftChannel
extends java.lang.Object
implements javax.sound.midi.MidiChannel, ModelDirectedPlayer

Software Synthesizer MIDI channel class.

Author:
Karl Helgason

Field Summary
protected  ModelConnectionBlock[] cds_channelpressure_connections
           
protected  ModelConnectionBlock[] cds_control_connections
           
protected  int cds_control_number
           
protected  ModelConnectionBlock[] cds_polypressure_connections
           
protected  SoftInstrument current_instrument
           
protected  ModelChannelMixer current_mixer
           
protected  boolean[][] keybasedcontroller_active
           
protected  double[][] keybasedcontroller_value
           
protected  int[] portamento_lastnote
           
protected  int portamento_lastnote_ix
           
protected  double portamento_time
           
protected  boolean sustain
           
protected  SoftTuning tuning
           
protected  int tuning_bank
           
protected  int tuning_program
           
 
Constructor Summary
SoftChannel(SoftSynthesizer synth, int channel)
           
 
Method Summary
 void allNotesOff()
           
 void allSoundOff()
           
protected  void applyInstrumentCustomization()
           
 void controlChange(int controller, int value)
           
 void controlChangePerNote(int noteNumber, int controller, int value)
           
 int getChannelPressure()
           
 int getController(int controller)
           
 int getControlPerNote(int noteNumber, int controller)
           
 boolean getMono()
           
 boolean getMute()
           
 boolean getOmni()
           
 int getPitchBend()
           
 int getPolyPressure(int noteNumber)
           
 int getProgram()
           
 boolean getSolo()
           
protected  void initVoice(SoftVoice voice, SoftPerformer p, int voiceID, int noteNumber, int velocity, ModelConnectionBlock[] connectionBlocks, ModelChannelMixer channelmixer, boolean releaseTriggered)
           
 boolean localControl(boolean on)
           
 void mapChannelPressureToDestination(int[] destination, int[] range)
           
 void mapControlToDestination(int control, int[] destination, int[] range)
           
 void mapPolyPressureToDestination(int[] destination, int[] range)
           
 void noteOff(int noteNumber)
           
 void noteOff(int noteNumber, int velocity)
           
 void noteOn(int noteNumber, int velocity)
           
 void nrpnChange(int controller, int value)
           
 void play(int performerIndex, ModelConnectionBlock[] connectionBlocks)
           
 void programChange(int program)
           
 void programChange(int bank, int program)
           
 void resetAllControllers()
           
 void resetAllControllers(boolean allControls)
           
 void rpnChange(int controller, int value)
           
 void setChannelPressure(int pressure)
           
 void setMono(boolean on)
           
 void setMute(boolean mute)
           
 void setOmni(boolean on)
           
 void setPitchBend(int bend)
           
 void setPolyPressure(int noteNumber, int pressure)
           
 void setSolo(boolean soloState)
           
 void tuningChange(int program)
           
 void tuningChange(int bank, int program)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

portamento_time

protected double portamento_time

portamento_lastnote

protected int[] portamento_lastnote

portamento_lastnote_ix

protected int portamento_lastnote_ix

tuning

protected SoftTuning tuning

tuning_bank

protected int tuning_bank

tuning_program

protected int tuning_program

current_instrument

protected SoftInstrument current_instrument

current_mixer

protected ModelChannelMixer current_mixer

cds_control_number

protected int cds_control_number

cds_control_connections

protected ModelConnectionBlock[] cds_control_connections

cds_channelpressure_connections

protected ModelConnectionBlock[] cds_channelpressure_connections

cds_polypressure_connections

protected ModelConnectionBlock[] cds_polypressure_connections

sustain

protected boolean sustain

keybasedcontroller_active

protected boolean[][] keybasedcontroller_active

keybasedcontroller_value

protected double[][] keybasedcontroller_value
Constructor Detail

SoftChannel

public SoftChannel(SoftSynthesizer synth,
                   int channel)
Method Detail

initVoice

protected void initVoice(SoftVoice voice,
                         SoftPerformer p,
                         int voiceID,
                         int noteNumber,
                         int velocity,
                         ModelConnectionBlock[] connectionBlocks,
                         ModelChannelMixer channelmixer,
                         boolean releaseTriggered)

noteOn

public void noteOn(int noteNumber,
                   int velocity)
Specified by:
noteOn in interface javax.sound.midi.MidiChannel

noteOff

public void noteOff(int noteNumber,
                    int velocity)
Specified by:
noteOff in interface javax.sound.midi.MidiChannel

play

public void play(int performerIndex,
                 ModelConnectionBlock[] connectionBlocks)
Specified by:
play in interface ModelDirectedPlayer

noteOff

public void noteOff(int noteNumber)
Specified by:
noteOff in interface javax.sound.midi.MidiChannel

setPolyPressure

public void setPolyPressure(int noteNumber,
                            int pressure)
Specified by:
setPolyPressure in interface javax.sound.midi.MidiChannel

getPolyPressure

public int getPolyPressure(int noteNumber)
Specified by:
getPolyPressure in interface javax.sound.midi.MidiChannel

setChannelPressure

public void setChannelPressure(int pressure)
Specified by:
setChannelPressure in interface javax.sound.midi.MidiChannel

getChannelPressure

public int getChannelPressure()
Specified by:
getChannelPressure in interface javax.sound.midi.MidiChannel

applyInstrumentCustomization

protected void applyInstrumentCustomization()

mapPolyPressureToDestination

public void mapPolyPressureToDestination(int[] destination,
                                         int[] range)

mapChannelPressureToDestination

public void mapChannelPressureToDestination(int[] destination,
                                            int[] range)

mapControlToDestination

public void mapControlToDestination(int control,
                                    int[] destination,
                                    int[] range)

controlChangePerNote

public void controlChangePerNote(int noteNumber,
                                 int controller,
                                 int value)

getControlPerNote

public int getControlPerNote(int noteNumber,
                             int controller)

controlChange

public void controlChange(int controller,
                          int value)
Specified by:
controlChange in interface javax.sound.midi.MidiChannel

getController

public int getController(int controller)
Specified by:
getController in interface javax.sound.midi.MidiChannel

tuningChange

public void tuningChange(int program)

tuningChange

public void tuningChange(int bank,
                         int program)

programChange

public void programChange(int program)
Specified by:
programChange in interface javax.sound.midi.MidiChannel

programChange

public void programChange(int bank,
                          int program)
Specified by:
programChange in interface javax.sound.midi.MidiChannel

getProgram

public int getProgram()
Specified by:
getProgram in interface javax.sound.midi.MidiChannel

setPitchBend

public void setPitchBend(int bend)
Specified by:
setPitchBend in interface javax.sound.midi.MidiChannel

getPitchBend

public int getPitchBend()
Specified by:
getPitchBend in interface javax.sound.midi.MidiChannel

nrpnChange

public void nrpnChange(int controller,
                       int value)

rpnChange

public void rpnChange(int controller,
                      int value)

resetAllControllers

public void resetAllControllers()
Specified by:
resetAllControllers in interface javax.sound.midi.MidiChannel

resetAllControllers

public void resetAllControllers(boolean allControls)

allNotesOff

public void allNotesOff()
Specified by:
allNotesOff in interface javax.sound.midi.MidiChannel

allSoundOff

public void allSoundOff()
Specified by:
allSoundOff in interface javax.sound.midi.MidiChannel

localControl

public boolean localControl(boolean on)
Specified by:
localControl in interface javax.sound.midi.MidiChannel

setMono

public void setMono(boolean on)
Specified by:
setMono in interface javax.sound.midi.MidiChannel

getMono

public boolean getMono()
Specified by:
getMono in interface javax.sound.midi.MidiChannel

setOmni

public void setOmni(boolean on)
Specified by:
setOmni in interface javax.sound.midi.MidiChannel

getOmni

public boolean getOmni()
Specified by:
getOmni in interface javax.sound.midi.MidiChannel

setMute

public void setMute(boolean mute)
Specified by:
setMute in interface javax.sound.midi.MidiChannel

getMute

public boolean getMute()
Specified by:
getMute in interface javax.sound.midi.MidiChannel

setSolo

public void setSolo(boolean soloState)
Specified by:
setSolo in interface javax.sound.midi.MidiChannel

getSolo

public boolean getSolo()
Specified by:
getSolo in interface javax.sound.midi.MidiChannel