20 const float kTcAnalog = log(1/M_E);
21 const float kTcDigital= log(0.01);
61 EnvelopeDetector(
float attackTimeMs,
float releaseTimeMs,
float sampleRate,
unsigned int constantMode = ANALOG,
unsigned int branchingMode = BRANCHING,
unsigned int detectionMode = PEAK,
bool smooth =
true);
68 int setup(
float attackTimeMs,
float releaseTimeMs,
float sampleRate,
unsigned int constantMode = ANALOG,
unsigned int branchingMode = BRANCHING,
unsigned int detectionMode = PEAK,
bool smooth =
true);
76 float process(
float input);
82 void setAttackTime(
float attackTimeMs);
88 float getAttackTime() {
return _attackTimeMs; };
94 void setReleaseTime(
float releaseTimeMs);
100 float getReleaseTime() {
return _releaseTimeMs; };
106 void setConstantMode(
unsigned int mode);
110 unsigned int getConstantMode() {
return _constantMode; };
116 void setBranchingMode(
unsigned int mode);
120 unsigned int getBranchingMOde() {
return _branchingMode; };
126 void setDetectionMode(
unsigned int mode);
130 unsigned getDetectionMode() {
return _detectionMode; };
137 void setSmooth(
bool isSmooth);
141 bool getSmooth() {
return _smooth; };
145 float _tc = kTcAnalog;
147 float _attackTimeMs = 0.0;
148 float _releaseTimeMs = 0.0;
150 float _tConstantAttack = 0.0;
151 float _tConstantRelease = 0.0;
153 float _fastPeakEstimation = 0.0;
154 float _envelope = 0.0;
156 unsigned int _constantMode = ANALOG;
157 unsigned int _branchingMode = BRANCHING;
158 unsigned int _detectionMode = PEAK;
167 double computeTimeConstant(
float timeMs);
Definition: EnvelopeDetector.h:17