com.jsyn.unitgen
Class EnvelopeDAHDSR

java.lang.Object
  extended by com.jsyn.unitgen.UnitGenerator
      extended by com.jsyn.unitgen.UnitFilter
          extended by com.jsyn.unitgen.EnvelopeDAHDSR
All Implemented Interfaces:
UnitSink, UnitSource

public class EnvelopeDAHDSR
extends UnitFilter

Six stage envelope similar to the envelope in DLS2. The envelope is triggered when the input goes above THRESHOLD. The envelope is released when the input goes below THRESHOLD.


Field Summary
 UnitInputPort amplitude
           
 UnitInputPort attack
          Time in seconds for the rising stage of the envelope to go from 0.0 to 1.0.
 UnitInputPort decay
          Time in seconds for the falling stage to go from 0 dB to -96 dB.
 UnitInputPort delay
          Time in seconds for first stage of the envelope, before the attack.
 UnitInputPort hold
          Time in seconds for the plateau between the attack and decay stages.
 UnitInputPort release
          Time in seconds to go from 0 dB to -96 dB.
 UnitInputPort sustain
          Level for the sustain stage.
static double THRESHOLD
           
 
Fields inherited from class com.jsyn.unitgen.UnitFilter
input, output
 
Fields inherited from class com.jsyn.unitgen.UnitGenerator
FALSE, TRUE
 
Constructor Summary
EnvelopeDAHDSR()
           
 
Method Summary
 void generate(int start, int limit)
          Perform essential synthesis function.
 
Methods inherited from class com.jsyn.unitgen.UnitFilter
getInput, getOutput
 
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

THRESHOLD

public static final double THRESHOLD
See Also:
Constant Field Values

delay

public UnitInputPort delay
Time in seconds for first stage of the envelope, before the attack. Typically zero.


attack

public UnitInputPort attack
Time in seconds for the rising stage of the envelope to go from 0.0 to 1.0. The attack is a linear ramp.


hold

public UnitInputPort hold
Time in seconds for the plateau between the attack and decay stages.


decay

public UnitInputPort decay
Time in seconds for the falling stage to go from 0 dB to -96 dB. The decay stage will stop at the sustain level. But we calculate the time to fall to -96 dB so that the decay rate will be unaffected by the sustain level.


sustain

public UnitInputPort sustain
Level for the sustain stage. The envelope will hold here until the input goes to zero or less.


release

public UnitInputPort release
Time in seconds to go from 0 dB to -96 dB. This stage is triggered when the input goes to zero or less. The release stage will start from the sustain level. But we calculate the time to fall from full amplitude so that the release rate will be unaffected by the sustain level.


amplitude

public UnitInputPort amplitude
Constructor Detail

EnvelopeDAHDSR

public EnvelopeDAHDSR()
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