diff options
author | Chris Johnson <jinx6568@sover.net> | 2020-07-05 22:01:06 -0400 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2020-07-05 22:01:06 -0400 |
commit | c653c8b38fdc79f61ee191052901ac2012d476b4 (patch) | |
tree | ee0f0c7a35a07788d5242165f6274d701e7a92be /plugins/MacVST/Dark/source/DarkProc.cpp | |
parent | a9a344ede4d4a6c3e7960af07389db5b031d0260 (diff) | |
download | airwindows-lv2-port-c653c8b38fdc79f61ee191052901ac2012d476b4.tar.gz airwindows-lv2-port-c653c8b38fdc79f61ee191052901ac2012d476b4.tar.bz2 airwindows-lv2-port-c653c8b38fdc79f61ee191052901ac2012d476b4.zip |
DeRez Dither Updates (Beam, Dark, NJAD)
Diffstat (limited to 'plugins/MacVST/Dark/source/DarkProc.cpp')
-rwxr-xr-x | plugins/MacVST/Dark/source/DarkProc.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/plugins/MacVST/Dark/source/DarkProc.cpp b/plugins/MacVST/Dark/source/DarkProc.cpp index 2aa85c4..955a53f 100755 --- a/plugins/MacVST/Dark/source/DarkProc.cpp +++ b/plugins/MacVST/Dark/source/DarkProc.cpp @@ -13,13 +13,14 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram float* in2 = inputs[1]; float* out1 = outputs[0]; float* out2 = outputs[1]; - int processing = (VstInt32)( A * 1.999 ); double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); int depth = (int)(17.0*overallscale); if (depth < 3) depth = 3; if (depth > 98) depth = 98; + + int processing = (VstInt32)( A * 1.999 ); bool highres = false; if (processing == 1) highres = true; float scaleFactor; @@ -28,6 +29,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram float derez = B; if (derez > 0.0) scaleFactor *= pow(1.0-derez,6); if (scaleFactor < 0.0001) scaleFactor = 0.0001; + float outScale = scaleFactor; + if (outScale < 8.0) outScale = 8.0; while (--sampleFrames >= 0) { @@ -105,8 +108,8 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram lastSampleR[0] = inputSampleR; //end right - inputSampleL /= scaleFactor; - inputSampleR /= scaleFactor; + inputSampleL /= outScale; + inputSampleR /= outScale; *out1 = inputSampleL; *out2 = inputSampleR; @@ -125,13 +128,14 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa double* out1 = outputs[0]; double* out2 = outputs[1]; - int processing = (VstInt32)( A * 1.999 ); double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); int depth = (int)(17.0*overallscale); if (depth < 3) depth = 3; if (depth > 98) depth = 98; + + int processing = (VstInt32)( A * 1.999 ); bool highres = false; if (processing == 1) highres = true; float scaleFactor; @@ -139,7 +143,9 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa else scaleFactor = 32768.0; float derez = B; if (derez > 0.0) scaleFactor *= pow(1.0-derez,6); - if (scaleFactor < 1.0) scaleFactor = 1.0; + if (scaleFactor < 0.0001) scaleFactor = 0.0001; + float outScale = scaleFactor; + if (outScale < 8.0) outScale = 8.0; while (--sampleFrames >= 0) { @@ -217,8 +223,8 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa lastSampleR[0] = inputSampleR; //end right - inputSampleL /= scaleFactor; - inputSampleR /= scaleFactor; + inputSampleL /= outScale; + inputSampleR /= outScale; *out1 = inputSampleL; *out2 = inputSampleR; |