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

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


Constructor Summary
DoubleTable(double[] data)
           
DoubleTable(int numFrames)
           
 
Method Summary
 void allocate(int numFrames)
           
 double evaluate(double input)
          Treat the double array as a lookup table with a domain of -1.0 to 1.0.
 void write(double[] data)
           
 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)

DoubleTable

public DoubleTable(double[] data)
Method Detail

allocate

public void allocate(int numFrames)

write

public void write(double[] data)

write

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

write

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

evaluate

public double evaluate(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:
evaluate in interface Function
Parameters:
input -
Returns:
interpolated value from table