arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::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 audio_tools::ADSRGain:
audio_tools::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)
 
float attackRate ()
 
ADSRGainclone ()
 
float decayRate ()
 
bool isActive ()
 
void keyOff ()
 
void keyOn (float tgt=0)
 
effect_t process (effect_t input)
 calculates the effect output from the input More...
 
float releaseRate ()
 
void setAttackRate (float a)
 
void setDecayRate (float d)
 
void setReleaseRate (float r)
 
void setSustainLevel (float s)
 
float sustainLevel ()
 
- Public Member Functions inherited from audio_tools::AudioEffect
virtual bool active ()
 determines if the effect is active
 
virtual AudioEffectclone ()=0
 
int id ()
 Allows to identify an effect.
 
virtual effect_t process (effect_t in)=0
 calculates the effect output from the input More...
 
virtual void setActive (bool value)
 sets the effect active/inactive
 
void setId (int id)
 Allows to identify an effect.
 

Protected Attributes

ADSRadsr
 
float factor
 
- Protected Attributes inherited from audio_tools::AudioEffect
bool active_flag = true
 
int id_value = -1
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::AudioEffect
int16_t clip (int32_t in, int16_t clipLimit=32767, int16_t resultLimit=32767)
 generic clipping method
 
void copyParent (AudioEffect *copy)
 

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

Member Function Documentation

◆ clone()

ADSRGain * audio_tools::ADSRGain::clone ( )
inlinevirtual

◆ process()

effect_t audio_tools::ADSRGain::process ( effect_t  in)
inlinevirtual

calculates the effect output from the input

Implements audio_tools::AudioEffect.


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