public class SineOscillator extends UnitOscillator
amplitude, DEFAULT_AMPLITUDE, DEFAULT_FREQUENCY, frequency, output, phase
FALSE, 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 |
---|
SineOscillator() |
SineOscillator(double freq) |
SineOscillator(double freq,
double amp) |
Modifier and Type | Method and Description |
---|---|
static double |
fastSin(double currentPhase)
Calculate sine using Taylor expansion.
|
void |
generate(int start,
int limit)
Perform essential synthesis function.
|
convertFrequencyToPhaseIncrement, getOutput, noteOff, noteOff, noteOn, noteOn, usePreset
addPort, 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, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUnitGenerator, setPort
public SineOscillator()
public SineOscillator(double freq)
public SineOscillator(double freq, double amp)
public void generate(int start, int limit)
UnitGenerator
generate
in class UnitGenerator
start
- offset into port bufferslimit
- limit offset into port buffers for looppublic static double fastSin(double currentPhase)
currentPhase
- in the range of -1.0 to +1.0 for one cycle