Skip to content

Commit

Permalink
Interpolator:Allpass changing last_out variable to private mY1. issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolek committed Jan 1, 2016
1 parent aeb80f0 commit b9d2d87
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/core/JamomaInterpolator.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,26 @@ namespace Jamoma {
class Allpass : Base {
public:
static const int delay = 1;
T last_out = T(0.0);

constexpr T operator()(T x1, T x2, double delta) noexcept {
T out = x1 + delta * (x2-last_out);
last_out = out;
T out = x1 + delta * (x2-mY1);
mY1 = out;
return out;
}

constexpr T operator()(T x0, T x1, T x2, T x3, double delta) noexcept {
// NW: ideally we would call the operator above to remain DRY, but I could not get syntax right
T out = x1 + delta * (x2-last_out);
last_out = out;
T out = x1 + delta * (x2-mY1);
mY1 = out;
return out;
}

void reset() {
last_out = T(0.0);
mY1 = T(0.0);
}

private:
T mY1 = T(0.0);
};


Expand Down

0 comments on commit b9d2d87

Please sign in to comment.