Browse Source

Slightly change SlewLimiter implementation

pull/1639/head
Andrew Belt 7 years ago
parent
commit
397f646649
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      include/dsp/filter.hpp

+ 4
- 5
include/dsp/filter.hpp View File

@@ -52,13 +52,12 @@ struct SlewLimiter {
float fall = 1.f; float fall = 1.f;
float out = 0.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 process(float in) {
float delta = clamp(in - out, -fall, rise);
out += delta;
out = clamp(in, out - fall, out + rise);
return out; return out;
} }
}; };


Loading…
Cancel
Save