Package voltage.processors

# Class Limiter

java.lang.Object
voltage.processors.Limiter

public class Limiter extends Object
A type of compressor designed to limit the signal to a certain threshold.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Limiter()`
  Construct a Limiter

- ## Method Summary

  Modifier and Type
  Method
  Description
  `double`
  `GetAttackTime()`
  Gets the attack time in milliseconds
  `double`
  `GetGain()`
  Gets the gain amount.
  `double`
  `GetReleaseTime()`
  Gets the release time in milliseconds
  `double`
  `GetThresholdDecibels()`
  Gets the threshold in decibels.
  `double`
  `GetThresholdPercent()`
  Gets the threshold in percentage.
  `double`
  `ProcessSample(double sampleIn)`
  Process a sample.
  `void`
  `ProcessSample(double[] stereoSamplesIn)`
  Process a stereo sample.
  `void`
  `Reset()`
  Resets the limiter.
  `void`
  `SetAttackTime(double ms)`
  Sets the attack time of the limiter.
  `void`
  `SetReleaseTime(double ms)`
  Set the release time of the limiter.
  `void`
  `SetThresholdDecibels(double dB)`
  Set the threshold level by decibals
  `void`
  `SetThresholdPercent(double percent)`
  Set the threshold level by percent.

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

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

- ## Constructor Details

  - ### Limiter

    public Limiter()
    Construct a Limiter

- ## Method Details

  - ### SetThresholdDecibels

    public void SetThresholdDecibels(double dB)
    Set the threshold level by decibals
    Parameters:
      `dB` - the decibels to limit at. Valid range is from -Inf to 0.0

  - ### SetThresholdPercent

    public void SetThresholdPercent(double percent)
    Set the threshold level by percent.
    Parameters:
      `percent` - the percent of maximum amplitude to limit to. (Useful range is from 0 to 100)

  - ### SetAttackTime

    public void SetAttackTime(double ms)
    Sets the attack time of the limiter. Slower attack results in smoother limiting. Fast attack results in hard and drastic limiting.
    Parameters:
      `ms` - attack time in milliseconds

  - ### SetReleaseTime

    public void SetReleaseTime(double ms)
    Set the release time of the limiter. Slower release times make for a smoother transition to the original signal.
    Parameters:
      `ms` - release time in milliseconds.

  - ### GetThresholdDecibels

    public double GetThresholdDecibels()
    Gets the threshold in decibels.
    Returns:
      the threshold in dB.

  - ### GetThresholdPercent

    public double GetThresholdPercent()
    Gets the threshold in percentage.
    Returns:
      the threshold in percentage.

  - ### GetAttackTime

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

  - ### GetReleaseTime

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

  - ### GetGain

    public double GetGain()
    Gets the gain amount.
    Returns:
      the gain amount.

  - ### Reset

    public void Reset()
    Resets the limiter.

  - ### ProcessSample

    public double ProcessSample(double sampleIn)
    Process a sample. Typical use is to call this once per VoltageModule.ProcessSample()
    Parameters:
      `sampleIn` - the input sample.
    Returns:
      the limited and processed sample.

  - ### ProcessSample

    public void ProcessSample(double[] stereoSamplesIn)
    Process a stereo sample.
    Parameters:
      `stereoSamplesIn` - an array of doubles. Array must have two elements. stereoSamplesIn[0] is the left channel value and stereoSamplesIn[1] is the right channel value.