com.jsyn.unitgen
Class PowerOfTwo

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.PowerOfTwo

public class PowerOfTwo
extends UnitGenerator

output = (2.0^input) This is useful for converting a pitch modulation value into a frequency scaler. An input value of +1.0 will output 2.0 for an octave increase. An input value of -1.0 will output 0.5 for an octave decrease. This implementation uses a table lookup to optimize for speed.


Field Summary
 UnitInputPort input
           
 UnitOutputPort output
           
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
PowerOfTwo()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 
Methods inherited from class com.jsyn.unitgen.UnitGenerator
addPort, convertHalfLifeToMultiplier, flattenOutputs, generate, getFramePeriod, getFrameRate, getPortByName, getPorts, getSynthesisEngine, isEnabled, pullData, setCircuit, setFrameRate, setSynthesisEngine, start, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

public UnitInputPort input

output

public UnitOutputPort output
Constructor Detail

PowerOfTwo

public PowerOfTwo()
Method Detail

generate

public void generate(int start,
                     int limit)
Description copied from class: UnitGenerator
Perform essential synthesis function.

Specified by:
generate in class UnitGenerator
Parameters:
start - offset into port buffers
limit - limit offset into port buffers for loop