Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
#include <ADSR.h>
Inheritance diagram for ADSR:
This Envelope subclass implements a traditional ADSR (Attack, Decay, Sustain, Release) envelope. It responds to simple keyOn and keyOff messages, keeping track of its state. The state = ADSR::DONE after the envelope value reaches 0.0 in the ADSR::RELEASE state.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
Public Types | |
enum | |
Envelope states. | |
Public Member Functions | |
ADSR (void) | |
Default constructor. | |
~ADSR (void) | |
Class destructor. | |
void | keyOn (void) |
Set target = 1, state = ADSR::ATTACK. | |
void | keyOff (void) |
Set target = 0, state = ADSR::RELEASE. | |
void | setAttackRate (StkFloat rate) |
Set the attack rate. | |
void | setDecayRate (StkFloat rate) |
Set the decay rate. | |
void | setSustainLevel (StkFloat level) |
Set the sustain level. | |
void | setReleaseRate (StkFloat rate) |
Set the release rate. | |
void | setAttackTime (StkFloat time) |
Set the attack rate based on a time duration. | |
void | setDecayTime (StkFloat time) |
Set the decay rate based on a time duration. | |
void | setReleaseTime (StkFloat time) |
Set the release rate based on a time duration. | |
void | setAllTimes (StkFloat aTime, StkFloat dTime, StkFloat sLevel, StkFloat rTime) |
Set sustain level and attack, decay, and release time durations. | |
void | setTarget (StkFloat target) |
Set the target value. | |
int | getState (void) const |
Return the current envelope state (ATTACK, DECAY, SUSTAIN, RELEASE, DONE). | |
void | setValue (StkFloat value) |
Set to state = ADSR::SUSTAIN with current and target values of aValue. |
The Synthesis ToolKit in C++ (STK) |
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |