public class FunctionEvaluator extends UnitFilter
// A unit that will lookup the function.
FunctionEvaluator shaper = new FunctionEvaluator();
synth.add( shaper );
shaper.start();
// Define a custom function.
Function cuber = new Function()
{
public double evaluate( double x )
{
return x * x * x;
}
};
shaper.function.set(cuber);
shaper.input.set( 0.5 );
Function| Modifier and Type | Field and Description |
|---|---|
UnitInputPort |
amplitude |
UnitFunctionPort |
function |
input, outputFALSE, TRUE| Constructor and Description |
|---|
FunctionEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
void |
generate(int start,
int limit)
Perform essential synthesis function.
|
getInput, getOutputaddPort, addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getCircuit, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, getSynthesizer, getTopUnit, getUnitGenerator, isEnabled, pullData, setCircuit, setEnabled, setFrameRate, setPort, setSynthesisEngine, start, start, stop, stopequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUnitGenerator, start, start, stop, stopgetUnitGeneratorpublic UnitInputPort amplitude
public UnitFunctionPort function
public void generate(int start,
int limit)
UnitGeneratorgenerate in class UnitGeneratorstart - offset into port bufferslimit - limit offset into port buffers for loop