added waveform selectors

This commit is contained in:
2025-12-27 14:30:49 -06:00
parent 6b52f8fa4f
commit 814002f0d9
9 changed files with 354 additions and 79 deletions

View File

@@ -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_;