From 823088b629742147f7faff81ac8b164e24c912fb Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Thu, 6 Aug 2020 13:52:49 +0200 Subject: [PATCH] Fix the LPF cutoff --- src/sfizz/effects/Disto.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sfizz/effects/Disto.cpp b/src/sfizz/effects/Disto.cpp index 4aea5188..9e83856a 100644 --- a/src/sfizz/effects/Disto.cpp +++ b/src/sfizz/effects/Disto.cpp @@ -21,6 +21,7 @@ #include "Disto.h" #include "Opcode.h" #include "Config.h" +#include "MathHelpers.h" #include #include #include @@ -57,7 +58,11 @@ struct Disto::Impl { std::unique_ptr _temp8x[2]; // use the same formula as reverb - float toneCutoff() const noexcept { return 21.0f + _tone * 1.08f; } + float toneCutoff() const noexcept + { + float mk = 21.0f + _tone * 1.08f; + return 440.0f * std::exp2((mk - 69.0f) * (1.0f / 12.0f)); + } #define DEFINE_SET_GET(type, ident, name, var, def, min, max, step) \ float get_##ident(size_t c, size_t s) const noexcept { return _stages[c][s].var; } \