Skip to content

Commit

Permalink
Merge pull request #3702 from anatoly-os/LoudSamplesNoteOffFix23
Browse files Browse the repository at this point in the history
fix #271719: sound accumulation on noteOff
  • Loading branch information
anatoly-os committed Jun 5, 2018
2 parents 3a8e42c + c704c7a commit 24789fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zerberus/zerberus.cpp
Expand Up @@ -136,9 +136,8 @@ void Zerberus::processNoteOff(Channel* cp, int key)
&& (v->key() == key)
&& (v->loopMode() != LoopMode::ONE_SHOT)
) {
if (cp->sustain() < 0x40) {
if (!v->isStopped())
v->stop();
if (cp->sustain() < 0x40 && !v->isStopped()) {
v->stop();
double durSinceNoteOn = v->getSamplesSinceStart() / sampleRate();
trigger(cp, key, v->velocity(), Trigger::RELEASE, -1, -1, durSinceNoteOn);
}
Expand Down

0 comments on commit 24789fd

Please sign in to comment.