com.softsynth.jsyn
Class PeakFollower

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.PeakFollower

public class PeakFollower
extends SynthUnit

Tracks the peaks of an input signal. This can be used to monitor the overall amplitude of a signal. The output can be used to drive color organs, vocoders, VUmeters, etc. Output drops exponentially when the input drops below the current output level. The output approaches zero based on the value on the halfLife port.

Version:
JSyn Version 013
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
PeakFollower()
           
PeakFollower(SynthContext synthContext)
          Create a PeakFollower that runs at Synth.RATE_AUDIO.
PeakFollower(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_RAW_SIGNED


halfLife

public SynthVariable halfLife
Controls rate at which to approach input. If the input is zero, then the output will go from its current value halfway to zero in the time specified using this port. 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 forcing the current value to a number above zero.


output

public SynthOutput output
Constructor Detail

PeakFollower

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

PeakFollower

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

Throws:
SynthException - If out of memory.

PeakFollower

public PeakFollower()
             throws SynthException
Throws:
SynthException