Analog synthesis engine for Klang Modular
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include "dsp/adsr.h"
|
|
|
|
void ADSR::reset() {
|
|
state = IDLE;
|
|
t = 0;
|
|
}
|
|
|
|
void ADSR::assign(Envelope const * env) {
|
|
this->env = env;
|
|
}
|
|
|
|
void ADSR::noteOn() {
|
|
state = ATTACK;
|
|
t = 0;
|
|
}
|
|
|
|
void ADSR::noteOff() {
|
|
if(state != RELEASE) {
|
|
state = RELEASE;
|
|
t = 1;
|
|
}
|
|
} |