Package net.paulhertz.pixelaudio.sampler

# Class ADSRUtils

java.lang.Object
net.paulhertz.pixelaudio.sampler.ADSRUtils

public final class ADSRUtils extends Object
Utility functions for ADSRParams.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `private`
  `ADSRUtils()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static ADSRParams`
  `fitEnvelopeToDuration(ADSRParams adsr, int duration)`
  Returns a new ADSRParams scaled to fit the specified duration (ms).

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

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

- ## Constructor Details

  - ### ADSRUtils

    private ADSRUtils()

- ## Method Details

  - ### fitEnvelopeToDuration

    public static ADSRParams fitEnvelopeToDuration(ADSRParams adsr, int duration)
    Returns a new ADSRParams scaled to fit the specified duration (ms).
    Parameters:
      `adsr` - a ADSRParams instance
      `duration` - duration in milliseconds
    Returns:
      a new ADSRParams with attack, decay and release scaled to the requested duration