Skip to content

Commit

Permalink
Fix bug that happens when setting predelay to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwillis committed Dec 28, 2022
1 parent f7bb1bb commit d87f5e4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/DragonflyVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

#define MAJOR_VERSION 3
#define MINOR_VERSION 2
#define PATCH_VERSION 7
#define PATCH_VERSION 8
#define VERSION_SUFFIX ""
9 changes: 8 additions & 1 deletion plugins/dragonfly-hall-reverb/DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ void DragonflyReverbDSP::run(const float** inputs, float** outputs, uint32_t fra
late.setRSFactor (value / 80.0); break;
case paramWidth: early.setwidth (value / 100.0);
late.setwidth (value / 100.0); break;
case paramPredelay: late.setPreDelay (value); break;
case paramPredelay:
// Freeverb doesn't handle zero predelay properly
// Instead of modifying the library, avoid it here
if (value < 0.1) {
value = 0.1;
}
late.setPreDelay (value);
break;
case paramDiffuse: late.setidiffusion1(value / 140.0);
late.setapfeedback (value / 140.0); break;
case paramLowCut: early.setoutputhpf (value);
Expand Down
13 changes: 10 additions & 3 deletions plugins/dragonfly-plate-reverb/DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,16 @@ void DragonflyReverbDSP::run(const float** inputs, float** outputs, uint32_t fra
case paramWidth: strev.setwidth (value / 120.0);
nrev.setwidth (value / 120.0);
nrevb.setwidth (value / 120.0); break;
case paramPredelay: strev.setPreDelay (value);
nrev.setPreDelay (value);
nrevb.setPreDelay (value); break;
case paramPredelay:
// Freeverb doesn't handle zero predelay properly
// Instead of modifying the library, avoid it here
if (value < 0.1) {
value = 0.1;
}
strev.setPreDelay (value);
nrev.setPreDelay (value);
nrevb.setPreDelay (value);
break;
case paramDecay: strev.setrt60 (value);
nrev.setrt60 (value);
nrevb.setrt60 (value); break;
Expand Down
9 changes: 8 additions & 1 deletion plugins/dragonfly-room-reverb/DSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ void DragonflyReverbDSP::run(const float** inputs, float** outputs, uint32_t fra
late.setbassboost( newParams[paramBoost] / 20.0 / pow(newParams[paramDecay], 1.5) * (newParams[paramSize] / 10.0) ); break;
case paramWidth: early.setwidth (value / 120.0);
late.setwidth (value / 100.0); break;
case paramPredelay: late.setPreDelay (value); break;
case paramPredelay:
// Freeverb doesn't handle zero predelay properly
// Instead of modifying the library, avoid it here
if (value < 0.1) {
value = 0.1;
}
late.setPreDelay (value);
break;
case paramDecay: late.setrt60 (value);
late.setbassboost( newParams[paramBoost] / 20.0 / pow(newParams[paramDecay], 1.5) * (newParams[paramSize] / 10.0) ); break;
case paramDiffuse: late.setidiffusion1(value / 120.0);
Expand Down

0 comments on commit d87f5e4

Please sign in to comment.