com.jsyn.data
Class DoubleTable

java.lang.Object
  extended by com.jsyn.data.DoubleTable
All Implemented Interfaces:
Function

public class DoubleTable
extends java.lang.Object
implements Function

Perform a Function by interpolating values in a table. This can be used for wavetable lookup or waveshaping.


Constructor Summary
DoubleTable(int numFrames)
           
 
Method Summary
 double lookup(double input)
          Treat the double array as a lookup table with a domain of -1.0 to 1.0.
 void write(int startFrame, double[] data, int startIndex, int numFrames)
           
 void write(int startFrame, short[] data, int startIndex, int numFrames)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleTable

public DoubleTable(int numFrames)
Method Detail

write

public void write(int startFrame,
                  short[] data,
                  int startIndex,
                  int numFrames)

write

public void write(int startFrame,
                  double[] data,
                  int startIndex,
                  int numFrames)

lookup

public double lookup(double input)
Treat the double array as a lookup table with a domain of -1.0 to 1.0. If the input is out of range then the output will clip to the end values.

Specified by:
lookup in interface Function
Parameters:
input -
Returns:
interpolated value from table