Package com.softsynth.jmsl.jsyn2
Class JSynMusicDevice
java.lang.Object
com.softsynth.jmsl.jsyn2.JSynMusicDevice
- All Implemented Interfaces:
Editable
,MusicDevice
public class JSynMusicDevice extends java.lang.Object implements MusicDevice
MusicDevice for pure Java JSyn. Singleton, use JSynMusicDevice.instance(),
since constructor is not public
Use this device to convert from JMSL time to JSyn time stamps, instead of
using JMSL.clock
- Author:
- Nick Didkovsky, email: nick@didkovsky.com, (c) 2012 Nick Didkovsky, all rights reserved.
-
Method Summary
Modifier and Type Method Description void
add(com.jsyn.unitgen.UnitGenerator ugen)
void
addEditListener(EditListener listener)
unimplementedboolean
close()
void
edit(java.awt.Frame f)
Bring up a Dialog for editing, for exampleboolean
getEditEnabled()
int
getFrameRate()
int
getInputDeviceID()
int
getNumInputChannels()
int
getNumOutputChannels()
int
getOutputDeviceID()
double
getSuggestedOutputLatency()
com.jsyn.Synthesizer
getSynthesizer()
static int
getSynthVersion()
static JSynMusicDevice
instance()
double
jmslTimeToJSynTime(double playTime)
static void
main(java.lang.String[] args)
boolean
open()
void
remove(com.jsyn.unitgen.UnitGenerator ugen)
void
removeEditListener(EditListener listener)
unimplementedvoid
setEditEnabled(boolean flag)
Set a flag.void
setFrameRate(int frameRate)
Defaults to 44100void
setInputDeviceID(int inputDeviceID)
void
setNumInputChannels(int numInputChannels)
set to 0 to disable input, important for unsigned Applets!void
setNumOutputChannels(int numOutputChannels)
void
setOutputDeviceID(int outputDeviceID)
void
setSuggestedOutputLatency(double suggestedOutputLatency)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
instance
-
getSynthesizer
public com.jsyn.Synthesizer getSynthesizer() -
add
public void add(com.jsyn.unitgen.UnitGenerator ugen) -
remove
public void remove(com.jsyn.unitgen.UnitGenerator ugen) -
jmslTimeToJSynTime
public double jmslTimeToJSynTime(double playTime) -
setFrameRate
public void setFrameRate(int frameRate)Defaults to 44100- See Also:
Synth
-
getFrameRate
public int getFrameRate() -
getNumInputChannels
public int getNumInputChannels()- Returns:
- the numInputChannels
-
setNumInputChannels
public void setNumInputChannels(int numInputChannels)set to 0 to disable input, important for unsigned Applets!- Parameters:
numInputChannels
- the numInputChannels to set
-
getNumOutputChannels
public int getNumOutputChannels()- Returns:
- the numOutputChannels
-
setNumOutputChannels
public void setNumOutputChannels(int numOutputChannels)- Parameters:
numOutputChannels
- the numOutputChannels to set
-
getSynthVersion
public static int getSynthVersion() -
open
public final boolean open()- Specified by:
open
in interfaceMusicDevice
-
close
public boolean close()- Specified by:
close
in interfaceMusicDevice
-
addEditListener
unimplemented- Specified by:
addEditListener
in interfaceEditable
-
removeEditListener
unimplemented- Specified by:
removeEditListener
in interfaceEditable
-
edit
public void edit(java.awt.Frame f)Description copied from interface:Editable
Bring up a Dialog for editing, for example -
getSuggestedOutputLatency
public double getSuggestedOutputLatency() -
setSuggestedOutputLatency
public void setSuggestedOutputLatency(double suggestedOutputLatency) -
setEditEnabled
public void setEditEnabled(boolean flag)Description copied from interface:Editable
Set a flag. For example you might setEditEnabled(false) after first edit(), or you might hard code values for some Editable class and so want to disable editing.- Specified by:
setEditEnabled
in interfaceEditable
-
getEditEnabled
public boolean getEditEnabled()- Specified by:
getEditEnabled
in interfaceEditable
- Returns:
- flag
-
getInputDeviceID
public int getInputDeviceID()- Returns:
- Returns the inputDeviceID.
-
setInputDeviceID
public void setInputDeviceID(int inputDeviceID)- Parameters:
inputDeviceID
- The inputDeviceID to set.
-
getOutputDeviceID
public int getOutputDeviceID()- Returns:
- Returns the outputDeviceID.
-
setOutputDeviceID
public void setOutputDeviceID(int outputDeviceID)- Parameters:
outputDeviceID
- The outputDeviceID to set.
-
main
public static void main(java.lang.String[] args)
-