com.softsynth.jmsl.jsyn
Class JSynMixer

java.lang.Object
  extended by com.softsynth.jmsl.jsyn.JSynMixer
All Implemented Interfaces:
Mixer, PanAmpListener

public class JSynMixer
extends java.lang.Object
implements Mixer

JSynMixer, accomodates JSynInstruments with any number of parts in their getOutput(). Includes LineOut

Author:
Nick Didkovsky, email: didkovn@mail.rockefeller.edu, (c) 2003 Nick Didkovsky, all rights reserved.

Constructor Summary
JSynMixer()
           
 
Method Summary
 int addInstrument(Instrument ins)
          When Instruments are added to this Mixer, they are implicitely associated with an autoincrementing fader index.
 int addInstrument(Instrument ins, double pan, double amp)
          Add a JSynInstrument to JSynMixer.
 double getAmp(int faderIndex)
           
 int[] getFaderIndexes(Instrument ins)
          faders index(es) associated with an instrument, or NULL if not found
 boolean getFaderMute(int faderIndex)
           
 boolean getFaderSolo(int faderIndex)
           
 java.awt.Component getGUIComponent()
           
 Instrument getInstrument(int faderIndex)
          Get instrument associated with fader index (some instruments may have more than one fader, so you cannot assume fader n goes with ins n)
 int getNumFaders()
           
 com.softsynth.jsyn.SynthOutput getOutput(int part)
          This method is unique to JSynMixer, not part of Mixer interface .
 double getPan(int faderIndex)
           
 boolean hasExtension(java.lang.String fname, java.lang.String ext)
          True if filename ends in 3 letter extension ext.
static void main(java.lang.String[] args)
           
 void muteChange(int faderIndex, boolean flag)
           
 void panAmpChange(int faderIndex, double pan, double amp)
           
 void removeInstrument(Instrument ins)
          Remove all faders associated with this instrument
 void repatch(Instrument ins)
          Sometimes the internals of an instrument change which require that it be repatched
 void setFaderMute(int faderIndex, boolean flag)
           
 void setFaderSolo(int faderIndex, boolean flag)
          Disconnect non-soloed SynthOutputs, connect soloed SynthOutputs.
 void soloChange(int faderIndex, boolean flag)
           
 void start()
          start()'s BusReaders, LineOut, and all FaderUnits
 void stop()
          stop()'s BusReaders, LineOut, and all FaderUnits
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSynMixer

public JSynMixer()
Method Detail

getNumFaders

public int getNumFaders()
Specified by:
getNumFaders in interface Mixer

getOutput

public com.softsynth.jsyn.SynthOutput getOutput(int part)
This method is unique to JSynMixer, not part of Mixer interface . You can get at this mixer from JMSLMixerContainer with a call to JMSLMixerContainer.getMixer(JSynMixer.class.getName());


addInstrument

public int addInstrument(Instrument ins)
Description copied from interface: Mixer
When Instruments are added to this Mixer, they are implicitely associated with an autoincrementing fader index.

Specified by:
addInstrument in interface Mixer
Returns:
number of new faders added to mixer by adding this instrument

addInstrument

public int addInstrument(Instrument ins,
                         double pan,
                         double amp)
Add a JSynInstrument to JSynMixer. Handles multipart SynthOutput, adds a PanAmpPanel and FaderUnit for each. So adding a mono instrument and a stereo instrument would result in three faders

Specified by:
addInstrument in interface Mixer
Returns:
numParts of instrument's outputs, ie number of faders added to this mixer

removeInstrument

public void removeInstrument(Instrument ins)
Description copied from interface: Mixer
Remove all faders associated with this instrument

Specified by:
removeInstrument in interface Mixer

setFaderMute

public void setFaderMute(int faderIndex,
                         boolean flag)
Specified by:
setFaderMute in interface Mixer

setFaderSolo

public void setFaderSolo(int faderIndex,
                         boolean flag)
Disconnect non-soloed SynthOutputs, connect soloed SynthOutputs. Connect all if none are soloed

Specified by:
setFaderSolo in interface Mixer

getFaderMute

public boolean getFaderMute(int faderIndex)
Specified by:
getFaderMute in interface Mixer

getFaderSolo

public boolean getFaderSolo(int faderIndex)
Specified by:
getFaderSolo in interface Mixer

muteChange

public void muteChange(int faderIndex,
                       boolean flag)
Specified by:
muteChange in interface PanAmpListener

soloChange

public void soloChange(int faderIndex,
                       boolean flag)
Specified by:
soloChange in interface PanAmpListener

repatch

public void repatch(Instrument ins)
Description copied from interface: Mixer
Sometimes the internals of an instrument change which require that it be repatched

Specified by:
repatch in interface Mixer

getInstrument

public Instrument getInstrument(int faderIndex)
Description copied from interface: Mixer
Get instrument associated with fader index (some instruments may have more than one fader, so you cannot assume fader n goes with ins n)

Specified by:
getInstrument in interface Mixer
Returns:
Instrument associated with a fader.

getFaderIndexes

public int[] getFaderIndexes(Instrument ins)
Description copied from interface: Mixer
faders index(es) associated with an instrument, or NULL if not found

Specified by:
getFaderIndexes in interface Mixer

start

public void start()
start()'s BusReaders, LineOut, and all FaderUnits

Specified by:
start in interface Mixer

stop

public void stop()
stop()'s BusReaders, LineOut, and all FaderUnits

Specified by:
stop in interface Mixer

panAmpChange

public void panAmpChange(int faderIndex,
                         double pan,
                         double amp)
Specified by:
panAmpChange in interface PanAmpListener

getPan

public double getPan(int faderIndex)
Specified by:
getPan in interface Mixer

getAmp

public double getAmp(int faderIndex)
Specified by:
getAmp in interface Mixer

getGUIComponent

public java.awt.Component getGUIComponent()
Specified by:
getGUIComponent in interface Mixer

hasExtension

public boolean hasExtension(java.lang.String fname,
                            java.lang.String ext)
True if filename ends in 3 letter extension ext. Case insensitive


main

public static void main(java.lang.String[] args)