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

Generates ADSR values between 0.0 and 1.0. More...

#include <AudioParameters.h>

Inheritance diagram for ADSR:
AbstractParameter

Public Member Functions

 ADSR (ADSR &copy)=default
 
 ADSR (float attack=0.001, float decay=0.001, float sustainLevel=0.5, float release=0.005)
 
float attackRate ()
 
float decayRate ()
 
bool isActive ()
 
void keyOff ()
 
void keyOn (float tgt=0)
 
float releaseRate ()
 
void setAttackRate (float a)
 
void setDecayRate (float d)
 
void setReleaseRate (float r)
 
void setSustainLevel (float s)
 
float sustainLevel ()
 
virtual float tick ()
 
virtual float value ()
 

Protected Types

enum  AdsrPhase {
  Idle , Attack , Decay , Sustain ,
  Release
}
 

Protected Member Functions

float update ()
 

Protected Attributes

float act_value = 0
 
const char * adsrNames [5] = {"Idle", "Attack", "Decay", "Sustain", "Release"}
 
float attack
 
float decay
 
float release
 
AdsrPhase state = Idle
 
float sustain
 
float target = 0
 
int zeroCount = 0
 

Detailed Description

Generates ADSR values between 0.0 and 1.0.


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