diff --git a/src/Blinds.cpp b/src/Blinds.cpp index dbe2a40..1e38355 100644 --- a/src/Blinds.cpp +++ b/src/Blinds.cpp @@ -48,7 +48,7 @@ Blinds::Blinds() { } static float getChannelOutput(const float *in, float gain, const float *cv, float mod, float *light) { - gain += mod * getf(cv) / 5.0; + gain += mod * fmaxf(getf(cv) / 5.0, 0.0); *light = gain * 5.0; return gain * getf(in, 5.0); } diff --git a/src/Veils.cpp b/src/Veils.cpp index ca98cad..9781ad2 100644 --- a/src/Veils.cpp +++ b/src/Veils.cpp @@ -56,7 +56,7 @@ static float getChannelOutput(float *in, float gain, float *cv, float response) if (linear == 0.0) return 0.0; const float ex = 200.0; - float exponential = (powf(ex, linear) - 1.0) / (ex - 1.0); + float exponential = rescalef(powf(ex, linear), 1.0, ex, 0.0, 1.0); out *= crossf(exponential, linear, response); } return out;