Skip to content

Commit

Permalink
predelay & lfo bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pvig committed Oct 16, 2021
1 parent bd56ea3 commit 1ebce47
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions firmware/Src/synth/FxBus.cpp
Expand Up @@ -371,7 +371,7 @@ void FxBus::paramChanged() {


fxTimeLinear = masterfxConfig[GLOBALFX_PREDELAYTIME];
if (prevFxTimeLinear == fxTimeLinear)
if (prevFxTimeLinear != fxTimeLinear)
{
fxTime = clamp(fxTimeLinear, 0.0003f, 0.9996f);
fxTime *= fxTime * fxTime;
Expand All @@ -383,7 +383,7 @@ void FxBus::paramChanged() {
predelayMixAttn = predelayMixLevel * (1 - (predelayMixLevel * predelayMixLevel * 0.1f));

lfoSpeedLinear = masterfxConfig[GLOBALFX_LFOSPEED];
if (prevLfoSpeedLinear == lfoSpeedLinear)
if (prevLfoSpeedLinear != lfoSpeedLinear)
{
temp = lfoSpeedLinear;
temp *= temp * temp;
Expand All @@ -408,12 +408,6 @@ void FxBus::paramChanged() {

//------- some process

if(diffusion != prevDiffusion) {
//diffuserCoef1 = -(0.01f + diffusion * 0.67f);
//diffuserCoef2 = -(0.01f + diffusion * 0.5f);
}
prevDiffusion = diffusion;

if(damping != prevDamping) {
damp_b = 1 - damping * damping;
damp_a = 1 - damp_b;
Expand All @@ -432,13 +426,10 @@ void FxBus::paramChanged() {
prevDecayVal = decayVal;

if(notchBase != prevNotchBase || notchSpread != prevNotchSpread) {
//float offset = sqrt3(notchSpread) * 0.25f;
float notchB = notchBase * 0.25f;
float offset = (notchSpread) * 0.125f;
float range = 0.67f;

//notchBase = clamp( notchBase + 0.22f * notchSpread, windowMin, windowMax);

f1L = clamp( fold(notchB + offset) * range, windowMin, windowMax);
f2L = clamp( fold(notchB - offset) * range, windowMin, windowMax);
f3L = clamp( fold(notchB + offset * 1.5f) * range, windowMin, windowMax);
Expand Down

0 comments on commit 1ebce47

Please sign in to comment.