Package com.softsynth.jmsl.jsyn2
Class JSynMixer
java.lang.Object
com.softsynth.jmsl.jsyn2.JSynMixer
- All Implemented Interfaces:
Mixer
,PanAmpListener
public class JSynMixer extends java.lang.Object implements Mixer
JSynMixer, accommodates Pure JSyn JSynInstruments with any number of parts in their getOutput().
Includes LineOut
- Author:
- Nick Didkovsky, email: nick@didkovsky.com, (c) 2012 Nick Didkovsky, all rights reserved.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description 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 foundboolean
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()
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)
gain is 0..1, pan is 0..1void
removeInstrument(Instrument ins)
Remove all faders associated with this instrumentvoid
repatch(Instrument ins)
Sometimes the internals of an instrument change which require that it be repatchedvoid
setFaderMute(int faderIndex, boolean flag)
void
setFaderSolo(int faderIndex, boolean flag)
void
soloChange(int faderIndex, boolean flag)
void
start()
start()'s LineOutvoid
stop()
stop()'s LineOutMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JSynMixer
public JSynMixer() -
JSynMixer
public JSynMixer(com.jsyn.unitgen.UnitSink unitSink)
-
-
Method Details
-
getNumFaders
public int getNumFaders()- Specified by:
getNumFaders
in interfaceMixer
-
addInstrument
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 interfaceMixer
- Returns:
- number of new faders added to mixer by adding this instrument
-
addInstrument
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 interfaceMixer
- Returns:
- numParts of instrument's outputs, ie number of faders added to this mixer
-
removeInstrument
Description copied from interface:Mixer
Remove all faders associated with this instrument- Specified by:
removeInstrument
in interfaceMixer
-
getInstrument
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 interfaceMixer
- Returns:
- Instrument associated with a fader.
-
getFaderIndexes
Description copied from interface:Mixer
faders index(es) associated with an instrument, or NULL if not found- Specified by:
getFaderIndexes
in interfaceMixer
-
start
public void start()start()'s LineOut -
stop
public void stop()stop()'s LineOut -
panAmpChange
public void panAmpChange(int faderIndex, double pan, double amp)gain is 0..1, pan is 0..1- Specified by:
panAmpChange
in interfacePanAmpListener
-
getPan
public double getPan(int faderIndex) -
getAmp
public double getAmp(int faderIndex) -
getGUIComponent
public java.awt.Component getGUIComponent()- Specified by:
getGUIComponent
in interfaceMixer
-
hasExtension
public boolean hasExtension(java.lang.String fname, java.lang.String ext)True if filename ends in 3 letter extension ext. Case insensitive -
setFaderMute
public void setFaderMute(int faderIndex, boolean flag)- Specified by:
setFaderMute
in interfaceMixer
-
getFaderMute
public boolean getFaderMute(int faderIndex)- Specified by:
getFaderMute
in interfaceMixer
-
getFaderSolo
public boolean getFaderSolo(int faderIndex)- Specified by:
getFaderSolo
in interfaceMixer
-
repatch
Description copied from interface:Mixer
Sometimes the internals of an instrument change which require that it be repatched -
setFaderSolo
public void setFaderSolo(int faderIndex, boolean flag)- Specified by:
setFaderSolo
in interfaceMixer
-
muteChange
public void muteChange(int faderIndex, boolean flag)- Specified by:
muteChange
in interfacePanAmpListener
-
soloChange
public void soloChange(int faderIndex, boolean flag)- Specified by:
soloChange
in interfacePanAmpListener
-
main
public static void main(java.lang.String[] args)
-