com.softsynth.jsyn
Class ExponentialLag

java.lang.Object
  extended by java.util.Observable
      extended by com.softsynth.jsyn.SynthObject
          extended by com.softsynth.jsyn.SynthSound
              extended by com.softsynth.jsyn.SynthUnit
                  extended by com.softsynth.jsyn.ExponentialLag

public class ExponentialLag
extends SynthUnit

Output approaches Input exponentially. This unit provides a slowly changing value that approaches its Input value exponentially. The equation is:

        Output = Output + Rate*(Input - Output);
The Rate is calculated internally based on the value on the halfLife port. Rate is generally just slightly less than 1.0.

Version:
JSyn Version 005
Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
Synth, SynthUnit

Field Summary
 SynthVariable current
          Current internal value.
 SynthVariable halfLife
          Controls rate at which to approach input.
 SynthInput input
          Signal to approach.
 SynthOutput output
           
 
Constructor Summary
ExponentialLag()
           
ExponentialLag(SynthContext synthContext)
          Create a ExponentialLag that runs at Synth.RATE_AUDIO.
ExponentialLag(SynthContext synthContext, int calculationRate)
           
 
Method Summary
 
Methods inherited from class com.softsynth.jsyn.SynthSound
addPort, addPort, findNamedPort, getName, getNumPorts, getPortAt, getPriority, setPriority, setStage, setStage, start, start, stop, stop
 
Methods inherited from class com.softsynth.jsyn.SynthObject
delete, deleteAll, enableDeletionByGarbageCollector, enableTracking, getPeer, getSynthContext, isTrackingEnabled, toString, track
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

input

public SynthInput input
Signal to approach. SIGNAL_TYPE_FULL_RANGE


halfLife

public SynthVariable halfLife
Controls rate at which to approach input. The output will go from its current value halfway to its input value in the time specified using this port. Note: not connectable. SIGNAL_TYPE_HALF_LIFE


current

public SynthVariable current
Current internal value. This may be tweaked to force the output to a value immediately. It can be used to generate an inexpensive decaying envelope by setting the Input to 0.0 and then setting Current to 1.0.


output

public SynthOutput output
Constructor Detail

ExponentialLag

public ExponentialLag(SynthContext synthContext,
                      int calculationRate)
               throws SynthException
Throws:
SynthException

ExponentialLag

public ExponentialLag(SynthContext synthContext)
               throws SynthException
Create a ExponentialLag that runs at Synth.RATE_AUDIO.

Throws:
SynthException - If out of memory.

ExponentialLag

public ExponentialLag()
               throws SynthException
Throws:
SynthException