Package wellen.dsp
Class ADSR
java.lang.Object
wellen.dsp.ADSR
- All Implemented Interfaces:
DSPNodeOutput
envelope with (A)ttack (D)ecay (S)ustain (R)elease stages:
ADSR
it is usually used to control the amplitude of an *oscillator*.
|-----›|--›| |--›|
|---A--|-D-|-S-|-R-|
| /\
| / \
| / \_____
| / ^ \
| / | \
| / | \
|/___________|_____\
|
|Press |Release
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
float
float
float
float
output()
returns the output signal.void
set_adsr
(float pAttack, float pDecay, float pSustain, float pRelease) void
set_attack
(float pAttack) void
set_decay
(float pDecay) void
set_release
(float pRelease) void
set_sustain
(float pSustain) void
start()
void
stop()
-
Field Details
-
ADSR_DIAGRAM
ASCII diagram of an ADSR envelope.- See Also:
-
-
Constructor Details
-
ADSR
public ADSR(int pSamplingRate) - Parameters:
pSamplingRate
- sampling rate in Hz.
-
ADSR
public ADSR()
-
-
Method Details
-
output
public float output()Description copied from interface:DSPNodeOutput
returns the output signal.- Specified by:
output
in interfaceDSPNodeOutput
- Returns:
- current envelope value
-
start
public void start() -
stop
public void stop() -
get_attack
public float get_attack()- Returns:
- attack value in seconds
-
set_attack
public void set_attack(float pAttack) - Parameters:
pAttack
- attack value in seconds
-
set_adsr
public void set_adsr(float pAttack, float pDecay, float pSustain, float pRelease) - Parameters:
pAttack
- attack value in secondspDecay
- decay value in secondspSustain
- sustain value in secondspRelease
- release value in seconds
-
get_decay
public float get_decay()- Returns:
- decay value in seconds
-
set_decay
public void set_decay(float pDecay) - Parameters:
pDecay
- decay value in seconds
-
get_sustain
public float get_sustain()- Returns:
- sustain value in seconds
-
set_sustain
public void set_sustain(float pSustain) - Parameters:
pSustain
- sustain value in seconds
-
get_release
public float get_release()- Returns:
- release value in seconds
-
set_release
public void set_release(float pRelease) - Parameters:
pRelease
- release value in seconds
-