arduino-audio-tools
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ADSRGain Class Reference

ADSR Envelope: Attack, Decay, Sustain and Release. Attack is the time taken for initial run-up oeffect_tf level from nil to peak, beginning when the key is pressed. Decay is the time taken for the subsequent run down from the attack level to the designated sustainLevel level. Sustain is the level during the main sequence of the sound's duration, until the key is released. Release is the time taken for the level to decay from the sustainLevel level to zero after the key is released.[4]. More...

#include <AudioEffect.h>

Inheritance diagram for ADSRGain:
AudioEffect

Public Member Functions

 ADSRGain (const ADSRGain &ref)
 
 ADSRGain (float attack=0.001, float decay=0.001, float sustainLevel=0.5, float release=0.005, float boostFactor=1.0)
 
virtual bool active ()
 determines if the effect is active
 
float attackRate ()
 
ADSRGainclone ()
 
float decayRate ()
 
int id ()
 Allows to identify an effect.
 
bool isActive ()
 
void keyOff ()
 
void keyOn (float tgt=0)
 
effect_t process (effect_t input)
 calculates the effect output from the input
 
float releaseRate ()
 
virtual void setActive (bool value)
 sets the effect active/inactive
 
void setAttackRate (float a)
 
void setDecayRate (float d)
 
void setId (int id)
 Allows to identify an effect.
 
void setReleaseRate (float r)
 
void setSustainLevel (float s)
 
float sustainLevel ()
 

Protected Member Functions

int16_t clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767)
 generic clipping method
 
void copyParent (AudioEffect *copy)
 

Protected Attributes

bool active_flag = true
 
ADSRadsr
 
float factor
 
int id_value = -1
 

Detailed Description

ADSR Envelope: Attack, Decay, Sustain and Release. Attack is the time taken for initial run-up oeffect_tf level from nil to peak, beginning when the key is pressed. Decay is the time taken for the subsequent run down from the attack level to the designated sustainLevel level. Sustain is the level during the main sequence of the sound's duration, until the key is released. Release is the time taken for the level to decay from the sustainLevel level to zero after the key is released.[4].

Author
Phil Schatzmann

The documentation for this class was generated from the following file: