diff --git a/plugins/LinuxVST/src/Tape/Thunder.cpp b/plugins/LinuxVST/src/Tape/Thunder.cpp deleted file mode 100755 index b206dace5..000000000 --- a/plugins/LinuxVST/src/Tape/Thunder.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* ======================================== - * Thunder - Thunder.h - * Copyright (c) 2016 airwindows, All rights reserved - * ======================================== */ - -#ifndef __Thunder_H -#include "Thunder.h" -#endif - -AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Thunder(audioMaster);} - -Thunder::Thunder(audioMasterCallback audioMaster) : - AudioEffectX(audioMaster, kNumPrograms, kNumParameters) -{ - A = 0.0; - B = 1.0; - - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; - muSpeedA = 10000; - muSpeedB = 10000; - muCoefficientA = 1; - muCoefficientB = 1; - muVary = 1; - gateL = 0.0; - gateR = 0.0; - iirSampleAL = 0.0; - iirSampleBL = 0.0; - iirSampleAR = 0.0; - iirSampleBR = 0.0; - iirSampleAM = 0.0; - iirSampleBM = 0.0; - iirSampleCM = 0.0; - flip = false; - //this is reset: values being initialized only once. Startup values, whatever they are. - - _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. - _canDo.insert("plugAsSend"); // plug-in can be used as a send effect. - _canDo.insert("x2in2out"); - setNumInputs(kNumInputs); - setNumOutputs(kNumOutputs); - setUniqueID(kUniqueId); - canProcessReplacing(); // supports output replacing - canDoubleReplacing(); // supports double precision processing - programsAreChunks(true); - vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name -} - -Thunder::~Thunder() {} -VstInt32 Thunder::getVendorVersion () {return 1000;} -void Thunder::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} -void Thunder::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);} -//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than -//trying to do versioning and preventing people from using older versions. Maybe they like the old one! - -static float pinParameter(float data) -{ - if (data < 0.0f) return 0.0f; - if (data > 1.0f) return 1.0f; - return data; -} - -VstInt32 Thunder::getChunk (void** data, bool isPreset) -{ - float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); - chunkData[0] = A; - chunkData[1] = B; - /* Note: The way this is set up, it will break if you manage to save settings on an Intel - machine and load them on a PPC Mac. However, it's fine if you stick to the machine you - started with. */ - - *data = chunkData; - return kNumParameters * sizeof(float); -} - -VstInt32 Thunder::setChunk (void* data, VstInt32 byteSize, bool isPreset) -{ - float *chunkData = (float *)data; - A = pinParameter(chunkData[0]); - B = pinParameter(chunkData[1]); - /* We're ignoring byteSize as we found it to be a filthy liar */ - - /* calculate any other fields you need here - you could copy in - code from setParameter() here. */ - return 0; -} - -void Thunder::setParameter(VstInt32 index, float value) { - switch (index) { - case kParamA: A = value; break; - case kParamB: B = value; break; //percent. Using this value, it'll be 0-100 everywhere - default: throw; // unknown parameter, shouldn't happen! - } -} - -float Thunder::getParameter(VstInt32 index) { - switch (index) { - case kParamA: return A; break; - case kParamB: return B; break; - default: break; // unknown parameter, shouldn't happen! - } return 0.0; //we only need to update the relevant name, this is simple to manage -} - -void Thunder::getParameterName(VstInt32 index, char *text) { - switch (index) { - case kParamA: vst_strncpy (text, "Thunder", kVstMaxParamStrLen); break; - case kParamB: vst_strncpy (text, "Output Trim", kVstMaxParamStrLen); break; - default: break; // unknown parameter, shouldn't happen! - } //this is our labels for displaying in the VST host -} - -void Thunder::getParameterDisplay(VstInt32 index, char *text) { - switch (index) { - case kParamA: float2string (A, text, kVstMaxParamStrLen); break; - case kParamB: dB2string (B, text, kVstMaxParamStrLen); break; - default: break; // unknown parameter, shouldn't happen! - } //this displays the values and handles 'popups' where it's discrete choices -} - -void Thunder::getParameterLabel(VstInt32 index, char *text) { - switch (index) { - case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; - case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; //the percent - default: break; // unknown parameter, shouldn't happen! - } -} - -VstInt32 Thunder::canDo(char *text) -{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know - -bool Thunder::getEffectName(char* name) { - vst_strncpy(name, "Thunder", kVstMaxProductStrLen); return true; -} - -VstPlugCategory Thunder::getPlugCategory() {return kPlugCategEffect;} - -bool Thunder::getProductString(char* text) { - vst_strncpy (text, "airwindows Thunder", kVstMaxProductStrLen); return true; -} - -bool Thunder::getVendorString(char* text) { - vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; -} diff --git a/plugins/LinuxVST/src/Tape/Thunder.h b/plugins/LinuxVST/src/Tape/Thunder.h deleted file mode 100755 index fc8bf411e..000000000 --- a/plugins/LinuxVST/src/Tape/Thunder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* ======================================== - * Thunder - Thunder.h - * Created 8/12/11 by SPIAdmin - * Copyright (c) 2011 __MyCompanyName__, All rights reserved - * ======================================== */ - -#ifndef __Thunder_H -#define __Thunder_H - -#ifndef __audioeffect__ -#include "audioeffectx.h" -#endif - -#include -#include -#include - -enum { - kParamA = 0, - kParamB = 1, - kNumParameters = 2 -}; // - -const int kNumPrograms = 0; -const int kNumInputs = 2; -const int kNumOutputs = 2; -const unsigned long kUniqueId = 'thun'; //Change this to what the AU identity is! - -class Thunder : - public AudioEffectX -{ -public: - Thunder(audioMasterCallback audioMaster); - ~Thunder(); - virtual bool getEffectName(char* name); // The plug-in name - virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in - virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg - virtual bool getVendorString(char* text); // Vendor info - virtual VstInt32 getVendorVersion(); // Version number - virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); - virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); - virtual void getProgramName(char *name); // read the name from the host - virtual void setProgramName(char *name); // changes the name of the preset displayed in the host - virtual VstInt32 getChunk (void** data, bool isPreset); - virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); - virtual float getParameter(VstInt32 index); // get the parameter value at the specified index - virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value - virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) - virtual void getParameterName(VstInt32 index, char *text); // name of the parameter - virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value - virtual VstInt32 canDo(char *text); -private: - char _programName[kVstMaxProgNameLen + 1]; - std::set< std::string > _canDo; - - double muVary; - double muAttack; - double muNewSpeed; - double muSpeedA; - double muSpeedB; - double muCoefficientA; - double muCoefficientB; - double gateL; - double gateR; - double iirSampleAL; - double iirSampleBL; - double iirSampleAR; - double iirSampleBR; - double iirSampleAM; - double iirSampleBM; - double iirSampleCM; - uint32_t fpdL; - uint32_t fpdR; - bool flip; - - float A; - float B; - -}; - -#endif diff --git a/plugins/LinuxVST/src/Tape/ThunderProc.cpp b/plugins/LinuxVST/src/Tape/ThunderProc.cpp deleted file mode 100755 index ce6b41c13..000000000 --- a/plugins/LinuxVST/src/Tape/ThunderProc.cpp +++ /dev/null @@ -1,406 +0,0 @@ -/* ======================================== - * Thunder - Thunder.h - * Copyright (c) 2016 airwindows, All rights reserved - * ======================================== */ - -#ifndef __Thunder_H -#include "Thunder.h" -#endif - -void Thunder::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) -{ - float* in1 = inputs[0]; - float* in2 = inputs[1]; - float* out1 = outputs[0]; - float* out2 = outputs[1]; - - double overallscale = 1.0; - overallscale /= 44100.0; - overallscale *= getSampleRate(); - - double thunder = A * 0.4; - double threshold = 1.0 - (thunder * 2.0); - if (threshold < 0.01) threshold = 0.01; - double muMakeupGain = 1.0 / threshold; - double release = pow((1.28-thunder),5)*32768.0; - release /= overallscale; - double fastest = sqrt(release); - double EQ = ((0.0275 / getSampleRate())*32000.0); - double dcblock = EQ / 300.0; - double basstrim = (0.01/EQ)+1.0; - //FF parameters also ride off Speed - double outputGain = B; - - double coefficient; - double inputSense; - - double resultL; - double resultR; - double resultM; - double resultML; - double resultMR; - - double inputSampleL; - double inputSampleR; - - while (--sampleFrames >= 0) - { - inputSampleL = *in1; - inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - - inputSampleL = inputSampleL * muMakeupGain; - inputSampleR = inputSampleR * muMakeupGain; - - if (gateL < fabs(inputSampleL)) gateL = inputSampleL; - else gateL -= dcblock; - if (gateR < fabs(inputSampleR)) gateR = inputSampleR; - else gateR -= dcblock; - //setting up gated DC blocking to control the tendency for rumble and offset - - //begin three FathomFive stages - iirSampleAL += (inputSampleL * EQ * thunder); - iirSampleAL -= (iirSampleAL * iirSampleAL * iirSampleAL * EQ); - if (iirSampleAL > gateL) iirSampleAL -= dcblock; - if (iirSampleAL < -gateL) iirSampleAL += dcblock; - resultL = iirSampleAL*basstrim; - iirSampleBL = (iirSampleBL * (1 - EQ)) + (resultL * EQ); - resultL = iirSampleBL; - - iirSampleAR += (inputSampleR * EQ * thunder); - iirSampleAR -= (iirSampleAR * iirSampleAR * iirSampleAR * EQ); - if (iirSampleAR > gateR) iirSampleAR -= dcblock; - if (iirSampleAR < -gateR) iirSampleAR += dcblock; - resultR = iirSampleAR*basstrim; - iirSampleBR = (iirSampleBR * (1 - EQ)) + (resultR * EQ); - resultR = iirSampleBR; - - iirSampleAM += ((inputSampleL + inputSampleR) * EQ * thunder); - iirSampleAM -= (iirSampleAM * iirSampleAM * iirSampleAM * EQ); - resultM = iirSampleAM*basstrim; - iirSampleBM = (iirSampleBM * (1 - EQ)) + (resultM * EQ); - resultM = iirSampleBM; - iirSampleCM = (iirSampleCM * (1 - EQ)) + (resultM * EQ); - - resultM = fabs(iirSampleCM); - resultML = fabs(resultL); - resultMR = fabs(resultR); - - if (resultM > resultML) resultML = resultM; - if (resultM > resultMR) resultMR = resultM; - //trying to restrict the buzziness - - if (resultML > 1.0) resultML = 1.0; - if (resultMR > 1.0) resultMR = 1.0; - //now we have result L, R and M the trigger modulator which must be 0-1 - - //begin compressor section - inputSampleL -= (iirSampleBL * thunder); - inputSampleR -= (iirSampleBR * thunder); - //highpass the comp section by sneaking out what will be the reinforcement - - inputSense = fabs(inputSampleL); - if (fabs(inputSampleR) > inputSense) - inputSense = fabs(inputSampleR); - //we will take the greater of either channel and just use that, then apply the result - //to both stereo channels. - - if (flip) - { - if (inputSense > threshold) - { - muVary = threshold / inputSense; - muAttack = sqrt(fabs(muSpeedA)); - muCoefficientA = muCoefficientA * (muAttack-1.0); - if (muVary < threshold) - { - muCoefficientA = muCoefficientA + threshold; - } - else - { - muCoefficientA = muCoefficientA + muVary; - } - muCoefficientA = muCoefficientA / muAttack; - } - else - { - muCoefficientA = muCoefficientA * ((muSpeedA * muSpeedA)-1.0); - muCoefficientA = muCoefficientA + 1.0; - muCoefficientA = muCoefficientA / (muSpeedA * muSpeedA); - } - muNewSpeed = muSpeedA * (muSpeedA-1); - muNewSpeed = muNewSpeed + fabs(inputSense*release)+fastest; - muSpeedA = muNewSpeed / muSpeedA; - } - else - { - if (inputSense > threshold) - { - muVary = threshold / inputSense; - muAttack = sqrt(fabs(muSpeedB)); - muCoefficientB = muCoefficientB * (muAttack-1); - if (muVary < threshold) - { - muCoefficientB = muCoefficientB + threshold; - } - else - { - muCoefficientB = muCoefficientB + muVary; - } - muCoefficientB = muCoefficientB / muAttack; - } - else - { - muCoefficientB = muCoefficientB * ((muSpeedB * muSpeedB)-1.0); - muCoefficientB = muCoefficientB + 1.0; - muCoefficientB = muCoefficientB / (muSpeedB * muSpeedB); - } - muNewSpeed = muSpeedB * (muSpeedB-1); - muNewSpeed = muNewSpeed + fabs(inputSense*release)+fastest; - muSpeedB = muNewSpeed / muSpeedB; - } - //got coefficients, adjusted speeds - - if (flip) - { - coefficient = pow(muCoefficientA,2); - inputSampleL *= coefficient; - inputSampleR *= coefficient; - } - else - { - coefficient = pow(muCoefficientB,2); - inputSampleL *= coefficient; - inputSampleR *= coefficient; - } - //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ - //applied gain correction to control output level- tends to constrain sound rather than inflate it - - inputSampleL += (resultL * resultM); - inputSampleR += (resultR * resultM); - //combine the two by adding the summed channnel of lows - - if (outputGain != 1.0) { - inputSampleL *= outputGain; - inputSampleR *= outputGain; - } - - //begin 32 bit stereo floating point dither - int expon; frexpf((float)inputSampleL, &expon); - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); - frexpf((float)inputSampleR, &expon); - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); - //end 32 bit stereo floating point dither - - - *out1 = inputSampleL; - *out2 = inputSampleR; - - *in1++; - *in2++; - *out1++; - *out2++; - } -} - -void Thunder::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) -{ - double* in1 = inputs[0]; - double* in2 = inputs[1]; - double* out1 = outputs[0]; - double* out2 = outputs[1]; - - double overallscale = 1.0; - overallscale /= 44100.0; - overallscale *= getSampleRate(); - - double thunder = A * 0.4; - double threshold = 1.0 - (thunder * 2.0); - if (threshold < 0.01) threshold = 0.01; - double muMakeupGain = 1.0 / threshold; - double release = pow((1.28-thunder),5)*32768.0; - release /= overallscale; - double fastest = sqrt(release); - double EQ = ((0.0275 / getSampleRate())*32000.0); - double dcblock = EQ / 300.0; - double basstrim = (0.01/EQ)+1.0; - //FF parameters also ride off Speed - double outputGain = B; - - double coefficient; - double inputSense; - - double resultL; - double resultR; - double resultM; - double resultML; - double resultMR; - - double inputSampleL; - double inputSampleR; - - while (--sampleFrames >= 0) - { - inputSampleL = *in1; - inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - - inputSampleL = inputSampleL * muMakeupGain; - inputSampleR = inputSampleR * muMakeupGain; - - if (gateL < fabs(inputSampleL)) gateL = inputSampleL; - else gateL -= dcblock; - if (gateR < fabs(inputSampleR)) gateR = inputSampleR; - else gateR -= dcblock; - //setting up gated DC blocking to control the tendency for rumble and offset - - //begin three FathomFive stages - iirSampleAL += (inputSampleL * EQ * thunder); - iirSampleAL -= (iirSampleAL * iirSampleAL * iirSampleAL * EQ); - if (iirSampleAL > gateL) iirSampleAL -= dcblock; - if (iirSampleAL < -gateL) iirSampleAL += dcblock; - resultL = iirSampleAL*basstrim; - iirSampleBL = (iirSampleBL * (1 - EQ)) + (resultL * EQ); - resultL = iirSampleBL; - - iirSampleAR += (inputSampleR * EQ * thunder); - iirSampleAR -= (iirSampleAR * iirSampleAR * iirSampleAR * EQ); - if (iirSampleAR > gateR) iirSampleAR -= dcblock; - if (iirSampleAR < -gateR) iirSampleAR += dcblock; - resultR = iirSampleAR*basstrim; - iirSampleBR = (iirSampleBR * (1 - EQ)) + (resultR * EQ); - resultR = iirSampleBR; - - iirSampleAM += ((inputSampleL + inputSampleR) * EQ * thunder); - iirSampleAM -= (iirSampleAM * iirSampleAM * iirSampleAM * EQ); - resultM = iirSampleAM*basstrim; - iirSampleBM = (iirSampleBM * (1 - EQ)) + (resultM * EQ); - resultM = iirSampleBM; - iirSampleCM = (iirSampleCM * (1 - EQ)) + (resultM * EQ); - - resultM = fabs(iirSampleCM); - resultML = fabs(resultL); - resultMR = fabs(resultR); - - if (resultM > resultML) resultML = resultM; - if (resultM > resultMR) resultMR = resultM; - //trying to restrict the buzziness - - if (resultML > 1.0) resultML = 1.0; - if (resultMR > 1.0) resultMR = 1.0; - //now we have result L, R and M the trigger modulator which must be 0-1 - - //begin compressor section - inputSampleL -= (iirSampleBL * thunder); - inputSampleR -= (iirSampleBR * thunder); - //highpass the comp section by sneaking out what will be the reinforcement - - inputSense = fabs(inputSampleL); - if (fabs(inputSampleR) > inputSense) - inputSense = fabs(inputSampleR); - //we will take the greater of either channel and just use that, then apply the result - //to both stereo channels. - - if (flip) - { - if (inputSense > threshold) - { - muVary = threshold / inputSense; - muAttack = sqrt(fabs(muSpeedA)); - muCoefficientA = muCoefficientA * (muAttack-1.0); - if (muVary < threshold) - { - muCoefficientA = muCoefficientA + threshold; - } - else - { - muCoefficientA = muCoefficientA + muVary; - } - muCoefficientA = muCoefficientA / muAttack; - } - else - { - muCoefficientA = muCoefficientA * ((muSpeedA * muSpeedA)-1.0); - muCoefficientA = muCoefficientA + 1.0; - muCoefficientA = muCoefficientA / (muSpeedA * muSpeedA); - } - muNewSpeed = muSpeedA * (muSpeedA-1); - muNewSpeed = muNewSpeed + fabs(inputSense*release)+fastest; - muSpeedA = muNewSpeed / muSpeedA; - } - else - { - if (inputSense > threshold) - { - muVary = threshold / inputSense; - muAttack = sqrt(fabs(muSpeedB)); - muCoefficientB = muCoefficientB * (muAttack-1); - if (muVary < threshold) - { - muCoefficientB = muCoefficientB + threshold; - } - else - { - muCoefficientB = muCoefficientB + muVary; - } - muCoefficientB = muCoefficientB / muAttack; - } - else - { - muCoefficientB = muCoefficientB * ((muSpeedB * muSpeedB)-1.0); - muCoefficientB = muCoefficientB + 1.0; - muCoefficientB = muCoefficientB / (muSpeedB * muSpeedB); - } - muNewSpeed = muSpeedB * (muSpeedB-1); - muNewSpeed = muNewSpeed + fabs(inputSense*release)+fastest; - muSpeedB = muNewSpeed / muSpeedB; - } - //got coefficients, adjusted speeds - - if (flip) - { - coefficient = pow(muCoefficientA,2); - inputSampleL *= coefficient; - inputSampleR *= coefficient; - } - else - { - coefficient = pow(muCoefficientB,2); - inputSampleL *= coefficient; - inputSampleR *= coefficient; - } - //applied compression with vari-vari-µ-µ-µ-µ-µ-µ-is-the-kitten-song o/~ - //applied gain correction to control output level- tends to constrain sound rather than inflate it - - inputSampleL += (resultL * resultM); - inputSampleR += (resultR * resultM); - //combine the two by adding the summed channnel of lows - - if (outputGain != 1.0) { - inputSampleL *= outputGain; - inputSampleR *= outputGain; - } - - //begin 64 bit stereo floating point dither - //int expon; frexp((double)inputSampleL, &expon); - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - //frexp((double)inputSampleR, &expon); - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - //end 64 bit stereo floating point dither - - - *out1 = inputSampleL; - *out2 = inputSampleR; - - *in1++; - *in2++; - *out1++; - *out2++; - } -} \ No newline at end of file diff --git a/plugins/MacSignedVST/ADT/source/ADT.cpp b/plugins/MacSignedVST/ADT/source/ADT.cpp index 653f19aa7..ea5906c22 100755 --- a/plugins/MacSignedVST/ADT/source/ADT.cpp +++ b/plugins/MacSignedVST/ADT/source/ADT.cpp @@ -24,8 +24,8 @@ ADT::ADT(audioMasterCallback audioMaster) : offsetB = 9001; // :D gcount = 0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/ADT/source/ADTProc.cpp b/plugins/MacSignedVST/ADT/source/ADTProc.cpp index c6f9d3dff..9ed2f4762 100755 --- a/plugins/MacSignedVST/ADT/source/ADTProc.cpp +++ b/plugins/MacSignedVST/ADT/source/ADTProc.cpp @@ -126,10 +126,10 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += static_cast(fpdL) * 5.960464655174751e-36L * pow(2,expon+62); + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += static_cast(fpdR) * 5.960464655174751e-36L * pow(2,expon+62); + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -167,8 +167,8 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fabs(offsetA - targetA) > 1000) offsetA = targetA; @@ -259,12 +259,12 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); + //int expon; frexp((double)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += static_cast(fpdL) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += static_cast(fpdR) * 1.110223024625156e-44L * pow(2,expon+62); + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Apicolypse/source/Apicolypse.cpp b/plugins/MacSignedVST/Apicolypse/source/Apicolypse.cpp index 29091468a..f86eaa223 100755 --- a/plugins/MacSignedVST/Apicolypse/source/Apicolypse.cpp +++ b/plugins/MacSignedVST/Apicolypse/source/Apicolypse.cpp @@ -19,8 +19,8 @@ Apicolypse::Apicolypse(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Apicolypse/source/Apicolypse.h b/plugins/MacSignedVST/Apicolypse/source/Apicolypse.h index df2675de1..030e910fc 100755 --- a/plugins/MacSignedVST/Apicolypse/source/Apicolypse.h +++ b/plugins/MacSignedVST/Apicolypse/source/Apicolypse.h @@ -59,8 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpdL; - uint32_t fpdR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp b/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp index 564b8c5b1..9e43be098 100755 --- a/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp +++ b/plugins/MacSignedVST/Apicolypse/source/ApicolypseProc.cpp @@ -215,8 +215,8 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= indrive; inputSampleR *= indrive; diff --git a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h index 93f0c5c0c..375f70022 100755 --- a/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h +++ b/plugins/MacSignedVST/AtmosphereBuss/source/AtmosphereBuss.h @@ -56,6 +56,8 @@ private: double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double lastSampleAL; double lastSampleBL; @@ -100,9 +102,6 @@ private: double thresholdL; double thresholdM; - uint32_t fpdL; - uint32_t fpdR; - float A; }; diff --git a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h index 500d7d54f..7bc3ff2fd 100755 --- a/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h +++ b/plugins/MacSignedVST/AtmosphereChannel/source/AtmosphereChannel.h @@ -56,6 +56,8 @@ private: double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double lastSampleAL; double lastSampleBL; @@ -99,9 +101,6 @@ private: double thresholdK; double thresholdL; double thresholdM; - - uint32_t fpdL; - uint32_t fpdR; float A; }; diff --git a/plugins/MacSignedVST/AverMatrix/source/AverMatrix.cpp b/plugins/MacSignedVST/AverMatrix/source/AverMatrix.cpp index 17c0c5d9c..9c1db1f5e 100755 --- a/plugins/MacSignedVST/AverMatrix/source/AverMatrix.cpp +++ b/plugins/MacSignedVST/AverMatrix/source/AverMatrix.cpp @@ -22,8 +22,8 @@ AverMatrix::AverMatrix(audioMasterCallback audioMaster) : } } - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/AverMatrix/source/AverMatrix.h b/plugins/MacSignedVST/AverMatrix/source/AverMatrix.h index 11679f6d3..a21b9f267 100755 --- a/plugins/MacSignedVST/AverMatrix/source/AverMatrix.h +++ b/plugins/MacSignedVST/AverMatrix/source/AverMatrix.h @@ -57,8 +57,8 @@ private: double bL[11][11]; double bR[11][11]; double f[11]; - uint32_t fpdL; - uint32_t fpdR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp b/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp index a60a1f15b..ae941ec2b 100755 --- a/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp +++ b/plugins/MacSignedVST/BassAmp/source/BassAmpProc.cpp @@ -195,7 +195,7 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF LataLowpass += LataHalfwayLowpass; //and combined them. Now we make sub-octaves RataLowpass += RataHalfwayLowpass; //and combined them. Now we make sub-octaves - double randy = (double(fpdL)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed + double randy = (double(fpdL)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed switch (bflip) { @@ -365,8 +365,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; LinputSample += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)RinputSample, &expon); - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - RinputSample += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + RinputSample += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = LinputSample; diff --git a/plugins/MacSignedVST/Beam/source/BeamProc.cpp b/plugins/MacSignedVST/Beam/source/BeamProc.cpp index 2f961f232..6a2ba2eb7 100755 --- a/plugins/MacSignedVST/Beam/source/BeamProc.cpp +++ b/plugins/MacSignedVST/Beam/source/BeamProc.cpp @@ -37,9 +37,9 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpdL * 1.18e-37; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpdR * 1.18e-37; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; @@ -166,9 +166,9 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpdL * 1.18e-43; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpdR * 1.18e-43; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; diff --git a/plugins/MacSignedVST/BlockParty/source/BlockParty.cpp b/plugins/MacSignedVST/BlockParty/source/BlockParty.cpp index 75840a97f..ba6d66fc6 100755 --- a/plugins/MacSignedVST/BlockParty/source/BlockParty.cpp +++ b/plugins/MacSignedVST/BlockParty/source/BlockParty.cpp @@ -14,7 +14,7 @@ BlockParty::BlockParty(audioMasterCallback audioMaster) : { A = 0.0; B = 1.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedAL = 10000; diff --git a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.cpp b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.cpp index 4bb0be1a1..50f8100ec 100755 --- a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.cpp +++ b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.cpp @@ -22,9 +22,7 @@ BuildATPDF::BuildATPDF(audioMasterCallback audioMaster) : H = 0.5; I = 0.5; J = 0.5; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; - + for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.h b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.h index 742530261..06b07b9dd 100755 --- a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.h +++ b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDF.h @@ -65,9 +65,6 @@ private: double bR[11]; double f[11]; //default stuff - - uint32_t fpdL; - uint32_t fpdR; float A; float B; @@ -80,7 +77,8 @@ private: float I; float J; //parameters. Always 0-1, and we scale/alter them elsewhere. - + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp index 46cf79b7c..277522f81 100755 --- a/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp +++ b/plugins/MacSignedVST/BuildATPDF/source/BuildATPDFProc.cpp @@ -77,7 +77,7 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; - + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; //pseudorandom number updater @@ -162,7 +162,7 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; - + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; //pseudorandom number updater @@ -175,4 +175,4 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn *out1++; *out2++; } -} +} \ No newline at end of file diff --git a/plugins/MacSignedVST/Channel4/source/Channel4.h b/plugins/MacSignedVST/Channel4/source/Channel4.h index e8ca7a260..1f427f88d 100755 --- a/plugins/MacSignedVST/Channel4/source/Channel4.h +++ b/plugins/MacSignedVST/Channel4/source/Channel4.h @@ -67,6 +67,9 @@ private: double lastSampleR; double iirAmount; double threshold; + + uint32_t fpdL; + uint32_t fpdR; float consoletype; float drive; //parameters. Always 0-1, and we scale/alter them elsewhere. diff --git a/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp b/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp index a9e7fb195..a57623d4f 100755 --- a/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp +++ b/plugins/MacSignedVST/Channel4/source/Channel4Proc.cpp @@ -34,6 +34,8 @@ void Channel4::processReplacing(float **inputs, float **outputs, VstInt32 sample { inputSampleL = *in1; inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -136,6 +138,8 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 { inputSampleL = *in1; inputSampleR = *in2; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -209,4 +213,4 @@ void Channel4::processDoubleReplacing(double **inputs, double **outputs, VstInt3 *out1++; *out2++; } -} +} \ No newline at end of file diff --git a/plugins/MacSignedVST/Channel5/source/Channel5.cpp b/plugins/MacSignedVST/Channel5/source/Channel5.cpp index b9417ae12..975c7bab8 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5.cpp +++ b/plugins/MacSignedVST/Channel5/source/Channel5.cpp @@ -12,13 +12,11 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new C Channel5::Channel5(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { + fpNShapeL = 0.0; + fpNShapeR = 0.0; consoletype = 0.0; drive = 0.0; output = 1.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; - fpNShapeL = 0.0; - fpNShapeR = 0.0; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/MacSignedVST/Channel5/source/Channel5.h b/plugins/MacSignedVST/Channel5/source/Channel5.h index 7c9385d3e..ef3c2b8bd 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5.h +++ b/plugins/MacSignedVST/Channel5/source/Channel5.h @@ -54,10 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpdL; - uint32_t fpdR; - double fpNShapeL; - double fpNShapeR; + double fpNShapeL; + double fpNShapeR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp b/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp index 5d25c69e4..d873e2b2c 100755 --- a/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp +++ b/plugins/MacSignedVST/Channel5/source/Channel5Proc.cpp @@ -26,8 +26,6 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -127,8 +125,6 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/MacSignedVST/Compresaturator/source/Compresaturator.cpp b/plugins/MacSignedVST/Compresaturator/source/Compresaturator.cpp index 5409416d5..299892abb 100755 --- a/plugins/MacSignedVST/Compresaturator/source/Compresaturator.cpp +++ b/plugins/MacSignedVST/Compresaturator/source/Compresaturator.cpp @@ -25,7 +25,7 @@ Compresaturator::Compresaturator(audioMasterCallback audioMaster) : lastWidthR = 500; padFactorR = 0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp b/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp index 49cce79aa..c75fc4bdf 100755 --- a/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp +++ b/plugins/MacSignedVST/Compresaturator/source/CompresaturatorProc.cpp @@ -172,10 +172,10 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + inputSampleL += static_cast(fpdL) * 5.960464655174751e-36L * pow(2,expon+62); frexpf((float)inputSampleR, &expon); fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + inputSampleR += static_cast(fpdR) * 5.960464655174751e-36L * pow(2,expon+62); //end 32 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp index ab02a78ad..4db7b1432 100755 --- a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp +++ b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.cpp @@ -22,9 +22,8 @@ Console4Buss::Console4Buss(audioMasterCallback audioMaster) : gainchase = -90.0; settingchase = -90.0; chasespeed = 350.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; - + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; // TODO: uncomment canDo entries according to your plugin's capabilities // _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. diff --git a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.h b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.h index 92a351a23..04fb5d2bd 100755 --- a/plugins/MacSignedVST/Console4Buss/source/Console4Buss.h +++ b/plugins/MacSignedVST/Console4Buss/source/Console4Buss.h @@ -71,6 +71,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double fpNShapeR; //default stuff @@ -79,8 +81,7 @@ private: double gainchase; double settingchase; double chasespeed; - uint32_t fpdL; - uint32_t fpdR; + float gain; diff --git a/plugins/MacSignedVST/Console4Channel/source/Console4Channel.h b/plugins/MacSignedVST/Console4Channel/source/Console4Channel.h index 9e7bbacb3..f5542d4bb 100755 --- a/plugins/MacSignedVST/Console4Channel/source/Console4Channel.h +++ b/plugins/MacSignedVST/Console4Channel/source/Console4Channel.h @@ -75,11 +75,11 @@ private: double gainchase; double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double fpNShapeR; - uint32_t fpdL; - uint32_t fpdR; //default stuff float gain; }; diff --git a/plugins/MacSignedVST/Dark/source/DarkProc.cpp b/plugins/MacSignedVST/Dark/source/DarkProc.cpp index 811fdf384..f026c1cd0 100755 --- a/plugins/MacSignedVST/Dark/source/DarkProc.cpp +++ b/plugins/MacSignedVST/Dark/source/DarkProc.cpp @@ -36,10 +36,10 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -151,10 +151,10 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp b/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp index fcecee4ce..a63176921 100755 --- a/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp +++ b/plugins/MacSignedVST/Deckwrecka/source/DeckwreckaProc.cpp @@ -41,22 +41,32 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - randyL = (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); + randyL = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); randyL /= 6.0; randyL *= wreck; //0 to 1 the noise, may not be needed //set up the noise - randyR = (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); + randyR = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); randyR /= 6.0; randyR *= wreck; //0 to 1 the noise, may not be needed //set up the noise @@ -226,22 +236,32 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - randyL = (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); + randyL = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); randyL /= 6.0; randyL *= wreck; //0 to 1 the noise, may not be needed //set up the noise - randyR = (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); + randyR = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); randyR /= 6.0; randyR *= wreck; //0 to 1 the noise, may not be needed //set up the noise diff --git a/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp b/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp index 80e204250..9c894ad8a 100755 --- a/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp +++ b/plugins/MacSignedVST/DitherFloat/source/DitherFloatProc.cpp @@ -70,11 +70,11 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdL ^= fpdL<<13; fpdL ^= fpdL>>17; fpdL ^= fpdL<<5; + inputSampleL += (fpdL*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdR ^= fpdR<<13; fpdR ^= fpdR>>17; fpdR ^= fpdR<<5; + inputSampleR += (fpdR*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; //end stereo 32 bit floating point dither @@ -155,11 +155,11 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdL ^= fpdL<<13; fpdL ^= fpdL>>17; fpdL ^= fpdL<<5; + inputSampleL += (fpdL*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdR ^= fpdR<<13; fpdR ^= fpdR>>17; fpdR ^= fpdR<<5; + inputSampleR += (fpdR*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; //end stereo 32 bit floating point dither diff --git a/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h b/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h index 164f37bab..51bc80e54 100755 --- a/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h +++ b/plugins/MacSignedVST/Ditherbox/source/Ditherbox.h @@ -127,6 +127,9 @@ private: double iirSampleYR; double iirSampleZR; + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp b/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp index 1acc7a63e..f12d2abbe 100755 --- a/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp +++ b/plugins/MacSignedVST/Ditherbox/source/DitherboxProc.cpp @@ -70,34 +70,36 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 2: - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 0.5; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 0.5; inputSampleR = floor(inputSampleR); //flat dither break; case 3: - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 1.0; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 1.0; inputSampleR = floor(inputSampleR); //TPDF dither break; case 4: - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleL -= lastSampleL; inputSampleL = floor(inputSampleL); lastSampleL = currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; inputSampleR -= lastSampleR; inputSampleR = floor(inputSampleR); @@ -108,7 +110,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl case 5: nsL[9] = nsL[8]; nsL[8] = nsL[7]; nsL[7] = nsL[6]; nsL[6] = nsL[5]; nsL[5] = nsL[4]; nsL[4] = nsL[3]; nsL[3] = nsL[2]; nsL[2] = nsL[1]; - nsL[1] = nsL[0]; nsL[0] = (double(fpd)/UINT32_MAX); + nsL[1] = nsL[0]; nsL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (nsL[0] * 0.061); currentDitherL -= (nsL[1] * 0.11); @@ -131,7 +133,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl nsR[9] = nsR[8]; nsR[8] = nsR[7]; nsR[7] = nsR[6]; nsR[6] = nsR[5]; nsR[5] = nsR[4]; nsR[4] = nsR[3]; nsR[3] = nsR[2]; nsR[2] = nsR[1]; - nsR[1] = nsR[0]; nsR[0] = (double(fpd)/UINT32_MAX); + nsR[1] = nsR[0]; nsR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (nsR[0] * 0.061); currentDitherR -= (nsR[1] * 0.11); @@ -156,8 +158,8 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 6: - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -202,37 +204,52 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 8: - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -249,37 +266,52 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -303,7 +335,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -317,7 +352,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -339,11 +377,11 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl case 10: //this one is the original Naturalize if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -900,12 +938,13 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleL > 0.0) inputSampleL = bridgerectifier; else inputSampleL = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleL); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdL)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleL); @@ -930,12 +969,13 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleR > 0.0) inputSampleR = bridgerectifier; else inputSampleR = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleR); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdR)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleR); @@ -965,7 +1005,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl noiseShapingL += inputSampleL - drySampleL; noiseShapingR += inputSampleR - drySampleR; } - + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; //pseudorandom number updater @@ -1043,34 +1083,36 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 2: - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 0.5; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 0.5; inputSampleR = floor(inputSampleR); //flat dither break; case 3: - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 1.0; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 1.0; inputSampleR = floor(inputSampleR); //TPDF dither break; case 4: - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleL -= lastSampleL; inputSampleL = floor(inputSampleL); lastSampleL = currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; inputSampleR -= lastSampleR; inputSampleR = floor(inputSampleR); @@ -1081,7 +1123,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt case 5: nsL[9] = nsL[8]; nsL[8] = nsL[7]; nsL[7] = nsL[6]; nsL[6] = nsL[5]; nsL[5] = nsL[4]; nsL[4] = nsL[3]; nsL[3] = nsL[2]; nsL[2] = nsL[1]; - nsL[1] = nsL[0]; nsL[0] = (double(fpd)/UINT32_MAX); + nsL[1] = nsL[0]; nsL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (nsL[0] * 0.061); currentDitherL -= (nsL[1] * 0.11); @@ -1104,7 +1146,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt nsR[9] = nsR[8]; nsR[8] = nsR[7]; nsR[7] = nsR[6]; nsR[6] = nsR[5]; nsR[5] = nsR[4]; nsR[4] = nsR[3]; nsR[3] = nsR[2]; nsR[2] = nsR[1]; - nsR[1] = nsR[0]; nsR[0] = (double(fpd)/UINT32_MAX); + nsR[1] = nsR[0]; nsR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (nsR[0] * 0.061); currentDitherR -= (nsR[1] * 0.11); @@ -1128,8 +1170,8 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 6: - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -1174,37 +1216,52 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 8: - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -1221,37 +1278,52 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -1275,7 +1347,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -1289,7 +1364,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -1311,11 +1389,11 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt case 10: //this one is the original Naturalize if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -1872,12 +1950,13 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleL > 0.0) inputSampleL = bridgerectifier; else inputSampleL = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleL); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdL)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleL); @@ -1902,12 +1981,13 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleR > 0.0) inputSampleR = bridgerectifier; else inputSampleR = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleR); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdR)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleR); @@ -1937,7 +2017,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt noiseShapingL += inputSampleL - drySampleL; noiseShapingR += inputSampleR - drySampleR; } - + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; //pseudorandom number updater diff --git a/plugins/MacSignedVST/DoublePaul/source/DoublePaul.h b/plugins/MacSignedVST/DoublePaul/source/DoublePaul.h index 4cb0b8827..1a9f0fd05 100755 --- a/plugins/MacSignedVST/DoublePaul/source/DoublePaul.h +++ b/plugins/MacSignedVST/DoublePaul/source/DoublePaul.h @@ -52,7 +52,9 @@ private: std::set< std::string > _canDo; double bL[11]; - double bR[11]; + double bR[11]; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp b/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp index cd11d65ea..430915416 100755 --- a/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp +++ b/plugins/MacSignedVST/DoublePaul/source/DoublePaulProc.cpp @@ -33,7 +33,7 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (bL[0] * 0.061); currentDitherL -= (bL[1] * 0.11); @@ -56,7 +56,7 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (bR[0] * 0.061); currentDitherR -= (bR[1] * 0.11); @@ -120,7 +120,7 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (bL[0] * 0.061); currentDitherL -= (bL[1] * 0.11); @@ -143,7 +143,7 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (bR[0] * 0.061); currentDitherR -= (bR[1] * 0.11); diff --git a/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp b/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp index b51207b1d..eac78920a 100755 --- a/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp +++ b/plugins/MacSignedVST/DubCenter/source/DubCenterProc.cpp @@ -42,7 +42,6 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSample; @@ -155,7 +154,7 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise @@ -326,7 +325,6 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSample; @@ -438,7 +436,7 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise diff --git a/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp b/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp index bdc30447d..679ab020b 100755 --- a/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp +++ b/plugins/MacSignedVST/DubSub/source/DubSubProc.cpp @@ -46,7 +46,6 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSampleL; double tempSampleR; @@ -194,11 +193,11 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr else {WasNegativeR = true;} //set up polarities for sub-bass version - randyL = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyL = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyL = (1.0-randyL); randyL /= 2.0; - randyR = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyR = (double(fpdR)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyR = (1.0-randyR); randyR /= 2.0; //set up the noise @@ -450,7 +449,6 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSampleL; double tempSampleR; @@ -597,11 +595,11 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 else {WasNegativeR = true;} //set up polarities for sub-bass version - randyL = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyL = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyL = (1.0-randyL); randyL /= 2.0; - randyR = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyR = (double(fpdR)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyR = (1.0-randyR); randyR /= 2.0; //set up the noise diff --git a/plugins/MacSignedVST/DustBunny/source/DustBunny.h b/plugins/MacSignedVST/DustBunny/source/DustBunny.h index 0e75e7880..e9f1199a4 100755 --- a/plugins/MacSignedVST/DustBunny/source/DustBunny.h +++ b/plugins/MacSignedVST/DustBunny/source/DustBunny.h @@ -85,6 +85,9 @@ private: bool LataFlip; //end defining of antialiasing variables bool RataFlip; //end defining of antialiasing variables + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp b/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp index 2273bfcaa..39f21f688 100755 --- a/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp +++ b/plugins/MacSignedVST/EdIsDim/source/EdIsDimProc.cpp @@ -36,15 +36,17 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF mid = (inputSampleL+inputSampleR)/2.0; side = (inputSampleL-inputSampleR)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit floating point dither int expon; frexpf((float)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - mid += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //begin 32 bit floating point dither frexpf((float)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - side += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither - + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + *out1 = mid; *out2 = side; @@ -86,14 +88,14 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 side = (inputSampleL-inputSampleR)/2.0; //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - mid += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - side += (dither-fpNShapeR); fpNShapeR = dither; + //int expon; frexpf((float)mid, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //begin 32 bit floating point dither + //frexpf((float)side, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 64 bit dither *out1 = mid; diff --git a/plugins/MacSignedVST/Elation/source/ElationProc.cpp b/plugins/MacSignedVST/Elation/source/ElationProc.cpp index 0d5064ba1..8b99b97fa 100755 --- a/plugins/MacSignedVST/Elation/source/ElationProc.cpp +++ b/plugins/MacSignedVST/Elation/source/ElationProc.cpp @@ -258,12 +258,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF flip = !flip; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdL)/UINT32_MAX)*0.054); outputSample = ((((inputSampleL*(1-randy))+(lastSampleL*randy))*wet)+(drySampleL*(1.0-wet))) * outlevel; lastSampleL = inputSampleL; inputSampleL = outputSample; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdR)/UINT32_MAX)*0.054); outputSample = ((((inputSampleR*(1-randy))+(lastSampleR*randy))*wet)+(drySampleR*(1.0-wet))) * outlevel; lastSampleR = inputSampleR; inputSampleR = outputSample; @@ -538,12 +538,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 flip = !flip; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdL)/UINT32_MAX)*0.054); outputSample = ((((inputSampleL*(1-randy))+(lastSampleL*randy))*wet)+(drySampleL*(1.0-wet))) * outlevel; lastSampleL = inputSampleL; inputSampleL = outputSample; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdR)/UINT32_MAX)*0.054); outputSample = ((((inputSampleR*(1-randy))+(lastSampleR*randy))*wet)+(drySampleR*(1.0-wet))) * outlevel; lastSampleR = inputSampleR; inputSampleR = outputSample; diff --git a/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp b/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp index e1ef925b7..d49babc4b 100755 --- a/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp +++ b/plugins/MacSignedVST/ElectroHat/source/ElectroHatProc.cpp @@ -33,7 +33,6 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double brighten = C; double outputlevel = D; double wet = E; - double dry = 1.0-wet; if (deSyn == 4) {deSyn = 1; increment = 0.411; brighten = 0.87;} //606 preset @@ -168,7 +167,6 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double brighten = C; double outputlevel = D; double wet = E; - double dry = 1.0-wet; if (deSyn == 4) {deSyn = 1; increment = 0.411; brighten = 0.87;} //606 preset diff --git a/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp b/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp index 6cdbba15c..5b5933828 100755 --- a/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp +++ b/plugins/MacSignedVST/Energy2/source/Energy2Proc.cpp @@ -17,7 +17,6 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - int cycleEnd = floor(overallscale); if (cycleEnd < 1) cycleEnd = 1; if (cycleEnd > 4) cycleEnd = 4; @@ -660,7 +659,6 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - int cycleEnd = floor(overallscale); if (cycleEnd < 1) cycleEnd = 1; if (cycleEnd > 4) cycleEnd = 4; diff --git a/plugins/MacSignedVST/FathomFive/source/FathomFive.h b/plugins/MacSignedVST/FathomFive/source/FathomFive.h index 51b9f4e35..8a67aae1b 100755 --- a/plugins/MacSignedVST/FathomFive/source/FathomFive.h +++ b/plugins/MacSignedVST/FathomFive/source/FathomFive.h @@ -74,6 +74,8 @@ private: float C; //Frequency float D; //Dry/Wet //parameters. Always 0-1, and we scale/alter them elsewhere. + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/Floor/source/FloorProc.cpp b/plugins/MacSignedVST/Floor/source/FloorProc.cpp index 1c5ba156c..115f0bc79 100755 --- a/plugins/MacSignedVST/Floor/source/FloorProc.cpp +++ b/plugins/MacSignedVST/Floor/source/FloorProc.cpp @@ -32,7 +32,6 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (iirAmount <= 0.0) iirAmount = 0.0; if (iirAmount > 1.0) iirAmount = 1.0; double wet = C; - double dry = 1.0-wet; while (--sampleFrames >= 0) { @@ -257,7 +256,6 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (iirAmount <= 0.0) iirAmount = 0.0; if (iirAmount > 1.0) iirAmount = 1.0; double wet = C; - double dry = 1.0-wet; while (--sampleFrames >= 0) { diff --git a/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp b/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp index 46bc5759b..eb3154f70 100755 --- a/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp +++ b/plugins/MacSignedVST/FromTape/source/FromTapeProc.cpp @@ -55,7 +55,7 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= inputgain; } - randy = (double(fpd)/UINT32_MAX) * SoftenControl; //for soften + randy = (double(fpdL)/UINT32_MAX) * SoftenControl; //for soften invrandy = (1.0-randy); randy /= 2.0; //we've set up so that we dial in the amount of the alt sections (in pairs) with invrandy being the source section @@ -252,7 +252,7 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= inputgain; } - randy = (double(fpd)/UINT32_MAX) * SoftenControl; //for soften + randy = (double(fpdL)/UINT32_MAX) * SoftenControl; //for soften invrandy = (1.0-randy); randy /= 2.0; //we've set up so that we dial in the amount of the alt sections (in pairs) with invrandy being the source section diff --git a/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp b/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp index a39e01b19..9979a8126 100755 --- a/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp +++ b/plugins/MacSignedVST/HardVacuum/source/HardVacuumProc.cpp @@ -24,7 +24,6 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double aura = C*3.1415926; double out = D; double wet = E; - double dry = 1.0-wet; double drive; double positive; double negative; @@ -173,7 +172,6 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double aura = C*3.1415926; double out = D; double wet = E; - double dry = 1.0-wet; double drive; double positive; double negative; diff --git a/plugins/MacSignedVST/HighGlossDither/source/HighGlossDither.h b/plugins/MacSignedVST/HighGlossDither/source/HighGlossDither.h index 8bce9066b..96804c5a8 100755 --- a/plugins/MacSignedVST/HighGlossDither/source/HighGlossDither.h +++ b/plugins/MacSignedVST/HighGlossDither/source/HighGlossDither.h @@ -53,6 +53,8 @@ private: int Position; bool flip; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp b/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp index ebffe6e53..b51e9b7cf 100755 --- a/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp +++ b/plugins/MacSignedVST/IronOxide5/source/IronOxide5Proc.cpp @@ -76,7 +76,7 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleL = inputSampleL; drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); //part of flutter section //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (fstoredcount < 0 || fstoredcount > 30) {fstoredcount = 30;} @@ -347,7 +347,7 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp else inputSampleR = -bridgerectifierR; //second stage of overdrive to prevent overs and allow bloody loud extremeness - randy = (0.55 + tempRandy + ((double(fpd)/UINT32_MAX)*tempRandy))*noise; //0 to 2 + randy = (0.55 + tempRandy + ((double(fpdR)/UINT32_MAX)*tempRandy))*noise; //0 to 2 inputSampleL *= (1.0 - randy); inputSampleL += (prevInputSampleL*randy); @@ -471,7 +471,7 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleL = inputSampleL; drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); //part of flutter section //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (fstoredcount < 0 || fstoredcount > 30) {fstoredcount = 30;} @@ -742,7 +742,7 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn else inputSampleR = -bridgerectifierR; //second stage of overdrive to prevent overs and allow bloody loud extremeness - randy = (0.55 + tempRandy + ((double(fpd)/UINT32_MAX)*tempRandy))*noise; //0 to 2 + randy = (0.55 + tempRandy + ((double(fpdR)/UINT32_MAX)*tempRandy))*noise; //0 to 2 inputSampleL *= (1.0 - randy); inputSampleL += (prevInputSampleL*randy); diff --git a/plugins/MacSignedVST/Logical4/source/Logical4.h b/plugins/MacSignedVST/Logical4/source/Logical4.h index fd802c812..f1389f452 100755 --- a/plugins/MacSignedVST/Logical4/source/Logical4.h +++ b/plugins/MacSignedVST/Logical4/source/Logical4.h @@ -143,10 +143,10 @@ private: int gcount; - double fpNShapeL; - double fpNShapeR; bool fpFlip; //default stuff + uint32_t fpdL; + uint32_t fpdR; float A; float B; diff --git a/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp b/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp index 2dfb60013..2ea8a55c1 100755 --- a/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp +++ b/plugins/MacSignedVST/Luxor/source/LuxorProc.cpp @@ -160,11 +160,11 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdL)/UINT32_MAX)*0.031); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdR)/UINT32_MAX)*0.031); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -341,11 +341,11 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdL)/UINT32_MAX)*0.031); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdR)/UINT32_MAX)*0.031); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp b/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp index 46fb1397e..cb5f2ffa6 100755 --- a/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp +++ b/plugins/MacSignedVST/MidSide/source/MidSideProc.cpp @@ -37,14 +37,15 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF mid *= midgain; side *= sidegain; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit floating point dither int expon; frexpf((float)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - mid += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither frexpf((float)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - side += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *out1 = mid; *out2 = side; @@ -87,14 +88,13 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 side *= sidegain; //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - mid += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - side += (dither-fpNShapeR); fpNShapeR = dither; + //int expon; frexpf((float)mid, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //frexpf((float)side, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 64 bit dither *out1 = mid; diff --git a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDither.h b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDither.h index 47044a992..6692763d8 100755 --- a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDither.h +++ b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDither.h @@ -53,7 +53,8 @@ private: double bynL[13]; double bynR[13]; - + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp index 6228d9601..04f45e9b1 100755 --- a/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp +++ b/plugins/MacSignedVST/NaturalizeDither/source/NaturalizeDitherProc.cpp @@ -36,11 +36,11 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -238,11 +238,11 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); diff --git a/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp b/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp index 26ed2c176..f2224b6ea 100755 --- a/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp +++ b/plugins/MacSignedVST/Neverland/source/NeverlandProc.cpp @@ -156,11 +156,11 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (bR[33] * (0.00555223929714115 - (0.00030319367948553*fabs(bR[33])))); //we apply the first samples of the Neve impulse- dynamically adjusted. } - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdL)/UINT32_MAX)*0.034); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdR)/UINT32_MAX)*0.034); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -332,11 +332,11 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (bR[33] * (0.00555223929714115 - (0.00030319367948553*fabs(bR[33])))); //we apply the first samples of the Neve impulse- dynamically adjusted. } - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdL)/UINT32_MAX)*0.034); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdR)/UINT32_MAX)*0.034); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/MacSignedVST/NodeDither/source/NodeDither.h b/plugins/MacSignedVST/NodeDither/source/NodeDither.h index 240a8d961..bfd641309 100755 --- a/plugins/MacSignedVST/NodeDither/source/NodeDither.h +++ b/plugins/MacSignedVST/NodeDither/source/NodeDither.h @@ -57,6 +57,8 @@ private: double dR[5000]; int gcount; //default stuff + uint32_t fpdL; + uint32_t fpdR; float A; float B; diff --git a/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp b/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp index cf4d3c51d..3dc70a685 100755 --- a/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp +++ b/plugins/MacSignedVST/NodeDither/source/NodeDitherProc.cpp @@ -43,10 +43,10 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp if (gcount < 0 || gcount > 2450) {gcount = 2450;} - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; if (phase == 1) { @@ -121,10 +121,10 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn if (gcount < 0 || gcount > 2450) {gcount = 2450;} - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; if (phase == 1) { diff --git a/plugins/MacSignedVST/Noise/source/NoiseProc.cpp b/plugins/MacSignedVST/Noise/source/NoiseProc.cpp index bc268c0ff..0dbe5c6d2 100755 --- a/plugins/MacSignedVST/Noise/source/NoiseProc.cpp +++ b/plugins/MacSignedVST/Noise/source/NoiseProc.cpp @@ -118,12 +118,12 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (surgeL 1.0) surgeL = 1.0; } else { - surgeL -= ((double(fpd)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); + surgeL -= ((double(fpdL)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); if (surgeL < 0.0) surgeL = 0.0; } @@ -134,12 +134,12 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (surgeR 1.0) surgeR = 1.0; } else { - surgeR -= ((double(fpd)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); + surgeR -= ((double(fpdR)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); if (surgeR < 0.0) surgeR = 0.0; } @@ -172,11 +172,13 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra else {flipR = false;} } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); if (filterflip) { @@ -388,12 +390,12 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (surgeL 1.0) surgeL = 1.0; } else { - surgeL -= ((double(fpd)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); + surgeL -= ((double(fpdL)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); if (surgeL < 0.0) surgeL = 0.0; } @@ -404,12 +406,12 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (surgeR 1.0) surgeR = 1.0; } else { - surgeR -= ((double(fpd)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); + surgeR -= ((double(fpdR)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); if (surgeR < 0.0) surgeR = 0.0; } @@ -442,11 +444,13 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s else {flipR = false;} } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); if (filterflip) { diff --git a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h index d27f0cc5c..81fe49f8d 100755 --- a/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h +++ b/plugins/MacSignedVST/NotJustAnotherCD/source/NotJustAnotherCD.h @@ -55,6 +55,8 @@ private: double bynR[13]; double noiseShapingL; double noiseShapingR; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp index 7e38de75c..f9721a726 100755 --- a/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp +++ b/plugins/MacSignedVST/NotJustAnotherDither/source/NotJustAnotherDitherProc.cpp @@ -31,10 +31,10 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -185,10 +185,10 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp b/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp index 6495542ba..366455123 100755 --- a/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp +++ b/plugins/MacSignedVST/PaulDither/source/PaulDitherProc.cpp @@ -33,17 +33,17 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -69,10 +69,6 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= outScale; inputSampleR /= outScale; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - //pseudorandom number updater - *out1 = inputSampleL; *out2 = inputSampleR; @@ -109,17 +105,17 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -145,10 +141,6 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= outScale; inputSampleR /= outScale; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - //pseudorandom number updater - *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp b/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp index ecdae8a30..0f165a3c5 100755 --- a/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp +++ b/plugins/MacSignedVST/PaulWide/source/PaulWideProc.cpp @@ -46,34 +46,37 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - double currentDither = (double(fpd)/UINT32_MAX); + double currentDither = (double(fpdL)/UINT32_MAX); double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises - currentDither = (double(fpd)/UINT32_MAX); + currentDither = (double(fpdR)/UINT32_MAX); double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + currentDither = (double(fpdR)/UINT32_MAX); ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; @@ -138,34 +141,37 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - double currentDither = (double(fpd)/UINT32_MAX); + double currentDither = (double(fpdL)/UINT32_MAX); double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises - currentDither = (double(fpd)/UINT32_MAX); + currentDither = (double(fpdR)/UINT32_MAX); double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + currentDither = (double(fpdR)/UINT32_MAX); ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; diff --git a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp index 7288502cb..73e9b1254 100755 --- a/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp +++ b/plugins/MacSignedVST/PhaseNudge/source/PhaseNudgeProc.cpp @@ -93,8 +93,8 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= 4.0; if (wet < 1.0) { - inputSampleL = (drySampleL * dry)+(inputSampleL * wet); - inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL * wet); + inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR * wet); } //begin 32 bit stereo floating point dither @@ -201,8 +201,8 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= 4.0; if (wet < 1.0) { - inputSampleL = (drySampleL * dry)+(inputSampleL * wet); - inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL * wet); + inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR * wet); } //begin 64 bit stereo floating point dither diff --git a/plugins/MacSignedVST/Precious/source/PreciousProc.cpp b/plugins/MacSignedVST/Precious/source/PreciousProc.cpp index e06ba2f3a..ed37b906a 100755 --- a/plugins/MacSignedVST/Precious/source/PreciousProc.cpp +++ b/plugins/MacSignedVST/Precious/source/PreciousProc.cpp @@ -158,11 +158,11 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdL)/UINT32_MAX)*0.017); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdR)/UINT32_MAX)*0.017); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -337,11 +337,11 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdL)/UINT32_MAX)*0.017); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdR)/UINT32_MAX)*0.017); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp b/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp index 8dcd957fd..eca9d83ce 100755 --- a/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp +++ b/plugins/MacSignedVST/PurestFade/source/PurestFadeProc.cpp @@ -79,11 +79,11 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,12 +166,12 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp b/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp index 2ca5b8478..1bb58d727 100755 --- a/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp +++ b/plugins/MacSignedVST/PurestGain/source/PurestGainProc.cpp @@ -84,14 +84,14 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp } else { inputSampleL *= outputgain; inputSampleR *= outputgain; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; } @@ -174,16 +174,14 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn } else { inputSampleL *= outputgain; inputSampleR *= outputgain; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; } diff --git a/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp b/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp index b34bfb596..9039bbcca 100755 --- a/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp +++ b/plugins/MacSignedVST/PurestWarm/source/PurestWarmProc.cpp @@ -32,52 +32,52 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp if (inputSampleL < 0) { inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } if (inputSampleR < 0) { inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } } else { if (inputSampleL > 0) { inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } if (inputSampleR > 0) { inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } } //that's it. Only applies on one half of the waveform, other half is passthrough untouched. @@ -117,60 +117,52 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn if (inputSampleL < 0) { inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } if (inputSampleR < 0) { inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } } else { if (inputSampleL > 0) { inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } if (inputSampleR > 0) { inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } } //that's it. Only applies on one half of the waveform, other half is passthrough untouched. diff --git a/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp b/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp index a4414634e..c98e0f6cb 100755 --- a/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp +++ b/plugins/MacSignedVST/RawGlitters/source/RawGlittersProc.cpp @@ -29,10 +29,10 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -86,10 +86,10 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp b/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp index 0a1b401c3..626a3c84a 100755 --- a/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp +++ b/plugins/MacSignedVST/RawTimbers/source/RawTimbersProc.cpp @@ -30,10 +30,10 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; @@ -89,10 +89,10 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/MacSignedVST/Slew/source/Slew.h b/plugins/MacSignedVST/Slew/source/Slew.h index 29d091639..c78cae48d 100755 --- a/plugins/MacSignedVST/Slew/source/Slew.h +++ b/plugins/MacSignedVST/Slew/source/Slew.h @@ -74,6 +74,8 @@ private: float gain; double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/Slew2/source/Slew2.h b/plugins/MacSignedVST/Slew2/source/Slew2.h index c57161f5b..f2e323a84 100755 --- a/plugins/MacSignedVST/Slew2/source/Slew2.h +++ b/plugins/MacSignedVST/Slew2/source/Slew2.h @@ -88,6 +88,9 @@ private: double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/MacSignedVST/SlewOnly/source/SlewOnly.h b/plugins/MacSignedVST/SlewOnly/source/SlewOnly.h index 0c2d666bc..f4ab7bb8a 100755 --- a/plugins/MacSignedVST/SlewOnly/source/SlewOnly.h +++ b/plugins/MacSignedVST/SlewOnly/source/SlewOnly.h @@ -51,6 +51,8 @@ private: double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp b/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp index d3e5723be..9b1e135f7 100755 --- a/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp +++ b/plugins/MacSignedVST/SpatializeDither/source/SpatializeDitherProc.cpp @@ -36,10 +36,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -51,7 +49,10 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -65,7 +66,10 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -131,10 +135,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -146,7 +148,10 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -160,7 +165,10 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err diff --git a/plugins/MacSignedVST/Srsly/source/Srsly.cpp b/plugins/MacSignedVST/Srsly/source/Srsly.cpp index 900dac4fe..6a7c5a896 100755 --- a/plugins/MacSignedVST/Srsly/source/Srsly.cpp +++ b/plugins/MacSignedVST/Srsly/source/Srsly.cpp @@ -28,8 +28,8 @@ Srsly::Srsly(audioMasterCallback audioMaster) : C = 1.0; D = 0.5; E = 1.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/MacSignedVST/Srsly/source/Srsly.h b/plugins/MacSignedVST/Srsly/source/Srsly.h index ff5958586..6d1dcc7d9 100755 --- a/plugins/MacSignedVST/Srsly/source/Srsly.h +++ b/plugins/MacSignedVST/Srsly/source/Srsly.h @@ -68,8 +68,8 @@ private: double biquadS3[11]; double biquadS5[11]; - uint32_t fpdL; - uint32_t fpdR; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp b/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp index 0cde87189..f59ea964b 100755 --- a/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp +++ b/plugins/MacSignedVST/Srsly/source/SrslyProc.cpp @@ -226,15 +226,15 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleR = (inputSampleR * wet)+(drySampleR * (1.0-wet)); } - //begin 32 bit stereo floating point dither - int expon; frexpf((float)inputSampleL, &expon); - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); - frexpf((float)inputSampleR, &expon); - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); - //end 32 bit stereo floating point dither - + //begin 32 bit stereo floating point dither + int expon; frexpf((float)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + frexpf((float)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither + *out1 = inputSampleL; *out2 = inputSampleR; @@ -464,15 +464,15 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleR = (inputSampleR * wet)+(drySampleR * (1.0-wet)); } - //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; - inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - //end 64 bit stereo floating point dither - + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/MacSignedVST/SubsOnly/source/SubsOnly.h b/plugins/MacSignedVST/SubsOnly/source/SubsOnly.h index 316a44686..f4bd2a51b 100755 --- a/plugins/MacSignedVST/SubsOnly/source/SubsOnly.h +++ b/plugins/MacSignedVST/SubsOnly/source/SubsOnly.h @@ -103,6 +103,9 @@ private: double iirSampleYR; double iirSampleZR; + uint32_t fpdL; + uint32_t fpdR; + }; #endif diff --git a/plugins/MacSignedVST/Surge/source/SurgeProc.cpp b/plugins/MacSignedVST/Surge/source/SurgeProc.cpp index b77e5a6e1..145e5237c 100755 --- a/plugins/MacSignedVST/Surge/source/SurgeProc.cpp +++ b/plugins/MacSignedVST/Surge/source/SurgeProc.cpp @@ -75,11 +75,11 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL *= chaseMax; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseMax; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -167,11 +167,11 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL *= chaseMax; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseMax; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp b/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp index e2331485a..0db02fc7c 100755 --- a/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp +++ b/plugins/MacSignedVST/SurgeTide/source/SurgeTideProc.cpp @@ -65,11 +65,11 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL *= chaseC; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseC; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -148,11 +148,11 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL *= chaseC; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseC; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp b/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp index f86345088..b5b7f15bc 100755 --- a/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp +++ b/plugins/MacSignedVST/TPDFDither/source/TPDFDitherProc.cpp @@ -30,10 +30,10 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -42,11 +42,12 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL -= 1.0; inputSampleR -= 1.0; - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); - - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleL = floor(inputSampleL); inputSampleR = floor(inputSampleR); @@ -92,10 +93,10 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -104,11 +105,12 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL -= 1.0; inputSampleR -= 1.0; - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); - - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleL = floor(inputSampleL); inputSampleR = floor(inputSampleR); diff --git a/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp b/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp index 2b9232bf0..150b4f39c 100755 --- a/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp +++ b/plugins/MacSignedVST/TPDFWide/source/TPDFWideProc.cpp @@ -31,40 +31,43 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample double inputSampleL = *in1; double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither double ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); //TPDF: two 0-1 random noises double ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } inputSampleL = floor(inputSampleL+ditherL); @@ -111,40 +114,43 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double inputSampleL = *in1; double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither double ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); //TPDF: two 0-1 random noises double ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } inputSampleL = floor(inputSampleL+ditherL); diff --git a/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp b/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp index f67b259b1..f43301489 100755 --- a/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp +++ b/plugins/MacSignedVST/TapeDither/source/TapeDitherProc.cpp @@ -32,17 +32,17 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -105,17 +105,17 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; diff --git a/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp b/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp index 840dbd28c..f2ad65562 100755 --- a/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp +++ b/plugins/MacSignedVST/ToTape5/source/ToTape5Proc.cpp @@ -77,7 +77,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); randy = flutterrandy * tempRandy; //for soften invrandy = (1.0-randy); randy /= 2.0; @@ -406,7 +406,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); randy = flutterrandy * tempRandy; //for soften invrandy = (1.0-randy); randy /= 2.0; diff --git a/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp b/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp index 47f1e541a..ea7353a5a 100755 --- a/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp +++ b/plugins/MacSignedVST/ToTape6/source/ToTape6Proc.cpp @@ -66,7 +66,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= inputgain; } //gain cut before plugin - double flutterrandy = fpd / (double)UINT32_MAX; + double flutterrandy = (double(fpdL)/UINT32_MAX); //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (gcount < 0 || gcount > 499) {gcount = 499;} dL[gcount] = inputSampleL; @@ -400,7 +400,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= inputgain; } //gain cut before plugin - double flutterrandy = fpd / (double)UINT32_MAX; + double flutterrandy = (double(fpdL)/UINT32_MAX); //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (gcount < 0 || gcount > 499) {gcount = 499;} dL[gcount] = inputSampleL; diff --git a/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp b/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp index 018cea36a..1adede36a 100755 --- a/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp +++ b/plugins/MacSignedVST/VinylDither/source/VinylDitherProc.cpp @@ -32,46 +32,59 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -87,37 +100,52 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL = floor(absSample); //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -175,46 +203,59 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -230,37 +271,52 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL = floor(absSample); //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; diff --git a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp index fd6e5bdfa..8ea666d37 100755 --- a/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp +++ b/plugins/MacSignedVST/VoiceOfTheStarship/source/VoiceOfTheStarshipProc.cpp @@ -110,10 +110,10 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn //it's a pure random walk that will generate DC. } - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); //here's the guts of the random walk if (filterflip) @@ -300,10 +300,10 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output //it's a pure random walk that will generate DC. } - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); //here's the guts of the random walk if (filterflip) diff --git a/plugins/MacSignedVST/Wider/source/WiderProc.cpp b/plugins/MacSignedVST/Wider/source/WiderProc.cpp index 8abd00908..fc9f5241a 100755 --- a/plugins/MacSignedVST/Wider/source/WiderProc.cpp +++ b/plugins/MacSignedVST/Wider/source/WiderProc.cpp @@ -99,8 +99,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } count -= 1; - inputSampleL = (drySampleL * dry) + ((mid+side) * wet); - inputSampleR = (drySampleR * dry) + ((mid-side) * wet); + inputSampleL = (drySampleL * (1.0-wet)) + ((mid+side) * wet); + inputSampleR = (drySampleR * (1.0-wet)) + ((mid-side) * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -213,8 +213,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } count -= 1; - inputSampleL = (drySampleL * dry) + ((mid+side) * wet); - inputSampleR = (drySampleR * dry) + ((mid-side) * wet); + inputSampleL = (drySampleL * (1.0-wet)) + ((mid+side) * wet); + inputSampleR = (drySampleR * (1.0-wet)) + ((mid-side) * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/MacSignedVST/YLowpass/source/YLowpass.h b/plugins/MacSignedVST/YLowpass/source/YLowpass.h index d26f5f781..564336a3b 100755 --- a/plugins/MacSignedVST/YLowpass/source/YLowpass.h +++ b/plugins/MacSignedVST/YLowpass/source/YLowpass.h @@ -82,8 +82,7 @@ private: biq_total }; //coefficient interpolating biquad filter, stereo double biquad[biq_total]; - //double biquadC[biq_total]; - //double biquadD[biq_total]; + double powFactorA; double powFactorB; double inTrimA; @@ -107,6 +106,7 @@ private: }; //fixed frequency biquad filter for ultrasonics, stereo double fixA[fix_total]; double fixB[fix_total]; + uint32_t fpdL; uint32_t fpdR; //default stuff diff --git a/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h b/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h index d37a5ac4a..fc00f8ff8 100755 --- a/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h +++ b/plugins/MacSignedVST/ZHighpass/source/ZHighpass.h @@ -72,8 +72,6 @@ private: float B; float C; float D; - float E; //parameters. Always 0-1, and we scale/alter them elsewhere. - }; #endif diff --git a/plugins/WinVST/ADT/ADT.cpp b/plugins/WinVST/ADT/ADT.cpp index 34db6d535..ea5906c22 100755 --- a/plugins/WinVST/ADT/ADT.cpp +++ b/plugins/WinVST/ADT/ADT.cpp @@ -24,7 +24,8 @@ ADT::ADT(audioMasterCallback audioMaster) : offsetB = 9001; // :D gcount = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ADT/ADTProc.cpp b/plugins/WinVST/ADT/ADTProc.cpp index 3071123f4..9ed2f4762 100755 --- a/plugins/WinVST/ADT/ADTProc.cpp +++ b/plugins/WinVST/ADT/ADTProc.cpp @@ -125,11 +125,11 @@ void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -259,12 +259,12 @@ void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Air2/Air2.cpp b/plugins/WinVST/Air2/Air2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Air2/Air2.h b/plugins/WinVST/Air2/Air2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Air2/Air2Proc.cpp b/plugins/WinVST/Air2/Air2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Apicolypse/Apicolypse.cpp b/plugins/WinVST/Apicolypse/Apicolypse.cpp index 8c9d15ec5..f86eaa223 100755 --- a/plugins/WinVST/Apicolypse/Apicolypse.cpp +++ b/plugins/WinVST/Apicolypse/Apicolypse.cpp @@ -19,7 +19,8 @@ Apicolypse::Apicolypse(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Apicolypse/Apicolypse.h b/plugins/WinVST/Apicolypse/Apicolypse.h index 66c3f4640..030e910fc 100755 --- a/plugins/WinVST/Apicolypse/Apicolypse.h +++ b/plugins/WinVST/Apicolypse/Apicolypse.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Apicolypse/ApicolypseProc.cpp b/plugins/WinVST/Apicolypse/ApicolypseProc.cpp index 5ac19e64f..9e43be098 100755 --- a/plugins/WinVST/Apicolypse/ApicolypseProc.cpp +++ b/plugins/WinVST/Apicolypse/ApicolypseProc.cpp @@ -155,11 +155,11 @@ void Apicolypse::processReplacing(float **inputs, float **outputs, VstInt32 samp } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.033); + randy = ((double(fpdL)/UINT32_MAX)*0.033); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.033); + randy = ((double(fpdR)/UINT32_MAX)*0.033); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -331,11 +331,11 @@ void Apicolypse::processDoubleReplacing(double **inputs, double **outputs, VstIn } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.033); + randy = ((double(fpdL)/UINT32_MAX)*0.033); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.033); + randy = ((double(fpdR)/UINT32_MAX)*0.033); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h b/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h index ebaf0919c..375f70022 100755 --- a/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h +++ b/plugins/WinVST/AtmosphereBuss/AtmosphereBuss.h @@ -56,6 +56,8 @@ private: double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double lastSampleAL; double lastSampleBL; diff --git a/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h b/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h index 4ed29b1c1..7bc3ff2fd 100755 --- a/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h +++ b/plugins/WinVST/AtmosphereChannel/AtmosphereChannel.h @@ -56,6 +56,8 @@ private: double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double lastSampleAL; double lastSampleBL; diff --git a/plugins/WinVST/AutoPan/AutoPan.cpp b/plugins/WinVST/AutoPan/AutoPan.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/AutoPan/AutoPan.h b/plugins/WinVST/AutoPan/AutoPan.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/AutoPan/AutoPanProc.cpp b/plugins/WinVST/AutoPan/AutoPanProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/AverMatrix/AverMatrix.cpp b/plugins/WinVST/AverMatrix/AverMatrix.cpp index e2e346a0f..9c1db1f5e 100755 --- a/plugins/WinVST/AverMatrix/AverMatrix.cpp +++ b/plugins/WinVST/AverMatrix/AverMatrix.cpp @@ -22,7 +22,8 @@ AverMatrix::AverMatrix(audioMasterCallback audioMaster) : } } - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/AverMatrix/AverMatrix.h b/plugins/WinVST/AverMatrix/AverMatrix.h index b5f2012b1..a21b9f267 100755 --- a/plugins/WinVST/AverMatrix/AverMatrix.h +++ b/plugins/WinVST/AverMatrix/AverMatrix.h @@ -57,7 +57,8 @@ private: double bL[11][11]; double bR[11][11]; double f[11]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BassAmp/BassAmp.cpp b/plugins/WinVST/BassAmp/BassAmp.cpp index 330f7ac10..85eba6d6d 100755 --- a/plugins/WinVST/BassAmp/BassAmp.cpp +++ b/plugins/WinVST/BassAmp/BassAmp.cpp @@ -135,7 +135,8 @@ BassAmp::BassAmp(audioMasterCallback audioMaster) : ataK3 = 0.114; //add raw to interpolated dry, toughens ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 ataK5 = 0.122; //subtract this much prev. diff sample, brightens - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BassAmp/BassAmp.h b/plugins/WinVST/BassAmp/BassAmp.h index 67fd21f34..a50b4d688 100755 --- a/plugins/WinVST/BassAmp/BassAmp.h +++ b/plugins/WinVST/BassAmp/BassAmp.h @@ -183,7 +183,8 @@ private: bool flip; //drive things int bflip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BassAmp/BassAmpProc.cpp b/plugins/WinVST/BassAmp/BassAmpProc.cpp index e7790e45c..ae941ec2b 100755 --- a/plugins/WinVST/BassAmp/BassAmpProc.cpp +++ b/plugins/WinVST/BassAmp/BassAmpProc.cpp @@ -38,8 +38,8 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF { double LinputSample = *in1; double RinputSample = *in2; - if (fabs(LinputSample)<1.18e-37) LinputSample = fpd * 1.18e-37; - if (fabs(RinputSample)<1.18e-37) RinputSample = fpd * 1.18e-37; + if (fabs(LinputSample)<1.18e-37) LinputSample = fpdL * 1.18e-37; + if (fabs(RinputSample)<1.18e-37) RinputSample = fpdR * 1.18e-37; LataDrySample = LinputSample; LataHalfDrySample = LataHalfwaySample = (LinputSample + LataLast1Sample + (LataLast2Sample*ataK1) + (LataLast3Sample*ataK2) + (LataLast4Sample*ataK6) + (LataLast5Sample*ataK7) + (LataLast6Sample*ataK8)) / 2.0; @@ -195,7 +195,7 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF LataLowpass += LataHalfwayLowpass; //and combined them. Now we make sub-octaves RataLowpass += RataHalfwayLowpass; //and combined them. Now we make sub-octaves - double randy = (double(fpd)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed + double randy = (double(fpdL)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed switch (bflip) { @@ -362,11 +362,11 @@ void BassAmp::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //begin 32 bit stereo floating point dither int expon; frexpf((float)LinputSample, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - LinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + LinputSample += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)RinputSample, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - RinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + RinputSample += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = LinputSample; @@ -410,8 +410,8 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 { double LinputSample = *in1; double RinputSample = *in2; - if (fabs(LinputSample)<1.18e-43) LinputSample = fpd * 1.18e-43; - if (fabs(RinputSample)<1.18e-43) RinputSample = fpd * 1.18e-43; + if (fabs(LinputSample)<1.18e-43) LinputSample = fpdL * 1.18e-43; + if (fabs(RinputSample)<1.18e-43) RinputSample = fpdR * 1.18e-43; LataDrySample = LinputSample; LataHalfDrySample = LataHalfwaySample = (LinputSample + LataLast1Sample + (LataLast2Sample*ataK1) + (LataLast3Sample*ataK2) + (LataLast4Sample*ataK6) + (LataLast5Sample*ataK7) + (LataLast6Sample*ataK8)) / 2.0; @@ -567,7 +567,7 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 LataLowpass += LataHalfwayLowpass; //and combined them. Now we make sub-octaves RataLowpass += RataHalfwayLowpass; //and combined them. Now we make sub-octaves - double randy = (double(fpd)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed + double randy = (double(fpdL)/UINT32_MAX)*0.0555; //0 to 1 the noise, may not be needed switch (bflip) { @@ -733,12 +733,12 @@ void BassAmp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //apply stored up tiny corrections //begin 64 bit stereo floating point dither - int expon; frexp((double)LinputSample, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - LinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)RinputSample, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - RinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //int expon; frexp((double)LinputSample, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //LinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)RinputSample, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //RinputSample += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = LinputSample; diff --git a/plugins/WinVST/BassDrive/BassDrive.cpp b/plugins/WinVST/BassDrive/BassDrive.cpp index fd327fac1..b042dd13b 100755 --- a/plugins/WinVST/BassDrive/BassDrive.cpp +++ b/plugins/WinVST/BassDrive/BassDrive.cpp @@ -56,7 +56,8 @@ BassDrive::BassDrive(audioMasterCallback audioMaster) : flip = false; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BassDrive/BassDrive.h b/plugins/WinVST/BassDrive/BassDrive.h index 74af9f644..c4b152e43 100755 --- a/plugins/WinVST/BassDrive/BassDrive.h +++ b/plugins/WinVST/BassDrive/BassDrive.h @@ -56,7 +56,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double presenceInAL[7]; double presenceOutAL[7]; diff --git a/plugins/WinVST/BassKit/BassKitProc.cpp b/plugins/WinVST/BassKit/BassKitProc.cpp index b4621d946..c05d6e66f 100755 --- a/plugins/WinVST/BassKit/BassKitProc.cpp +++ b/plugins/WinVST/BassKit/BassKitProc.cpp @@ -57,7 +57,7 @@ void BassKit::processReplacing(float **inputs, float **outputs, VstInt32 sampleF {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise @@ -239,7 +239,7 @@ void BassKit::processDoubleReplacing(double **inputs, double **outputs, VstInt32 {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise diff --git a/plugins/WinVST/Baxandall/Baxandall.cpp b/plugins/WinVST/Baxandall/Baxandall.cpp index 55be20100..a9f32fa6d 100755 --- a/plugins/WinVST/Baxandall/Baxandall.cpp +++ b/plugins/WinVST/Baxandall/Baxandall.cpp @@ -26,7 +26,8 @@ Baxandall::Baxandall(audioMasterCallback audioMaster) : bassBR[x] = 0.0; } flip = false; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Baxandall/Baxandall.h b/plugins/WinVST/Baxandall/Baxandall.h index a30751cfc..f8b773123 100755 --- a/plugins/WinVST/Baxandall/Baxandall.h +++ b/plugins/WinVST/Baxandall/Baxandall.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double trebleAL[9]; double trebleBL[9]; diff --git a/plugins/WinVST/Beam/Beam.cpp b/plugins/WinVST/Beam/Beam.cpp index a1adf4a2f..2f52cf2fd 100755 --- a/plugins/WinVST/Beam/Beam.cpp +++ b/plugins/WinVST/Beam/Beam.cpp @@ -19,7 +19,8 @@ Beam::Beam(audioMasterCallback audioMaster) : lastSampleL[count] = 0; lastSampleR[count] = 0; } - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Beam/Beam.h b/plugins/WinVST/Beam/Beam.h index 30e1ccd75..0b59bbfb8 100755 --- a/plugins/WinVST/Beam/Beam.h +++ b/plugins/WinVST/Beam/Beam.h @@ -56,7 +56,8 @@ private: float lastSampleL[100]; float lastSampleR[100]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Beam/BeamProc.cpp b/plugins/WinVST/Beam/BeamProc.cpp index 15eda5357..6a2ba2eb7 100755 --- a/plugins/WinVST/Beam/BeamProc.cpp +++ b/plugins/WinVST/Beam/BeamProc.cpp @@ -37,10 +37,10 @@ void Beam::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -166,10 +166,10 @@ void Beam::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/WinVST/Biquad/Biquad.cpp b/plugins/WinVST/Biquad/Biquad.cpp index fbcf8b446..66882abdd 100755 --- a/plugins/WinVST/Biquad/Biquad.cpp +++ b/plugins/WinVST/Biquad/Biquad.cpp @@ -17,7 +17,8 @@ Biquad::Biquad(audioMasterCallback audioMaster) : B = 0.5; C = 0.5; D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Biquad/Biquad.h b/plugins/WinVST/Biquad/Biquad.h index 2476d2595..caa938859 100755 --- a/plugins/WinVST/Biquad/Biquad.h +++ b/plugins/WinVST/Biquad/Biquad.h @@ -59,7 +59,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Biquad2/Biquad2.cpp b/plugins/WinVST/Biquad2/Biquad2.cpp index 7b9d33802..46b86d670 100755 --- a/plugins/WinVST/Biquad2/Biquad2.cpp +++ b/plugins/WinVST/Biquad2/Biquad2.cpp @@ -30,7 +30,8 @@ Biquad2::Biquad2(audioMasterCallback audioMaster) : C = 0.5; D = 1.0; E = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Biquad2/Biquad2.h b/plugins/WinVST/Biquad2/Biquad2.h index 1c715f1a7..f27b567e3 100755 --- a/plugins/WinVST/Biquad2/Biquad2.h +++ b/plugins/WinVST/Biquad2/Biquad2.h @@ -73,7 +73,8 @@ private: double wetsetting; double chasespeed; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BiquadDouble/BiquadDouble.cpp b/plugins/WinVST/BiquadDouble/BiquadDouble.cpp index aaacd15b4..5ceb395ff 100755 --- a/plugins/WinVST/BiquadDouble/BiquadDouble.cpp +++ b/plugins/WinVST/BiquadDouble/BiquadDouble.cpp @@ -17,7 +17,8 @@ BiquadDouble::BiquadDouble(audioMasterCallback audioMaster) : B = 0.5; C = 0.5; D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BiquadDouble/BiquadDouble.h b/plugins/WinVST/BiquadDouble/BiquadDouble.h index 486a9b642..8ea80f434 100755 --- a/plugins/WinVST/BiquadDouble/BiquadDouble.h +++ b/plugins/WinVST/BiquadDouble/BiquadDouble.h @@ -61,7 +61,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.cpp b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.cpp index ee0943339..5bbf7ff4a 100755 --- a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.cpp +++ b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.cpp @@ -18,7 +18,8 @@ BiquadOneHalf::BiquadOneHalf(audioMasterCallback audioMaster) : B = 0.0; C = 0.0; D = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h index e3024989d..13874fd38 100755 --- a/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h +++ b/plugins/WinVST/BiquadOneHalf/BiquadOneHalf.h @@ -60,7 +60,8 @@ private: double biquadBL[9]; double biquadBR[9]; bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BiquadPlus/BiquadPlus.cpp b/plugins/WinVST/BiquadPlus/BiquadPlus.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BiquadPlus/BiquadPlus.h b/plugins/WinVST/BiquadPlus/BiquadPlus.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp b/plugins/WinVST/BiquadPlus/BiquadPlusProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BiquadTriple/BiquadTriple.cpp b/plugins/WinVST/BiquadTriple/BiquadTriple.cpp index a56973eca..f416a95e0 100755 --- a/plugins/WinVST/BiquadTriple/BiquadTriple.cpp +++ b/plugins/WinVST/BiquadTriple/BiquadTriple.cpp @@ -17,7 +17,8 @@ BiquadTriple::BiquadTriple(audioMasterCallback audioMaster) : B = 0.5; C = 0.5; D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BiquadTriple/BiquadTriple.h b/plugins/WinVST/BiquadTriple/BiquadTriple.h index b23660d14..f86dda9b5 100755 --- a/plugins/WinVST/BiquadTriple/BiquadTriple.h +++ b/plugins/WinVST/BiquadTriple/BiquadTriple.h @@ -61,7 +61,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8 and 9-10, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BitGlitter/BitGlitter.cpp b/plugins/WinVST/BitGlitter/BitGlitter.cpp index 88aedaddb..13e689a6a 100755 --- a/plugins/WinVST/BitGlitter/BitGlitter.cpp +++ b/plugins/WinVST/BitGlitter/BitGlitter.cpp @@ -17,7 +17,8 @@ BitGlitter::BitGlitter(audioMasterCallback audioMaster) : C = 0.5; D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; ataLastSampleL = 0.0; ataHalfwaySampleL = 0.0; diff --git a/plugins/WinVST/BitGlitter/BitGlitterProc.cpp b/plugins/WinVST/BitGlitter/BitGlitterProc.cpp index 8178e1cd7..792c78c67 100755 --- a/plugins/WinVST/BitGlitter/BitGlitterProc.cpp +++ b/plugins/WinVST/BitGlitter/BitGlitterProc.cpp @@ -210,11 +210,11 @@ void BitGlitter::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -428,12 +428,12 @@ void BitGlitter::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR = outputSampleR; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/BlockParty/BlockParty.cpp b/plugins/WinVST/BlockParty/BlockParty.cpp index fd9e2ff39..ba6d66fc6 100755 --- a/plugins/WinVST/BlockParty/BlockParty.cpp +++ b/plugins/WinVST/BlockParty/BlockParty.cpp @@ -14,7 +14,8 @@ BlockParty::BlockParty(audioMasterCallback audioMaster) : { A = 0.0; B = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; muSpeedAL = 10000; muSpeedBL = 10000; diff --git a/plugins/WinVST/BlockParty/BlockPartyProc.cpp b/plugins/WinVST/BlockParty/BlockPartyProc.cpp index 42d2924fe..da0bb1398 100755 --- a/plugins/WinVST/BlockParty/BlockPartyProc.cpp +++ b/plugins/WinVST/BlockParty/BlockPartyProc.cpp @@ -517,11 +517,11 @@ void BlockParty::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -1043,12 +1043,12 @@ void BlockParty::processDoubleReplacing(double **inputs, double **outputs, VstIn //iron bar clip comes after the dry/wet: alternate way to clean things up //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/BrassRider/BrassRider.cpp b/plugins/WinVST/BrassRider/BrassRider.cpp index ff0fdb80d..46f5e98b9 100755 --- a/plugins/WinVST/BrassRider/BrassRider.cpp +++ b/plugins/WinVST/BrassRider/BrassRider.cpp @@ -30,7 +30,8 @@ BrassRider::BrassRider(audioMasterCallback audioMaster) : lastSampleR = 0.0; lastSlewR = 0.0; gcount = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BrassRider/BrassRider.h b/plugins/WinVST/BrassRider/BrassRider.h index 06fb616a7..0e93752bb 100755 --- a/plugins/WinVST/BrassRider/BrassRider.h +++ b/plugins/WinVST/BrassRider/BrassRider.h @@ -70,7 +70,8 @@ private: double lastSampleR; double lastSlewR; int gcount; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BrightAmbience/BrightAmbience.cpp b/plugins/WinVST/BrightAmbience/BrightAmbience.cpp index afa450178..7f40ecbf3 100755 --- a/plugins/WinVST/BrightAmbience/BrightAmbience.cpp +++ b/plugins/WinVST/BrightAmbience/BrightAmbience.cpp @@ -17,7 +17,8 @@ BrightAmbience::BrightAmbience(audioMasterCallback audioMaster) : A = 0.0; B = 0.0; C = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BrightAmbience/BrightAmbience.h b/plugins/WinVST/BrightAmbience/BrightAmbience.h index 872d5f06e..ce3b2c53b 100755 --- a/plugins/WinVST/BrightAmbience/BrightAmbience.h +++ b/plugins/WinVST/BrightAmbience/BrightAmbience.h @@ -57,7 +57,8 @@ private: int32_t pL[25361]; int32_t pR[25361]; int gcount; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/BrightAmbience2/BrightAmbience2.cpp b/plugins/WinVST/BrightAmbience2/BrightAmbience2.cpp index 65f5728bc..d12ddc5e9 100755 --- a/plugins/WinVST/BrightAmbience2/BrightAmbience2.cpp +++ b/plugins/WinVST/BrightAmbience2/BrightAmbience2.cpp @@ -19,7 +19,8 @@ BrightAmbience2::BrightAmbience2(audioMasterCallback audioMaster) : B = 0.2; C = 0.0; D = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/BrightAmbience2/BrightAmbience2.h b/plugins/WinVST/BrightAmbience2/BrightAmbience2.h index 860fe9551..efd6e3f4c 100755 --- a/plugins/WinVST/BrightAmbience2/BrightAmbience2.h +++ b/plugins/WinVST/BrightAmbience2/BrightAmbience2.h @@ -59,7 +59,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff int gcount; float pL[32768]; diff --git a/plugins/WinVST/BrightAmbience3/BrightAmbience3.cpp b/plugins/WinVST/BrightAmbience3/BrightAmbience3.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BrightAmbience3/BrightAmbience3.h b/plugins/WinVST/BrightAmbience3/BrightAmbience3.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp b/plugins/WinVST/BrightAmbience3/BrightAmbience3Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BuildATPDF/BuildATPDF.cpp b/plugins/WinVST/BuildATPDF/BuildATPDF.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/BuildATPDF/BuildATPDF.h b/plugins/WinVST/BuildATPDF/BuildATPDF.h old mode 100644 new mode 100755 index 4de6dc8c6..06b07b9dd --- a/plugins/WinVST/BuildATPDF/BuildATPDF.h +++ b/plugins/WinVST/BuildATPDF/BuildATPDF.h @@ -77,7 +77,8 @@ private: float I; float J; //parameters. Always 0-1, and we scale/alter them elsewhere. - + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp b/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp old mode 100644 new mode 100755 index 51f46f489..277522f81 --- a/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp +++ b/plugins/WinVST/BuildATPDF/BuildATPDFProc.cpp @@ -41,7 +41,7 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDither = (bL[0] * f[0]); currentDither += (bL[1] * f[1]); @@ -58,7 +58,7 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDither = (bR[0] * f[0]); currentDither += (bR[1] * f[1]); @@ -78,6 +78,10 @@ void BuildATPDF::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -122,7 +126,7 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDither = (bL[0] * f[0]); currentDither += (bL[1] * f[1]); @@ -139,7 +143,7 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDither = (bR[0] * f[0]); currentDither += (bR[1] * f[1]); @@ -159,6 +163,10 @@ void BuildATPDF::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Cabs/Cabs.cpp b/plugins/WinVST/Cabs/Cabs.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Cabs/Cabs.h b/plugins/WinVST/Cabs/Cabs.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Cabs/CabsProc.cpp b/plugins/WinVST/Cabs/CabsProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Calibre/Calibre.cpp b/plugins/WinVST/Calibre/Calibre.cpp index 5bf269d0b..ee18c9617 100755 --- a/plugins/WinVST/Calibre/Calibre.cpp +++ b/plugins/WinVST/Calibre/Calibre.cpp @@ -18,7 +18,8 @@ Calibre::Calibre(audioMasterCallback audioMaster) : D = 1.0; for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Calibre/Calibre.h b/plugins/WinVST/Calibre/Calibre.h index 9b5bdef62..41ac899ae 100755 --- a/plugins/WinVST/Calibre/Calibre.h +++ b/plugins/WinVST/Calibre/Calibre.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Calibre/CalibreProc.cpp b/plugins/WinVST/Calibre/CalibreProc.cpp index d70cc94c0..9cb3232be 100755 --- a/plugins/WinVST/Calibre/CalibreProc.cpp +++ b/plugins/WinVST/Calibre/CalibreProc.cpp @@ -160,11 +160,11 @@ void Calibre::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.042); + randy = ((double(fpdL)/UINT32_MAX)*0.042); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.042); + randy = ((double(fpdR)/UINT32_MAX)*0.042); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -341,11 +341,11 @@ void Calibre::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.042); + randy = ((double(fpdL)/UINT32_MAX)*0.042); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.042); + randy = ((double(fpdR)/UINT32_MAX)*0.042); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/Capacitor2/Capacitor2.cpp b/plugins/WinVST/Capacitor2/Capacitor2.cpp index 9dec180d3..308b53490 100755 --- a/plugins/WinVST/Capacitor2/Capacitor2.cpp +++ b/plugins/WinVST/Capacitor2/Capacitor2.cpp @@ -52,7 +52,8 @@ Capacitor2::Capacitor2(audioMasterCallback audioMaster) : lastHighpass = 1000.0; lastWet = 1000.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Capacitor2/Capacitor2.h b/plugins/WinVST/Capacitor2/Capacitor2.h index dc9f1fa66..c9460f0db 100755 --- a/plugins/WinVST/Capacitor2/Capacitor2.h +++ b/plugins/WinVST/Capacitor2/Capacitor2.h @@ -95,7 +95,8 @@ private: double lastHighpass; double lastWet; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Chamber/Chamber.cpp b/plugins/WinVST/Chamber/Chamber.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Chamber/Chamber.h b/plugins/WinVST/Chamber/Chamber.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Chamber/ChamberProc.cpp b/plugins/WinVST/Chamber/ChamberProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Channel4/Channel4.h b/plugins/WinVST/Channel4/Channel4.h index e8ca7a260..1f427f88d 100755 --- a/plugins/WinVST/Channel4/Channel4.h +++ b/plugins/WinVST/Channel4/Channel4.h @@ -67,6 +67,9 @@ private: double lastSampleR; double iirAmount; double threshold; + + uint32_t fpdL; + uint32_t fpdR; float consoletype; float drive; //parameters. Always 0-1, and we scale/alter them elsewhere. diff --git a/plugins/WinVST/Channel5/Channel5.cpp b/plugins/WinVST/Channel5/Channel5.cpp index 21581df74..975c7bab8 100755 --- a/plugins/WinVST/Channel5/Channel5.cpp +++ b/plugins/WinVST/Channel5/Channel5.cpp @@ -12,11 +12,11 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new C Channel5::Channel5(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { + fpNShapeL = 0.0; + fpNShapeR = 0.0; consoletype = 0.0; drive = 0.0; output = 1.0; - fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; - fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; fpFlip = true; iirSampleLA = 0.0; iirSampleRA = 0.0; diff --git a/plugins/WinVST/Channel5/Channel5.h b/plugins/WinVST/Channel5/Channel5.h index 510f34f6a..ef3c2b8bd 100755 --- a/plugins/WinVST/Channel5/Channel5.h +++ b/plugins/WinVST/Channel5/Channel5.h @@ -54,8 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpdL; - uint32_t fpdR; + double fpNShapeL; + double fpNShapeR; bool fpFlip; //default stuff double iirSampleLA; diff --git a/plugins/WinVST/Channel5/Channel5Proc.cpp b/plugins/WinVST/Channel5/Channel5Proc.cpp index 5d25c69e4..d873e2b2c 100755 --- a/plugins/WinVST/Channel5/Channel5Proc.cpp +++ b/plugins/WinVST/Channel5/Channel5Proc.cpp @@ -26,8 +26,6 @@ void Channel5::processReplacing(float **inputs, float **outputs, VstInt32 sample double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { @@ -127,8 +125,6 @@ void Channel5::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; if (fpFlip) { diff --git a/plugins/WinVST/Channel6/Channel6.cpp b/plugins/WinVST/Channel6/Channel6.cpp index 80e17af19..a47a1c872 100755 --- a/plugins/WinVST/Channel6/Channel6.cpp +++ b/plugins/WinVST/Channel6/Channel6.cpp @@ -15,7 +15,8 @@ Channel6::Channel6(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleLA = 0.0; iirSampleRA = 0.0; iirSampleLB = 0.0; diff --git a/plugins/WinVST/Channel6/Channel6Proc.cpp b/plugins/WinVST/Channel6/Channel6Proc.cpp index c57faee2c..be57dbc44 100755 --- a/plugins/WinVST/Channel6/Channel6Proc.cpp +++ b/plugins/WinVST/Channel6/Channel6Proc.cpp @@ -90,11 +90,11 @@ void Channel6::processReplacing(float **inputs, float **outputs, VstInt32 sample //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -189,12 +189,12 @@ void Channel6::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Channel7/Channel7.cpp b/plugins/WinVST/Channel7/Channel7.cpp index 1b753f1cd..d9d6fbfd0 100755 --- a/plugins/WinVST/Channel7/Channel7.cpp +++ b/plugins/WinVST/Channel7/Channel7.cpp @@ -15,7 +15,8 @@ Channel7::Channel7(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleLA = 0.0; iirSampleRA = 0.0; iirSampleLB = 0.0; diff --git a/plugins/WinVST/Channel7/Channel7.h b/plugins/WinVST/Channel7/Channel7.h index 2ffd6c965..5f4a1a1bc 100755 --- a/plugins/WinVST/Channel7/Channel7.h +++ b/plugins/WinVST/Channel7/Channel7.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleLA; double iirSampleRA; diff --git a/plugins/WinVST/Channel8/Channel8.cpp b/plugins/WinVST/Channel8/Channel8.cpp index 3678965d6..2e9827760 100755 --- a/plugins/WinVST/Channel8/Channel8.cpp +++ b/plugins/WinVST/Channel8/Channel8.cpp @@ -15,7 +15,8 @@ Channel8::Channel8(audioMasterCallback audioMaster) : consoletype = 0.0; drive = 0.0; output = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleLA = 0.0; iirSampleRA = 0.0; iirSampleLB = 0.0; diff --git a/plugins/WinVST/Channel8/Channel8.h b/plugins/WinVST/Channel8/Channel8.h index 1d27fddd6..89bed0c09 100755 --- a/plugins/WinVST/Channel8/Channel8.h +++ b/plugins/WinVST/Channel8/Channel8.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleLA; double iirSampleRA; diff --git a/plugins/WinVST/Channel9/Channel9.cpp b/plugins/WinVST/Channel9/Channel9.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Channel9/Channel9.h b/plugins/WinVST/Channel9/Channel9.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Channel9/Channel9Proc.cpp b/plugins/WinVST/Channel9/Channel9Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ChromeOxide/ChromeOxide.cpp b/plugins/WinVST/ChromeOxide/ChromeOxide.cpp index 183fa9079..f3d7f337a 100755 --- a/plugins/WinVST/ChromeOxide/ChromeOxide.cpp +++ b/plugins/WinVST/ChromeOxide/ChromeOxide.cpp @@ -31,7 +31,8 @@ ChromeOxide::ChromeOxide(audioMasterCallback audioMaster) : flip = false; A = 0.5; B = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ChromeOxide/ChromeOxide.h b/plugins/WinVST/ChromeOxide/ChromeOxide.h index c67e7aac2..a644646b8 100755 --- a/plugins/WinVST/ChromeOxide/ChromeOxide.h +++ b/plugins/WinVST/ChromeOxide/ChromeOxide.h @@ -73,7 +73,8 @@ private: bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp b/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp index 70ba26008..e69607979 100755 --- a/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp +++ b/plugins/WinVST/ChromeOxide/ChromeOxideProc.cpp @@ -96,7 +96,7 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam bridgerectifier = inputSampleL; //insanity check - randy = bias+((double(fpd)/UINT32_MAX)*noise); + randy = bias+((double(fpdL)/UINT32_MAX)*noise); if ((randy >= 0.0)&&(randy < 1.0)) bridgerectifier = (inputSampleL * randy)+(secondSampleL * (1.0-randy)); if ((randy >= 1.0)&&(randy < 2.0)) bridgerectifier = (secondSampleL * (randy-1.0))+(thirdSampleL * (2.0-randy)); if ((randy >= 2.0)&&(randy < 3.0)) bridgerectifier = (thirdSampleL * (randy-2.0))+(fourthSampleL * (3.0-randy)); @@ -112,7 +112,7 @@ void ChromeOxide::processReplacing(float **inputs, float **outputs, VstInt32 sam bridgerectifier = inputSampleR; //insanity check - randy = bias+((double(fpd)/UINT32_MAX)*noise); + randy = bias+((double(fpdR)/UINT32_MAX)*noise); if ((randy >= 0.0)&&(randy < 1.0)) bridgerectifier = (inputSampleR * randy)+(secondSampleR * (1.0-randy)); if ((randy >= 1.0)&&(randy < 2.0)) bridgerectifier = (secondSampleR * (randy-1.0))+(thirdSampleR * (2.0-randy)); if ((randy >= 2.0)&&(randy < 3.0)) bridgerectifier = (thirdSampleR * (randy-2.0))+(fourthSampleR * (3.0-randy)); @@ -257,7 +257,7 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI bridgerectifier = inputSampleL; //insanity check - randy = bias+((double(fpd)/UINT32_MAX)*noise); + randy = bias+((double(fpdL)/UINT32_MAX)*noise); if ((randy >= 0.0)&&(randy < 1.0)) bridgerectifier = (inputSampleL * randy)+(secondSampleL * (1.0-randy)); if ((randy >= 1.0)&&(randy < 2.0)) bridgerectifier = (secondSampleL * (randy-1.0))+(thirdSampleL * (2.0-randy)); if ((randy >= 2.0)&&(randy < 3.0)) bridgerectifier = (thirdSampleL * (randy-2.0))+(fourthSampleL * (3.0-randy)); @@ -273,7 +273,7 @@ void ChromeOxide::processDoubleReplacing(double **inputs, double **outputs, VstI bridgerectifier = inputSampleR; //insanity check - randy = bias+((double(fpd)/UINT32_MAX)*noise); + randy = bias+((double(fpdR)/UINT32_MAX)*noise); if ((randy >= 0.0)&&(randy < 1.0)) bridgerectifier = (inputSampleR * randy)+(secondSampleR * (1.0-randy)); if ((randy >= 1.0)&&(randy < 2.0)) bridgerectifier = (secondSampleR * (randy-1.0))+(thirdSampleR * (2.0-randy)); if ((randy >= 2.0)&&(randy < 3.0)) bridgerectifier = (thirdSampleR * (randy-2.0))+(fourthSampleR * (3.0-randy)); diff --git a/plugins/WinVST/Cider/Cider.cpp b/plugins/WinVST/Cider/Cider.cpp index ebdd1a4f4..e32cf78e0 100755 --- a/plugins/WinVST/Cider/Cider.cpp +++ b/plugins/WinVST/Cider/Cider.cpp @@ -18,7 +18,8 @@ Cider::Cider(audioMasterCallback audioMaster) : D = 1.0; for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Cider/Cider.h b/plugins/WinVST/Cider/Cider.h index 0a0bedc1f..e184005d1 100755 --- a/plugins/WinVST/Cider/Cider.h +++ b/plugins/WinVST/Cider/Cider.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Cider/CiderProc.cpp b/plugins/WinVST/Cider/CiderProc.cpp index b85ffd773..86bd45278 100755 --- a/plugins/WinVST/Cider/CiderProc.cpp +++ b/plugins/WinVST/Cider/CiderProc.cpp @@ -158,11 +158,11 @@ void Cider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.057); + randy = ((double(fpdL)/UINT32_MAX)*0.057); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.057); + randy = ((double(fpdR)/UINT32_MAX)*0.057); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -337,11 +337,11 @@ void Cider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.057); + randy = ((double(fpdL)/UINT32_MAX)*0.057); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.057); + randy = ((double(fpdR)/UINT32_MAX)*0.057); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/ClipOnly2/ClipOnly2.cpp b/plugins/WinVST/ClipOnly2/ClipOnly2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ClipOnly2/ClipOnly2.h b/plugins/WinVST/ClipOnly2/ClipOnly2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ClipOnly2/ClipOnly2Proc.cpp b/plugins/WinVST/ClipOnly2/ClipOnly2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Coils/Coils.cpp b/plugins/WinVST/Coils/Coils.cpp index e40878412..0a2d4437b 100755 --- a/plugins/WinVST/Coils/Coils.cpp +++ b/plugins/WinVST/Coils/Coils.cpp @@ -16,7 +16,8 @@ Coils::Coils(audioMasterCallback audioMaster) : B = 0.5; C = 1.0; for (int x = 0; x < 9; x++) {figureL[x] = 0.0;figureR[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Coils/Coils.h b/plugins/WinVST/Coils/Coils.h index 8a4469ee2..3643a3979 100755 --- a/plugins/WinVST/Coils/Coils.h +++ b/plugins/WinVST/Coils/Coils.h @@ -56,7 +56,8 @@ private: double figureL[9]; double figureR[9]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Coils2/Coils2.cpp b/plugins/WinVST/Coils2/Coils2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Coils2/Coils2.h b/plugins/WinVST/Coils2/Coils2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Coils2/Coils2Proc.cpp b/plugins/WinVST/Coils2/Coils2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Compresaturator/Compresaturator.cpp b/plugins/WinVST/Compresaturator/Compresaturator.cpp index 1bb483138..299892abb 100755 --- a/plugins/WinVST/Compresaturator/Compresaturator.cpp +++ b/plugins/WinVST/Compresaturator/Compresaturator.cpp @@ -25,7 +25,8 @@ Compresaturator::Compresaturator(audioMasterCallback audioMaster) : lastWidthR = 500; padFactorR = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp b/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp index b5104171d..c75fc4bdf 100755 --- a/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp +++ b/plugins/WinVST/Compresaturator/CompresaturatorProc.cpp @@ -119,7 +119,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 //begin pad L padFactorL += dL[dCount]; - double randy = (double(fpd)/UINT32_MAX); + double randy = (double(fpdL)/UINT32_MAX); if ((targetWidth*randy) > lastWidthL) { //we are expanding the buffer so we don't remove this trailing sample lastWidthL += 1; @@ -140,7 +140,7 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 //begin pad R padFactorR += dR[dCount]; - randy = (double(fpd)/UINT32_MAX); + randy = (double(fpdR)/UINT32_MAX); if ((targetWidth*randy) > lastWidthR) { //we are expanding the buffer so we don't remove this trailing sample lastWidthR += 1; @@ -171,11 +171,11 @@ void Compresaturator::processReplacing(float **inputs, float **outputs, VstInt32 //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += static_cast(fpdL) * 5.960464655174751e-36L * pow(2,expon+62); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += static_cast(fpdR) * 5.960464655174751e-36L * pow(2,expon+62); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -258,7 +258,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, //we now have a big buffer to draw from, which is always positive amount of overspill padFactorL += dL[dCount]; - double randy = (double(fpd)/UINT32_MAX); + double randy = (double(fpdL)/UINT32_MAX); if ((targetWidth*randy) > lastWidthL) { //we are expanding the buffer so we don't remove this trailing sample lastWidthL += 1; @@ -319,7 +319,7 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, //we now have a big buffer to draw from, which is always positive amount of overspill padFactorR += dR[dCount]; - randy = (double(fpd)/UINT32_MAX); + randy = (double(fpdR)/UINT32_MAX); if ((targetWidth*randy) > lastWidthR) { //we are expanding the buffer so we don't remove this trailing sample lastWidthR += 1; @@ -351,12 +351,12 @@ void Compresaturator::processDoubleReplacing(double **inputs, double **outputs, } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Console4Buss/Console4Buss.h b/plugins/WinVST/Console4Buss/Console4Buss.h index 9a9cbfbff..04fb5d2bd 100755 --- a/plugins/WinVST/Console4Buss/Console4Buss.h +++ b/plugins/WinVST/Console4Buss/Console4Buss.h @@ -71,6 +71,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double fpNShapeR; //default stuff diff --git a/plugins/WinVST/Console4Channel/Console4Channel.h b/plugins/WinVST/Console4Channel/Console4Channel.h index 564853af6..f5542d4bb 100755 --- a/plugins/WinVST/Console4Channel/Console4Channel.h +++ b/plugins/WinVST/Console4Channel/Console4Channel.h @@ -75,6 +75,8 @@ private: double gainchase; double settingchase; double chasespeed; + uint32_t fpdL; + uint32_t fpdR; double fpNShapeL; double fpNShapeR; diff --git a/plugins/WinVST/Console6Buss/Console6Buss.cpp b/plugins/WinVST/Console6Buss/Console6Buss.cpp index c6658226e..21fb9728b 100755 --- a/plugins/WinVST/Console6Buss/Console6Buss.cpp +++ b/plugins/WinVST/Console6Buss/Console6Buss.cpp @@ -13,7 +13,8 @@ Console6Buss::Console6Buss(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Console6Buss/Console6Buss.h b/plugins/WinVST/Console6Buss/Console6Buss.h index 440039bcf..67e3a3d4a 100755 --- a/plugins/WinVST/Console6Buss/Console6Buss.h +++ b/plugins/WinVST/Console6Buss/Console6Buss.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Console6Channel/Console6Channel.cpp b/plugins/WinVST/Console6Channel/Console6Channel.cpp index d8634744e..fee5a551c 100755 --- a/plugins/WinVST/Console6Channel/Console6Channel.cpp +++ b/plugins/WinVST/Console6Channel/Console6Channel.cpp @@ -13,7 +13,8 @@ Console6Channel::Console6Channel(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Console6Channel/Console6Channel.h b/plugins/WinVST/Console6Channel/Console6Channel.h index 54360a1bf..976a9b43c 100755 --- a/plugins/WinVST/Console6Channel/Console6Channel.h +++ b/plugins/WinVST/Console6Channel/Console6Channel.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Console7Buss/Console7Buss.cpp b/plugins/WinVST/Console7Buss/Console7Buss.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Buss/Console7Buss.h b/plugins/WinVST/Console7Buss/Console7Buss.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Buss/Console7BussProc.cpp b/plugins/WinVST/Console7Buss/Console7BussProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Cascade/Console7Cascade.cpp b/plugins/WinVST/Console7Cascade/Console7Cascade.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Cascade/Console7Cascade.h b/plugins/WinVST/Console7Cascade/Console7Cascade.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp b/plugins/WinVST/Console7Cascade/Console7CascadeProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Channel/Console7Channel.cpp b/plugins/WinVST/Console7Channel/Console7Channel.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Channel/Console7Channel.h b/plugins/WinVST/Console7Channel/Console7Channel.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp b/plugins/WinVST/Console7Channel/Console7ChannelProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Crunch/Console7Crunch.cpp b/plugins/WinVST/Console7Crunch/Console7Crunch.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Crunch/Console7Crunch.h b/plugins/WinVST/Console7Crunch/Console7Crunch.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp b/plugins/WinVST/Console7Crunch/Console7CrunchProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Crystal/CrystalProc.cpp b/plugins/WinVST/Crystal/CrystalProc.cpp index 5e90250eb..1ebd6fd39 100755 --- a/plugins/WinVST/Crystal/CrystalProc.cpp +++ b/plugins/WinVST/Crystal/CrystalProc.cpp @@ -143,12 +143,12 @@ void Crystal::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //because it introduces a point where the saturation 'curve' changes from straight to curved. //People don't like these discontinuities, but you can use them for effect or to grit up the sound. - randy = ((double(fpd)/UINT32_MAX)*0.022); + randy = ((double(fpdL)/UINT32_MAX)*0.022); bridgerectifier = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; inputSampleL = bridgerectifier; //applies a tiny 'fuzz' to highs: from original Crystal. - randy = ((double(fpd)/UINT32_MAX)*0.022); + randy = ((double(fpdR)/UINT32_MAX)*0.022); bridgerectifier = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; inputSampleR = bridgerectifier; //applies a tiny 'fuzz' to highs: from original Crystal. @@ -312,12 +312,12 @@ void Crystal::processDoubleReplacing(double **inputs, double **outputs, VstInt32 //because it introduces a point where the saturation 'curve' changes from straight to curved. //People don't like these discontinuities, but you can use them for effect or to grit up the sound. - randy = ((double(fpd)/UINT32_MAX)*0.022); + randy = ((double(fpdL)/UINT32_MAX)*0.022); bridgerectifier = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; inputSampleL = bridgerectifier; //applies a tiny 'fuzz' to highs: from original Crystal. - randy = ((double(fpd)/UINT32_MAX)*0.022); + randy = ((double(fpdR)/UINT32_MAX)*0.022); bridgerectifier = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; inputSampleR = bridgerectifier; //applies a tiny 'fuzz' to highs: from original Crystal. diff --git a/plugins/WinVST/Dark/Dark.cpp b/plugins/WinVST/Dark/Dark.cpp index 8c038752e..a1bb3148a 100755 --- a/plugins/WinVST/Dark/Dark.cpp +++ b/plugins/WinVST/Dark/Dark.cpp @@ -14,7 +14,8 @@ Dark::Dark(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; for(int count = 0; count < 99; count++) { lastSampleL[count] = 0; lastSampleR[count] = 0; diff --git a/plugins/WinVST/Dark/Dark.h b/plugins/WinVST/Dark/Dark.h index df557e8b3..13e02ae87 100755 --- a/plugins/WinVST/Dark/Dark.h +++ b/plugins/WinVST/Dark/Dark.h @@ -55,7 +55,8 @@ private: float lastSampleL[100]; float lastSampleR[100]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Dark/DarkProc.cpp b/plugins/WinVST/Dark/DarkProc.cpp index 811fdf384..f026c1cd0 100755 --- a/plugins/WinVST/Dark/DarkProc.cpp +++ b/plugins/WinVST/Dark/DarkProc.cpp @@ -36,10 +36,10 @@ void Dark::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -151,10 +151,10 @@ void Dark::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/WinVST/DeBess/DeBess.cpp b/plugins/WinVST/DeBess/DeBess.cpp index 87d7316b8..43ead3df6 100755 --- a/plugins/WinVST/DeBess/DeBess.cpp +++ b/plugins/WinVST/DeBess/DeBess.cpp @@ -29,7 +29,8 @@ DeBess::DeBess(audioMasterCallback audioMaster) : iirSampleBR = 0.0; flip = false; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DeBess/DeBess.h b/plugins/WinVST/DeBess/DeBess.h index 26e8bb620..a3c4cb2ab 100755 --- a/plugins/WinVST/DeBess/DeBess.h +++ b/plugins/WinVST/DeBess/DeBess.h @@ -70,7 +70,8 @@ private: bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DeHiss/DeHiss.cpp b/plugins/WinVST/DeHiss/DeHiss.cpp index 17f386f5d..4473972cb 100755 --- a/plugins/WinVST/DeHiss/DeHiss.cpp +++ b/plugins/WinVST/DeHiss/DeHiss.cpp @@ -25,7 +25,8 @@ DeHiss::DeHiss(audioMasterCallback audioMaster) : gateR = 1.0; rawR = 2.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DeHiss/DeHiss.h b/plugins/WinVST/DeHiss/DeHiss.h index f8fb0a7cc..647f3abe8 100755 --- a/plugins/WinVST/DeHiss/DeHiss.h +++ b/plugins/WinVST/DeHiss/DeHiss.h @@ -53,7 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedL[2]; double diffL[6]; diff --git a/plugins/WinVST/DeRez2/DeRez2.cpp b/plugins/WinVST/DeRez2/DeRez2.cpp index acc092ee5..9f706d2bb 100755 --- a/plugins/WinVST/DeRez2/DeRez2.cpp +++ b/plugins/WinVST/DeRez2/DeRez2.cpp @@ -29,7 +29,8 @@ DeRez2::DeRez2(audioMasterCallback audioMaster) : position = 0.0; incrementA = 0.0; incrementB = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DeRez2/DeRez2.h b/plugins/WinVST/DeRez2/DeRez2.h index 7cfdaff6f..c3856a97a 100755 --- a/plugins/WinVST/DeRez2/DeRez2.h +++ b/plugins/WinVST/DeRez2/DeRez2.h @@ -69,7 +69,8 @@ private: double incrementA; double incrementB; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Deckwrecka/Deckwrecka.cpp b/plugins/WinVST/Deckwrecka/Deckwrecka.cpp index 8e4fc6d08..7e0a202c2 100755 --- a/plugins/WinVST/Deckwrecka/Deckwrecka.cpp +++ b/plugins/WinVST/Deckwrecka/Deckwrecka.cpp @@ -13,7 +13,8 @@ Deckwrecka::Deckwrecka(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; bflip = 1; iirHeadBumpAL = 0.0; diff --git a/plugins/WinVST/Deckwrecka/Deckwrecka.h b/plugins/WinVST/Deckwrecka/Deckwrecka.h index d33d2c70b..73c5a1d76 100755 --- a/plugins/WinVST/Deckwrecka/Deckwrecka.h +++ b/plugins/WinVST/Deckwrecka/Deckwrecka.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff int bflip; diff --git a/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp b/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp index fcecee4ce..a63176921 100755 --- a/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp +++ b/plugins/WinVST/Deckwrecka/DeckwreckaProc.cpp @@ -41,22 +41,32 @@ void Deckwrecka::processReplacing(float **inputs, float **outputs, VstInt32 samp bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - randyL = (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); + randyL = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); randyL /= 6.0; randyL *= wreck; //0 to 1 the noise, may not be needed //set up the noise - randyR = (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); + randyR = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); randyR /= 6.0; randyR *= wreck; //0 to 1 the noise, may not be needed //set up the noise @@ -226,22 +236,32 @@ void Deckwrecka::processDoubleReplacing(double **inputs, double **outputs, VstIn bflip++; if (bflip < 1 || bflip > 3) bflip = 1; - randyL = (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); - randyL += (double(fpd)/UINT32_MAX); + randyL = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + randyL += (double(fpdL)/UINT32_MAX); randyL /= 6.0; randyL *= wreck; //0 to 1 the noise, may not be needed //set up the noise - randyR = (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); - randyR += (double(fpd)/UINT32_MAX); + randyR = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + randyR += (double(fpdR)/UINT32_MAX); randyR /= 6.0; randyR *= wreck; //0 to 1 the noise, may not be needed //set up the noise diff --git a/plugins/WinVST/DigitalBlack/DigitalBlack.cpp b/plugins/WinVST/DigitalBlack/DigitalBlack.cpp index 89a10236a..840435762 100755 --- a/plugins/WinVST/DigitalBlack/DigitalBlack.cpp +++ b/plugins/WinVST/DigitalBlack/DigitalBlack.cpp @@ -20,7 +20,8 @@ DigitalBlack::DigitalBlack(audioMasterCallback audioMaster) : WasNegativeR = false; ZeroCrossR = 0; gaterollerR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DigitalBlack/DigitalBlack.h b/plugins/WinVST/DigitalBlack/DigitalBlack.h index 783e49f10..636911dd9 100755 --- a/plugins/WinVST/DigitalBlack/DigitalBlack.h +++ b/plugins/WinVST/DigitalBlack/DigitalBlack.h @@ -59,7 +59,8 @@ private: bool WasNegativeR; int ZeroCrossR; double gaterollerR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Dirt/Dirt.cpp b/plugins/WinVST/Dirt/Dirt.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Dirt/Dirt.h b/plugins/WinVST/Dirt/Dirt.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Dirt/DirtProc.cpp b/plugins/WinVST/Dirt/DirtProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Distortion/Distortion.cpp b/plugins/WinVST/Distortion/Distortion.cpp index 373ec3574..413805a65 100755 --- a/plugins/WinVST/Distortion/Distortion.cpp +++ b/plugins/WinVST/Distortion/Distortion.cpp @@ -20,7 +20,8 @@ Distortion::Distortion(audioMasterCallback audioMaster) : previousInL[x] = 0.0; previousOutL[x] = 0.0; previousInR[x] = 0.0; previousOutR[x] = 0.0; } - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Distortion/Distortion.h b/plugins/WinVST/Distortion/Distortion.h index c0f2d7553..2a9013380 100755 --- a/plugins/WinVST/Distortion/Distortion.h +++ b/plugins/WinVST/Distortion/Distortion.h @@ -60,7 +60,8 @@ private: double previousInR[9]; double previousOutR[9]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DitherFloat/DitherFloat.cpp b/plugins/WinVST/DitherFloat/DitherFloat.cpp index 9443a2daa..509db420c 100755 --- a/plugins/WinVST/DitherFloat/DitherFloat.cpp +++ b/plugins/WinVST/DitherFloat/DitherFloat.cpp @@ -14,7 +14,8 @@ DitherFloat::DitherFloat(audioMasterCallback audioMaster) : { A = 0.0; B = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/DitherFloat/DitherFloat.h b/plugins/WinVST/DitherFloat/DitherFloat.h index 08cce740e..dd828e6a5 100755 --- a/plugins/WinVST/DitherFloat/DitherFloat.h +++ b/plugins/WinVST/DitherFloat/DitherFloat.h @@ -53,7 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/DitherFloat/DitherFloatProc.cpp b/plugins/WinVST/DitherFloat/DitherFloatProc.cpp index 80e204250..9c894ad8a 100755 --- a/plugins/WinVST/DitherFloat/DitherFloatProc.cpp +++ b/plugins/WinVST/DitherFloat/DitherFloatProc.cpp @@ -70,11 +70,11 @@ void DitherFloat::processReplacing(float **inputs, float **outputs, VstInt32 sam //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdL ^= fpdL<<13; fpdL ^= fpdL>>17; fpdL ^= fpdL<<5; + inputSampleL += (fpdL*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdR ^= fpdR<<13; fpdR ^= fpdR>>17; fpdR ^= fpdR<<5; + inputSampleR += (fpdR*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; //end stereo 32 bit floating point dither @@ -155,11 +155,11 @@ void DitherFloat::processDoubleReplacing(double **inputs, double **outputs, VstI //begin stereo 32 bit floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleL += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdL ^= fpdL<<13; fpdL ^= fpdL>>17; fpdL ^= fpdL<<5; + inputSampleL += (fpdL*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; frexpf((float)inputSampleR, &expon); - fpd ^= fpd<<13; fpd ^= fpd>>17; fpd ^= fpd<<5; - inputSampleR += (fpd*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; + fpdR ^= fpdR<<13; fpdR ^= fpdR>>17; fpdR ^= fpdR<<5; + inputSampleR += (fpdR*3.4e-36l*pow(2,expon+62)* blend); //remove 'blend' for real use, it's for the demo; //end stereo 32 bit floating point dither diff --git a/plugins/WinVST/Ditherbox/Ditherbox.h b/plugins/WinVST/Ditherbox/Ditherbox.h index 164f37bab..51bc80e54 100755 --- a/plugins/WinVST/Ditherbox/Ditherbox.h +++ b/plugins/WinVST/Ditherbox/Ditherbox.h @@ -127,6 +127,9 @@ private: double iirSampleYR; double iirSampleZR; + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/WinVST/Ditherbox/DitherboxProc.cpp b/plugins/WinVST/Ditherbox/DitherboxProc.cpp index 04ba38eaf..f12d2abbe 100755 --- a/plugins/WinVST/Ditherbox/DitherboxProc.cpp +++ b/plugins/WinVST/Ditherbox/DitherboxProc.cpp @@ -70,34 +70,36 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 2: - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 0.5; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 0.5; inputSampleR = floor(inputSampleR); //flat dither break; case 3: - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 1.0; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 1.0; inputSampleR = floor(inputSampleR); //TPDF dither break; case 4: - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleL -= lastSampleL; inputSampleL = floor(inputSampleL); lastSampleL = currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; inputSampleR -= lastSampleR; inputSampleR = floor(inputSampleR); @@ -108,7 +110,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl case 5: nsL[9] = nsL[8]; nsL[8] = nsL[7]; nsL[7] = nsL[6]; nsL[6] = nsL[5]; nsL[5] = nsL[4]; nsL[4] = nsL[3]; nsL[3] = nsL[2]; nsL[2] = nsL[1]; - nsL[1] = nsL[0]; nsL[0] = (double(fpd)/UINT32_MAX); + nsL[1] = nsL[0]; nsL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (nsL[0] * 0.061); currentDitherL -= (nsL[1] * 0.11); @@ -131,7 +133,7 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl nsR[9] = nsR[8]; nsR[8] = nsR[7]; nsR[7] = nsR[6]; nsR[6] = nsR[5]; nsR[5] = nsR[4]; nsR[4] = nsR[3]; nsR[3] = nsR[2]; nsR[2] = nsR[1]; - nsR[1] = nsR[0]; nsR[0] = (double(fpd)/UINT32_MAX); + nsR[1] = nsR[0]; nsR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (nsR[0] * 0.061); currentDitherR -= (nsR[1] * 0.11); @@ -156,8 +158,8 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 6: - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -202,37 +204,52 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl break; case 8: - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -249,37 +266,52 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -303,7 +335,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -317,7 +352,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -339,11 +377,11 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl case 10: //this one is the original Naturalize if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -900,12 +938,13 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleL > 0.0) inputSampleL = bridgerectifier; else inputSampleL = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleL); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdL)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleL); @@ -930,12 +969,13 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl if (inputSampleR > 0.0) inputSampleR = bridgerectifier; else inputSampleR = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleR); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdR)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleR); @@ -966,6 +1006,10 @@ void Ditherbox::processReplacing(float **inputs, float **outputs, VstInt32 sampl noiseShapingR += inputSampleR - drySampleR; } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -1039,34 +1083,36 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 2: - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 0.5; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 0.5; inputSampleR = floor(inputSampleR); //flat dither break; case 3: - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleL += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); inputSampleL -= 1.0; inputSampleL = floor(inputSampleL); - inputSampleR += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleR -= 1.0; inputSampleR = floor(inputSampleR); //TPDF dither break; case 4: - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleL -= lastSampleL; inputSampleL = floor(inputSampleL); lastSampleL = currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; inputSampleR -= lastSampleR; inputSampleR = floor(inputSampleR); @@ -1077,7 +1123,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt case 5: nsL[9] = nsL[8]; nsL[8] = nsL[7]; nsL[7] = nsL[6]; nsL[6] = nsL[5]; nsL[5] = nsL[4]; nsL[4] = nsL[3]; nsL[3] = nsL[2]; nsL[2] = nsL[1]; - nsL[1] = nsL[0]; nsL[0] = (double(fpd)/UINT32_MAX); + nsL[1] = nsL[0]; nsL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (nsL[0] * 0.061); currentDitherL -= (nsL[1] * 0.11); @@ -1100,7 +1146,7 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt nsR[9] = nsR[8]; nsR[8] = nsR[7]; nsR[7] = nsR[6]; nsR[6] = nsR[5]; nsR[5] = nsR[4]; nsR[4] = nsR[3]; nsR[3] = nsR[2]; nsR[2] = nsR[1]; - nsR[1] = nsR[0]; nsR[0] = (double(fpd)/UINT32_MAX); + nsR[1] = nsR[0]; nsR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (nsR[0] * 0.061); currentDitherR -= (nsR[1] * 0.11); @@ -1124,8 +1170,8 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 6: - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -1170,37 +1216,52 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt break; case 8: - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -1217,37 +1278,52 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -1271,7 +1347,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -1285,7 +1364,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -1307,11 +1389,11 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt case 10: //this one is the original Naturalize if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -1868,12 +1950,13 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleL > 0.0) inputSampleL = bridgerectifier; else inputSampleL = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleL); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdL)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleL); @@ -1898,12 +1981,13 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt if (inputSampleR > 0.0) inputSampleR = bridgerectifier; else inputSampleR = -bridgerectifier; - silhouette = rand()/(double)RAND_MAX; + silhouette = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; silhouette -= 0.5; silhouette *= 2.0; silhouette *= fabs(inputSampleR); - smoother = rand()/(double)RAND_MAX; + smoother = (double(fpdR)/UINT32_MAX); smoother -= 0.5; smoother *= 2.0; smoother *= fabs(lastSampleR); @@ -1934,6 +2018,10 @@ void Ditherbox::processDoubleReplacing(double **inputs, double **outputs, VstInt noiseShapingR += inputSampleR - drySampleR; } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DoublePaul/DoublePaul.h b/plugins/WinVST/DoublePaul/DoublePaul.h index 4cb0b8827..1a9f0fd05 100755 --- a/plugins/WinVST/DoublePaul/DoublePaul.h +++ b/plugins/WinVST/DoublePaul/DoublePaul.h @@ -52,7 +52,9 @@ private: std::set< std::string > _canDo; double bL[11]; - double bR[11]; + double bR[11]; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/WinVST/DoublePaul/DoublePaulProc.cpp b/plugins/WinVST/DoublePaul/DoublePaulProc.cpp index aae850666..430915416 100755 --- a/plugins/WinVST/DoublePaul/DoublePaulProc.cpp +++ b/plugins/WinVST/DoublePaul/DoublePaulProc.cpp @@ -33,7 +33,7 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (bL[0] * 0.061); currentDitherL -= (bL[1] * 0.11); @@ -56,7 +56,7 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (bR[0] * 0.061); currentDitherR -= (bR[1] * 0.11); @@ -80,6 +80,10 @@ void DoublePaul::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -116,7 +120,7 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn bL[9] = bL[8]; bL[8] = bL[7]; bL[7] = bL[6]; bL[6] = bL[5]; bL[5] = bL[4]; bL[4] = bL[3]; bL[3] = bL[2]; bL[2] = bL[1]; - bL[1] = bL[0]; bL[0] = (double(fpd)/UINT32_MAX); + bL[1] = bL[0]; bL[0] = (double(fpdL)/UINT32_MAX); currentDitherL = (bL[0] * 0.061); currentDitherL -= (bL[1] * 0.11); @@ -139,7 +143,7 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn bR[9] = bR[8]; bR[8] = bR[7]; bR[7] = bR[6]; bR[6] = bR[5]; bR[5] = bR[4]; bR[4] = bR[3]; bR[3] = bR[2]; bR[2] = bR[1]; - bR[1] = bR[0]; bR[0] = (double(fpd)/UINT32_MAX); + bR[1] = bR[0]; bR[0] = (double(fpdR)/UINT32_MAX); currentDitherR = (bR[0] * 0.061); currentDitherR -= (bR[1] * 0.11); @@ -163,6 +167,10 @@ void DoublePaul::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/DubCenter/DubCenterProc.cpp b/plugins/WinVST/DubCenter/DubCenterProc.cpp index b51207b1d..eac78920a 100755 --- a/plugins/WinVST/DubCenter/DubCenterProc.cpp +++ b/plugins/WinVST/DubCenter/DubCenterProc.cpp @@ -42,7 +42,6 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSample; @@ -155,7 +154,7 @@ void DubCenter::processReplacing(float **inputs, float **outputs, VstInt32 sampl {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise @@ -326,7 +325,6 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSample; @@ -438,7 +436,7 @@ void DubCenter::processDoubleReplacing(double **inputs, double **outputs, VstInt {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} else {WasNegative = true;} //set up polarities for sub-bass version - randy = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randy = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandy = (1.0-randy); randy /= 2.0; //set up the noise diff --git a/plugins/WinVST/DubSub/DubSubProc.cpp b/plugins/WinVST/DubSub/DubSubProc.cpp index bdc30447d..679ab020b 100755 --- a/plugins/WinVST/DubSub/DubSubProc.cpp +++ b/plugins/WinVST/DubSub/DubSubProc.cpp @@ -46,7 +46,6 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSampleL; double tempSampleR; @@ -194,11 +193,11 @@ void DubSub::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr else {WasNegativeR = true;} //set up polarities for sub-bass version - randyL = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyL = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyL = (1.0-randyL); randyL /= 2.0; - randyR = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyR = (double(fpdR)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyR = (1.0-randyR); randyR /= 2.0; //set up the noise @@ -450,7 +449,6 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double out; double fuzz = 0.111; double wet = J; - double dry = 1.0-wet; double glitch = 0.60; double tempSampleL; double tempSampleR; @@ -597,11 +595,11 @@ void DubSub::processDoubleReplacing(double **inputs, double **outputs, VstInt32 else {WasNegativeR = true;} //set up polarities for sub-bass version - randyL = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyL = (double(fpdL)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyL = (1.0-randyL); randyL /= 2.0; - randyR = (double(fpd)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed + randyR = (double(fpdR)/UINT32_MAX)*fuzz; //0 to 1 the noise, may not be needed invrandyR = (1.0-randyR); randyR /= 2.0; //set up the noise diff --git a/plugins/WinVST/DustBunny/DustBunny.h b/plugins/WinVST/DustBunny/DustBunny.h index 0e75e7880..e9f1199a4 100755 --- a/plugins/WinVST/DustBunny/DustBunny.h +++ b/plugins/WinVST/DustBunny/DustBunny.h @@ -85,6 +85,9 @@ private: bool LataFlip; //end defining of antialiasing variables bool RataFlip; //end defining of antialiasing variables + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/WinVST/Dyno/Dyno.cpp b/plugins/WinVST/Dyno/Dyno.cpp index 0239412a3..203403b0d 100755 --- a/plugins/WinVST/Dyno/Dyno.cpp +++ b/plugins/WinVST/Dyno/Dyno.cpp @@ -13,7 +13,8 @@ Dyno::Dyno(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Dyno/Dyno.h b/plugins/WinVST/Dyno/Dyno.h index 80f46e625..db407c216 100755 --- a/plugins/WinVST/Dyno/Dyno.h +++ b/plugins/WinVST/Dyno/Dyno.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/EdIsDim/EdIsDimProc.cpp b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp index 2273bfcaa..39f21f688 100755 --- a/plugins/WinVST/EdIsDim/EdIsDimProc.cpp +++ b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp @@ -36,15 +36,17 @@ void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleF mid = (inputSampleL+inputSampleR)/2.0; side = (inputSampleL-inputSampleR)/2.0; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit floating point dither int expon; frexpf((float)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - mid += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //begin 32 bit floating point dither frexpf((float)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - side += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither - + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + *out1 = mid; *out2 = side; @@ -86,14 +88,14 @@ void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 side = (inputSampleL-inputSampleR)/2.0; //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - mid += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - side += (dither-fpNShapeR); fpNShapeR = dither; + //int expon; frexpf((float)mid, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //begin 32 bit floating point dither + //frexpf((float)side, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 64 bit dither *out1 = mid; diff --git a/plugins/WinVST/Edge/Edge.cpp b/plugins/WinVST/Edge/Edge.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Edge/Edge.h b/plugins/WinVST/Edge/Edge.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Edge/EdgeProc.cpp b/plugins/WinVST/Edge/EdgeProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Elation/Elation.cpp b/plugins/WinVST/Elation/Elation.cpp index d4740eca0..0f4c87092 100755 --- a/plugins/WinVST/Elation/Elation.cpp +++ b/plugins/WinVST/Elation/Elation.cpp @@ -23,7 +23,8 @@ Elation::Elation(audioMasterCallback audioMaster) : compCR = 1.0; compDR = 1.0; previousBR = 0.0; flip = false; lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Elation/Elation.h b/plugins/WinVST/Elation/Elation.h index 76e0c790b..86c647701 100755 --- a/plugins/WinVST/Elation/Elation.h +++ b/plugins/WinVST/Elation/Elation.h @@ -74,7 +74,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Elation/ElationProc.cpp b/plugins/WinVST/Elation/ElationProc.cpp index 0d5064ba1..8b99b97fa 100755 --- a/plugins/WinVST/Elation/ElationProc.cpp +++ b/plugins/WinVST/Elation/ElationProc.cpp @@ -258,12 +258,12 @@ void Elation::processReplacing(float **inputs, float **outputs, VstInt32 sampleF flip = !flip; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdL)/UINT32_MAX)*0.054); outputSample = ((((inputSampleL*(1-randy))+(lastSampleL*randy))*wet)+(drySampleL*(1.0-wet))) * outlevel; lastSampleL = inputSampleL; inputSampleL = outputSample; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdR)/UINT32_MAX)*0.054); outputSample = ((((inputSampleR*(1-randy))+(lastSampleR*randy))*wet)+(drySampleR*(1.0-wet))) * outlevel; lastSampleR = inputSampleR; inputSampleR = outputSample; @@ -538,12 +538,12 @@ void Elation::processDoubleReplacing(double **inputs, double **outputs, VstInt32 flip = !flip; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdL)/UINT32_MAX)*0.054); outputSample = ((((inputSampleL*(1-randy))+(lastSampleL*randy))*wet)+(drySampleL*(1.0-wet))) * outlevel; lastSampleL = inputSampleL; inputSampleL = outputSample; - randy = ((double(fpd)/UINT32_MAX)*0.054); + randy = ((double(fpdR)/UINT32_MAX)*0.054); outputSample = ((((inputSampleR*(1-randy))+(lastSampleR*randy))*wet)+(drySampleR*(1.0-wet))) * outlevel; lastSampleR = inputSampleR; inputSampleR = outputSample; diff --git a/plugins/WinVST/ElectroHat/ElectroHatProc.cpp b/plugins/WinVST/ElectroHat/ElectroHatProc.cpp index e1ef925b7..d49babc4b 100755 --- a/plugins/WinVST/ElectroHat/ElectroHatProc.cpp +++ b/plugins/WinVST/ElectroHat/ElectroHatProc.cpp @@ -33,7 +33,6 @@ void ElectroHat::processReplacing(float **inputs, float **outputs, VstInt32 samp double brighten = C; double outputlevel = D; double wet = E; - double dry = 1.0-wet; if (deSyn == 4) {deSyn = 1; increment = 0.411; brighten = 0.87;} //606 preset @@ -168,7 +167,6 @@ void ElectroHat::processDoubleReplacing(double **inputs, double **outputs, VstIn double brighten = C; double outputlevel = D; double wet = E; - double dry = 1.0-wet; if (deSyn == 4) {deSyn = 1; increment = 0.411; brighten = 0.87;} //606 preset diff --git a/plugins/WinVST/Energy2/Energy2.cpp b/plugins/WinVST/Energy2/Energy2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Energy2/Energy2.h b/plugins/WinVST/Energy2/Energy2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Energy2/Energy2Proc.cpp b/plugins/WinVST/Energy2/Energy2Proc.cpp old mode 100644 new mode 100755 index 6cdbba15c..5b5933828 --- a/plugins/WinVST/Energy2/Energy2Proc.cpp +++ b/plugins/WinVST/Energy2/Energy2Proc.cpp @@ -17,7 +17,6 @@ void Energy2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - int cycleEnd = floor(overallscale); if (cycleEnd < 1) cycleEnd = 1; if (cycleEnd > 4) cycleEnd = 4; @@ -660,7 +659,6 @@ void Energy2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - int cycleEnd = floor(overallscale); if (cycleEnd < 1) cycleEnd = 1; if (cycleEnd > 4) cycleEnd = 4; diff --git a/plugins/WinVST/Facet/Facet.cpp b/plugins/WinVST/Facet/Facet.cpp index a6a5614fb..a6b2b3f99 100755 --- a/plugins/WinVST/Facet/Facet.cpp +++ b/plugins/WinVST/Facet/Facet.cpp @@ -13,7 +13,8 @@ Facet::Facet(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Facet/Facet.h b/plugins/WinVST/Facet/Facet.h index 14bccceed..a96770914 100755 --- a/plugins/WinVST/Facet/Facet.h +++ b/plugins/WinVST/Facet/Facet.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/FathomFive/FathomFive.h b/plugins/WinVST/FathomFive/FathomFive.h index 51b9f4e35..8a67aae1b 100755 --- a/plugins/WinVST/FathomFive/FathomFive.h +++ b/plugins/WinVST/FathomFive/FathomFive.h @@ -74,6 +74,8 @@ private: float C; //Frequency float D; //Dry/Wet //parameters. Always 0-1, and we scale/alter them elsewhere. + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/Floor/FloorProc.cpp b/plugins/WinVST/Floor/FloorProc.cpp index 1c5ba156c..115f0bc79 100755 --- a/plugins/WinVST/Floor/FloorProc.cpp +++ b/plugins/WinVST/Floor/FloorProc.cpp @@ -32,7 +32,6 @@ void Floor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (iirAmount <= 0.0) iirAmount = 0.0; if (iirAmount > 1.0) iirAmount = 1.0; double wet = C; - double dry = 1.0-wet; while (--sampleFrames >= 0) { @@ -257,7 +256,6 @@ void Floor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (iirAmount <= 0.0) iirAmount = 0.0; if (iirAmount > 1.0) iirAmount = 1.0; double wet = C; - double dry = 1.0-wet; while (--sampleFrames >= 0) { diff --git a/plugins/WinVST/Focus/Focus.cpp b/plugins/WinVST/Focus/Focus.cpp index a9e66020d..983edb647 100755 --- a/plugins/WinVST/Focus/Focus.cpp +++ b/plugins/WinVST/Focus/Focus.cpp @@ -18,7 +18,8 @@ Focus::Focus(audioMasterCallback audioMaster) : D = 1.0; E = 1.0; for (int x = 0; x < 9; x++) {figureL[x] = 0.0;figureR[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Focus/Focus.h b/plugins/WinVST/Focus/Focus.h index 7b2cf706d..7a99c47b0 100755 --- a/plugins/WinVST/Focus/Focus.h +++ b/plugins/WinVST/Focus/Focus.h @@ -58,7 +58,8 @@ private: double figureL[9]; double figureR[9]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/FromTape/FromTapeProc.cpp b/plugins/WinVST/FromTape/FromTapeProc.cpp index 46bc5759b..eb3154f70 100755 --- a/plugins/WinVST/FromTape/FromTapeProc.cpp +++ b/plugins/WinVST/FromTape/FromTapeProc.cpp @@ -55,7 +55,7 @@ void FromTape::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleR *= inputgain; } - randy = (double(fpd)/UINT32_MAX) * SoftenControl; //for soften + randy = (double(fpdL)/UINT32_MAX) * SoftenControl; //for soften invrandy = (1.0-randy); randy /= 2.0; //we've set up so that we dial in the amount of the alt sections (in pairs) with invrandy being the source section @@ -252,7 +252,7 @@ void FromTape::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleR *= inputgain; } - randy = (double(fpd)/UINT32_MAX) * SoftenControl; //for soften + randy = (double(fpdL)/UINT32_MAX) * SoftenControl; //for soften invrandy = (1.0-randy); randy /= 2.0; //we've set up so that we dial in the amount of the alt sections (in pairs) with invrandy being the source section diff --git a/plugins/WinVST/Galactic/Galactic.cpp b/plugins/WinVST/Galactic/Galactic.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Galactic/Galactic.h b/plugins/WinVST/Galactic/Galactic.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Galactic/GalacticProc.cpp b/plugins/WinVST/Galactic/GalacticProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/GlitchShifter/GlitchShifter.cpp b/plugins/WinVST/GlitchShifter/GlitchShifter.cpp index 2bd39758e..9fa68aa0b 100755 --- a/plugins/WinVST/GlitchShifter/GlitchShifter.cpp +++ b/plugins/WinVST/GlitchShifter/GlitchShifter.cpp @@ -53,7 +53,8 @@ GlitchShifter::GlitchShifter(audioMasterCallback audioMaster) : C = 0.5; D = 0.0; E = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/GlitchShifter/GlitchShifter.h b/plugins/WinVST/GlitchShifter/GlitchShifter.h index bcb0dbab2..ffbd303eb 100755 --- a/plugins/WinVST/GlitchShifter/GlitchShifter.h +++ b/plugins/WinVST/GlitchShifter/GlitchShifter.h @@ -101,7 +101,8 @@ private: int gcount; VstInt32 lastwidth; bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Gringer/Gringer.cpp b/plugins/WinVST/Gringer/Gringer.cpp index f071dedb8..6f37ac79c 100755 --- a/plugins/WinVST/Gringer/Gringer.cpp +++ b/plugins/WinVST/Gringer/Gringer.cpp @@ -13,7 +13,8 @@ Gringer::Gringer(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { for (int x = 0; x < 9; x++) {inbandL[x] = 0.0; outbandL[x] = 0.0; inbandR[x] = 0.0; outbandR[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Gringer/Gringer.h b/plugins/WinVST/Gringer/Gringer.h index 53d8dce83..27f05155b 100755 --- a/plugins/WinVST/Gringer/Gringer.h +++ b/plugins/WinVST/Gringer/Gringer.h @@ -51,7 +51,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double inbandL[9]; diff --git a/plugins/WinVST/HardVacuum/HardVacuumProc.cpp b/plugins/WinVST/HardVacuum/HardVacuumProc.cpp index a39e01b19..9979a8126 100755 --- a/plugins/WinVST/HardVacuum/HardVacuumProc.cpp +++ b/plugins/WinVST/HardVacuum/HardVacuumProc.cpp @@ -24,7 +24,6 @@ void HardVacuum::processReplacing(float **inputs, float **outputs, VstInt32 samp double aura = C*3.1415926; double out = D; double wet = E; - double dry = 1.0-wet; double drive; double positive; double negative; @@ -173,7 +172,6 @@ void HardVacuum::processDoubleReplacing(double **inputs, double **outputs, VstIn double aura = C*3.1415926; double out = D; double wet = E; - double dry = 1.0-wet; double drive; double positive; double negative; diff --git a/plugins/WinVST/HighGlossDither/HighGlossDither.h b/plugins/WinVST/HighGlossDither/HighGlossDither.h index 8bce9066b..96804c5a8 100755 --- a/plugins/WinVST/HighGlossDither/HighGlossDither.h +++ b/plugins/WinVST/HighGlossDither/HighGlossDither.h @@ -53,6 +53,8 @@ private: int Position; bool flip; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/Highpass2/Highpass2.cpp b/plugins/WinVST/Highpass2/Highpass2.cpp index c88927ae2..3c1833407 100755 --- a/plugins/WinVST/Highpass2/Highpass2.cpp +++ b/plugins/WinVST/Highpass2/Highpass2.cpp @@ -16,7 +16,8 @@ Highpass2::Highpass2(audioMasterCallback audioMaster) : B = 0.5; //-1.0 to 1.0 C = 0.25; // 0.0 to 4.0 D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleAL = 0.0; iirSampleBL = 0.0; diff --git a/plugins/WinVST/Highpass2/Highpass2.h b/plugins/WinVST/Highpass2/Highpass2.h index ea8176b17..4b9efb1f3 100755 --- a/plugins/WinVST/Highpass2/Highpass2.h +++ b/plugins/WinVST/Highpass2/Highpass2.h @@ -55,7 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/WinVST/Holt/Holt.cpp b/plugins/WinVST/Holt/Holt.cpp index 499217c23..8f14a7238 100755 --- a/plugins/WinVST/Holt/Holt.cpp +++ b/plugins/WinVST/Holt/Holt.cpp @@ -36,7 +36,8 @@ Holt::Holt(audioMasterCallback audioMaster) : previousSampleDR = 0.0; previousTrendDR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Holt/HoltProc.cpp b/plugins/WinVST/Holt/HoltProc.cpp index 413c1e159..d37f50ef4 100755 --- a/plugins/WinVST/Holt/HoltProc.cpp +++ b/plugins/WinVST/Holt/HoltProc.cpp @@ -127,11 +127,11 @@ void Holt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -263,12 +263,12 @@ void Holt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Hull/Hull.cpp b/plugins/WinVST/Hull/Hull.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Hull/Hull.h b/plugins/WinVST/Hull/Hull.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Hull/HullProc.cpp b/plugins/WinVST/Hull/HullProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/HypersonX/HypersonX.cpp b/plugins/WinVST/HypersonX/HypersonX.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/HypersonX/HypersonX.h b/plugins/WinVST/HypersonX/HypersonX.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/HypersonX/HypersonXProc.cpp b/plugins/WinVST/HypersonX/HypersonXProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Hypersonic/Hypersonic.cpp b/plugins/WinVST/Hypersonic/Hypersonic.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Hypersonic/Hypersonic.h b/plugins/WinVST/Hypersonic/Hypersonic.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Hypersonic/HypersonicProc.cpp b/plugins/WinVST/Hypersonic/HypersonicProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Infinity2/Infinity2.cpp b/plugins/WinVST/Infinity2/Infinity2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Infinity2/Infinity2.h b/plugins/WinVST/Infinity2/Infinity2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Infinity2/Infinity2Proc.cpp b/plugins/WinVST/Infinity2/Infinity2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Infrasonic/Infrasonic.cpp b/plugins/WinVST/Infrasonic/Infrasonic.cpp index bfd10d163..7d77058bc 100755 --- a/plugins/WinVST/Infrasonic/Infrasonic.cpp +++ b/plugins/WinVST/Infrasonic/Infrasonic.cpp @@ -13,7 +13,8 @@ Infrasonic::Infrasonic(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { for (int x = 0; x < 15; x++) {biquadA[x] = 0.0; biquadB[x] = 0.0; biquadC[x] = 0.0; biquadD[x] = 0.0; biquadE[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Infrasonic/Infrasonic.h b/plugins/WinVST/Infrasonic/Infrasonic.h index ef33b30ed..3258cc059 100755 --- a/plugins/WinVST/Infrasonic/Infrasonic.h +++ b/plugins/WinVST/Infrasonic/Infrasonic.h @@ -59,7 +59,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/Interstage/Interstage.cpp b/plugins/WinVST/Interstage/Interstage.cpp index 92acc46cc..03c0aec6c 100755 --- a/plugins/WinVST/Interstage/Interstage.cpp +++ b/plugins/WinVST/Interstage/Interstage.cpp @@ -26,7 +26,8 @@ Interstage::Interstage(audioMasterCallback audioMaster) : iirSampleER = 0.0; iirSampleFR = 0.0; lastSampleR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; flip = true; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/Interstage/Interstage.h b/plugins/WinVST/Interstage/Interstage.h index bb23c5c57..16e5d2aa7 100755 --- a/plugins/WinVST/Interstage/Interstage.h +++ b/plugins/WinVST/Interstage/Interstage.h @@ -65,7 +65,8 @@ private: double iirSampleER; double iirSampleFR; double lastSampleR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; bool flip; }; diff --git a/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp index ebffe6e53..b51e9b7cf 100755 --- a/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp +++ b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp @@ -76,7 +76,7 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp drySampleL = inputSampleL; drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); //part of flutter section //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (fstoredcount < 0 || fstoredcount > 30) {fstoredcount = 30;} @@ -347,7 +347,7 @@ void IronOxide5::processReplacing(float **inputs, float **outputs, VstInt32 samp else inputSampleR = -bridgerectifierR; //second stage of overdrive to prevent overs and allow bloody loud extremeness - randy = (0.55 + tempRandy + ((double(fpd)/UINT32_MAX)*tempRandy))*noise; //0 to 2 + randy = (0.55 + tempRandy + ((double(fpdR)/UINT32_MAX)*tempRandy))*noise; //0 to 2 inputSampleL *= (1.0 - randy); inputSampleL += (prevInputSampleL*randy); @@ -471,7 +471,7 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn drySampleL = inputSampleL; drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); //part of flutter section //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (fstoredcount < 0 || fstoredcount > 30) {fstoredcount = 30;} @@ -742,7 +742,7 @@ void IronOxide5::processDoubleReplacing(double **inputs, double **outputs, VstIn else inputSampleR = -bridgerectifierR; //second stage of overdrive to prevent overs and allow bloody loud extremeness - randy = (0.55 + tempRandy + ((double(fpd)/UINT32_MAX)*tempRandy))*noise; //0 to 2 + randy = (0.55 + tempRandy + ((double(fpdR)/UINT32_MAX)*tempRandy))*noise; //0 to 2 inputSampleL *= (1.0 - randy); inputSampleL += (prevInputSampleL*randy); diff --git a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.cpp b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp b/plugins/WinVST/IronOxideClassic2/IronOxideClassic2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Isolator/Isolator.cpp b/plugins/WinVST/Isolator/Isolator.cpp index c8222a86f..779521dc4 100755 --- a/plugins/WinVST/Isolator/Isolator.cpp +++ b/plugins/WinVST/Isolator/Isolator.cpp @@ -16,7 +16,8 @@ Isolator::Isolator(audioMasterCallback audioMaster) : A = 1.0; B = 0.0; C = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Isolator/Isolator.h b/plugins/WinVST/Isolator/Isolator.h index c353897e0..9734c4c75 100755 --- a/plugins/WinVST/Isolator/Isolator.h +++ b/plugins/WinVST/Isolator/Isolator.h @@ -60,7 +60,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Isolator2/Isolator2.cpp b/plugins/WinVST/Isolator2/Isolator2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Isolator2/Isolator2.h b/plugins/WinVST/Isolator2/Isolator2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Isolator2/Isolator2Proc.cpp b/plugins/WinVST/Isolator2/Isolator2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Logical4/Logical4.h b/plugins/WinVST/Logical4/Logical4.h index fd802c812..f1389f452 100755 --- a/plugins/WinVST/Logical4/Logical4.h +++ b/plugins/WinVST/Logical4/Logical4.h @@ -143,10 +143,10 @@ private: int gcount; - double fpNShapeL; - double fpNShapeR; bool fpFlip; //default stuff + uint32_t fpdL; + uint32_t fpdR; float A; float B; diff --git a/plugins/WinVST/Loud/Loud.cpp b/plugins/WinVST/Loud/Loud.cpp index 1f884deb1..06a6020af 100755 --- a/plugins/WinVST/Loud/Loud.cpp +++ b/plugins/WinVST/Loud/Loud.cpp @@ -17,7 +17,8 @@ Loud::Loud(audioMasterCallback audioMaster) : C = 1.0; lastSampleL = 0.0; lastSampleR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Loud/LoudProc.cpp b/plugins/WinVST/Loud/LoudProc.cpp index 5669725ca..8637aba0c 100755 --- a/plugins/WinVST/Loud/LoudProc.cpp +++ b/plugins/WinVST/Loud/LoudProc.cpp @@ -107,11 +107,11 @@ void Loud::processReplacing(float **inputs, float **outputs, VstInt32 sampleFram //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -222,12 +222,12 @@ void Loud::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sa //number, we really don't want to meaninglessly multiply that by 1.0. //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Lowpass2/Lowpass2.cpp b/plugins/WinVST/Lowpass2/Lowpass2.cpp index 1de69450a..27f081846 100755 --- a/plugins/WinVST/Lowpass2/Lowpass2.cpp +++ b/plugins/WinVST/Lowpass2/Lowpass2.cpp @@ -16,7 +16,8 @@ Lowpass2::Lowpass2(audioMasterCallback audioMaster) : B = 0.5; //-1.0 to 1.0 C = 0.25; // 0.0 to 4.0 D = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleAL = 0.0; iirSampleBL = 0.0; diff --git a/plugins/WinVST/Lowpass2/Lowpass2.h b/plugins/WinVST/Lowpass2/Lowpass2.h index 45b96e69b..6d7cebe29 100755 --- a/plugins/WinVST/Lowpass2/Lowpass2.h +++ b/plugins/WinVST/Lowpass2/Lowpass2.h @@ -55,7 +55,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirSampleAL; diff --git a/plugins/WinVST/Luxor/Luxor.cpp b/plugins/WinVST/Luxor/Luxor.cpp index 001286dd8..673c0cfe9 100755 --- a/plugins/WinVST/Luxor/Luxor.cpp +++ b/plugins/WinVST/Luxor/Luxor.cpp @@ -18,7 +18,8 @@ Luxor::Luxor(audioMasterCallback audioMaster) : D = 1.0; for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Luxor/Luxor.h b/plugins/WinVST/Luxor/Luxor.h index b7d79e9fe..a354f2c3c 100755 --- a/plugins/WinVST/Luxor/Luxor.h +++ b/plugins/WinVST/Luxor/Luxor.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Luxor/LuxorProc.cpp b/plugins/WinVST/Luxor/LuxorProc.cpp index 2dfb60013..2ea8a55c1 100755 --- a/plugins/WinVST/Luxor/LuxorProc.cpp +++ b/plugins/WinVST/Luxor/LuxorProc.cpp @@ -160,11 +160,11 @@ void Luxor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdL)/UINT32_MAX)*0.031); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdR)/UINT32_MAX)*0.031); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -341,11 +341,11 @@ void Luxor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdL)/UINT32_MAX)*0.031); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.031); + randy = ((double(fpdR)/UINT32_MAX)*0.031); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/MV/MV.cpp b/plugins/WinVST/MV/MV.cpp index 90246abae..c6d104f9b 100755 --- a/plugins/WinVST/MV/MV.cpp +++ b/plugins/WinVST/MV/MV.cpp @@ -76,7 +76,8 @@ MV::MV(audioMasterCallback audioMaster) : feedbackL = 0.0; feedbackR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/MV/MVProc.cpp b/plugins/WinVST/MV/MVProc.cpp index 5a0b96333..bab3b0416 100755 --- a/plugins/WinVST/MV/MVProc.cpp +++ b/plugins/WinVST/MV/MVProc.cpp @@ -752,11 +752,11 @@ void MV::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -1513,12 +1513,12 @@ void MV::processDoubleReplacing(double **inputs, double **outputs, VstInt32 samp //Dry/Wet control, defaults to the last slider //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/MackEQ/MackEQ.cpp b/plugins/WinVST/MackEQ/MackEQ.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MackEQ/MackEQ.h b/plugins/WinVST/MackEQ/MackEQ.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MackEQ/MackEQProc.cpp b/plugins/WinVST/MackEQ/MackEQProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Mackity/Mackity.cpp b/plugins/WinVST/Mackity/Mackity.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Mackity/Mackity.h b/plugins/WinVST/Mackity/Mackity.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Mackity/MackityProc.cpp b/plugins/WinVST/Mackity/MackityProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MidSide/MidSideProc.cpp b/plugins/WinVST/MidSide/MidSideProc.cpp index 46fb1397e..cb5f2ffa6 100755 --- a/plugins/WinVST/MidSide/MidSideProc.cpp +++ b/plugins/WinVST/MidSide/MidSideProc.cpp @@ -37,14 +37,15 @@ void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleF mid *= midgain; side *= sidegain; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit floating point dither int expon; frexpf((float)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - mid += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither frexpf((float)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - side += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither *out1 = mid; *out2 = side; @@ -87,14 +88,13 @@ void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 side *= sidegain; //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)mid, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - mid += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)side, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - side += (dither-fpNShapeR); fpNShapeR = dither; + //int expon; frexpf((float)mid, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //mid += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit floating point dither + //frexpf((float)side, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //side += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 64 bit dither *out1 = mid; diff --git a/plugins/WinVST/MoNoam/MoNoam.cpp b/plugins/WinVST/MoNoam/MoNoam.cpp index 746f43edb..56a243e5d 100755 --- a/plugins/WinVST/MoNoam/MoNoam.cpp +++ b/plugins/WinVST/MoNoam/MoNoam.cpp @@ -13,7 +13,8 @@ MoNoam::MoNoam(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/MoNoam/MoNoam.h b/plugins/WinVST/MoNoam/MoNoam.h index c30fbdc4b..e4aff140f 100755 --- a/plugins/WinVST/MoNoam/MoNoam.h +++ b/plugins/WinVST/MoNoam/MoNoam.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff static const int kBYPASS = 0; diff --git a/plugins/WinVST/Mojo/Mojo.cpp b/plugins/WinVST/Mojo/Mojo.cpp index 78bb5c9c3..65c270402 100755 --- a/plugins/WinVST/Mojo/Mojo.cpp +++ b/plugins/WinVST/Mojo/Mojo.cpp @@ -13,7 +13,8 @@ Mojo::Mojo(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Mojo/Mojo.h b/plugins/WinVST/Mojo/Mojo.h index ea8c2fd50..4e759375b 100755 --- a/plugins/WinVST/Mojo/Mojo.h +++ b/plugins/WinVST/Mojo/Mojo.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Monitoring/Monitoring.cpp b/plugins/WinVST/Monitoring/Monitoring.cpp index 635ca615b..5acf52beb 100755 --- a/plugins/WinVST/Monitoring/Monitoring.cpp +++ b/plugins/WinVST/Monitoring/Monitoring.cpp @@ -60,7 +60,8 @@ Monitoring::Monitoring(audioMasterCallback audioMaster) : for (int x = 0; x < 11; x++) {biquadL[x] = 0.0; biquadR[x] = 0.0;} //Bandpasses A = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Monitoring/Monitoring.h b/plugins/WinVST/Monitoring/Monitoring.h index 8dd0210fc..12452111a 100755 --- a/plugins/WinVST/Monitoring/Monitoring.h +++ b/plugins/WinVST/Monitoring/Monitoring.h @@ -77,7 +77,8 @@ private: double biquadR[11]; //Bandpasses - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Monitoring2/Monitoring2.cpp b/plugins/WinVST/Monitoring2/Monitoring2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Monitoring2/Monitoring2.h b/plugins/WinVST/Monitoring2/Monitoring2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp b/plugins/WinVST/Monitoring2/Monitoring2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MultiBandDistortion/MultiBandDistortion.cpp b/plugins/WinVST/MultiBandDistortion/MultiBandDistortion.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MultiBandDistortion/MultiBandDistortion.h b/plugins/WinVST/MultiBandDistortion/MultiBandDistortion.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp b/plugins/WinVST/MultiBandDistortion/MultiBandDistortionProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/NCSeventeen/NCSeventeen.cpp b/plugins/WinVST/NCSeventeen/NCSeventeen.cpp index 9bc129a9d..a0a9a061d 100755 --- a/plugins/WinVST/NCSeventeen/NCSeventeen.cpp +++ b/plugins/WinVST/NCSeventeen/NCSeventeen.cpp @@ -31,11 +31,8 @@ NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : flip = false; - fpNShapeLA = 0.0; - fpNShapeLB = 0.0; - fpNShapeRA = 0.0; - fpNShapeRB = 0.0; - fpFlip = true; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/NCSeventeen/NCSeventeen.h b/plugins/WinVST/NCSeventeen/NCSeventeen.h index 7ca781c3b..100f02bdb 100755 --- a/plugins/WinVST/NCSeventeen/NCSeventeen.h +++ b/plugins/WinVST/NCSeventeen/NCSeventeen.h @@ -70,11 +70,8 @@ private: bool flip; - double fpNShapeLA; - double fpNShapeLB; - double fpNShapeRA; - double fpNShapeRB; - bool fpFlip; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp index 4711f6b90..aebc1ba49 100755 --- a/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp +++ b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp @@ -19,9 +19,6 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - float fpTemp; - double fpOld = 0.618033988749894848204586; //golden ratio! - double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0004716; double bassScaleback = 0.0002364; @@ -311,25 +308,14 @@ void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sam if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //noise shaping to 32-bit floating point - if (fpFlip) { - fpTemp = inputSampleL; - fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); - inputSampleL += fpNShapeLA; - fpTemp = inputSampleR; - fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); - inputSampleR += fpNShapeRA; - } - else { - fpTemp = inputSampleL; - fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); - inputSampleL += fpNShapeLB; - fpTemp = inputSampleR; - fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); - inputSampleR += fpNShapeRB; - } - fpFlip = !fpFlip; - //end noise shaping on 32 bit output + //begin 32 bit stereo floating point dither + int expon; frexpf((float)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + frexpf((float)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -353,9 +339,6 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI double overallscale = 1.0; overallscale /= 44100.0; overallscale *= getSampleRate(); - double fpTemp; - double fpOld = 0.618033988749894848204586; //golden ratio! - double fpNew = 1.0 - fpOld; double IIRscaleback = 0.0004716; double bassScaleback = 0.0002364; @@ -644,25 +627,14 @@ void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstI if (inputSampleR < -0.95) inputSampleR = -0.95; //iron bar - //noise shaping to 64-bit floating point - if (fpFlip) { - fpTemp = inputSampleL; - fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); - inputSampleL += fpNShapeLA; - fpTemp = inputSampleR; - fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); - inputSampleR += fpNShapeRA; - } - else { - fpTemp = inputSampleL; - fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); - inputSampleL += fpNShapeLB; - fpTemp = inputSampleR; - fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); - inputSampleR += fpNShapeRB; - } - fpFlip = !fpFlip; - //end noise shaping on 64 bit output + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/NaturalizeDither/NaturalizeDither.h b/plugins/WinVST/NaturalizeDither/NaturalizeDither.h index 47044a992..6692763d8 100755 --- a/plugins/WinVST/NaturalizeDither/NaturalizeDither.h +++ b/plugins/WinVST/NaturalizeDither/NaturalizeDither.h @@ -53,7 +53,8 @@ private: double bynL[13]; double bynR[13]; - + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp index 8325a9f0e..04f45e9b1 100755 --- a/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp +++ b/plugins/WinVST/NaturalizeDither/NaturalizeDitherProc.cpp @@ -36,11 +36,11 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -195,6 +195,10 @@ void NaturalizeDither::processReplacing(float **inputs, float **outputs, VstInt3 inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -234,11 +238,11 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, if (inputSampleL > 0) inputSampleL += (0.3333333333); if (inputSampleL < 0) inputSampleL -= (0.3333333333); - inputSampleL += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleL += (double(fpdL)/UINT32_MAX)*0.6666666666; if (inputSampleR > 0) inputSampleR += (0.3333333333); if (inputSampleR < 0) inputSampleR -= (0.3333333333); - inputSampleR += (double(fpd)/UINT32_MAX)*0.6666666666; + inputSampleR += (double(fpdR)/UINT32_MAX)*0.6666666666; //begin L benfordize = floor(inputSampleL); @@ -393,6 +397,10 @@ void NaturalizeDither::processDoubleReplacing(double **inputs, double **outputs, inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Neverland/Neverland.cpp b/plugins/WinVST/Neverland/Neverland.cpp index fae1d9216..2af42daa3 100755 --- a/plugins/WinVST/Neverland/Neverland.cpp +++ b/plugins/WinVST/Neverland/Neverland.cpp @@ -19,7 +19,8 @@ Neverland::Neverland(audioMasterCallback audioMaster) : for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Neverland/Neverland.h b/plugins/WinVST/Neverland/Neverland.h index fbddcebb7..03c03f45b 100755 --- a/plugins/WinVST/Neverland/Neverland.h +++ b/plugins/WinVST/Neverland/Neverland.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Neverland/NeverlandProc.cpp b/plugins/WinVST/Neverland/NeverlandProc.cpp index 26ed2c176..f2224b6ea 100755 --- a/plugins/WinVST/Neverland/NeverlandProc.cpp +++ b/plugins/WinVST/Neverland/NeverlandProc.cpp @@ -156,11 +156,11 @@ void Neverland::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleR += (bR[33] * (0.00555223929714115 - (0.00030319367948553*fabs(bR[33])))); //we apply the first samples of the Neve impulse- dynamically adjusted. } - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdL)/UINT32_MAX)*0.034); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdR)/UINT32_MAX)*0.034); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -332,11 +332,11 @@ void Neverland::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleR += (bR[33] * (0.00555223929714115 - (0.00030319367948553*fabs(bR[33])))); //we apply the first samples of the Neve impulse- dynamically adjusted. } - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdL)/UINT32_MAX)*0.034); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.034); + randy = ((double(fpdR)/UINT32_MAX)*0.034); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/Nikola/Nikola.cpp b/plugins/WinVST/Nikola/Nikola.cpp index 6938af08c..db76154df 100755 --- a/plugins/WinVST/Nikola/Nikola.cpp +++ b/plugins/WinVST/Nikola/Nikola.cpp @@ -23,7 +23,8 @@ Nikola::Nikola(audioMasterCallback audioMaster) : outlevelR = 0.0; framenumberR = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Nikola/Nikola.h b/plugins/WinVST/Nikola/Nikola.h index c9c88a4ba..7170189ac 100755 --- a/plugins/WinVST/Nikola/Nikola.h +++ b/plugins/WinVST/Nikola/Nikola.h @@ -61,7 +61,8 @@ private: bool WasNegativeR; double outlevelR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/NodeDither/NodeDither.h b/plugins/WinVST/NodeDither/NodeDither.h index 240a8d961..bfd641309 100755 --- a/plugins/WinVST/NodeDither/NodeDither.h +++ b/plugins/WinVST/NodeDither/NodeDither.h @@ -57,6 +57,8 @@ private: double dR[5000]; int gcount; //default stuff + uint32_t fpdL; + uint32_t fpdR; float A; float B; diff --git a/plugins/WinVST/NodeDither/NodeDitherProc.cpp b/plugins/WinVST/NodeDither/NodeDitherProc.cpp index f934c763f..3dc70a685 100755 --- a/plugins/WinVST/NodeDither/NodeDitherProc.cpp +++ b/plugins/WinVST/NodeDither/NodeDitherProc.cpp @@ -43,10 +43,10 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp if (gcount < 0 || gcount > 2450) {gcount = 2450;} - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; if (phase == 1) { @@ -71,6 +71,10 @@ void NodeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -117,10 +121,10 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn if (gcount < 0 || gcount > 2450) {gcount = 2450;} - currentDitherL = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); inputSampleL += currentDitherL; - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleR += currentDitherR; if (phase == 1) { @@ -145,6 +149,10 @@ void NodeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= 8388608.0; inputSampleR /= 8388608.0; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Noise/NoiseProc.cpp b/plugins/WinVST/Noise/NoiseProc.cpp index bc268c0ff..0dbe5c6d2 100755 --- a/plugins/WinVST/Noise/NoiseProc.cpp +++ b/plugins/WinVST/Noise/NoiseProc.cpp @@ -118,12 +118,12 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (surgeL 1.0) surgeL = 1.0; } else { - surgeL -= ((double(fpd)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); + surgeL -= ((double(fpdL)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); if (surgeL < 0.0) surgeL = 0.0; } @@ -134,12 +134,12 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra if (surgeR 1.0) surgeR = 1.0; } else { - surgeR -= ((double(fpd)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); + surgeR -= ((double(fpdR)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); if (surgeR < 0.0) surgeR = 0.0; } @@ -172,11 +172,13 @@ void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra else {flipR = false;} } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); if (filterflip) { @@ -388,12 +390,12 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (surgeL 1.0) surgeL = 1.0; } else { - surgeL -= ((double(fpd)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); + surgeL -= ((double(fpdL)/UINT32_MAX)*(surgeL-fabs(inputSampleL))*decay); if (surgeL < 0.0) surgeL = 0.0; } @@ -404,12 +406,12 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (surgeR 1.0) surgeR = 1.0; } else { - surgeR -= ((double(fpd)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); + surgeR -= ((double(fpdR)/UINT32_MAX)*(surgeR-fabs(inputSampleR))*decay); if (surgeR < 0.0) surgeR = 0.0; } @@ -442,11 +444,13 @@ void Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s else {flipR = false;} } + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); if (filterflip) { diff --git a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h index d27f0cc5c..81fe49f8d 100755 --- a/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h +++ b/plugins/WinVST/NotJustAnotherCD/NotJustAnotherCD.h @@ -55,6 +55,8 @@ private: double bynR[13]; double noiseShapingL; double noiseShapingR; + uint32_t fpdL; + uint32_t fpdR; }; diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.cpp b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.cpp index e90337260..6213b6228 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.cpp +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.cpp @@ -14,7 +14,8 @@ NotJustAnotherDither::NotJustAnotherDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; bynL[0] = 1000; bynL[1] = 301; bynL[2] = 176; diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h index 184a9269e..e0a1402a8 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDither.h @@ -57,7 +57,8 @@ private: double bynR[13]; double noiseShapingL; double noiseShapingR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp index 7e38de75c..f9721a726 100755 --- a/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp +++ b/plugins/WinVST/NotJustAnotherDither/NotJustAnotherDitherProc.cpp @@ -31,10 +31,10 @@ void NotJustAnotherDither::processReplacing(float **inputs, float **outputs, Vst { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -185,10 +185,10 @@ void NotJustAnotherDither::processDoubleReplacing(double **inputs, double **outp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/WinVST/PaulDither/PaulDither.cpp b/plugins/WinVST/PaulDither/PaulDither.cpp index f9a8de8b7..dc7aaeb6d 100755 --- a/plugins/WinVST/PaulDither/PaulDither.cpp +++ b/plugins/WinVST/PaulDither/PaulDither.cpp @@ -14,7 +14,8 @@ PaulDither::PaulDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; previousDitherL = 0.0; previousDitherR = 0.0; //this is reset: values being initialized only once. Startup values, whatever they are. diff --git a/plugins/WinVST/PaulDither/PaulDither.h b/plugins/WinVST/PaulDither/PaulDither.h index 00bdaf597..62f360514 100755 --- a/plugins/WinVST/PaulDither/PaulDither.h +++ b/plugins/WinVST/PaulDither/PaulDither.h @@ -55,7 +55,8 @@ private: double previousDitherL; double previousDitherR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/PaulDither/PaulDitherProc.cpp b/plugins/WinVST/PaulDither/PaulDitherProc.cpp index b7e2b2fb9..366455123 100755 --- a/plugins/WinVST/PaulDither/PaulDitherProc.cpp +++ b/plugins/WinVST/PaulDither/PaulDitherProc.cpp @@ -33,17 +33,17 @@ void PaulDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -105,17 +105,17 @@ void PaulDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; diff --git a/plugins/WinVST/PaulWide/PaulWide.cpp b/plugins/WinVST/PaulWide/PaulWide.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PaulWide/PaulWide.h b/plugins/WinVST/PaulWide/PaulWide.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PaulWide/PaulWideProc.cpp b/plugins/WinVST/PaulWide/PaulWideProc.cpp old mode 100644 new mode 100755 index fe0e52a9a..0f165a3c5 --- a/plugins/WinVST/PaulWide/PaulWideProc.cpp +++ b/plugins/WinVST/PaulWide/PaulWideProc.cpp @@ -46,34 +46,37 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - double currentDither = (double(fpd)/UINT32_MAX); + double currentDither = (double(fpdL)/UINT32_MAX); double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises - currentDither = (double(fpd)/UINT32_MAX); + currentDither = (double(fpdR)/UINT32_MAX); double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + currentDither = (double(fpdR)/UINT32_MAX); ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; @@ -85,6 +88,10 @@ void PaulWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -134,34 +141,37 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 //away from the previous one - this gives you the triangular PDF and the //filtering in one go :-) - double currentDither = (double(fpd)/UINT32_MAX); + double currentDither = (double(fpdL)/UINT32_MAX); double ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; //TPDF: two 0-1 random noises - currentDither = (double(fpd)/UINT32_MAX); + currentDither = (double(fpdR)/UINT32_MAX); double ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + currentDither = (double(fpdR)/UINT32_MAX); ditherR = currentDither; ditherR -= previousDitherR; previousDitherR = currentDither; } if (fabs(ditherL-ditherR) < 0.5) { - currentDither = (double(fpd)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + currentDither = (double(fpdL)/UINT32_MAX); ditherL = currentDither; ditherL -= previousDitherL; previousDitherL = currentDither; @@ -173,6 +183,10 @@ void PaulWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/PeaksOnly/PeaksOnly.cpp b/plugins/WinVST/PeaksOnly/PeaksOnly.cpp index 73fd7bacc..bca880912 100755 --- a/plugins/WinVST/PeaksOnly/PeaksOnly.cpp +++ b/plugins/WinVST/PeaksOnly/PeaksOnly.cpp @@ -14,7 +14,8 @@ PeaksOnly::PeaksOnly(audioMasterCallback audioMaster) : { for(int count = 0; count < 1502; count++) {aL[count] = 0.0; bL[count] = 0.0; cL[count] = 0.0; dL[count] = 0.0;aR[count] = 0.0; bR[count] = 0.0; cR[count] = 0.0; dR[count] = 0.0;} ax = 1; bx = 1; cx = 1; dx = 1; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PeaksOnly/PeaksOnly.h b/plugins/WinVST/PeaksOnly/PeaksOnly.h index f7b0eceb1..f17716230 100755 --- a/plugins/WinVST/PeaksOnly/PeaksOnly.h +++ b/plugins/WinVST/PeaksOnly/PeaksOnly.h @@ -49,7 +49,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double aL[1503]; diff --git a/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp index 7288502cb..73e9b1254 100755 --- a/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp +++ b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp @@ -93,8 +93,8 @@ void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleR *= 4.0; if (wet < 1.0) { - inputSampleL = (drySampleL * dry)+(inputSampleL * wet); - inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL * wet); + inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR * wet); } //begin 32 bit stereo floating point dither @@ -201,8 +201,8 @@ void PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= 4.0; if (wet < 1.0) { - inputSampleL = (drySampleL * dry)+(inputSampleL * wet); - inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL * wet); + inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR * wet); } //begin 64 bit stereo floating point dither diff --git a/plugins/WinVST/PitchDelay/PitchDelay.cpp b/plugins/WinVST/PitchDelay/PitchDelay.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PitchDelay/PitchDelay.h b/plugins/WinVST/PitchDelay/PitchDelay.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PitchDelay/PitchDelayProc.cpp b/plugins/WinVST/PitchDelay/PitchDelayProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PocketVerbs/PocketVerbs.cpp b/plugins/WinVST/PocketVerbs/PocketVerbs.cpp index f4102466c..3c6332d41 100755 --- a/plugins/WinVST/PocketVerbs/PocketVerbs.cpp +++ b/plugins/WinVST/PocketVerbs/PocketVerbs.cpp @@ -191,7 +191,8 @@ PocketVerbs::PocketVerbs(audioMasterCallback audioMaster) : countdown = -1; peakL = 1.0; peakR = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PocketVerbs/PocketVerbs.h b/plugins/WinVST/PocketVerbs/PocketVerbs.h index 7feaf8e91..3cdc9379c 100755 --- a/plugins/WinVST/PocketVerbs/PocketVerbs.h +++ b/plugins/WinVST/PocketVerbs/PocketVerbs.h @@ -282,7 +282,8 @@ private: double peakL; double peakR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Podcast/Podcast.cpp b/plugins/WinVST/Podcast/Podcast.cpp index decf86e4d..1a7edc51c 100755 --- a/plugins/WinVST/Podcast/Podcast.cpp +++ b/plugins/WinVST/Podcast/Podcast.cpp @@ -18,7 +18,8 @@ Podcast::Podcast(audioMasterCallback audioMaster) : c1L = 2.0; c2L = 2.0; c3L = 2.0; c4L = 2.0; c5L = 2.0; //startup comp gains c1R = 2.0; c2R = 2.0; c3R = 2.0; c4R = 2.0; c5R = 2.0; //startup comp gains - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Podcast/Podcast.h b/plugins/WinVST/Podcast/Podcast.h index f99b6c1e4..f753ffb25 100755 --- a/plugins/WinVST/Podcast/Podcast.h +++ b/plugins/WinVST/Podcast/Podcast.h @@ -53,7 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double c1L; double c2L; diff --git a/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.cpp b/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.cpp old mode 100644 new mode 100755 index 6765486f7..a410bc2f0 --- a/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.cpp +++ b/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.cpp @@ -32,7 +32,8 @@ PodcastDeluxe::PodcastDeluxe(audioMasterCallback audioMaster) : maxdelay1 = 9001; maxdelay2 = 9001; maxdelay3 = 9001; maxdelay4 = 9001; maxdelay5 = 9001; c1R = 2.0; c2R = 2.0; c3R = 2.0; c4R = 2.0; c5R = 2.0; //startup comp gains - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.h b/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.h old mode 100644 new mode 100755 index 59445c43f..78e81f9c7 --- a/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.h +++ b/plugins/WinVST/PodcastDeluxe/PodcastDeluxe.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double d1L[503]; diff --git a/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp b/plugins/WinVST/PodcastDeluxe/PodcastDeluxeProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Pop/Pop.cpp b/plugins/WinVST/Pop/Pop.cpp index a48aea872..55903d7f0 100755 --- a/plugins/WinVST/Pop/Pop.cpp +++ b/plugins/WinVST/Pop/Pop.cpp @@ -15,7 +15,8 @@ Pop::Pop(audioMasterCallback audioMaster) : A = 0.3; B = 1.0; C = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; for(int count = 0; count < 10000; count++) {dL[count] = 0; dR[count] = 0;} delay = 0; diff --git a/plugins/WinVST/Pop/PopProc.cpp b/plugins/WinVST/Pop/PopProc.cpp index 8ddfd5490..2186f06fb 100755 --- a/plugins/WinVST/Pop/PopProc.cpp +++ b/plugins/WinVST/Pop/PopProc.cpp @@ -237,11 +237,11 @@ void Pop::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrame //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -483,12 +483,12 @@ void Pop::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sam } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PowerSag2/PowerSag2.cpp b/plugins/WinVST/PowerSag2/PowerSag2.cpp index 2e68a9376..cd6430a4b 100755 --- a/plugins/WinVST/PowerSag2/PowerSag2.cpp +++ b/plugins/WinVST/PowerSag2/PowerSag2.cpp @@ -20,7 +20,8 @@ PowerSag2::PowerSag2(audioMasterCallback audioMaster) : A = 0.3; B = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PowerSag2/PowerSag2.h b/plugins/WinVST/PowerSag2/PowerSag2.h index 8d347009a..b85beb050 100755 --- a/plugins/WinVST/PowerSag2/PowerSag2.h +++ b/plugins/WinVST/PowerSag2/PowerSag2.h @@ -59,7 +59,8 @@ private: double controlR; int gcount; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Precious/Precious.cpp b/plugins/WinVST/Precious/Precious.cpp index 78a045cf8..c2ed1d7c7 100755 --- a/plugins/WinVST/Precious/Precious.cpp +++ b/plugins/WinVST/Precious/Precious.cpp @@ -18,7 +18,8 @@ Precious::Precious(audioMasterCallback audioMaster) : D = 1.0; for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;} lastSampleR = 0.0;lastSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Precious/Precious.h b/plugins/WinVST/Precious/Precious.h index 07954a26f..36f51a058 100755 --- a/plugins/WinVST/Precious/Precious.h +++ b/plugins/WinVST/Precious/Precious.h @@ -59,7 +59,8 @@ private: double lastSampleR; double bL[35]; double lastSampleL; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Precious/PreciousProc.cpp b/plugins/WinVST/Precious/PreciousProc.cpp index e06ba2f3a..ed37b906a 100755 --- a/plugins/WinVST/Precious/PreciousProc.cpp +++ b/plugins/WinVST/Precious/PreciousProc.cpp @@ -158,11 +158,11 @@ void Precious::processReplacing(float **inputs, float **outputs, VstInt32 sample } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdL)/UINT32_MAX)*0.017); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdR)/UINT32_MAX)*0.017); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; @@ -337,11 +337,11 @@ void Precious::processDoubleReplacing(double **inputs, double **outputs, VstInt3 } //otherwise we leave it untouched by the overdrive stuff - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdL)/UINT32_MAX)*0.017); inputSampleL = ((inputSampleL*(1-randy))+(lastSampleL*randy)) * outlevel; lastSampleL = inputSampleL; - randy = ((double(fpd)/UINT32_MAX)*0.017); + randy = ((double(fpdR)/UINT32_MAX)*0.017); inputSampleR = ((inputSampleR*(1-randy))+(lastSampleR*randy)) * outlevel; lastSampleR = inputSampleR; diff --git a/plugins/WinVST/Pressure5/Pressure5.cpp b/plugins/WinVST/Pressure5/Pressure5.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Pressure5/Pressure5.h b/plugins/WinVST/Pressure5/Pressure5.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Pressure5/Pressure5Proc.cpp b/plugins/WinVST/Pressure5/Pressure5Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/PurestAir/PurestAir.cpp b/plugins/WinVST/PurestAir/PurestAir.cpp index 66e9e4d72..cd9734ccc 100755 --- a/plugins/WinVST/PurestAir/PurestAir.cpp +++ b/plugins/WinVST/PurestAir/PurestAir.cpp @@ -25,7 +25,8 @@ PurestAir::PurestAir(audioMasterCallback audioMaster) : lastSampleR = 0.0; s1R = s2R = s3R = 0.0; applyR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestAir/PurestAir.h b/plugins/WinVST/PurestAir/PurestAir.h index d077af8c5..3cff79445 100755 --- a/plugins/WinVST/PurestAir/PurestAir.h +++ b/plugins/WinVST/PurestAir/PurestAir.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double last1SampleL; double halfwaySampleL; diff --git a/plugins/WinVST/PurestFade/PurestFade.cpp b/plugins/WinVST/PurestFade/PurestFade.cpp index b86eea6b7..1ed241db4 100755 --- a/plugins/WinVST/PurestFade/PurestFade.cpp +++ b/plugins/WinVST/PurestFade/PurestFade.cpp @@ -18,7 +18,8 @@ PurestFade::PurestFade(audioMasterCallback audioMaster) : settingchase = -90.0; gainBchase = -90.0; chasespeed = 350.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestFade/PurestFade.h b/plugins/WinVST/PurestFade/PurestFade.h index d107d1bd9..2a3540af6 100755 --- a/plugins/WinVST/PurestFade/PurestFade.h +++ b/plugins/WinVST/PurestFade/PurestFade.h @@ -53,7 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double gainchase; double settingchase; diff --git a/plugins/WinVST/PurestFade/PurestFadeProc.cpp b/plugins/WinVST/PurestFade/PurestFadeProc.cpp index 8dcd957fd..eca9d83ce 100755 --- a/plugins/WinVST/PurestFade/PurestFadeProc.cpp +++ b/plugins/WinVST/PurestFade/PurestFadeProc.cpp @@ -79,11 +79,11 @@ void PurestFade::processReplacing(float **inputs, float **outputs, VstInt32 samp //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; @@ -166,12 +166,12 @@ void PurestFade::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleR *= outputgain; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PurestGain/PurestGainProc.cpp b/plugins/WinVST/PurestGain/PurestGainProc.cpp index 2ca5b8478..1bb58d727 100755 --- a/plugins/WinVST/PurestGain/PurestGainProc.cpp +++ b/plugins/WinVST/PurestGain/PurestGainProc.cpp @@ -84,14 +84,14 @@ void PurestGain::processReplacing(float **inputs, float **outputs, VstInt32 samp } else { inputSampleL *= outputgain; inputSampleR *= outputgain; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; } @@ -174,16 +174,14 @@ void PurestGain::processDoubleReplacing(double **inputs, double **outputs, VstIn } else { inputSampleL *= outputgain; inputSampleR *= outputgain; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither *out1 = inputSampleL; *out2 = inputSampleR; } diff --git a/plugins/WinVST/PurestSquish/PurestSquish.cpp b/plugins/WinVST/PurestSquish/PurestSquish.cpp index 1ea9b70fe..e165860c5 100755 --- a/plugins/WinVST/PurestSquish/PurestSquish.cpp +++ b/plugins/WinVST/PurestSquish/PurestSquish.cpp @@ -64,7 +64,8 @@ PurestSquish::PurestSquish(audioMasterCallback audioMaster) : count = 1; fpFlip = true; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/PurestSquish/PurestSquishProc.cpp b/plugins/WinVST/PurestSquish/PurestSquishProc.cpp index e763aa5ce..48ccc6d3a 100755 --- a/plugins/WinVST/PurestSquish/PurestSquishProc.cpp +++ b/plugins/WinVST/PurestSquish/PurestSquishProc.cpp @@ -460,11 +460,11 @@ void PurestSquish::processReplacing(float **inputs, float **outputs, VstInt32 sa //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -929,12 +929,12 @@ void PurestSquish::processDoubleReplacing(double **inputs, double **outputs, Vst } //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/PurestWarm/PurestWarmProc.cpp b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp index b34bfb596..9039bbcca 100755 --- a/plugins/WinVST/PurestWarm/PurestWarmProc.cpp +++ b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp @@ -32,52 +32,52 @@ void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 samp if (inputSampleL < 0) { inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } if (inputSampleR < 0) { inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } } else { if (inputSampleL > 0) { inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } if (inputSampleR > 0) { inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; - //stereo 32 bit dither, made small and tidy. + //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 32 bit dither + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); + //end 32 bit stereo floating point dither } } //that's it. Only applies on one half of the waveform, other half is passthrough untouched. @@ -117,60 +117,52 @@ void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstIn if (inputSampleL < 0) { inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } if (inputSampleR < 0) { inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } } else { if (inputSampleL > 0) { inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } if (inputSampleR > 0) { inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; - //stereo 64 bit dither, made small and tidy. - int expon; frexp((double)inputSampleL, &expon); - double dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleL += (dither-fpNShapeL); fpNShapeL = dither; - frexp((double)inputSampleR, &expon); - dither = (rand()/(RAND_MAX*7.737125245533627e+25))*pow(2,expon+62); - dither /= 536870912.0; //needs this to scale to 64 bit zone - inputSampleR += (dither-fpNShapeR); fpNShapeR = dither; - //end 64 bit dither + //begin 64 bit stereo floating point dither + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //end 64 bit stereo floating point dither } } //that's it. Only applies on one half of the waveform, other half is passthrough untouched. diff --git a/plugins/WinVST/RawGlitters/RawGlitters.cpp b/plugins/WinVST/RawGlitters/RawGlitters.cpp index cdd0c545f..262b4122c 100755 --- a/plugins/WinVST/RawGlitters/RawGlitters.cpp +++ b/plugins/WinVST/RawGlitters/RawGlitters.cpp @@ -14,7 +14,8 @@ RawGlitters::RawGlitters(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; lastSampleL = 0.0; lastSample2L = 0.0; lastSampleR = 0.0; diff --git a/plugins/WinVST/RawGlitters/RawGlitters.h b/plugins/WinVST/RawGlitters/RawGlitters.h index 7c43c675a..8ff9806d1 100755 --- a/plugins/WinVST/RawGlitters/RawGlitters.h +++ b/plugins/WinVST/RawGlitters/RawGlitters.h @@ -57,7 +57,8 @@ private: double lastSample2L; double lastSampleR; double lastSample2R; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/RawGlitters/RawGlittersProc.cpp b/plugins/WinVST/RawGlitters/RawGlittersProc.cpp index a4414634e..c98e0f6cb 100755 --- a/plugins/WinVST/RawGlitters/RawGlittersProc.cpp +++ b/plugins/WinVST/RawGlitters/RawGlittersProc.cpp @@ -29,10 +29,10 @@ void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sam { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -86,10 +86,10 @@ void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstI { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/WinVST/RawTimbers/RawTimbers.cpp b/plugins/WinVST/RawTimbers/RawTimbers.cpp index da85dbaf2..9b0093a23 100755 --- a/plugins/WinVST/RawTimbers/RawTimbers.cpp +++ b/plugins/WinVST/RawTimbers/RawTimbers.cpp @@ -14,7 +14,8 @@ RawTimbers::RawTimbers(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; lastSampleL = 0.0; lastSample2L = 0.0; lastSampleR = 0.0; diff --git a/plugins/WinVST/RawTimbers/RawTimbers.h b/plugins/WinVST/RawTimbers/RawTimbers.h index 9aea03dec..15311f058 100755 --- a/plugins/WinVST/RawTimbers/RawTimbers.h +++ b/plugins/WinVST/RawTimbers/RawTimbers.h @@ -57,7 +57,8 @@ private: double lastSample2L; double lastSampleR; double lastSample2R; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/RawTimbers/RawTimbersProc.cpp b/plugins/WinVST/RawTimbers/RawTimbersProc.cpp index 0a1b401c3..626a3c84a 100755 --- a/plugins/WinVST/RawTimbers/RawTimbersProc.cpp +++ b/plugins/WinVST/RawTimbers/RawTimbersProc.cpp @@ -30,10 +30,10 @@ void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; @@ -89,10 +89,10 @@ void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; diff --git a/plugins/WinVST/Recurve/Recurve.cpp b/plugins/WinVST/Recurve/Recurve.cpp index a669540a9..8d8f1f0dc 100755 --- a/plugins/WinVST/Recurve/Recurve.cpp +++ b/plugins/WinVST/Recurve/Recurve.cpp @@ -13,7 +13,8 @@ Recurve::Recurve(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { gain = 2.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Recurve/Recurve.h b/plugins/WinVST/Recurve/Recurve.h index bb90e4bac..9a7875836 100755 --- a/plugins/WinVST/Recurve/Recurve.h +++ b/plugins/WinVST/Recurve/Recurve.h @@ -52,7 +52,8 @@ private: std::set< std::string > _canDo; double gain; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Remap/Remap.cpp b/plugins/WinVST/Remap/Remap.cpp index b4663c529..99b46e0ca 100755 --- a/plugins/WinVST/Remap/Remap.cpp +++ b/plugins/WinVST/Remap/Remap.cpp @@ -15,7 +15,8 @@ Remap::Remap(audioMasterCallback audioMaster) : A = 0.5; B = 1.0; C = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Remap/Remap.h b/plugins/WinVST/Remap/Remap.h index 3442cba12..cd5a901e9 100755 --- a/plugins/WinVST/Remap/Remap.h +++ b/plugins/WinVST/Remap/Remap.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ResEQ/ResEQ.cpp b/plugins/WinVST/ResEQ/ResEQ.cpp old mode 100644 new mode 100755 index feffbda53..ad7c8782f --- a/plugins/WinVST/ResEQ/ResEQ.cpp +++ b/plugins/WinVST/ResEQ/ResEQ.cpp @@ -26,7 +26,8 @@ ResEQ::ResEQ(audioMasterCallback audioMaster) : bR[count] = 0.0; fR[count] = 0.0; } framenumber = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ResEQ/ResEQ.h b/plugins/WinVST/ResEQ/ResEQ.h old mode 100644 new mode 100755 index 346175195..59e973560 --- a/plugins/WinVST/ResEQ/ResEQ.h +++ b/plugins/WinVST/ResEQ/ResEQ.h @@ -60,7 +60,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double bL[61]; diff --git a/plugins/WinVST/ResEQ/ResEQProc.cpp b/plugins/WinVST/ResEQ/ResEQProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Slew/Slew.cpp b/plugins/WinVST/Slew/Slew.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Slew/Slew.h b/plugins/WinVST/Slew/Slew.h old mode 100644 new mode 100755 index 29d091639..c78cae48d --- a/plugins/WinVST/Slew/Slew.h +++ b/plugins/WinVST/Slew/Slew.h @@ -74,6 +74,8 @@ private: float gain; double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/Slew/SlewProc.cpp b/plugins/WinVST/Slew/SlewProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Slew2/Slew2.h b/plugins/WinVST/Slew2/Slew2.h index c57161f5b..f2e323a84 100755 --- a/plugins/WinVST/Slew2/Slew2.h +++ b/plugins/WinVST/Slew2/Slew2.h @@ -88,6 +88,9 @@ private: double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; + float A; }; diff --git a/plugins/WinVST/Slew3/Slew3.cpp b/plugins/WinVST/Slew3/Slew3.cpp index 5bf29f586..96ce3829c 100755 --- a/plugins/WinVST/Slew3/Slew3.cpp +++ b/plugins/WinVST/Slew3/Slew3.cpp @@ -15,7 +15,8 @@ Slew3::Slew3(audioMasterCallback audioMaster) : A = 0.0; lastSampleAL = lastSampleBL = lastSampleCL = 0.0; lastSampleAR = lastSampleBR = lastSampleCR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Slew3/Slew3.h b/plugins/WinVST/Slew3/Slew3.h index e16347ca8..fd14c2a8c 100755 --- a/plugins/WinVST/Slew3/Slew3.h +++ b/plugins/WinVST/Slew3/Slew3.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/SlewOnly/SlewOnly.h b/plugins/WinVST/SlewOnly/SlewOnly.h index 0c2d666bc..f4ab7bb8a 100755 --- a/plugins/WinVST/SlewOnly/SlewOnly.h +++ b/plugins/WinVST/SlewOnly/SlewOnly.h @@ -51,6 +51,8 @@ private: double lastSampleL; double lastSampleR; + uint32_t fpdL; + uint32_t fpdR; }; #endif diff --git a/plugins/WinVST/Smooth/Smooth.cpp b/plugins/WinVST/Smooth/Smooth.cpp index 6509d2aeb..e134523b8 100755 --- a/plugins/WinVST/Smooth/Smooth.cpp +++ b/plugins/WinVST/Smooth/Smooth.cpp @@ -38,7 +38,8 @@ Smooth::Smooth(audioMasterCallback audioMaster) : lastSampleER = 0.0; gainER = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Smooth/Smooth.h b/plugins/WinVST/Smooth/Smooth.h index a9c3e5b24..15bca6583 100755 --- a/plugins/WinVST/Smooth/Smooth.h +++ b/plugins/WinVST/Smooth/Smooth.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double lastSampleAL; double gainAL; diff --git a/plugins/WinVST/SoftGate/SoftGate.cpp b/plugins/WinVST/SoftGate/SoftGate.cpp index 4db4f8f2f..6fd4a52a3 100755 --- a/plugins/WinVST/SoftGate/SoftGate.cpp +++ b/plugins/WinVST/SoftGate/SoftGate.cpp @@ -20,7 +20,8 @@ SoftGate::SoftGate(audioMasterCallback audioMaster) : storedR[0] = storedR[1] = 0.0; diffR = 0.0; gate = 1.1; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/SoftGate/SoftGate.h b/plugins/WinVST/SoftGate/SoftGate.h index 51daf4827..153392e59 100755 --- a/plugins/WinVST/SoftGate/SoftGate.h +++ b/plugins/WinVST/SoftGate/SoftGate.h @@ -54,7 +54,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double storedL[2]; double diffL; diff --git a/plugins/WinVST/SpatializeDither/SpatializeDither.cpp b/plugins/WinVST/SpatializeDither/SpatializeDither.cpp index e4ebc5549..f145ddd43 100755 --- a/plugins/WinVST/SpatializeDither/SpatializeDither.cpp +++ b/plugins/WinVST/SpatializeDither/SpatializeDither.cpp @@ -14,7 +14,8 @@ SpatializeDither::SpatializeDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; contingentErrL = 0.0; contingentErrR = 0.0; flip = false; diff --git a/plugins/WinVST/SpatializeDither/SpatializeDither.h b/plugins/WinVST/SpatializeDither/SpatializeDither.h index 2ffd6c0b0..2805c4ed4 100755 --- a/plugins/WinVST/SpatializeDither/SpatializeDither.h +++ b/plugins/WinVST/SpatializeDither/SpatializeDither.h @@ -56,7 +56,8 @@ private: double contingentErrL; double contingentErrR; bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp b/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp index 8e4a75591..9b1e135f7 100755 --- a/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp +++ b/plugins/WinVST/SpatializeDither/SpatializeDitherProc.cpp @@ -36,10 +36,8 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -51,7 +49,10 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -65,7 +66,10 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -88,6 +92,10 @@ void SpatializeDither::processReplacing(float **inputs, float **outputs, VstInt3 inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -127,10 +135,8 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -142,7 +148,10 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, if (inputSampleR < 0) inputSampleR -= 0.383; //adjusting to permit more information drug outta the noisefloor - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + contingentRnd += ((double(fpdL)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrL*omegaConstant; //include err absSample = fabs(inputSampleL); contingentErrL = absSample - floor(absSample); //get next err @@ -156,7 +165,10 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, //Contingent Dither inputSampleL = floor(inputSampleL); - contingentRnd = (((double(fpd)/UINT32_MAX)+(double(fpd)/UINT32_MAX))-1.0) * randyConstant; //produce TPDF dist, scale + contingentRnd = (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + contingentRnd += ((double(fpdR)/UINT32_MAX)-1.0); + contingentRnd *= randyConstant; //produce TPDF dist, scale contingentRnd -= contingentErrR*omegaConstant; //include err absSample = fabs(inputSampleR); contingentErrR = absSample - floor(absSample); //get next err @@ -179,6 +191,10 @@ void SpatializeDither::processDoubleReplacing(double **inputs, double **outputs, inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Spiral/Spiral.cpp b/plugins/WinVST/Spiral/Spiral.cpp index 88106caf6..11ef632c0 100755 --- a/plugins/WinVST/Spiral/Spiral.cpp +++ b/plugins/WinVST/Spiral/Spiral.cpp @@ -12,7 +12,8 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new S Spiral::Spiral(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Spiral/SpiralProc.cpp b/plugins/WinVST/Spiral/SpiralProc.cpp index d06e261e1..2401ee59c 100755 --- a/plugins/WinVST/Spiral/SpiralProc.cpp +++ b/plugins/WinVST/Spiral/SpiralProc.cpp @@ -29,11 +29,11 @@ void Spiral::processReplacing(float **inputs, float **outputs, VstInt32 sampleFr //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -67,12 +67,12 @@ void Spiral::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((fabs(inputSampleR) == 0.0) ?1:fabs(inputSampleR)); //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Spiral2/Spiral2.cpp b/plugins/WinVST/Spiral2/Spiral2.cpp index 4d1f8bb1e..1211da49e 100755 --- a/plugins/WinVST/Spiral2/Spiral2.cpp +++ b/plugins/WinVST/Spiral2/Spiral2.cpp @@ -20,7 +20,8 @@ Spiral2::Spiral2(audioMasterCallback audioMaster) : iirSampleAL = 0.0; iirSampleBL = 0.0; prevSampleL = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; iirSampleAR = 0.0; iirSampleBR = 0.0; diff --git a/plugins/WinVST/Spiral2/Spiral2Proc.cpp b/plugins/WinVST/Spiral2/Spiral2Proc.cpp index d18f357dc..18e1583b8 100755 --- a/plugins/WinVST/Spiral2/Spiral2Proc.cpp +++ b/plugins/WinVST/Spiral2/Spiral2Proc.cpp @@ -87,11 +87,11 @@ void Spiral2::processReplacing(float **inputs, float **outputs, VstInt32 sampleF //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -184,12 +184,12 @@ void Spiral2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 flip = !flip; //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Srsly/Srsly.cpp b/plugins/WinVST/Srsly/Srsly.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Srsly/Srsly.h b/plugins/WinVST/Srsly/Srsly.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Srsly/SrslyProc.cpp b/plugins/WinVST/Srsly/SrslyProc.cpp old mode 100644 new mode 100755 index 066119dac..f59ea964b --- a/plugins/WinVST/Srsly/SrslyProc.cpp +++ b/plugins/WinVST/Srsly/SrslyProc.cpp @@ -238,10 +238,10 @@ void Srsly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra *out1 = inputSampleL; *out2 = inputSampleR; - *in1++; - *in2++; - *out1++; - *out2++; + in1++; + in2++; + out1++; + out2++; } } @@ -476,9 +476,9 @@ void Srsly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s *out1 = inputSampleL; *out2 = inputSampleR; - *in1++; - *in2++; - *out1++; - *out2++; + in1++; + in2++; + out1++; + out2++; } } diff --git a/plugins/WinVST/StarChild/StarChild.cpp b/plugins/WinVST/StarChild/StarChild.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StarChild/StarChild.h b/plugins/WinVST/StarChild/StarChild.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StarChild/StarChildProc.cpp b/plugins/WinVST/StarChild/StarChildProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoChorus/StereoChorus.cpp b/plugins/WinVST/StereoChorus/StereoChorus.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoChorus/StereoChorus.h b/plugins/WinVST/StereoChorus/StereoChorus.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoChorus/StereoChorusProc.cpp b/plugins/WinVST/StereoChorus/StereoChorusProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoDoubler/StereoDoubler.cpp b/plugins/WinVST/StereoDoubler/StereoDoubler.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoDoubler/StereoDoubler.h b/plugins/WinVST/StereoDoubler/StereoDoubler.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoDoubler/StereoDoublerProc.cpp b/plugins/WinVST/StereoDoubler/StereoDoublerProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoEnsemble/StereoEnsemble.cpp b/plugins/WinVST/StereoEnsemble/StereoEnsemble.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoEnsemble/StereoEnsemble.h b/plugins/WinVST/StereoEnsemble/StereoEnsemble.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/StereoEnsemble/StereoEnsembleProc.cpp b/plugins/WinVST/StereoEnsemble/StereoEnsembleProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/SubsOnly/SubsOnly.h b/plugins/WinVST/SubsOnly/SubsOnly.h index 316a44686..f4bd2a51b 100755 --- a/plugins/WinVST/SubsOnly/SubsOnly.h +++ b/plugins/WinVST/SubsOnly/SubsOnly.h @@ -103,6 +103,9 @@ private: double iirSampleYR; double iirSampleZR; + uint32_t fpdL; + uint32_t fpdR; + }; #endif diff --git a/plugins/WinVST/Surge/SurgeProc.cpp b/plugins/WinVST/Surge/SurgeProc.cpp index b77e5a6e1..145e5237c 100755 --- a/plugins/WinVST/Surge/SurgeProc.cpp +++ b/plugins/WinVST/Surge/SurgeProc.cpp @@ -75,11 +75,11 @@ void Surge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra inputSampleL *= chaseMax; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseMax; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -167,11 +167,11 @@ void Surge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s inputSampleL *= chaseMax; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseMax; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/WinVST/SurgeTide/SurgeTideProc.cpp b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp index e2331485a..0db02fc7c 100755 --- a/plugins/WinVST/SurgeTide/SurgeTideProc.cpp +++ b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp @@ -65,11 +65,11 @@ void SurgeTide::processReplacing(float **inputs, float **outputs, VstInt32 sampl inputSampleL *= chaseC; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseC; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -148,11 +148,11 @@ void SurgeTide::processDoubleReplacing(double **inputs, double **outputs, VstInt inputSampleL *= chaseC; inputSampleL = drySampleL - (inputSampleL * intensity); - inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleL = (drySampleL * (1.0-wet)) + (inputSampleL * wet); inputSampleR *= chaseC; inputSampleR = drySampleR - (inputSampleR * intensity); - inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + inputSampleR = (drySampleR * (1.0-wet)) + (inputSampleR * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/WinVST/TPDFDither/TPDFDither.cpp b/plugins/WinVST/TPDFDither/TPDFDither.cpp index 2e8df5daa..2266f5851 100755 --- a/plugins/WinVST/TPDFDither/TPDFDither.cpp +++ b/plugins/WinVST/TPDFDither/TPDFDither.cpp @@ -14,7 +14,8 @@ TPDFDither::TPDFDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. _canDo.insert("plugAsSend"); // plug-in can be used as a send effect. diff --git a/plugins/WinVST/TPDFDither/TPDFDither.h b/plugins/WinVST/TPDFDither/TPDFDither.h index 948d68f60..a1994f15b 100755 --- a/plugins/WinVST/TPDFDither/TPDFDither.h +++ b/plugins/WinVST/TPDFDither/TPDFDither.h @@ -53,7 +53,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp b/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp index 6d333a4a0..b5b7f15bc 100755 --- a/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp +++ b/plugins/WinVST/TPDFDither/TPDFDitherProc.cpp @@ -30,10 +30,10 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -42,11 +42,12 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL -= 1.0; inputSampleR -= 1.0; - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); - - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleL = floor(inputSampleL); inputSampleR = floor(inputSampleR); @@ -55,6 +56,10 @@ void TPDFDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -88,10 +93,10 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; @@ -100,11 +105,12 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL -= 1.0; inputSampleR -= 1.0; - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); - - inputSampleL += (double(fpd)/UINT32_MAX); - inputSampleR += (double(fpd)/UINT32_MAX); + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleL += (double(fpdL)/UINT32_MAX); + inputSampleR += (double(fpdR)/UINT32_MAX); inputSampleL = floor(inputSampleL); inputSampleR = floor(inputSampleR); @@ -113,6 +119,10 @@ void TPDFDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/TPDFWide/TPDFWide.cpp b/plugins/WinVST/TPDFWide/TPDFWide.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/TPDFWide/TPDFWide.h b/plugins/WinVST/TPDFWide/TPDFWide.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/TPDFWide/TPDFWideProc.cpp b/plugins/WinVST/TPDFWide/TPDFWideProc.cpp old mode 100644 new mode 100755 index 3d63de4e4..150b4f39c --- a/plugins/WinVST/TPDFWide/TPDFWideProc.cpp +++ b/plugins/WinVST/TPDFWide/TPDFWideProc.cpp @@ -31,40 +31,43 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample double inputSampleL = *in1; double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither double ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); //TPDF: two 0-1 random noises double ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } inputSampleL = floor(inputSampleL+ditherL); @@ -73,6 +76,10 @@ void TPDFWide::processReplacing(float **inputs, float **outputs, VstInt32 sample inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -107,40 +114,43 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 double inputSampleL = *in1; double inputSampleR = *in2; if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; - fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; - fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither double ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); //TPDF: two 0-1 random noises double ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); //TPDF: two 0-1 random noises if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherR = -1.0; - ditherR += (double(fpd)/UINT32_MAX); - ditherR += (double(fpd)/UINT32_MAX); + ditherR += (double(fpdR)/UINT32_MAX); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + ditherR += (double(fpdR)/UINT32_MAX); } if (fabs(ditherL-ditherR) < 0.5) { ditherL = -1.0; - ditherL += (double(fpd)/UINT32_MAX); - ditherL += (double(fpd)/UINT32_MAX); + ditherL += (double(fpdL)/UINT32_MAX); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + ditherL += (double(fpdL)/UINT32_MAX); } inputSampleL = floor(inputSampleL+ditherL); @@ -149,6 +159,10 @@ void TPDFWide::processDoubleReplacing(double **inputs, double **outputs, VstInt3 inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/Tape/Tape.cpp b/plugins/WinVST/Tape/Tape.cpp index 8631f6bf1..1d9fbb93e 100755 --- a/plugins/WinVST/Tape/Tape.cpp +++ b/plugins/WinVST/Tape/Tape.cpp @@ -29,7 +29,8 @@ Tape::Tape(audioMasterCallback audioMaster) : flip = false; lastSampleL = 0.0; lastSampleR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Tape/Tape.h b/plugins/WinVST/Tape/Tape.h index 1ab35bd88..f25c49302 100755 --- a/plugins/WinVST/Tape/Tape.h +++ b/plugins/WinVST/Tape/Tape.h @@ -77,7 +77,8 @@ private: double lastSampleL; double lastSampleR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TapeDelay2/TapeDelay2.cpp b/plugins/WinVST/TapeDelay2/TapeDelay2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/TapeDelay2/TapeDelay2.h b/plugins/WinVST/TapeDelay2/TapeDelay2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp b/plugins/WinVST/TapeDelay2/TapeDelay2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/TapeDither/TapeDither.cpp b/plugins/WinVST/TapeDither/TapeDither.cpp index be85fcdb2..fdd04534f 100755 --- a/plugins/WinVST/TapeDither/TapeDither.cpp +++ b/plugins/WinVST/TapeDither/TapeDither.cpp @@ -14,7 +14,8 @@ TapeDither::TapeDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; previousDither1L = 0.0; previousDither2L = 0.0; previousDither3L = 0.0; diff --git a/plugins/WinVST/TapeDither/TapeDither.h b/plugins/WinVST/TapeDither/TapeDither.h index 9ec9539b9..2fec4c2eb 100755 --- a/plugins/WinVST/TapeDither/TapeDither.h +++ b/plugins/WinVST/TapeDither/TapeDither.h @@ -61,7 +61,8 @@ private: double previousDither2R; double previousDither3R; double previousDither4R; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TapeDither/TapeDitherProc.cpp b/plugins/WinVST/TapeDither/TapeDitherProc.cpp index 988bdc18a..f43301489 100755 --- a/plugins/WinVST/TapeDither/TapeDitherProc.cpp +++ b/plugins/WinVST/TapeDither/TapeDitherProc.cpp @@ -32,17 +32,17 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -65,6 +65,10 @@ void TapeDither::processReplacing(float **inputs, float **outputs, VstInt32 samp inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -101,17 +105,17 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - currentDitherL = (double(fpd)/UINT32_MAX); - currentDitherR = (double(fpd)/UINT32_MAX); + currentDitherL = (double(fpdL)/UINT32_MAX); + currentDitherR = (double(fpdR)/UINT32_MAX); inputSampleL += currentDitherL; inputSampleR += currentDitherR; @@ -134,6 +138,10 @@ void TapeDither::processDoubleReplacing(double **inputs, double **outputs, VstIn inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/ToTape5/ToTape5Proc.cpp b/plugins/WinVST/ToTape5/ToTape5Proc.cpp index 840dbd28c..f2ad65562 100755 --- a/plugins/WinVST/ToTape5/ToTape5Proc.cpp +++ b/plugins/WinVST/ToTape5/ToTape5Proc.cpp @@ -77,7 +77,7 @@ void ToTape5::processReplacing(float **inputs, float **outputs, VstInt32 sampleF drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); randy = flutterrandy * tempRandy; //for soften invrandy = (1.0-randy); randy /= 2.0; @@ -406,7 +406,7 @@ void ToTape5::processDoubleReplacing(double **inputs, double **outputs, VstInt32 drySampleR = inputSampleR; - flutterrandy = (double(fpd)/UINT32_MAX); + flutterrandy = (double(fpdL)/UINT32_MAX); randy = flutterrandy * tempRandy; //for soften invrandy = (1.0-randy); randy /= 2.0; diff --git a/plugins/WinVST/ToTape6/ToTape6.cpp b/plugins/WinVST/ToTape6/ToTape6.cpp index 741b7565e..fe39aef98 100755 --- a/plugins/WinVST/ToTape6/ToTape6.cpp +++ b/plugins/WinVST/ToTape6/ToTape6.cpp @@ -43,7 +43,8 @@ ToTape6::ToTape6(audioMasterCallback audioMaster) : lastSampleR = 0.0; flip = 0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/ToTape6/ToTape6.h b/plugins/WinVST/ToTape6/ToTape6.h index a613c4812..1f447dcc7 100755 --- a/plugins/WinVST/ToTape6/ToTape6.h +++ b/plugins/WinVST/ToTape6/ToTape6.h @@ -87,7 +87,8 @@ private: double lastSampleL; double lastSampleR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/ToTape6/ToTape6Proc.cpp b/plugins/WinVST/ToTape6/ToTape6Proc.cpp index 47f1e541a..ea7353a5a 100755 --- a/plugins/WinVST/ToTape6/ToTape6Proc.cpp +++ b/plugins/WinVST/ToTape6/ToTape6Proc.cpp @@ -66,7 +66,7 @@ void ToTape6::processReplacing(float **inputs, float **outputs, VstInt32 sampleF inputSampleR *= inputgain; } //gain cut before plugin - double flutterrandy = fpd / (double)UINT32_MAX; + double flutterrandy = (double(fpdL)/UINT32_MAX); //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (gcount < 0 || gcount > 499) {gcount = 499;} dL[gcount] = inputSampleL; @@ -400,7 +400,7 @@ void ToTape6::processDoubleReplacing(double **inputs, double **outputs, VstInt32 inputSampleR *= inputgain; } //gain cut before plugin - double flutterrandy = fpd / (double)UINT32_MAX; + double flutterrandy = (double(fpdL)/UINT32_MAX); //now we've got a random flutter, so we're messing with the pitch before tape effects go on if (gcount < 0 || gcount > 499) {gcount = 499;} dL[gcount] = inputSampleL; diff --git a/plugins/WinVST/TremoSquare/TremoSquare.cpp b/plugins/WinVST/TremoSquare/TremoSquare.cpp index e854b11ac..3bd90f485 100755 --- a/plugins/WinVST/TremoSquare/TremoSquare.cpp +++ b/plugins/WinVST/TremoSquare/TremoSquare.cpp @@ -19,7 +19,8 @@ TremoSquare::TremoSquare(audioMasterCallback audioMaster) : muteL = false; polarityR = false; muteR = false; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TremoSquare/TremoSquare.h b/plugins/WinVST/TremoSquare/TremoSquare.h index b99fc795b..afb4dbe98 100755 --- a/plugins/WinVST/TremoSquare/TremoSquare.h +++ b/plugins/WinVST/TremoSquare/TremoSquare.h @@ -58,7 +58,8 @@ private: bool muteL; bool polarityR; bool muteR; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/TripleSpread/TripleSpread.cpp b/plugins/WinVST/TripleSpread/TripleSpread.cpp index 7e4926290..c9ce7c968 100755 --- a/plugins/WinVST/TripleSpread/TripleSpread.cpp +++ b/plugins/WinVST/TripleSpread/TripleSpread.cpp @@ -51,7 +51,8 @@ TripleSpread::TripleSpread(audioMasterCallback audioMaster) : A = 0.5; B = 0.5; C = 0.5; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/TripleSpread/TripleSpread.h b/plugins/WinVST/TripleSpread/TripleSpread.h index 2ac10198d..1d2dbf5fa 100755 --- a/plugins/WinVST/TripleSpread/TripleSpread.h +++ b/plugins/WinVST/TripleSpread/TripleSpread.h @@ -99,7 +99,8 @@ private: int gcount; VstInt32 lastwidth; bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/Tube/Tube.cpp b/plugins/WinVST/Tube/Tube.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Tube/Tube.h b/plugins/WinVST/Tube/Tube.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Tube/TubeProc.cpp b/plugins/WinVST/Tube/TubeProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Tube2/Tube2.cpp b/plugins/WinVST/Tube2/Tube2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Tube2/Tube2.h b/plugins/WinVST/Tube2/Tube2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Tube2/Tube2Proc.cpp b/plugins/WinVST/Tube2/Tube2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/UltrasonX/UltrasonX.cpp b/plugins/WinVST/UltrasonX/UltrasonX.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/UltrasonX/UltrasonX.h b/plugins/WinVST/UltrasonX/UltrasonX.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/UltrasonX/UltrasonXProc.cpp b/plugins/WinVST/UltrasonX/UltrasonXProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Ultrasonic/Ultrasonic.cpp b/plugins/WinVST/Ultrasonic/Ultrasonic.cpp index e58027991..fe70912b4 100755 --- a/plugins/WinVST/Ultrasonic/Ultrasonic.cpp +++ b/plugins/WinVST/Ultrasonic/Ultrasonic.cpp @@ -13,7 +13,8 @@ Ultrasonic::Ultrasonic(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { for (int x = 0; x < 15; x++) {biquadA[x] = 0.0; biquadB[x] = 0.0; biquadC[x] = 0.0; biquadD[x] = 0.0; biquadE[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Ultrasonic/Ultrasonic.h b/plugins/WinVST/Ultrasonic/Ultrasonic.h index f853b70e2..d67457d29 100755 --- a/plugins/WinVST/Ultrasonic/Ultrasonic.h +++ b/plugins/WinVST/Ultrasonic/Ultrasonic.h @@ -59,7 +59,8 @@ private: //This is because so much of it is coefficients etc. that are the same on both channels. //So the stored samples are in 7-8-9-10 and 11-12-13-14, and freq/res/coefficients serve both. - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/UltrasonicLite/UltrasonicLite.cpp b/plugins/WinVST/UltrasonicLite/UltrasonicLite.cpp old mode 100644 new mode 100755 index cceaf217f..5f5d08cf1 --- a/plugins/WinVST/UltrasonicLite/UltrasonicLite.cpp +++ b/plugins/WinVST/UltrasonicLite/UltrasonicLite.cpp @@ -13,7 +13,8 @@ UltrasonicLite::UltrasonicLite(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { for (int x = 0; x < 15; x++) {biquadA[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/UltrasonicLite/UltrasonicLite.h b/plugins/WinVST/UltrasonicLite/UltrasonicLite.h old mode 100644 new mode 100755 index 59fd77310..a78879605 --- a/plugins/WinVST/UltrasonicLite/UltrasonicLite.h +++ b/plugins/WinVST/UltrasonicLite/UltrasonicLite.h @@ -53,7 +53,8 @@ private: double biquadA[15]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp b/plugins/WinVST/UltrasonicLite/UltrasonicLiteProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/UltrasonicMed/UltrasonicMed.cpp b/plugins/WinVST/UltrasonicMed/UltrasonicMed.cpp old mode 100644 new mode 100755 index fe2ac75a9..906bb46a6 --- a/plugins/WinVST/UltrasonicMed/UltrasonicMed.cpp +++ b/plugins/WinVST/UltrasonicMed/UltrasonicMed.cpp @@ -13,7 +13,8 @@ UltrasonicMed::UltrasonicMed(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { for (int x = 0; x < 15; x++) {biquadA[x] = 0.0;biquadB[x] = 0.0;} - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/UltrasonicMed/UltrasonicMed.h b/plugins/WinVST/UltrasonicMed/UltrasonicMed.h old mode 100644 new mode 100755 index 0a3552480..f50f4ef2a --- a/plugins/WinVST/UltrasonicMed/UltrasonicMed.h +++ b/plugins/WinVST/UltrasonicMed/UltrasonicMed.h @@ -54,7 +54,8 @@ private: double biquadA[15]; double biquadB[15]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff }; diff --git a/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp b/plugins/WinVST/UltrasonicMed/UltrasonicMedProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/UnBox/UnBox.cpp b/plugins/WinVST/UnBox/UnBox.cpp index 221f617d6..211bdb712 100755 --- a/plugins/WinVST/UnBox/UnBox.cpp +++ b/plugins/WinVST/UnBox/UnBox.cpp @@ -23,7 +23,8 @@ UnBox::UnBox(audioMasterCallback audioMaster) : iirSampleAR = 0.0; iirSampleBR = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/UnBox/UnBoxProc.cpp b/plugins/WinVST/UnBox/UnBoxProc.cpp index b50db896e..cbeae0d5e 100755 --- a/plugins/WinVST/UnBox/UnBoxProc.cpp +++ b/plugins/WinVST/UnBox/UnBoxProc.cpp @@ -187,11 +187,11 @@ void UnBox::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); frexpf((float)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 5.960464655174751e-36L * pow(2,expon+62); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62)); //end 32 bit stereo floating point dither *out1 = inputSampleL; @@ -383,12 +383,12 @@ void UnBox::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s if (output != 1.0) {inputSampleL *= output; inputSampleR *= output;} //begin 64 bit stereo floating point dither - int expon; frexp((double)inputSampleL, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleL += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); - frexp((double)inputSampleR, &expon); - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - inputSampleR += static_cast(fpd) * 1.110223024625156e-44L * pow(2,expon+62); + //int expon; frexp((double)inputSampleL, &expon); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + //inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); + //frexp((double)inputSampleR, &expon); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62)); //end 64 bit stereo floating point dither *out1 = inputSampleL; diff --git a/plugins/WinVST/Verbity/Verbity.cpp b/plugins/WinVST/Verbity/Verbity.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Verbity/Verbity.h b/plugins/WinVST/Verbity/Verbity.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Verbity/VerbityProc.cpp b/plugins/WinVST/Verbity/VerbityProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/Vibrato/Vibrato.cpp b/plugins/WinVST/Vibrato/Vibrato.cpp index 6b32cea10..9993a661d 100755 --- a/plugins/WinVST/Vibrato/Vibrato.cpp +++ b/plugins/WinVST/Vibrato/Vibrato.cpp @@ -34,7 +34,8 @@ Vibrato::Vibrato(audioMasterCallback audioMaster) : flip = false; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/Vibrato/Vibrato.h b/plugins/WinVST/Vibrato/Vibrato.h index 57ca0598c..6ad509090 100755 --- a/plugins/WinVST/Vibrato/Vibrato.h +++ b/plugins/WinVST/Vibrato/Vibrato.h @@ -72,7 +72,8 @@ private: double airFactorR; bool flip; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/VinylDither/VinylDither.cpp b/plugins/WinVST/VinylDither/VinylDither.cpp index 9123d5431..2538e55f8 100755 --- a/plugins/WinVST/VinylDither/VinylDither.cpp +++ b/plugins/WinVST/VinylDither/VinylDither.cpp @@ -14,7 +14,8 @@ VinylDither::VinylDither(audioMasterCallback audioMaster) : { A = 1.0; B = 0.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; NSOddL = 0.0; prevL = 0.0; nsL[0] = 0; diff --git a/plugins/WinVST/VinylDither/VinylDither.h b/plugins/WinVST/VinylDither/VinylDither.h index 368035053..2e1c695f9 100755 --- a/plugins/WinVST/VinylDither/VinylDither.h +++ b/plugins/WinVST/VinylDither/VinylDither.h @@ -59,7 +59,8 @@ private: double NSOddR; double prevR; double nsR[16]; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff float A; diff --git a/plugins/WinVST/VinylDither/VinylDitherProc.cpp b/plugins/WinVST/VinylDither/VinylDitherProc.cpp index 4ea1c3053..1adede36a 100755 --- a/plugins/WinVST/VinylDither/VinylDitherProc.cpp +++ b/plugins/WinVST/VinylDither/VinylDitherProc.cpp @@ -32,46 +32,59 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -87,37 +100,52 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL = floor(absSample); //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -136,6 +164,10 @@ void VinylDither::processReplacing(float **inputs, float **outputs, VstInt32 sam inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; @@ -171,46 +203,59 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI { double inputSampleL = *in1; double inputSampleR = *in2; - if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; - if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43; - fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5; + if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17; + if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17; inputSampleL *= scaleFactor; inputSampleR *= scaleFactor; //0-1 is now one bit, now we dither - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdL)/UINT32_MAX) - 0.5); nsL[0] += absSample; nsL[0] /= 2; absSample -= nsL[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[1] += absSample; nsL[1] /= 2; absSample -= nsL[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[2] += absSample; nsL[2] /= 2; absSample -= nsL[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[3] += absSample; nsL[3] /= 2; absSample -= nsL[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[4] += absSample; nsL[4] /= 2; absSample -= nsL[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[5] += absSample; nsL[5] /= 2; absSample -= nsL[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[6] += absSample; nsL[6] /= 2; absSample -= nsL[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[7] += absSample; nsL[7] /= 2; absSample -= nsL[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[8] += absSample; nsL[8] /= 2; absSample -= nsL[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[9] += absSample; nsL[9] /= 2; absSample -= nsL[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[10] += absSample; nsL[10] /= 2; absSample -= nsL[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[11] += absSample; nsL[11] /= 2; absSample -= nsL[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[12] += absSample; nsL[12] /= 2; absSample -= nsL[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[13] += absSample; nsL[13] /= 2; absSample -= nsL[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[14] += absSample; nsL[14] /= 2; absSample -= nsL[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + absSample += ((double(fpdL)/UINT32_MAX) - 0.5); nsL[15] += absSample; nsL[15] /= 2; absSample -= nsL[15]; //install noise and then shape it absSample += inputSampleL; @@ -226,37 +271,52 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL = floor(absSample); //TenNines dither L - absSample = ((double(fpd)/UINT32_MAX) - 0.5); + absSample = ((double(fpdR)/UINT32_MAX) - 0.5); nsR[0] += absSample; nsR[0] /= 2; absSample -= nsR[0]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[1] += absSample; nsR[1] /= 2; absSample -= nsR[1]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[2] += absSample; nsR[2] /= 2; absSample -= nsR[2]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[3] += absSample; nsR[3] /= 2; absSample -= nsR[3]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[4] += absSample; nsR[4] /= 2; absSample -= nsR[4]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[5] += absSample; nsR[5] /= 2; absSample -= nsR[5]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[6] += absSample; nsR[6] /= 2; absSample -= nsR[6]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[7] += absSample; nsR[7] /= 2; absSample -= nsR[7]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[8] += absSample; nsR[8] /= 2; absSample -= nsR[8]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[9] += absSample; nsR[9] /= 2; absSample -= nsR[9]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[10] += absSample; nsR[10] /= 2; absSample -= nsR[10]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[11] += absSample; nsR[11] /= 2; absSample -= nsR[11]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[12] += absSample; nsR[12] /= 2; absSample -= nsR[12]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[13] += absSample; nsR[13] /= 2; absSample -= nsR[13]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[14] += absSample; nsR[14] /= 2; absSample -= nsR[14]; - absSample += ((double(fpd)/UINT32_MAX) - 0.5); + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + absSample += ((double(fpdR)/UINT32_MAX) - 0.5); nsR[15] += absSample; nsR[15] /= 2; absSample -= nsR[15]; //install noise and then shape it absSample += inputSampleR; @@ -275,6 +335,10 @@ void VinylDither::processDoubleReplacing(double **inputs, double **outputs, VstI inputSampleL /= outScale; inputSampleR /= outScale; + fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5; + fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5; + //pseudorandom number updater + *out1 = inputSampleL; *out2 = inputSampleR; diff --git a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp index fd6e5bdfa..8ea666d37 100755 --- a/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp +++ b/plugins/WinVST/VoiceOfTheStarship/VoiceOfTheStarshipProc.cpp @@ -110,10 +110,10 @@ void VoiceOfTheStarship::processReplacing(float **inputs, float **outputs, VstIn //it's a pure random walk that will generate DC. } - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); //here's the guts of the random walk if (filterflip) @@ -300,10 +300,10 @@ void VoiceOfTheStarship::processDoubleReplacing(double **inputs, double **output //it's a pure random walk that will generate DC. } - if (flipL) noiseAL += (double(fpd)/UINT32_MAX); - else noiseAL -= (double(fpd)/UINT32_MAX); - if (flipR) noiseAR += (double(fpd)/UINT32_MAX); - else noiseAR -= (double(fpd)/UINT32_MAX); + if (flipL) noiseAL += (double(fpdL)/UINT32_MAX); + else noiseAL -= (double(fpdL)/UINT32_MAX); + if (flipR) noiseAR += (double(fpdR)/UINT32_MAX); + else noiseAR -= (double(fpdR)/UINT32_MAX); //here's the guts of the random walk if (filterflip) diff --git a/plugins/WinVST/VoiceTrick/VoiceTrick.cpp b/plugins/WinVST/VoiceTrick/VoiceTrick.cpp index 1553a504a..c4df942f9 100755 --- a/plugins/WinVST/VoiceTrick/VoiceTrick.cpp +++ b/plugins/WinVST/VoiceTrick/VoiceTrick.cpp @@ -23,7 +23,8 @@ VoiceTrick::VoiceTrick(audioMasterCallback audioMaster) : lowpassChase = 0.0; lowpassAmount = 1.0; lastLowpass = 1000.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/VoiceTrick/VoiceTrick.h b/plugins/WinVST/VoiceTrick/VoiceTrick.h index 64c4b43b2..d5b1e3ee4 100755 --- a/plugins/WinVST/VoiceTrick/VoiceTrick.h +++ b/plugins/WinVST/VoiceTrick/VoiceTrick.h @@ -52,7 +52,8 @@ private: char _programName[kVstMaxProgNameLen + 1]; std::set< std::string > _canDo; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff double iirLowpassA; double iirLowpassB; diff --git a/plugins/WinVST/Wider/WiderProc.cpp b/plugins/WinVST/Wider/WiderProc.cpp index 8abd00908..fc9f5241a 100755 --- a/plugins/WinVST/Wider/WiderProc.cpp +++ b/plugins/WinVST/Wider/WiderProc.cpp @@ -99,8 +99,8 @@ void Wider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFra } count -= 1; - inputSampleL = (drySampleL * dry) + ((mid+side) * wet); - inputSampleR = (drySampleR * dry) + ((mid-side) * wet); + inputSampleL = (drySampleL * (1.0-wet)) + ((mid+side) * wet); + inputSampleR = (drySampleR * (1.0-wet)) + ((mid-side) * wet); //begin 32 bit stereo floating point dither int expon; frexpf((float)inputSampleL, &expon); @@ -213,8 +213,8 @@ void Wider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 s } count -= 1; - inputSampleL = (drySampleL * dry) + ((mid+side) * wet); - inputSampleR = (drySampleR * dry) + ((mid-side) * wet); + inputSampleL = (drySampleL * (1.0-wet)) + ((mid+side) * wet); + inputSampleR = (drySampleR * (1.0-wet)) + ((mid-side) * wet); //begin 64 bit stereo floating point dither //int expon; frexp((double)inputSampleL, &expon); diff --git a/plugins/WinVST/XBandpass/XBandpass.cpp b/plugins/WinVST/XBandpass/XBandpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XBandpass/XBandpass.h b/plugins/WinVST/XBandpass/XBandpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XBandpass/XBandpassProc.cpp b/plugins/WinVST/XBandpass/XBandpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XHighpass/XHighpass.cpp b/plugins/WinVST/XHighpass/XHighpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XHighpass/XHighpass.h b/plugins/WinVST/XHighpass/XHighpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XHighpass/XHighpassProc.cpp b/plugins/WinVST/XHighpass/XHighpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XLowpass/XLowpass.cpp b/plugins/WinVST/XLowpass/XLowpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XLowpass/XLowpass.h b/plugins/WinVST/XLowpass/XLowpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XLowpass/XLowpassProc.cpp b/plugins/WinVST/XLowpass/XLowpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XNotch/XNotch.cpp b/plugins/WinVST/XNotch/XNotch.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XNotch/XNotch.h b/plugins/WinVST/XNotch/XNotch.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XNotch/XNotchProc.cpp b/plugins/WinVST/XNotch/XNotchProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XRegion/XRegion.cpp b/plugins/WinVST/XRegion/XRegion.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XRegion/XRegion.h b/plugins/WinVST/XRegion/XRegion.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/XRegion/XRegionProc.cpp b/plugins/WinVST/XRegion/XRegionProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YBandpass/YBandpass.cpp b/plugins/WinVST/YBandpass/YBandpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YBandpass/YBandpass.h b/plugins/WinVST/YBandpass/YBandpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YBandpass/YBandpassProc.cpp b/plugins/WinVST/YBandpass/YBandpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YHighpass/YHighpass.cpp b/plugins/WinVST/YHighpass/YHighpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YHighpass/YHighpass.h b/plugins/WinVST/YHighpass/YHighpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YHighpass/YHighpassProc.cpp b/plugins/WinVST/YHighpass/YHighpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YLowpass/YLowpass.cpp b/plugins/WinVST/YLowpass/YLowpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YLowpass/YLowpass.h b/plugins/WinVST/YLowpass/YLowpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YLowpass/YLowpassProc.cpp b/plugins/WinVST/YLowpass/YLowpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YNotch/YNotch.cpp b/plugins/WinVST/YNotch/YNotch.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YNotch/YNotch.h b/plugins/WinVST/YNotch/YNotch.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/YNotch/YNotchProc.cpp b/plugins/WinVST/YNotch/YNotchProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass/ZBandpass.cpp b/plugins/WinVST/ZBandpass/ZBandpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass/ZBandpass.h b/plugins/WinVST/ZBandpass/ZBandpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass/ZBandpassProc.cpp b/plugins/WinVST/ZBandpass/ZBandpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass2/ZBandpass2.cpp b/plugins/WinVST/ZBandpass2/ZBandpass2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass2/ZBandpass2.h b/plugins/WinVST/ZBandpass2/ZBandpass2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp b/plugins/WinVST/ZBandpass2/ZBandpass2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass/ZHighpass.cpp b/plugins/WinVST/ZHighpass/ZHighpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass/ZHighpass.h b/plugins/WinVST/ZHighpass/ZHighpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass/ZHighpassProc.cpp b/plugins/WinVST/ZHighpass/ZHighpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass2/ZHighpass2.cpp b/plugins/WinVST/ZHighpass2/ZHighpass2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass2/ZHighpass2.h b/plugins/WinVST/ZHighpass2/ZHighpass2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp b/plugins/WinVST/ZHighpass2/ZHighpass2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass/ZLowpass.cpp b/plugins/WinVST/ZLowpass/ZLowpass.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass/ZLowpass.h b/plugins/WinVST/ZLowpass/ZLowpass.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass/ZLowpassProc.cpp b/plugins/WinVST/ZLowpass/ZLowpassProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass2/ZLowpass2.cpp b/plugins/WinVST/ZLowpass2/ZLowpass2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass2/ZLowpass2.h b/plugins/WinVST/ZLowpass2/ZLowpass2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp b/plugins/WinVST/ZLowpass2/ZLowpass2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch/ZNotch.cpp b/plugins/WinVST/ZNotch/ZNotch.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch/ZNotch.h b/plugins/WinVST/ZNotch/ZNotch.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch/ZNotchProc.cpp b/plugins/WinVST/ZNotch/ZNotchProc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch2/ZNotch2.cpp b/plugins/WinVST/ZNotch2/ZNotch2.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch2/ZNotch2.h b/plugins/WinVST/ZNotch2/ZNotch2.h old mode 100644 new mode 100755 diff --git a/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp b/plugins/WinVST/ZNotch2/ZNotch2Proc.cpp old mode 100644 new mode 100755 diff --git a/plugins/WinVST/curve/curve.cpp b/plugins/WinVST/curve/curve.cpp index 8c4e78f40..3bebc534b 100755 --- a/plugins/WinVST/curve/curve.cpp +++ b/plugins/WinVST/curve/curve.cpp @@ -13,7 +13,8 @@ curve::curve(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { gain = 1.0; - fpd = 1.0; while (fpd < 16386) fpd = rand()*UINT32_MAX; + fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX; + fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. diff --git a/plugins/WinVST/curve/curve.h b/plugins/WinVST/curve/curve.h index 4dd52f8e7..c947b6713 100755 --- a/plugins/WinVST/curve/curve.h +++ b/plugins/WinVST/curve/curve.h @@ -52,7 +52,8 @@ private: std::set< std::string > _canDo; double gain; - uint32_t fpd; + uint32_t fpdL; + uint32_t fpdR; //default stuff };