Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
#include <Asymp.h>
Inheritance diagram for Asymp:
This class implements a simple envelope generator which asymptotically approaches a target value. The algorithm used is of the form:
x[n] = a x[n-1] + (1-a) target,
where a = exp(-T/tau), T is the sample period, and tau is a time constant. The user can set the time constant (default value = 0.3) and target value. Theoretically, this recursion never reaches its target, though the calculations in this class are stopped when the current value gets within a small threshold value of the target (at which time the current value is set to the target). It responds to keyOn and keyOff messages by ramping to 1.0 on keyOn and to 0.0 on keyOff.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
Public Member Functions | |
Asymp (void) | |
Default constructor. | |
~Asymp (void) | |
Class destructor. | |
void | keyOn (void) |
Set target = 1. | |
void | keyOff (void) |
Set target = 0. | |
void | setTau (StkFloat tau) |
Set the asymptotic rate via the time factor tau (must be > 0). | |
void | setTime (StkFloat time) |
Set the asymptotic rate based on a time duration (must be > 0). | |
void | setTarget (StkFloat target) |
Set the target value. |
|
Set the asymptotic rate via the time factor tau (must be > 0). The rate is computed as described above. The value of tau must be greater than zero. Values of tau close to zero produce fast approach rates, while values greater than 1.0 produce rather slow rates. |
The Synthesis ToolKit in C++ (STK) |
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |