From 7ed71e0b6db85e07688deb7f8787b346bb195d67 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 21 Mar 2018 03:29:25 -0400 Subject: [PATCH] Slightly change SlewLimiter implementation --- include/dsp/filter.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/dsp/filter.hpp b/include/dsp/filter.hpp index a61e907d..298c07c5 100644 --- a/include/dsp/filter.hpp +++ b/include/dsp/filter.hpp @@ -52,13 +52,12 @@ struct SlewLimiter { float fall = 1.f; float out = 0.f; - void setRiseFall(float _rise, float _fall) { - rise = _rise; - fall = _fall; + void setRiseFall(float rise, float fall) { + this->rise = rise; + this->fall = fall; } float process(float in) { - float delta = clamp(in - out, -fall, rise); - out += delta; + out = clamp(in, out - fall, out + rise); return out; } };