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, PORT_NAME_AMPLITUDE, PORT_NAME_CUTOFF, PORT_NAME_FREQUENCY, PORT_NAME_FREQUENCY_SCALER, PORT_NAME_INPUT, PORT_NAME_OUTPUT, PORT_NAME_PAN, PORT_NAME_PHASE, PORT_NAME_PRESSURE, PORT_NAME_TIMBRE, PORT_NAME_TIME, synthesisEngine, TRUE, VERY_SMALL_FLOAT| Constructor and Description |
|---|
FunctionEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
void |
generate(int start,
int limit)
Perform essential synthesis function.
|
getInput, getOutputaddPort, addPort, autoStop, convertHalfLifeToMultiplier, convertTimeToRate, flattenOutputs, generate, getCircuit, getFramePeriod, getFrameRate, getId, getPortByName, getPorts, getSynthesisEngine, getSynthesizer, getTopUnit, getUnitGenerator, incrementWrapPhase, isEnabled, isStartRequired, printConnections, printConnections, printConnections, pullData, setCircuit, setEnabled, setFrameRate, setPort, setSynthesisEngine, start, start, start, stop, stop, stopclone, equals, finalize, 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