aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/MacAU/Slew2/Slew2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MacAU/Slew2/Slew2.cpp')
-rwxr-xr-xplugins/MacAU/Slew2/Slew2.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/MacAU/Slew2/Slew2.cpp b/plugins/MacAU/Slew2/Slew2.cpp
index 06a128a..d9a5093 100755
--- a/plugins/MacAU/Slew2/Slew2.cpp
+++ b/plugins/MacAU/Slew2/Slew2.cpp
@@ -164,8 +164,8 @@ void Slew2::Slew2Kernel::Reset()
ataUpsampleHighTweak = 0.0414213562373095048801688; //more adds treble to upsampling
ataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity
ataFlip = false; //end reset of antialias parameters
- demotimer = 0;
lastSample = 0.0;
+ fpNShape = 0.0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -255,6 +255,12 @@ void Slew2::Slew2Kernel::Process( const Float32 *inSourceP,
ataPrevDiffSample = ataDiffSample / 2.0;
//apply processing as difference to non-oversampled raw input
+ //32 bit dither, made small and tidy.
+ int expon; frexpf((Float32)inputSample, &expon);
+ long double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62);
+ inputSample += (dither-fpNShape); fpNShape = dither;
+ //end 32 bit dither
+
*destP = inputSample;
//built in output trim and dry/wet by default