From 3c0d151e1a8014ece2a3982ec0e7b364e23a7575 Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Thu, 28 May 2020 07:27:31 -0400 Subject: Laserbat spotted an interesting bug in legacy NJAD code! --- plugins/WinVST/Ditherbox/DitherboxProc.cpp | 16 ++++++++-------- plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp | 8 ++++---- plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp | 8 ++++---- .../NotJustAnotherDither/NotJustAnotherDitherProc.cpp | 8 ++++---- plugins/WinVST/Righteous4/Righteous4Proc.cpp | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'plugins/WinVST') diff --git a/plugins/WinVST/Ditherbox/DitherboxProc.cpp b/plugins/WinVST/Ditherbox/DitherboxProc.cpp index 4115687..4906413 100755 --- a/plugins/WinVST/Ditherbox/DitherboxProc.cpp +++ b/plugins/WinVST/Ditherbox/DitherboxProc.cpp @@ -443,7 +443,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -518,7 +518,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -602,7 +602,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -683,7 +683,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -1447,7 +1447,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -1522,7 +1522,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -1606,7 +1606,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -1687,7 +1687,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; diff --git a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp index 7bd2210..e0b2d86 100755 --- a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp +++ b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp @@ -140,7 +140,7 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -215,7 +215,7 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -374,7 +374,7 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -449,7 +449,7 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; diff --git a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp index 28c4385..af43200 100755 --- a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp +++ b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCDProc.cpp @@ -145,7 +145,7 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -226,7 +226,7 @@ void NotJustAnotherCD::processReplacing(float **inputs, float **outputs, VstInt3 totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -395,7 +395,7 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -476,7 +476,7 @@ void NotJustAnotherCD::processDoubleReplacing(double **inputs, double **outputs, totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp index 46a073e..cbc6cc3 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp @@ -145,7 +145,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -226,7 +226,7 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -394,7 +394,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -475,7 +475,7 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; diff --git a/plugins/WinVST/Righteous4/Righteous4Proc.cpp b/plugins/WinVST/Righteous4/Righteous4Proc.cpp index 630360f..feff69b 100755 --- a/plugins/WinVST/Righteous4/Righteous4Proc.cpp +++ b/plugins/WinVST/Righteous4/Righteous4Proc.cpp @@ -391,7 +391,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -472,7 +472,7 @@ void Righteous4::processReplacing(float **inputs, float **outputs, VstInt32 samp totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; @@ -900,7 +900,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn totalA = bynL[1] + bynL[2] + bynL[3] + bynL[4] + bynL[5] + bynL[6] + bynL[7] + bynL[8] + bynL[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynL[1] /= totalA; bynL[2] /= totalA; bynL[3] /= totalA; @@ -981,7 +981,7 @@ void Righteous4::processDoubleReplacing(double **inputs, double **outputs, VstIn totalA = bynR[1] + bynR[2] + bynR[3] + bynR[4] + bynR[5] + bynR[6] + bynR[7] + bynR[8] + bynR[9]; totalA /= 1000; - if (totalA = 0) totalA = 1; + if (totalA = 0) totalA = 1; // spotted by Laserbat: this 'scaling back' code doesn't. It always divides by the fallback of 1. Old NJAD doesn't scale back the things we're comparing against. Kept to retain known behavior, use the one in StudioTan and Monitoring for a tuned-as-intended NJAD. bynR[1] /= totalA; bynR[2] /= totalA; bynR[3] /= totalA; -- cgit v1.2.3