From 633be2e22c6648c901f08f3b4cd4e8e14ea86443 Mon Sep 17 00:00:00 2001 From: Chris Johnson Date: Mon, 22 Oct 2018 18:04:06 -0400 Subject: Updates (in case my plane crashes) --- .../.vs/Console4Channel64/v14/.suo | Bin 0 -> 32768 bytes .../GuitarConditioner/.vs/VSTProject/v14/.suo | Bin 0 -> 23040 bytes .../WinVST/GuitarConditioner/GuitarConditioner.cpp | 104 ++++++ .../WinVST/GuitarConditioner/GuitarConditioner.h | 75 ++++ .../GuitarConditioner/GuitarConditionerProc.cpp | 385 +++++++++++++++++++++ plugins/WinVST/GuitarConditioner/VSTProject.sln | 28 ++ .../WinVST/GuitarConditioner/VSTProject.vcxproj | 183 ++++++++++ .../GuitarConditioner/VSTProject.vcxproj.filters | 48 +++ .../GuitarConditioner/VSTProject.vcxproj.user | 19 + plugins/WinVST/GuitarConditioner/vstplug.def | 3 + 10 files changed, 845 insertions(+) create mode 100755 plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo create mode 100755 plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo create mode 100755 plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp create mode 100755 plugins/WinVST/GuitarConditioner/GuitarConditioner.h create mode 100755 plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp create mode 100755 plugins/WinVST/GuitarConditioner/VSTProject.sln create mode 100755 plugins/WinVST/GuitarConditioner/VSTProject.vcxproj create mode 100755 plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.filters create mode 100755 plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.user create mode 100755 plugins/WinVST/GuitarConditioner/vstplug.def (limited to 'plugins/WinVST/GuitarConditioner') diff --git a/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo new file mode 100755 index 0000000..777b846 Binary files /dev/null and b/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo differ diff --git a/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo b/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo new file mode 100755 index 0000000..9e37109 Binary files /dev/null and b/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo differ diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp b/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp new file mode 100755 index 0000000..8f3ccfc --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/GuitarConditioner.cpp @@ -0,0 +1,104 @@ +/* ======================================== + * GuitarConditioner - GuitarConditioner.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __GuitarConditioner_H +#include "GuitarConditioner.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new GuitarConditioner(audioMaster);} + +GuitarConditioner::GuitarConditioner(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + + lastSampleTL = 0.0; + lastSampleBL = 0.0; //for Slews. T for treble, B for bass + iirSampleTAL = 0.0; + iirSampleTBL = 0.0; + iirSampleBAL = 0.0; + iirSampleBBL = 0.0; //for Highpasses + //this is reset: values being initialized only once. Startup values, whatever they are. + lastSampleTR = 0.0; + lastSampleBR = 0.0; //for Slews. T for treble, B for bass + iirSampleTAR = 0.0; + iirSampleTBR = 0.0; + iirSampleBAR = 0.0; + iirSampleBBR = 0.0; //for Highpasses + //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 + vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name +} + +GuitarConditioner::~GuitarConditioner() {} +VstInt32 GuitarConditioner::getVendorVersion () {return 1000;} +void GuitarConditioner::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void GuitarConditioner::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! + +void GuitarConditioner::setParameter(VstInt32 index, float value) { + switch (index) { + default: throw; // unknown parameter, shouldn't happen! + } + //we can also set other defaults here, and do calculations that only have to happen + //once when parameters actually change. Here is the 'popup' setting its (global) values. + //variables can also be set in the processreplacing loop, and there they'll be set every buffersize + //here they're set when a parameter's actually changed, which should be less frequent, but + //you must use global variables in the GuitarConditioner.h file to do it. +} + +float GuitarConditioner::getParameter(VstInt32 index) { + switch (index) { + default: break; // unknown parameter, shouldn't happen! + } return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void GuitarConditioner::getParameterName(VstInt32 index, char *text) { + switch (index) { + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void GuitarConditioner::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void GuitarConditioner::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 GuitarConditioner::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1 : 1; } // 1 = yes, -1 = no, 0 = don't know + +bool GuitarConditioner::getEffectName(char* name) { + vst_strncpy(name, "GuitarConditioner", kVstMaxProductStrLen); return true; +} + +VstPlugCategory GuitarConditioner::getPlugCategory() {return kPlugCategEffect;} + +bool GuitarConditioner::getProductString(char* text) { + vst_strncpy (text, "airwindows GuitarConditioner", kVstMaxProductStrLen); return true; +} + +bool GuitarConditioner::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditioner.h b/plugins/WinVST/GuitarConditioner/GuitarConditioner.h new file mode 100755 index 0000000..7bd73ab --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/GuitarConditioner.h @@ -0,0 +1,75 @@ +/* ======================================== + * GuitarConditioner - GuitarConditioner.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __GuitarConditioner_H +#define __GuitarConditioner_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include +#include +#include + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'gcon'; //Change this to what the AU identity is! + +class GuitarConditioner : + public AudioEffectX +{ +public: + GuitarConditioner(audioMasterCallback audioMaster); + ~GuitarConditioner(); + 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 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double lastSampleTL; + double lastSampleBL; //for Slews + double iirSampleTAL; + double iirSampleTBL; + double iirSampleBAL; + double iirSampleBBL; //for Highpasses + + double lastSampleTR; + double lastSampleBR; //for Slews + double iirSampleTAR; + double iirSampleTBR; + double iirSampleBAR; + double iirSampleBBR; //for Highpasses + +}; + +#endif diff --git a/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp b/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp new file mode 100755 index 0000000..83970f2 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/GuitarConditionerProc.cpp @@ -0,0 +1,385 @@ +/* ======================================== + * GuitarConditioner - GuitarConditioner.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __GuitarConditioner_H +#include "GuitarConditioner.h" +#endif + +void GuitarConditioner::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(); + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double trebleL; + long double bassL; + long double trebleR; + long double bassR; + + double iirTreble = 0.287496/overallscale; //tight is -1 + double iirBass = 0.085184/overallscale; //tight is 1 + iirTreble += iirTreble; + iirBass += iirBass; //simple double when tight is -1 or 1 + double tightBass = 0.6666666666; + double tightTreble = -0.3333333333; + double offset; + double clamp; + double threshTreble = 0.0081/overallscale; + double threshBass = 0.0256/overallscale; + + while (--sampleFrames >= 0) + { + inputSampleL = *in1; + inputSampleR = *in2; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + static int noisesource = 0; + //this declares a variable before anything else is compiled. It won't keep assigning + //it to 0 for every sample, it's as if the declaration doesn't exist in this context, + //but it lets me add this denormalization fix in a single place rather than updating + //it in three different locations. The variable isn't thread-safe but this is only + //a random seed and we can share it with whatever. + noisesource = noisesource % 1700021; noisesource++; + int residue = noisesource * noisesource; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + double applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL = applyresidue; + } + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + static int noisesource = 0; + noisesource = noisesource % 1700021; noisesource++; + int residue = noisesource * noisesource; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + double applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR = applyresidue; + //this denormalization routine produces a white noise at -300 dB which the noise + //shaping will interact with to produce a bipolar output, but the noise is actually + //all positive. That should stop any variables from going denormal, and the routine + //only kicks in if digital black is input. As a final touch, if you save to 24-bit + //the silence will return to being digital black again. + } + + trebleL = bassL = inputSampleL; + trebleR = bassR = inputSampleR; + trebleL += trebleL; //+3dB on treble as the highpass is higher + trebleR += trebleR; //+3dB on treble as the highpass is higher + + offset = (1 + tightTreble) + ((1-fabs(trebleL))*tightTreble); //treble HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; //made offset for HP + if (fpFlip) { + iirSampleTAL = (iirSampleTAL * (1 - (offset * iirTreble))) + (trebleL * (offset * iirTreble)); + trebleL = trebleL - iirSampleTAL; + } else { + iirSampleTBL = (iirSampleTBL * (1 - (offset * iirTreble))) + (trebleL * (offset * iirTreble)); + trebleL = trebleL - iirSampleTBL; + } //done trebleL HP + + offset = (1 + tightTreble) + ((1-fabs(trebleR))*tightTreble); //treble HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; //made offset for HP + if (fpFlip) { + iirSampleTAR = (iirSampleTAR * (1 - (offset * iirTreble))) + (trebleR * (offset * iirTreble)); + trebleR = trebleR - iirSampleTAR; + } else { + iirSampleTBR = (iirSampleTBR * (1 - (offset * iirTreble))) + (trebleR * (offset * iirTreble)); + trebleR = trebleR - iirSampleTBR; + } //done trebleR HP + + offset = (1 - tightBass) + (fabs(bassL)*tightBass); //bass HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) { + iirSampleBAL = (iirSampleBAL * (1 - (offset * iirBass))) + (bassL * (offset * iirBass)); + bassL = bassL - iirSampleBAL; + } else { + iirSampleBBL = (iirSampleBBL * (1 - (offset * iirBass))) + (bassL * (offset * iirBass)); + bassL = bassL - iirSampleBBL; + } //done bassL HP + + offset = (1 - tightBass) + (fabs(bassR)*tightBass); //bass HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) { + iirSampleBAR = (iirSampleBAR * (1 - (offset * iirBass))) + (bassR * (offset * iirBass)); + bassR = bassR - iirSampleBAR; + } else { + iirSampleBBR = (iirSampleBBR * (1 - (offset * iirBass))) + (bassR * (offset * iirBass)); + bassR = bassR - iirSampleBBR; + } //done bassR HP + + inputSampleL = trebleL; + clamp = inputSampleL - lastSampleTL; + if (clamp > threshTreble) + trebleL = lastSampleTL + threshTreble; + if (-clamp > threshTreble) + trebleL = lastSampleTL - threshTreble; + lastSampleTL = trebleL; //trebleL slew + + inputSampleR = trebleR; + clamp = inputSampleR - lastSampleTR; + if (clamp > threshTreble) + trebleR = lastSampleTR + threshTreble; + if (-clamp > threshTreble) + trebleR = lastSampleTR - threshTreble; + lastSampleTR = trebleR; //trebleR slew + + inputSampleL = bassL; + clamp = inputSampleL - lastSampleBL; + if (clamp > threshBass) + bassL = lastSampleBL + threshBass; + if (-clamp > threshBass) + bassL = lastSampleBL - threshBass; + lastSampleBL = bassL; //bassL slew + + inputSampleR = bassR; + clamp = inputSampleR - lastSampleBR; + if (clamp > threshBass) + bassR = lastSampleBR + threshBass; + if (-clamp > threshBass) + bassR = lastSampleBR - threshBass; + lastSampleBR = bassR; //bassR slew + + inputSampleL = trebleL + bassL; //final merge + inputSampleR = trebleR + bassR; //final merge + //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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void GuitarConditioner::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 fpTemp; //this is different from singlereplacing + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double trebleL; + long double bassL; + long double trebleR; + long double bassR; + + double iirTreble = 0.287496/overallscale; //tight is -1 + double iirBass = 0.085184/overallscale; //tight is 1 + iirTreble += iirTreble; + iirBass += iirBass; //simple double when tight is -1 or 1 + double tightBass = 0.6666666666; + double tightTreble = -0.3333333333; + double offset; + double clamp; + double threshTreble = 0.0081/overallscale; + double threshBass = 0.0256/overallscale; + + + while (--sampleFrames >= 0) + { + inputSampleL = *in1; + inputSampleR = *in2; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + static int noisesource = 0; + //this declares a variable before anything else is compiled. It won't keep assigning + //it to 0 for every sample, it's as if the declaration doesn't exist in this context, + //but it lets me add this denormalization fix in a single place rather than updating + //it in three different locations. The variable isn't thread-safe but this is only + //a random seed and we can share it with whatever. + noisesource = noisesource % 1700021; noisesource++; + int residue = noisesource * noisesource; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + double applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL = applyresidue; + } + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + static int noisesource = 0; + noisesource = noisesource % 1700021; noisesource++; + int residue = noisesource * noisesource; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + double applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR = applyresidue; + //this denormalization routine produces a white noise at -300 dB which the noise + //shaping will interact with to produce a bipolar output, but the noise is actually + //all positive. That should stop any variables from going denormal, and the routine + //only kicks in if digital black is input. As a final touch, if you save to 24-bit + //the silence will return to being digital black again. + } + + trebleL = bassL = inputSampleL; + trebleR = bassR = inputSampleR; + trebleL += trebleL; //+3dB on treble as the highpass is higher + trebleR += trebleR; //+3dB on treble as the highpass is higher + + offset = (1 + tightTreble) + ((1-fabs(trebleL))*tightTreble); //treble HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; //made offset for HP + if (fpFlip) { + iirSampleTAL = (iirSampleTAL * (1 - (offset * iirTreble))) + (trebleL * (offset * iirTreble)); + trebleL = trebleL - iirSampleTAL; + } else { + iirSampleTBL = (iirSampleTBL * (1 - (offset * iirTreble))) + (trebleL * (offset * iirTreble)); + trebleL = trebleL - iirSampleTBL; + } //done trebleL HP + + offset = (1 + tightTreble) + ((1-fabs(trebleR))*tightTreble); //treble HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; //made offset for HP + if (fpFlip) { + iirSampleTAR = (iirSampleTAR * (1 - (offset * iirTreble))) + (trebleR * (offset * iirTreble)); + trebleR = trebleR - iirSampleTAR; + } else { + iirSampleTBR = (iirSampleTBR * (1 - (offset * iirTreble))) + (trebleR * (offset * iirTreble)); + trebleR = trebleR - iirSampleTBR; + } //done trebleR HP + + offset = (1 - tightBass) + (fabs(bassL)*tightBass); //bass HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) { + iirSampleBAL = (iirSampleBAL * (1 - (offset * iirBass))) + (bassL * (offset * iirBass)); + bassL = bassL - iirSampleBAL; + } else { + iirSampleBBL = (iirSampleBBL * (1 - (offset * iirBass))) + (bassL * (offset * iirBass)); + bassL = bassL - iirSampleBBL; + } //done bassL HP + + offset = (1 - tightBass) + (fabs(bassR)*tightBass); //bass HP + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) { + iirSampleBAR = (iirSampleBAR * (1 - (offset * iirBass))) + (bassR * (offset * iirBass)); + bassR = bassR - iirSampleBAR; + } else { + iirSampleBBR = (iirSampleBBR * (1 - (offset * iirBass))) + (bassR * (offset * iirBass)); + bassR = bassR - iirSampleBBR; + } //done bassR HP + + inputSampleL = trebleL; + clamp = inputSampleL - lastSampleTL; + if (clamp > threshTreble) + trebleL = lastSampleTL + threshTreble; + if (-clamp > threshTreble) + trebleL = lastSampleTL - threshTreble; + lastSampleTL = trebleL; //trebleL slew + + inputSampleR = trebleR; + clamp = inputSampleR - lastSampleTR; + if (clamp > threshTreble) + trebleR = lastSampleTR + threshTreble; + if (-clamp > threshTreble) + trebleR = lastSampleTR - threshTreble; + lastSampleTR = trebleR; //trebleR slew + + inputSampleL = bassL; + clamp = inputSampleL - lastSampleBL; + if (clamp > threshBass) + bassL = lastSampleBL + threshBass; + if (-clamp > threshBass) + bassL = lastSampleBL - threshBass; + lastSampleBL = bassL; //bassL slew + + inputSampleR = bassR; + clamp = inputSampleR - lastSampleBR; + if (clamp > threshBass) + bassR = lastSampleBR + threshBass; + if (-clamp > threshBass) + bassR = lastSampleBR - threshBass; + lastSampleBR = bassR; //bassR slew + + inputSampleL = trebleL + bassL; //final merge + inputSampleR = trebleR + bassR; //final merge + //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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} \ No newline at end of file diff --git a/plugins/WinVST/GuitarConditioner/VSTProject.sln b/plugins/WinVST/GuitarConditioner/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/VSTProject.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VSTProject", "VSTProject.vcxproj", "{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Debug|x64.ActiveCfg = Debug|x64 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Debug|x64.Build.0 = Debug|x64 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Debug|x86.ActiveCfg = Debug|Win32 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Debug|x86.Build.0 = Debug|Win32 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Release|x64.ActiveCfg = Release|x64 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Release|x64.Build.0 = Release|x64 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Release|x86.ActiveCfg = Release|Win32 + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj new file mode 100755 index 0000000..3e08c03 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj @@ -0,0 +1,183 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + + + {16F7AB3C-1AE0-4574-B60C-7B4DED82938C} + VSTProject + 8.1 + GuitarConditioner64 + + + + DynamicLibrary + true + v140 + NotSet + + + DynamicLibrary + false + v140 + false + NotSet + + + DynamicLibrary + true + v140 + NotSet + + + DynamicLibrary + false + v140 + false + NotSet + + + + + + + + + + + + + + + + + + + + + .dll + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH) + + + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH) + + + + Level3 + MaxSpeed + true + C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories) + WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions) + MultiThreadedDebug + Speed + false + Default + false + None + + + vstplug.def + libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories) + Speed + WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions) + false + MultiThreadedDebug + Default + false + None + + + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries) + vstplug.def + + + + + Level3 + MaxSpeed + false + false + true + MultiThreaded + C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories) + None + Speed + WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions) + + + true + true + libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries) + libcmt.lib;uuid.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + vstplug.def + + + + + Level3 + MaxSpeed + false + false + true + C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories) + None + Speed + WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions) + MultiThreaded + + + true + true + libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries) + libcmt.lib;uuid.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + vstplug.def + + + + + + \ No newline at end of file diff --git a/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.filters b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.filters new file mode 100755 index 0000000..890f19d --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.user b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ + + + + {ADEFF70D-84BF-47A1-91C3-FF6B0FC71218} + WindowsLocalDebugger + + + {ADEFF70D-84BF-47A1-91C3-FF6B0FC71218} + WindowsLocalDebugger + + + {ADEFF70D-84BF-47A1-91C3-FF6B0FC71218} + WindowsLocalDebugger + + + {ADEFF70D-84BF-47A1-91C3-FF6B0FC71218} + WindowsLocalDebugger + + \ No newline at end of file diff --git a/plugins/WinVST/GuitarConditioner/vstplug.def b/plugins/WinVST/GuitarConditioner/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS + VSTPluginMain + main=VSTPluginMain \ No newline at end of file -- cgit v1.2.3