Browse Source

Slightly change SlewLimiter implementation

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
7ed71e0b6d
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 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;
}
};


Loading…
Cancel
Save