arduino-audio-tools
Loading...
Searching...
No Matches
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 ~ADSRGain ()
 
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

Constructor & Destructor Documentation

◆ ADSRGain() [1/2]

ADSRGain ( float  attack = 0.001,
float  decay = 0.001,
float  sustainLevel = 0.5,
float  release = 0.005,
float  boostFactor = 1.0 
)
inline

◆ ADSRGain() [2/2]

ADSRGain ( const ADSRGain ref)
inline

◆ ~ADSRGain()

virtual ~ADSRGain ( )
inlinevirtual

Member Function Documentation

◆ active()

virtual bool active ( )
inlinevirtualinherited

determines if the effect is active

◆ attackRate()

float attackRate ( )
inline

◆ clip()

int16_t clip ( int32_t  in,
int16_t  clipLimit = 32767,
int16_t  resultLimit = 32767 
)
inlineprotectedinherited

generic clipping method

◆ clone()

ADSRGain * clone ( )
inlinevirtual

Implements AudioEffect.

◆ copyParent()

void copyParent ( AudioEffect copy)
inlineprotectedinherited

◆ decayRate()

float decayRate ( )
inline

◆ id()

int id ( )
inlineinherited

Allows to identify an effect.

◆ isActive()

bool isActive ( )
inline

◆ keyOff()

void keyOff ( )
inline

◆ keyOn()

void keyOn ( float  tgt = 0)
inline

◆ process()

effect_t process ( effect_t  in)
inlinevirtual

calculates the effect output from the input

Implements AudioEffect.

◆ releaseRate()

float releaseRate ( )
inline

◆ setActive()

virtual void setActive ( bool  value)
inlinevirtualinherited

sets the effect active/inactive

◆ setAttackRate()

void setAttackRate ( float  a)
inline

◆ setDecayRate()

void setDecayRate ( float  d)
inline

◆ setId()

void setId ( int  id)
inlineinherited

Allows to identify an effect.

◆ setReleaseRate()

void setReleaseRate ( float  r)
inline

◆ setSustainLevel()

void setSustainLevel ( float  s)
inline

◆ sustainLevel()

float sustainLevel ( )
inline

Member Data Documentation

◆ active_flag

bool active_flag = true
protectedinherited

◆ adsr

ADSR* adsr
protected

◆ factor

float factor
protected

◆ id_value

int id_value = -1
protectedinherited

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