Package net.paulhertz.pixelaudio.voices
Class ADSRParams
java.lang.Object
net.paulhertz.pixelaudio.voices.ADSRParams
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 -
Constructor Summary
ConstructorsConstructorDescriptionADSRParams(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
-
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 secondsdecay- decay time in secondssustain- 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
-