added waveform selectors
This commit is contained in:
@@ -7,6 +7,7 @@ Envelope::Envelope() {
|
||||
|
||||
void Envelope::noteOn() {
|
||||
state_ = State::Attack;
|
||||
// there's interntionally no envelope value_ reset here because slurs
|
||||
}
|
||||
|
||||
void Envelope::noteOff() {
|
||||
@@ -26,7 +27,7 @@ float Envelope::process() {
|
||||
state_ = State::Decay;
|
||||
}
|
||||
break;
|
||||
case State::Decay: // TODO: if noteOff occurs during decay, release doesn't trigger until decay finishes
|
||||
case State::Decay:
|
||||
value_ -= (1.0f - sustain_) / (decay_ * sampleRate_);
|
||||
if(value_ <= sustain_) {
|
||||
value_ = sustain_;
|
||||
|
||||
Reference in New Issue
Block a user