Package voltage.processors

# Class EnvelopeFollower

java.lang.Object
voltage.processors.EnvelopeFollower

public class EnvelopeFollower extends Object
An envelope follower outputs a voltage that measures how loud an incoming audio signal is. For example, a very loud drum part could be triggering a lot, but if you happened to sample it while it was crossing a zero threshold, you would be showing an amplitude of zero when that is not indicative of the loudness.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EnvelopeFollower(double initialAttackMils, double initialReleaseMils, double initialValue)`
  Constructs an EnvelopeFollower

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `GetAttackTime()`
  Gets the current attack time
  `double`
  `GetRelease()`
  Gets the current release time
  `double`
  `ProcessSample(double value)`
  Process a sample input.
  `void`
  `SetAttackTime(double attackMils)`
  Sets the attack time.
  `void`
  `SetReleaseTime(double releaseMils)`
  Sets the release time.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EnvelopeFollower

    public EnvelopeFollower(double initialAttackMils, double initialReleaseMils, double initialValue)
    Constructs an EnvelopeFollower
    Parameters:
      `initialAttackMils` - the time in milliseconds that it takes to rise up to the input signal.
      `initialReleaseMils` - the time in milliseconds that it takes to fall back down to 0.
      `initialValue` - a default starting value.

- ## Method Details

  - ### SetAttackTime

    public void SetAttackTime(double attackMils)
    Sets the attack time.
    Parameters:
      `attackMils` - time in milliseconds.

  - ### GetAttackTime

    public double GetAttackTime()
    Gets the current attack time
    Returns:
      attack time in milliseconds.

  - ### SetReleaseTime

    public void SetReleaseTime(double releaseMils)
    Sets the release time.
    Parameters:
      `releaseMils` - time in milliseconds.

  - ### GetRelease

    public double GetRelease()
    Gets the current release time
    Returns:
      release time in milliseconds.

  - ### ProcessSample

    public double ProcessSample(double value)
    Process a sample input.
    Parameters:
      `value` - the input sample.
    Returns:
      the envelope follower level.