|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable com.softsynth.jsyn.SynthObject com.softsynth.jsyn.SynthTable
public class SynthTable
The SynthTable class is a container for digital audio data. The actual data may need to reside in memory that is accessible to DMA or to a DSP so we cannot assume that it is in main memory. We also need to maintain cache coherence if the data is going to be read or written by hardware other than the CPU. For this reason, SynthTable cannot use memory allocated by, or accessable to, the application. SynthTables differ from Samples in that SynthTables can be read via random access, while Samples can only be read sequentially. Thus tables can be used to implement function lookup and wave shaping, and also can be used with oscillators that have negative or very high frequencies. Samples are read by SynthUnits that are controlled by "Rate" ports. SynthTables are read by SynthUnits that are controlled by "Frequency" ports When using a hardware accelerator, SynthSample and SynthTable data may reside in different memories.
SynthSample
Constructor Summary | |
---|---|
SynthTable()
|
|
SynthTable(double[] data)
|
|
SynthTable(int numFrames)
|
|
SynthTable(SynthContext synthContext)
Create an empty table. |
|
SynthTable(SynthContext synthContext,
double[] data)
Create a monophonic SynthTable containing this double array. |
|
SynthTable(SynthContext synthContext,
int numFrames)
Create a monophonic SynthTable with the specified number of frames. |
Method Summary | |
---|---|
void |
allocate(int numFrames)
|
int |
length()
|
void |
write(double[] data)
|
void |
write(int startFrame,
double[] data,
int startIndex,
int numDoubles)
|
void |
write(int startFrame,
int partNum,
double[] data,
int startIndex,
int numDoubles)
Write data from an array of doubles to the Tables internal storage area. |
void |
write(int startFrame,
int partNum,
short[] data,
int startIndex,
int numShorts)
Write data from an array of shorts to the Tables internal storage area. |
void |
write(int startFrame,
short[] data,
int startIndex,
int numShorts)
|
void |
write(short[] data)
|
Methods inherited from class com.softsynth.jsyn.SynthObject |
---|
delete, deleteAll, enableDeletionByGarbageCollector, enableTracking, getPeer, getSynthContext, isTrackingEnabled, toString, track |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SynthTable(SynthContext synthContext)
public SynthTable()
public SynthTable(SynthContext synthContext, int numFrames) throws SynthException
numFrames
- Number of sample frames to allocate.
SynthException
- If there is insufficient memory.public SynthTable(int numFrames) throws SynthException
SynthException
public SynthTable(SynthContext synthContext, double[] data) throws SynthException
data
- data to fill table.
SynthException
- If there is insufficient memory.public SynthTable(double[] data) throws SynthException
SynthException
Method Detail |
---|
public void allocate(int numFrames) throws SynthException
SynthException
- If the memory allocation fails.public void write(int startFrame, int partNum, short[] data, int startIndex, int numShorts) throws SynthException
Write data from an array of shorts to the Tables internal storage area. The internal storage may be in main memory or it could be located on a sound card and only accessable by DMA. The 16 bit data will be scaled to -1.0 to +1.0 internally using N/32768.
SynthException
- If the data will not fit in the table.public void write(int startFrame, short[] data, int startIndex, int numShorts) throws SynthException
SynthException
public void write(short[] data) throws SynthException
SynthException
public void write(int startFrame, int partNum, double[] data, int startIndex, int numDoubles) throws SynthException
Write data from an array of doubles to the Tables internal storage area.
SynthException
- If the data will not fit in the table.public void write(int startFrame, double[] data, int startIndex, int numDoubles) throws SynthException
SynthException
public void write(double[] data) throws SynthException
SynthException
public int length()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |