Exponentially decaying curve. More...
#include <Envelope.h>
Inherits Ts.
Public Member Functions | |
Decay (T decay=T(1), T val=T(1)) | |
T | decay () const |
Returns -60 dB decay length. | |
bool | done (T thresh=T(0.001)) const |
Returns whether value is below threshold. | |
T | value () const |
Returns current value. | |
T | operator() () |
Generate next sample. | |
void | decay (T val) |
Set number of units for curve to decay -60 dB. | |
void | reset () |
Set current value to 1. | |
void | value (T val) |
Set current value. |
Exponentially decaying curve.
This envelope exponentially decays towards zero starting from an initial value. Because zero is never reached, the decay length determines when the envelope is -60 dB down from its initial value. This envelope is one of the most computationally efficient envelopes requiring only a single multiply per iteration.
Decay | ( | T | decay = T(1) , |
T | val = T(1) |
||
) |
[in] | decay | Number of units until initial value decays -60 dB |
[in] | val | Intial value |