49 void Init(
float sample_rate,
int blockSize = 1);
62 void SetTime(
int seg,
float time);
63 void SetAttackTime(
float timeInS,
float shape = 0.0f);
64 void SetDecayTime(
float timeInS);
65 void SetReleaseTime(
float timeInS);
68 void SetTimeConstant(
float timeInS,
float& time,
float& coeff);
76 sus_level = (sus_level <= 0.f) ? -0.01f
77 : (sus_level > 1.f) ? 1.f : sus_level;
78 sus_level_ = sus_level;
87 inline bool IsRunning()
const {
return mode_ != ADSR_SEG_IDLE; }
90 float sus_level_{0.f};
92 float attackShape_{-1.f};
93 float attackTarget_{0.0f};
94 float attackTime_{-1.0f};
95 float decayTime_{-1.0f};
96 float releaseTime_{-1.0f};
99 float releaseD0_{0.f};
101 uint8_t mode_{ADSR_SEG_IDLE};
void SetSustainLevel(float sus_level)
Definition adsr.h:74
float Process(bool gate)
Definition adsr.cpp:95
uint8_t GetCurrentSegment()
Definition adsr.h:83
void Init(float sample_rate, int blockSize=1)
Definition adsr.cpp:7
bool IsRunning() const
Definition adsr.h:87
void Retrigger(bool hard)
Definition adsr.cpp:25
void SetTime(int seg, float time)
Definition adsr.cpp:32
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16