Class ADSRParams

java.lang.Object
net.paulhertz.pixelaudio.voices.ADSRParams

public class ADSRParams extends Object
Value object for Minim ADSR parameters. Minim's implementation of a typical ADSR (attack, decay, sustain, release) envelope doesn't allow us to retrieve the values of its parameters after it's been created. This wrapper for ADSR makes those values available.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final float
     
    private final float
     
    private final float
     
    private final float
     
    private final float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ADSRParams(float maxAmp, float attack, float decay, float sustain, float release)
    Construct an ADSRParams object - note that duration of the envelope is calculated up to but not including release time.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    float
     
    float
     
    float
     
    float
     
    ddf.minim.ugens.ADSR
    Build a fresh Minim ADSR from these parameters.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • maxAmp

      private final float maxAmp
    • attack

      private final float attack
    • decay

      private final float decay
    • sustain

      private final float sustain
    • release

      private final float release
  • Constructor Details

    • ADSRParams

      public ADSRParams(float maxAmp, float attack, float decay, float sustain, float release)
      Construct an ADSRParams object - note that duration of the envelope is calculated up to but not including release time.
      Parameters:
      maxAmp - maximum amplitude (0..1)
      attack - attack time in seconds
      decay - decay time in seconds
      sustain - sustain amplitude 90..1)
      release - release time in seconds
  • Method Details

    • getMaxAmp

      public float getMaxAmp()
    • getAttack

      public float getAttack()
    • getDecay

      public float getDecay()
    • getSustain

      public float getSustain()
    • getRelease

      public float getRelease()
    • toADSR

      public ddf.minim.ugens.ADSR toADSR()
      Build a fresh Minim ADSR from these parameters.
      Returns:
      a Minim ADSR constructed with the instance variable stored in ADSRParams
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      a String representation of the ADSRParams data