|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jsyn.engine.SynthesisEngine
public class SynthesisEngine
Internal implementation of JSyn Synthesizer. The public API is in the Synthesizer interface. This class might be used directly internally.
Synthesizer
Field Summary | |
---|---|
static int |
BUILD_NUMBER
|
static double |
DB96
|
static int |
DEFAULT_FRAME_RATE
|
static java.lang.String |
VERSION_TEXT
|
Fields inherited from interface com.jsyn.Synthesizer |
---|
FRAMES_PER_BLOCK |
Constructor Summary | |
---|---|
SynthesisEngine()
|
Method Summary | |
---|---|
void |
add(UnitGenerator ugen)
Add a unit generator to the synthesizer so it can be played. |
void |
addBlockTask(java.lang.Runnable blockTask)
|
void |
autoStopUnit(UnitGenerator unitGenerator)
|
static short |
convertDoubleToShort(double d)
|
static double |
convertShortToDouble(short sdata)
|
double |
convertTimeToExponentialScaler(double duration)
|
TimeStamp |
createTimeStamp()
Create a TimeStamp using the current audio time. |
void |
generateNextBlock()
|
AudioDeviceManager |
getAudioDeviceManager()
An AudioDeviceManager is an interface to audio hardware. |
double |
getCurrentTime()
|
long |
getFrameCount()
|
double |
getFramePeriod()
|
int |
getFrameRate()
|
double[] |
getInputBuffer(int i)
|
double |
getInputLatency()
|
double |
getInverseNyquist()
|
double[] |
getOutputBuffer(int i)
|
double |
getOutputLatency()
|
double |
getUsage()
|
java.lang.String |
getVersion()
|
int |
getVersionCode()
|
boolean |
isPullDataEnabled()
|
boolean |
isRealTime()
Is JSyn running in real-time mode? |
void |
queueCommand(ScheduledCommand command)
|
void |
remove(UnitGenerator ugen)
|
void |
removeBlockTask(java.lang.Runnable blockTask)
|
void |
run()
|
void |
scheduleCommand(double time,
ScheduledCommand command)
|
void |
scheduleCommand(TimeStamp timeStamp,
ScheduledCommand command)
Send a command to be processed in the background audio thread. |
void |
setPullDataEnabled(boolean pullDataEnabled)
If set true then audio data will be pulled from the output ports of connected unit generators. |
void |
setRealTime(boolean realTime)
If set true then the synthesizer will generate audio in real-time. |
void |
sleepFor(double duration)
Sleep for the specified audio time duration. |
void |
sleepUntil(double time)
Sleep until the specified audio time is reached. |
void |
start()
Begin generating audio using default frame rate of 44100 and two stereo output channels. |
void |
start(int frameRate,
int inputDeviceID,
int numInputChannels,
int outputDeviceID,
int numOutputChannels)
|
void |
startUnit(UnitGenerator unit)
Start a unit generator now. |
void |
startUnit(UnitGenerator unit,
double time)
Start a unit generator at the specified time. |
void |
startUnit(UnitGenerator unit,
TimeStamp timeStamp)
|
void |
stop()
Stop generating audio. |
void |
stopUnit(UnitGenerator unit)
|
void |
stopUnit(UnitGenerator unit,
double time)
|
void |
stopUnit(UnitGenerator unit,
TimeStamp timeStamp)
|
void |
terminate()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int BUILD_NUMBER
public static final java.lang.String VERSION_TEXT
public static final int DEFAULT_FRAME_RATE
public static final double DB96
Constructor Detail |
---|
public SynthesisEngine()
Method Detail |
---|
public java.lang.String getVersion()
getVersion
in interface Synthesizer
public int getVersionCode()
getVersionCode
in interface Synthesizer
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPullDataEnabled()
public void setPullDataEnabled(boolean pullDataEnabled)
pullDataEnabled
- public void terminate()
public void start()
Synthesizer
start
in interface Synthesizer
public void start(int frameRate, int inputDeviceID, int numInputChannels, int outputDeviceID, int numOutputChannels)
start
in interface Synthesizer
public void stop()
Synthesizer
stop
in interface Synthesizer
public void run()
run
in interface java.lang.Runnable
public void generateNextBlock()
public double getCurrentTime()
getCurrentTime
in interface Synthesizer
public TimeStamp createTimeStamp()
Synthesizer
createTimeStamp
in interface Synthesizer
public void scheduleCommand(TimeStamp timeStamp, ScheduledCommand command)
Synthesizer
scheduleCommand
in interface Synthesizer
public void scheduleCommand(double time, ScheduledCommand command)
scheduleCommand
in interface Synthesizer
public void queueCommand(ScheduledCommand command)
queueCommand
in interface Synthesizer
public double[] getInputBuffer(int i)
public double[] getOutputBuffer(int i)
public void autoStopUnit(UnitGenerator unitGenerator)
public void startUnit(UnitGenerator unit, double time)
Synthesizer
startUnit
in interface Synthesizer
public void stopUnit(UnitGenerator unit, double time)
stopUnit
in interface Synthesizer
public void startUnit(UnitGenerator unit, TimeStamp timeStamp)
startUnit
in interface Synthesizer
public void stopUnit(UnitGenerator unit, TimeStamp timeStamp)
stopUnit
in interface Synthesizer
public void startUnit(UnitGenerator unit)
Synthesizer
startUnit
in interface Synthesizer
public void stopUnit(UnitGenerator unit)
stopUnit
in interface Synthesizer
public double getInverseNyquist()
public double convertTimeToExponentialScaler(double duration)
public long getFrameCount()
public int getFrameRate()
getFrameRate
in interface Synthesizer
public double getFramePeriod()
getFramePeriod
in interface Synthesizer
public static double convertShortToDouble(short sdata)
public static short convertDoubleToShort(double d)
public void addBlockTask(java.lang.Runnable blockTask)
public void removeBlockTask(java.lang.Runnable blockTask)
public double getUsage()
getUsage
in interface Synthesizer
public AudioDeviceManager getAudioDeviceManager()
Synthesizer
getAudioDeviceManager
in interface Synthesizer
public void setRealTime(boolean realTime)
Synthesizer
setRealTime
in interface Synthesizer
public boolean isRealTime()
Synthesizer
isRealTime
in interface Synthesizer
public double getOutputLatency()
public double getInputLatency()
public void add(UnitGenerator ugen)
Synthesizer
add
in interface Synthesizer
public void remove(UnitGenerator ugen)
remove
in interface Synthesizer
public void sleepUntil(double time) throws java.lang.InterruptedException
Synthesizer
sleepUntil
in interface Synthesizer
java.lang.InterruptedException
public void sleepFor(double duration) throws java.lang.InterruptedException
Synthesizer
sleepFor
in interface Synthesizer
java.lang.InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |