zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 5a384f7a70f4a023e68e095357c6b5bbce1d4301
parent f671cf5b29a17759b9599bb6b5e6a4f0d0c00814
Author: Ihor Khomyn <hoorkeet@gmail.com>
Date:   Wed,  1 Mar 2017 20:13:26 +0200

Fixed FXs to force zero-output when they are muted

Diffstat:
Msrc/Effects/Echo.cpp | 6+++++-
Msrc/Effects/Reverb.cpp | 6+++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/Effects/Echo.cpp b/src/Effects/Echo.cpp @@ -145,7 +145,11 @@ void Echo::setvolume(unsigned char _Pvolume) Pvolume = _Pvolume; if(insertion == 0) { - outvolume = powf(0.01f, (1.0f - Pvolume / 127.0f)) * 4.0f; + if (Pvolume == 0) { + outvolume = 0.0f; + } else { + outvolume = powf(0.01f, (1.0f - Pvolume / 127.0f)) * 4.0f; + } volume = 1.0f; } else diff --git a/src/Effects/Reverb.cpp b/src/Effects/Reverb.cpp @@ -215,7 +215,11 @@ void Reverb::setvolume(unsigned char _Pvolume) { Pvolume = _Pvolume; if(!insertion) { - outvolume = powf(0.01f, (1.0f - Pvolume / 127.0f)) * 4.0f; + if (Pvolume == 0) { + outvolume = 0.0f; + } else { + outvolume = powf(0.01f, (1.0f - Pvolume / 127.0f)) * 4.0f; + } volume = 1.0f; } else {