com.frinika.synth
Class Synth

java.lang.Object
  extended by com.frinika.synth.Synth
All Implemented Interfaces:
javax.sound.midi.MidiChannel
Direct Known Subclasses:
Analogika, FrinikaBezierSynth, MySampler, Organ

public abstract class Synth
extends java.lang.Object
implements javax.sound.midi.MidiChannel

Author:
Peter Johan Salomonsen

Field Summary
protected  java.util.HashMap<java.lang.Integer,Oscillator> keys
           
protected  java.util.LinkedList<Oscillator> oscillators
           
protected  PostOscillator postOscillator
           
protected  PreOscillator preOscillator
           
protected  boolean sustain
           
protected  java.util.HashMap<java.lang.Integer,Oscillator> sustainedKeys
           
 
Constructor Summary
Synth(SynthRack synth)
           
 
Method Summary
 void addInstrumentNameListener(InstrumentNameListener instrumentNameListener)
           
protected  void addOscillator(int noteNumber, Oscillator osc)
           
 void allNotesOff()
           
 void allSoundOff()
           
 void close()
           
 void controlChange(int controller, int value)
           
 VoiceServer getAudioOutput()
           
 int getChannelPressure()
           
 int getController(int controller)
           
 SynthRack getFrinikaSynth()
           
 java.lang.String getInstrumentName()
           
 boolean getMono()
           
 boolean getMute()
           
 boolean getOmni()
           
 int getPitchBend()
           
 int getPolyPressure(int noteNumber)
           
 PostOscillator getPostOscillator()
           
 PreOscillator getPreOscillator()
           
 int getProgram()
           
abstract  java.io.Serializable getSettings()
           
 boolean getSolo()
           
abstract  void loadSettings(java.io.Serializable settings)
           
 boolean localControl(boolean on)
           
 void noteOff(int noteNumber)
           
 void noteOff(int noteNumber, int velocity)
           
 void programChange(int program)
           
 void programChange(int bank, int program)
           
 void removeInstrumentNameListener(InstrumentNameListener instrumentNameListener)
           
 void resetAllControllers()
           
 void setChannelPressure(int pressure)
           
 void setInstrumentName(java.lang.String instrumentName)
           
 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 showGUI()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sound.midi.MidiChannel
noteOn
 

Field Detail

sustain

protected boolean sustain

keys

protected java.util.HashMap<java.lang.Integer,Oscillator> keys

sustainedKeys

protected java.util.HashMap<java.lang.Integer,Oscillator> sustainedKeys

oscillators

protected java.util.LinkedList<Oscillator> oscillators

preOscillator

protected PreOscillator preOscillator

postOscillator

protected PostOscillator postOscillator
Constructor Detail

Synth

public Synth(SynthRack synth)
Method Detail

addOscillator

protected void addOscillator(int noteNumber,
                             Oscillator osc)

noteOff

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

noteOff

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

loadSettings

public abstract void loadSettings(java.io.Serializable settings)

getSettings

public abstract java.io.Serializable getSettings()

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

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

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

resetAllControllers

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

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

getAudioOutput

public VoiceServer getAudioOutput()

close

public void close()

showGUI

public void showGUI()

getInstrumentName

public java.lang.String getInstrumentName()
Returns:

setInstrumentName

public void setInstrumentName(java.lang.String instrumentName)

addInstrumentNameListener

public void addInstrumentNameListener(InstrumentNameListener instrumentNameListener)
Parameters:
strip -

removeInstrumentNameListener

public void removeInstrumentNameListener(InstrumentNameListener instrumentNameListener)
Parameters:
adapter -

getPostOscillator

public final PostOscillator getPostOscillator()
Returns:
Returns the postOscillator.

getPreOscillator

public final PreOscillator getPreOscillator()
Returns:
Returns the preOscillator.

getFrinikaSynth

public SynthRack getFrinikaSynth()
Returns:
Returns the frinikaSynth.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object