diff --git a/src/sfizz/Smoothers.cpp b/src/sfizz/Smoothers.cpp index 970c05bb..7142050b 100644 --- a/src/sfizz/Smoothers.cpp +++ b/src/sfizz/Smoothers.cpp @@ -105,8 +105,8 @@ void LinearSmoother::process(absl::Span input, absl::Span ou if (target != nextTarget) { target = nextTarget; //framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; - //step = (target - current) / (16 * max(1, framesToTarget)); - step = (target - current) / (16 * max(1, smoothFrames)); + //step = (target - current) / max(16, framesToTarget); + step = (target - current) / max(16, smoothFrames); } const simde__m128 targetX4 = simde_mm_set1_ps(target); if (target > current) { @@ -154,8 +154,8 @@ void LinearSmoother::process(absl::Span input, absl::Span ou if (target != nextTarget) { target = nextTarget; //framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; - //step = (target - current) / (16 * max(1, framesToTarget)); - step = (target - current) / (16 * max(1, smoothFrames)); + //step = (target - current) / max(16, framesToTarget); + step = (target - current) / max(16, smoothFrames); } if (target > current) { for (size_t j = 0; j < 16; ++j) @@ -179,8 +179,8 @@ void LinearSmoother::process(absl::Span input, absl::Span ou if (target != nextTarget) { target = nextTarget; // framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; - // step = (target - current) / ((count - i) * max(1, framesToTarget)); - step = (target - current) / ((count - i) * max(1, smoothFrames)); + // step = (target - current) / max(static_cast(count - i), framesToTarget); + step = (target - current) / max(static_cast(count - i), smoothFrames); } if (target > current) { for (; i < count; ++i)