diff options
author | Chris Johnson <jinx6568@sover.net> | 2018-10-22 18:04:06 -0400 |
---|---|---|
committer | Chris Johnson <jinx6568@sover.net> | 2018-10-22 18:04:06 -0400 |
commit | 633be2e22c6648c901f08f3b4cd4e8e14ea86443 (patch) | |
tree | 1e272c3d2b5bd29636b9f9f521af62734e4df012 /plugins/WinVST | |
parent | 057757aa8eb0a463caf0cdfdb5894ac5f723ff3f (diff) | |
download | airwindows-lv2-port-633be2e22c6648c901f08f3b4cd4e8e14ea86443.tar.gz airwindows-lv2-port-633be2e22c6648c901f08f3b4cd4e8e14ea86443.tar.bz2 airwindows-lv2-port-633be2e22c6648c901f08f3b4cd4e8e14ea86443.zip |
Updates (in case my plane crashes)
Diffstat (limited to 'plugins/WinVST')
690 files changed, 67899 insertions, 0 deletions
diff --git a/plugins/WinVST/ADClip7/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ADClip7/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ADClip7/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ADClip7/.vs/VSTProject/v14/.suo b/plugins/WinVST/ADClip7/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..41b2402 --- /dev/null +++ b/plugins/WinVST/ADClip7/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ADClip7/ADClip7.cpp b/plugins/WinVST/ADClip7/ADClip7.cpp new file mode 100755 index 0000000..fb6d6c6 --- /dev/null +++ b/plugins/WinVST/ADClip7/ADClip7.cpp @@ -0,0 +1,165 @@ +/* ======================================== + * ADClip7 - ADClip7.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ADClip7_H +#include "ADClip7.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ADClip7(audioMaster);} + +ADClip7::ADClip7(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.5; + C = 0.5; + D = 0.0; + + lastSampleL = 0.0; + lastSampleR = 0.0; + for(int count = 0; count < 22199; count++) {bL[count] = 0; bR[count] = 0;} + gcount = 0; + lowsL = 0; + lowsR = 0; + refclipL = 0.99; + refclipR = 0.99; + iirLowsAL = 0.0; + iirLowsAR = 0.0; + iirLowsBL = 0.0; + iirLowsBR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +ADClip7::~ADClip7() {} +VstInt32 ADClip7::getVendorVersion () {return 1000;} +void ADClip7::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ADClip7::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 ADClip7::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 ADClip7::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 ADClip7::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ADClip7::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 ADClip7::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Boost", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Soften", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Enhance", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Mode", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ADClip7::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*18.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: switch((VstInt32)( D * 2.999 )) //0 to almost edge of # of params + {case 0: vst_strncpy (text, "Normal", kVstMaxParamStrLen); break; + case 1: vst_strncpy (text, "Atten", kVstMaxParamStrLen); break; + case 2: vst_strncpy (text, "Clips", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void ADClip7::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ADClip7::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ADClip7::getEffectName(char* name) { + vst_strncpy(name, "ADClip7", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ADClip7::getPlugCategory() {return kPlugCategEffect;} + +bool ADClip7::getProductString(char* text) { + vst_strncpy (text, "airwindows ADClip7", kVstMaxProductStrLen); return true; +} + +bool ADClip7::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ADClip7/ADClip7.h b/plugins/WinVST/ADClip7/ADClip7.h new file mode 100755 index 0000000..f20d3fb --- /dev/null +++ b/plugins/WinVST/ADClip7/ADClip7.h @@ -0,0 +1,85 @@ +/* ======================================== + * ADClip7 - ADClip7.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ADClip7_H +#define __ADClip7_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'adcr'; //Change this to what the AU identity is! + +class ADClip7 : + public AudioEffectX +{ +public: + ADClip7(audioMasterCallback audioMaster); + ~ADClip7(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + long double lastSampleL; + long double lastSampleR; + float bL[22200]; + float bR[22200]; + int gcount; + double lowsL; + double lowsR; + double iirLowsAL; + double iirLowsAR; + double iirLowsBL; + double iirLowsBR; + long double refclipL; + long double refclipR; + + float A; + float B; + float C; + float D; + +}; + +#endif diff --git a/plugins/WinVST/ADClip7/ADClip7Proc.cpp b/plugins/WinVST/ADClip7/ADClip7Proc.cpp new file mode 100755 index 0000000..2705d61 --- /dev/null +++ b/plugins/WinVST/ADClip7/ADClip7Proc.cpp @@ -0,0 +1,953 @@ +/* ======================================== + * ADClip7 - ADClip7.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ADClip7_H +#include "ADClip7.h" +#endif + +void ADClip7::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; + + double inputGain = pow(10.0,(A*18.0)/20.0); + double softness = B * fpNew; + double hardness = 1.0 - softness; + double highslift = 0.307 * C; + double adjust = pow(highslift,3) * 0.416; + double subslift = 0.796 * C; + double calibsubs = subslift/53; + double invcalibsubs = 1.0 - calibsubs; + double subs = 0.81 + (calibsubs*2); + long double bridgerectifier; + int mode = (int) floor(D*2.999)+1; + double overshootL; + double overshootR; + double offsetH1 = 1.84; + offsetH1 *= overallscale; + double offsetH2 = offsetH1 * 1.9; + double offsetH3 = offsetH1 * 2.7; + double offsetL1 = 612; + offsetL1 *= overallscale; + double offsetL2 = offsetL1 * 2.0; + int refH1 = (int)floor(offsetH1); + int refH2 = (int)floor(offsetH2); + int refH3 = (int)floor(offsetH3); + int refL1 = (int)floor(offsetL1); + int refL2 = (int)floor(offsetL2); + int temp; + double fractionH1 = offsetH1 - floor(offsetH1); + double fractionH2 = offsetH2 - floor(offsetH2); + double fractionH3 = offsetH3 - floor(offsetH3); + double minusH1 = 1.0 - fractionH1; + double minusH2 = 1.0 - fractionH2; + double minusH3 = 1.0 - fractionH3; + double highsL = 0.0; + double highsR = 0.0; + int count = 0; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + + + if (inputGain != 1.0) { + inputSampleL *= inputGain; + inputSampleR *= inputGain; + } + + overshootL = fabs(inputSampleL) - refclipL; + overshootR = fabs(inputSampleR) - refclipR; + if (overshootL < 0.0) overshootL = 0.0; + if (overshootR < 0.0) overshootR = 0.0; + + if (gcount < 0 || gcount > 11020) {gcount = 11020;} + count = gcount; + bL[count+11020] = bL[count] = overshootL; + bR[count+11020] = bR[count] = overshootR; + gcount--; + + if (highslift > 0.0) + { + //we have a big pile of b[] which is overshoots + temp = count+refH3; + highsL = -(bL[temp] * minusH3); //less as value moves away from .0 + highsL -= bL[temp+1]; //we can assume always using this in one way or another? + highsL -= (bL[temp+2] * fractionH3); //greater as value moves away from .0 + highsL += (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 3 is a negative add + highsR = -(bR[temp] * minusH3); //less as value moves away from .0 + highsR -= bR[temp+1]; //we can assume always using this in one way or another? + highsR -= (bR[temp+2] * fractionH3); //greater as value moves away from .0 + highsR += (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 3 is a negative add + temp = count+refH2; + highsL += (bL[temp] * minusH2); //less as value moves away from .0 + highsL += bL[temp+1]; //we can assume always using this in one way or another? + highsL += (bL[temp+2] * fractionH2); //greater as value moves away from .0 + highsL -= (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 2 is a positive feedback of the overshoot + highsR += (bR[temp] * minusH2); //less as value moves away from .0 + highsR += bR[temp+1]; //we can assume always using this in one way or another? + highsR += (bR[temp+2] * fractionH2); //greater as value moves away from .0 + highsR -= (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 2 is a positive feedback of the overshoot + temp = count+refH1; + highsL -= (bL[temp] * minusH1); //less as value moves away from .0 + highsL -= bL[temp+1]; //we can assume always using this in one way or another? + highsL -= (bL[temp+2] * fractionH1); //greater as value moves away from .0 + highsL += (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 1 is a negative feedback of the overshoot + highsR -= (bR[temp] * minusH1); //less as value moves away from .0 + highsR -= bR[temp+1]; //we can assume always using this in one way or another? + highsR -= (bR[temp+2] * fractionH1); //greater as value moves away from .0 + highsR += (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 1 is a negative feedback of the overshoot + //done with interpolated mostly negative feedback of the overshoot + } + + bridgerectifier = sin(fabs(highsL) * hardness); + //this will wrap around and is scaled back by softness + //wrap around is the same principle as Fracture: no top limit to sin() + if (highsL > 0) highsL = bridgerectifier; + else highsL = -bridgerectifier; + + bridgerectifier = sin(fabs(highsR) * hardness); + //this will wrap around and is scaled back by softness + //wrap around is the same principle as Fracture: no top limit to sin() + if (highsR > 0) highsR = bridgerectifier; + else highsR = -bridgerectifier; + + if (subslift > 0.0) + { + lowsL *= subs; + lowsR *= subs; + //going in we'll reel back some of the swing + temp = count+refL1; + + lowsL -= bL[temp+127]; + lowsL -= bL[temp+113]; + lowsL -= bL[temp+109]; + lowsL -= bL[temp+107]; + lowsL -= bL[temp+103]; + lowsL -= bL[temp+101]; + lowsL -= bL[temp+97]; + lowsL -= bL[temp+89]; + lowsL -= bL[temp+83]; + lowsL -= bL[temp+79]; + lowsL -= bL[temp+73]; + lowsL -= bL[temp+71]; + lowsL -= bL[temp+67]; + lowsL -= bL[temp+61]; + lowsL -= bL[temp+59]; + lowsL -= bL[temp+53]; + lowsL -= bL[temp+47]; + lowsL -= bL[temp+43]; + lowsL -= bL[temp+41]; + lowsL -= bL[temp+37]; + lowsL -= bL[temp+31]; + lowsL -= bL[temp+29]; + lowsL -= bL[temp+23]; + lowsL -= bL[temp+19]; + lowsL -= bL[temp+17]; + lowsL -= bL[temp+13]; + lowsL -= bL[temp+11]; + lowsL -= bL[temp+7]; + lowsL -= bL[temp+5]; + lowsL -= bL[temp+3]; + lowsL -= bL[temp+2]; + lowsL -= bL[temp+1]; + //initial negative lobe + + lowsR -= bR[temp+127]; + lowsR -= bR[temp+113]; + lowsR -= bR[temp+109]; + lowsR -= bR[temp+107]; + lowsR -= bR[temp+103]; + lowsR -= bR[temp+101]; + lowsR -= bR[temp+97]; + lowsR -= bR[temp+89]; + lowsR -= bR[temp+83]; + lowsR -= bR[temp+79]; + lowsR -= bR[temp+73]; + lowsR -= bR[temp+71]; + lowsR -= bR[temp+67]; + lowsR -= bR[temp+61]; + lowsR -= bR[temp+59]; + lowsR -= bR[temp+53]; + lowsR -= bR[temp+47]; + lowsR -= bR[temp+43]; + lowsR -= bR[temp+41]; + lowsR -= bR[temp+37]; + lowsR -= bR[temp+31]; + lowsR -= bR[temp+29]; + lowsR -= bR[temp+23]; + lowsR -= bR[temp+19]; + lowsR -= bR[temp+17]; + lowsR -= bR[temp+13]; + lowsR -= bR[temp+11]; + lowsR -= bR[temp+7]; + lowsR -= bR[temp+5]; + lowsR -= bR[temp+3]; + lowsR -= bR[temp+2]; + lowsR -= bR[temp+1]; + //initial negative lobe + + lowsL *= subs; + lowsL *= subs; + lowsR *= subs; + lowsR *= subs; + //twice, to minimize the suckout in low boost situations + temp = count+refL2; + + lowsL += bL[temp+127]; + lowsL += bL[temp+113]; + lowsL += bL[temp+109]; + lowsL += bL[temp+107]; + lowsL += bL[temp+103]; + lowsL += bL[temp+101]; + lowsL += bL[temp+97]; + lowsL += bL[temp+89]; + lowsL += bL[temp+83]; + lowsL += bL[temp+79]; + lowsL += bL[temp+73]; + lowsL += bL[temp+71]; + lowsL += bL[temp+67]; + lowsL += bL[temp+61]; + lowsL += bL[temp+59]; + lowsL += bL[temp+53]; + lowsL += bL[temp+47]; + lowsL += bL[temp+43]; + lowsL += bL[temp+41]; + lowsL += bL[temp+37]; + lowsL += bL[temp+31]; + lowsL += bL[temp+29]; + lowsL += bL[temp+23]; + lowsL += bL[temp+19]; + lowsL += bL[temp+17]; + lowsL += bL[temp+13]; + lowsL += bL[temp+11]; + lowsL += bL[temp+7]; + lowsL += bL[temp+5]; + lowsL += bL[temp+3]; + lowsL += bL[temp+2]; + lowsL += bL[temp+1]; + //followup positive lobe + + lowsR += bR[temp+127]; + lowsR += bR[temp+113]; + lowsR += bR[temp+109]; + lowsR += bR[temp+107]; + lowsR += bR[temp+103]; + lowsR += bR[temp+101]; + lowsR += bR[temp+97]; + lowsR += bR[temp+89]; + lowsR += bR[temp+83]; + lowsR += bR[temp+79]; + lowsR += bR[temp+73]; + lowsR += bR[temp+71]; + lowsR += bR[temp+67]; + lowsR += bR[temp+61]; + lowsR += bR[temp+59]; + lowsR += bR[temp+53]; + lowsR += bR[temp+47]; + lowsR += bR[temp+43]; + lowsR += bR[temp+41]; + lowsR += bR[temp+37]; + lowsR += bR[temp+31]; + lowsR += bR[temp+29]; + lowsR += bR[temp+23]; + lowsR += bR[temp+19]; + lowsR += bR[temp+17]; + lowsR += bR[temp+13]; + lowsR += bR[temp+11]; + lowsR += bR[temp+7]; + lowsR += bR[temp+5]; + lowsR += bR[temp+3]; + lowsR += bR[temp+2]; + lowsR += bR[temp+1]; + //followup positive lobe + + lowsL *= subs; + lowsR *= subs; + //now we have the lows content to use + } + + bridgerectifier = sin(fabs(lowsL) * softness); + //this will wrap around and is scaled back by hardness: hard = less bass push, more treble + //wrap around is the same principle as Fracture: no top limit to sin() + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + bridgerectifier = sin(fabs(lowsR) * softness); + //this will wrap around and is scaled back by hardness: hard = less bass push, more treble + //wrap around is the same principle as Fracture: no top limit to sin() + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + iirLowsAL = (iirLowsAL * invcalibsubs) + (lowsL * calibsubs); + lowsL = iirLowsAL; + bridgerectifier = sin(fabs(lowsL)); + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + iirLowsAR = (iirLowsAR * invcalibsubs) + (lowsR * calibsubs); + lowsR = iirLowsAR; + bridgerectifier = sin(fabs(lowsR)); + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + iirLowsBL = (iirLowsBL * invcalibsubs) + (lowsL * calibsubs); + lowsL = iirLowsBL; + bridgerectifier = sin(fabs(lowsL)) * 2.0; + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + iirLowsBR = (iirLowsBR * invcalibsubs) + (lowsR * calibsubs); + lowsR = iirLowsBR; + bridgerectifier = sin(fabs(lowsR)) * 2.0; + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + if (highslift > 0.0) inputSampleL += (highsL * (1.0-fabs(inputSampleL*hardness))); + if (subslift > 0.0) inputSampleL += (lowsL * (1.0-fabs(inputSampleL*softness))); + + if (highslift > 0.0) inputSampleR += (highsR * (1.0-fabs(inputSampleR*hardness))); + if (subslift > 0.0) inputSampleR += (lowsR * (1.0-fabs(inputSampleR*softness))); + + if (inputSampleL > refclipL && refclipL > 0.9) refclipL -= 0.01; + if (inputSampleL < -refclipL && refclipL > 0.9) refclipL -= 0.01; + if (refclipL < 0.99) refclipL += 0.00001; + //adjust clip level on the fly + + if (inputSampleR > refclipR && refclipR > 0.9) refclipR -= 0.01; + if (inputSampleR < -refclipR && refclipR > 0.9) refclipR -= 0.01; + if (refclipR < 0.99) refclipR += 0.00001; + //adjust clip level on the fly + + if (lastSampleL >= refclipL) + { + if (inputSampleL < refclipL) lastSampleL = ((refclipL*hardness) + (inputSampleL * softness)); + else lastSampleL = refclipL; + } + + if (lastSampleR >= refclipR) + { + if (inputSampleR < refclipR) lastSampleR = ((refclipR*hardness) + (inputSampleR * softness)); + else lastSampleR = refclipR; + } + + if (lastSampleL <= -refclipL) + { + if (inputSampleL > -refclipL) lastSampleL = ((-refclipL*hardness) + (inputSampleL * softness)); + else lastSampleL = -refclipL; + } + + if (lastSampleR <= -refclipR) + { + if (inputSampleR > -refclipR) lastSampleR = ((-refclipR*hardness) + (inputSampleR * softness)); + else lastSampleR = -refclipR; + } + + if (inputSampleL > refclipL) + { + if (lastSampleL < refclipL) inputSampleL = ((refclipL*hardness) + (lastSampleL * softness)); + else inputSampleL = refclipL; + } + + if (inputSampleR > refclipR) + { + if (lastSampleR < refclipR) inputSampleR = ((refclipR*hardness) + (lastSampleR * softness)); + else inputSampleR = refclipR; + } + + if (inputSampleL < -refclipL) + { + if (lastSampleL > -refclipL) inputSampleL = ((-refclipL*hardness) + (lastSampleL * softness)); + else inputSampleL = -refclipL; + } + + if (inputSampleR < -refclipR) + { + if (lastSampleR > -refclipR) inputSampleR = ((-refclipR*hardness) + (lastSampleR * softness)); + else inputSampleR = -refclipR; + } + lastSampleL = inputSampleL; + lastSampleR = inputSampleR; + + switch (mode) + { + case 1: break; //Normal + case 2: inputSampleL /= inputGain; inputSampleR /= inputGain; break; //Gain Match + case 3: inputSampleL = overshootL + highsL + lowsL; inputSampleR = overshootR + highsR + lowsR; break; //Clip Only + } + //this is our output mode switch, showing the effects + + if (inputSampleL > refclipL) inputSampleL = refclipL; + if (inputSampleL < -refclipL) inputSampleL = -refclipL; + if (inputSampleR > refclipR) inputSampleR = refclipR; + if (inputSampleR < -refclipR) inputSampleR = -refclipR; + //final 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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void ADClip7::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputGain = pow(10.0,(A*18.0)/20.0); + double softness = B * fpNew; + double hardness = 1.0 - softness; + double highslift = 0.307 * C; + double adjust = pow(highslift,3) * 0.416; + double subslift = 0.796 * C; + double calibsubs = subslift/53; + double invcalibsubs = 1.0 - calibsubs; + double subs = 0.81 + (calibsubs*2); + long double bridgerectifier; + int mode = (int) floor(D*2.999)+1; + double overshootL; + double overshootR; + double offsetH1 = 1.84; + offsetH1 *= overallscale; + double offsetH2 = offsetH1 * 1.9; + double offsetH3 = offsetH1 * 2.7; + double offsetL1 = 612; + offsetL1 *= overallscale; + double offsetL2 = offsetL1 * 2.0; + int refH1 = (int)floor(offsetH1); + int refH2 = (int)floor(offsetH2); + int refH3 = (int)floor(offsetH3); + int refL1 = (int)floor(offsetL1); + int refL2 = (int)floor(offsetL2); + int temp; + double fractionH1 = offsetH1 - floor(offsetH1); + double fractionH2 = offsetH2 - floor(offsetH2); + double fractionH3 = offsetH3 - floor(offsetH3); + double minusH1 = 1.0 - fractionH1; + double minusH2 = 1.0 - fractionH2; + double minusH3 = 1.0 - fractionH3; + double highsL = 0.0; + double highsR = 0.0; + int count = 0; + + long double inputSampleL; + long double inputSampleR; + + + 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. + } + + + + if (inputGain != 1.0) { + inputSampleL *= inputGain; + inputSampleR *= inputGain; + } + + overshootL = fabs(inputSampleL) - refclipL; + overshootR = fabs(inputSampleR) - refclipR; + if (overshootL < 0.0) overshootL = 0.0; + if (overshootR < 0.0) overshootR = 0.0; + + if (gcount < 0 || gcount > 11020) {gcount = 11020;} + count = gcount; + bL[count+11020] = bL[count] = overshootL; + bR[count+11020] = bR[count] = overshootR; + gcount--; + + if (highslift > 0.0) + { + //we have a big pile of b[] which is overshoots + temp = count+refH3; + highsL = -(bL[temp] * minusH3); //less as value moves away from .0 + highsL -= bL[temp+1]; //we can assume always using this in one way or another? + highsL -= (bL[temp+2] * fractionH3); //greater as value moves away from .0 + highsL += (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 3 is a negative add + highsR = -(bR[temp] * minusH3); //less as value moves away from .0 + highsR -= bR[temp+1]; //we can assume always using this in one way or another? + highsR -= (bR[temp+2] * fractionH3); //greater as value moves away from .0 + highsR += (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 3 is a negative add + temp = count+refH2; + highsL += (bL[temp] * minusH2); //less as value moves away from .0 + highsL += bL[temp+1]; //we can assume always using this in one way or another? + highsL += (bL[temp+2] * fractionH2); //greater as value moves away from .0 + highsL -= (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 2 is a positive feedback of the overshoot + highsR += (bR[temp] * minusH2); //less as value moves away from .0 + highsR += bR[temp+1]; //we can assume always using this in one way or another? + highsR += (bR[temp+2] * fractionH2); //greater as value moves away from .0 + highsR -= (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 2 is a positive feedback of the overshoot + temp = count+refH1; + highsL -= (bL[temp] * minusH1); //less as value moves away from .0 + highsL -= bL[temp+1]; //we can assume always using this in one way or another? + highsL -= (bL[temp+2] * fractionH1); //greater as value moves away from .0 + highsL += (((bL[temp]-bL[temp+1])-(bL[temp+1]-bL[temp+2]))/50); //interpolation hacks 'r us + highsL *= adjust; //add in the kernel elements backwards saves multiplies + //stage 1 is a negative feedback of the overshoot + highsR -= (bR[temp] * minusH1); //less as value moves away from .0 + highsR -= bR[temp+1]; //we can assume always using this in one way or another? + highsR -= (bR[temp+2] * fractionH1); //greater as value moves away from .0 + highsR += (((bR[temp]-bR[temp+1])-(bR[temp+1]-bR[temp+2]))/50); //interpolation hacks 'r us + highsR *= adjust; //add in the kernel elements backwards saves multiplies + //stage 1 is a negative feedback of the overshoot + //done with interpolated mostly negative feedback of the overshoot + } + + bridgerectifier = sin(fabs(highsL) * hardness); + //this will wrap around and is scaled back by softness + //wrap around is the same principle as Fracture: no top limit to sin() + if (highsL > 0) highsL = bridgerectifier; + else highsL = -bridgerectifier; + + bridgerectifier = sin(fabs(highsR) * hardness); + //this will wrap around and is scaled back by softness + //wrap around is the same principle as Fracture: no top limit to sin() + if (highsR > 0) highsR = bridgerectifier; + else highsR = -bridgerectifier; + + if (subslift > 0.0) + { + lowsL *= subs; + lowsR *= subs; + //going in we'll reel back some of the swing + temp = count+refL1; + + lowsL -= bL[temp+127]; + lowsL -= bL[temp+113]; + lowsL -= bL[temp+109]; + lowsL -= bL[temp+107]; + lowsL -= bL[temp+103]; + lowsL -= bL[temp+101]; + lowsL -= bL[temp+97]; + lowsL -= bL[temp+89]; + lowsL -= bL[temp+83]; + lowsL -= bL[temp+79]; + lowsL -= bL[temp+73]; + lowsL -= bL[temp+71]; + lowsL -= bL[temp+67]; + lowsL -= bL[temp+61]; + lowsL -= bL[temp+59]; + lowsL -= bL[temp+53]; + lowsL -= bL[temp+47]; + lowsL -= bL[temp+43]; + lowsL -= bL[temp+41]; + lowsL -= bL[temp+37]; + lowsL -= bL[temp+31]; + lowsL -= bL[temp+29]; + lowsL -= bL[temp+23]; + lowsL -= bL[temp+19]; + lowsL -= bL[temp+17]; + lowsL -= bL[temp+13]; + lowsL -= bL[temp+11]; + lowsL -= bL[temp+7]; + lowsL -= bL[temp+5]; + lowsL -= bL[temp+3]; + lowsL -= bL[temp+2]; + lowsL -= bL[temp+1]; + //initial negative lobe + + lowsR -= bR[temp+127]; + lowsR -= bR[temp+113]; + lowsR -= bR[temp+109]; + lowsR -= bR[temp+107]; + lowsR -= bR[temp+103]; + lowsR -= bR[temp+101]; + lowsR -= bR[temp+97]; + lowsR -= bR[temp+89]; + lowsR -= bR[temp+83]; + lowsR -= bR[temp+79]; + lowsR -= bR[temp+73]; + lowsR -= bR[temp+71]; + lowsR -= bR[temp+67]; + lowsR -= bR[temp+61]; + lowsR -= bR[temp+59]; + lowsR -= bR[temp+53]; + lowsR -= bR[temp+47]; + lowsR -= bR[temp+43]; + lowsR -= bR[temp+41]; + lowsR -= bR[temp+37]; + lowsR -= bR[temp+31]; + lowsR -= bR[temp+29]; + lowsR -= bR[temp+23]; + lowsR -= bR[temp+19]; + lowsR -= bR[temp+17]; + lowsR -= bR[temp+13]; + lowsR -= bR[temp+11]; + lowsR -= bR[temp+7]; + lowsR -= bR[temp+5]; + lowsR -= bR[temp+3]; + lowsR -= bR[temp+2]; + lowsR -= bR[temp+1]; + //initial negative lobe + + lowsL *= subs; + lowsL *= subs; + lowsR *= subs; + lowsR *= subs; + //twice, to minimize the suckout in low boost situations + temp = count+refL2; + + lowsL += bL[temp+127]; + lowsL += bL[temp+113]; + lowsL += bL[temp+109]; + lowsL += bL[temp+107]; + lowsL += bL[temp+103]; + lowsL += bL[temp+101]; + lowsL += bL[temp+97]; + lowsL += bL[temp+89]; + lowsL += bL[temp+83]; + lowsL += bL[temp+79]; + lowsL += bL[temp+73]; + lowsL += bL[temp+71]; + lowsL += bL[temp+67]; + lowsL += bL[temp+61]; + lowsL += bL[temp+59]; + lowsL += bL[temp+53]; + lowsL += bL[temp+47]; + lowsL += bL[temp+43]; + lowsL += bL[temp+41]; + lowsL += bL[temp+37]; + lowsL += bL[temp+31]; + lowsL += bL[temp+29]; + lowsL += bL[temp+23]; + lowsL += bL[temp+19]; + lowsL += bL[temp+17]; + lowsL += bL[temp+13]; + lowsL += bL[temp+11]; + lowsL += bL[temp+7]; + lowsL += bL[temp+5]; + lowsL += bL[temp+3]; + lowsL += bL[temp+2]; + lowsL += bL[temp+1]; + //followup positive lobe + + lowsR += bR[temp+127]; + lowsR += bR[temp+113]; + lowsR += bR[temp+109]; + lowsR += bR[temp+107]; + lowsR += bR[temp+103]; + lowsR += bR[temp+101]; + lowsR += bR[temp+97]; + lowsR += bR[temp+89]; + lowsR += bR[temp+83]; + lowsR += bR[temp+79]; + lowsR += bR[temp+73]; + lowsR += bR[temp+71]; + lowsR += bR[temp+67]; + lowsR += bR[temp+61]; + lowsR += bR[temp+59]; + lowsR += bR[temp+53]; + lowsR += bR[temp+47]; + lowsR += bR[temp+43]; + lowsR += bR[temp+41]; + lowsR += bR[temp+37]; + lowsR += bR[temp+31]; + lowsR += bR[temp+29]; + lowsR += bR[temp+23]; + lowsR += bR[temp+19]; + lowsR += bR[temp+17]; + lowsR += bR[temp+13]; + lowsR += bR[temp+11]; + lowsR += bR[temp+7]; + lowsR += bR[temp+5]; + lowsR += bR[temp+3]; + lowsR += bR[temp+2]; + lowsR += bR[temp+1]; + //followup positive lobe + + lowsL *= subs; + lowsR *= subs; + //now we have the lows content to use + } + + bridgerectifier = sin(fabs(lowsL) * softness); + //this will wrap around and is scaled back by hardness: hard = less bass push, more treble + //wrap around is the same principle as Fracture: no top limit to sin() + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + bridgerectifier = sin(fabs(lowsR) * softness); + //this will wrap around and is scaled back by hardness: hard = less bass push, more treble + //wrap around is the same principle as Fracture: no top limit to sin() + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + iirLowsAL = (iirLowsAL * invcalibsubs) + (lowsL * calibsubs); + lowsL = iirLowsAL; + bridgerectifier = sin(fabs(lowsL)); + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + iirLowsAR = (iirLowsAR * invcalibsubs) + (lowsR * calibsubs); + lowsR = iirLowsAR; + bridgerectifier = sin(fabs(lowsR)); + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + iirLowsBL = (iirLowsBL * invcalibsubs) + (lowsL * calibsubs); + lowsL = iirLowsBL; + bridgerectifier = sin(fabs(lowsL)) * 2.0; + if (lowsL > 0) lowsL = bridgerectifier; + else lowsL = -bridgerectifier; + + iirLowsBR = (iirLowsBR * invcalibsubs) + (lowsR * calibsubs); + lowsR = iirLowsBR; + bridgerectifier = sin(fabs(lowsR)) * 2.0; + if (lowsR > 0) lowsR = bridgerectifier; + else lowsR = -bridgerectifier; + + if (highslift > 0.0) inputSampleL += (highsL * (1.0-fabs(inputSampleL*hardness))); + if (subslift > 0.0) inputSampleL += (lowsL * (1.0-fabs(inputSampleL*softness))); + + if (highslift > 0.0) inputSampleR += (highsR * (1.0-fabs(inputSampleR*hardness))); + if (subslift > 0.0) inputSampleR += (lowsR * (1.0-fabs(inputSampleR*softness))); + + if (inputSampleL > refclipL && refclipL > 0.9) refclipL -= 0.01; + if (inputSampleL < -refclipL && refclipL > 0.9) refclipL -= 0.01; + if (refclipL < 0.99) refclipL += 0.00001; + //adjust clip level on the fly + + if (inputSampleR > refclipR && refclipR > 0.9) refclipR -= 0.01; + if (inputSampleR < -refclipR && refclipR > 0.9) refclipR -= 0.01; + if (refclipR < 0.99) refclipR += 0.00001; + //adjust clip level on the fly + + if (lastSampleL >= refclipL) + { + if (inputSampleL < refclipL) lastSampleL = ((refclipL*hardness) + (inputSampleL * softness)); + else lastSampleL = refclipL; + } + + if (lastSampleR >= refclipR) + { + if (inputSampleR < refclipR) lastSampleR = ((refclipR*hardness) + (inputSampleR * softness)); + else lastSampleR = refclipR; + } + + if (lastSampleL <= -refclipL) + { + if (inputSampleL > -refclipL) lastSampleL = ((-refclipL*hardness) + (inputSampleL * softness)); + else lastSampleL = -refclipL; + } + + if (lastSampleR <= -refclipR) + { + if (inputSampleR > -refclipR) lastSampleR = ((-refclipR*hardness) + (inputSampleR * softness)); + else lastSampleR = -refclipR; + } + + if (inputSampleL > refclipL) + { + if (lastSampleL < refclipL) inputSampleL = ((refclipL*hardness) + (lastSampleL * softness)); + else inputSampleL = refclipL; + } + + if (inputSampleR > refclipR) + { + if (lastSampleR < refclipR) inputSampleR = ((refclipR*hardness) + (lastSampleR * softness)); + else inputSampleR = refclipR; + } + + if (inputSampleL < -refclipL) + { + if (lastSampleL > -refclipL) inputSampleL = ((-refclipL*hardness) + (lastSampleL * softness)); + else inputSampleL = -refclipL; + } + + if (inputSampleR < -refclipR) + { + if (lastSampleR > -refclipR) inputSampleR = ((-refclipR*hardness) + (lastSampleR * softness)); + else inputSampleR = -refclipR; + } + lastSampleL = inputSampleL; + lastSampleR = inputSampleR; + + switch (mode) + { + case 1: break; //Normal + case 2: inputSampleL /= inputGain; inputSampleR /= inputGain; break; //Gain Match + case 3: inputSampleL = overshootL + highsL + lowsL; inputSampleR = overshootR + highsR + lowsR; break; //Clip Only + } + //this is our output mode switch, showing the effects + + if (inputSampleL > refclipL) inputSampleL = refclipL; + if (inputSampleL < -refclipL) inputSampleL = -refclipL; + if (inputSampleR > refclipR) inputSampleR = refclipR; + if (inputSampleR < -refclipR) inputSampleR = -refclipR; + //final 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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/ADClip7/VSTProject.sln b/plugins/WinVST/ADClip7/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ADClip7/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/ADClip7/VSTProject.vcxproj b/plugins/WinVST/ADClip7/VSTProject.vcxproj new file mode 100755 index 0000000..9134595 --- /dev/null +++ b/plugins/WinVST/ADClip7/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ADClip7.cpp" />
+ <ClCompile Include="ADClip7Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ADClip7.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ADClip764</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADClip7/VSTProject.vcxproj.filters b/plugins/WinVST/ADClip7/VSTProject.vcxproj.filters new file mode 100755 index 0000000..9739ed7 --- /dev/null +++ b/plugins/WinVST/ADClip7/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ADClip7.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ADClip7Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ADClip7.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADClip7/VSTProject.vcxproj.user b/plugins/WinVST/ADClip7/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ADClip7/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADClip7/vstplug.def b/plugins/WinVST/ADClip7/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ADClip7/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ADT/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ADT/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ADT/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ADT/.vs/VSTProject/v14/.suo b/plugins/WinVST/ADT/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..bf5ce54 --- /dev/null +++ b/plugins/WinVST/ADT/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ADT/ADT.cpp b/plugins/WinVST/ADT/ADT.cpp new file mode 100755 index 0000000..8be818c --- /dev/null +++ b/plugins/WinVST/ADT/ADT.cpp @@ -0,0 +1,165 @@ +/* ======================================== + * ADT - ADT.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ADT_H +#include "ADT.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ADT(audioMaster);} + +ADT::ADT(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; //0.0 to 2.0 headroom + B = 0.5; //delay time + C = 0.5; //-1.0 to 1.0 inv/out + D = 0.5; //delay time + E = 0.5; //-1.0 to 1.0 inv/out + F = 0.5; //0.0 to 2.0 output level + + for(int count = 0; count < 9999; count++) {pL[count] = 0; pR[count] = 0;} + offsetA = 9001; + offsetB = 9001; // :D + gcount = 0; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; + //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 +} + +ADT::~ADT() {} +VstInt32 ADT::getVendorVersion () {return 1000;} +void ADT::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ADT::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 ADT::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* 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 ADT::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* 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 ADT::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ADT::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; 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 ADT::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Headrm", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "A Delay", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "A Level", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "B Delay", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "B Level", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ADT::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*2.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string ((E*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F*2.0, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void ADT::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ADT::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ADT::getEffectName(char* name) { + vst_strncpy(name, "ADT", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ADT::getPlugCategory() {return kPlugCategEffect;} + +bool ADT::getProductString(char* text) { + vst_strncpy (text, "airwindows ADT", kVstMaxProductStrLen); return true; +} + +bool ADT::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ADT/ADT.h b/plugins/WinVST/ADT/ADT.h new file mode 100755 index 0000000..bc0bf4d --- /dev/null +++ b/plugins/WinVST/ADT/ADT.h @@ -0,0 +1,79 @@ +/* ======================================== + * ADT - ADT.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ADT_H +#define __ADT_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'aadt'; //Change this to what the AU identity is! + +class ADT : + public AudioEffectX +{ +public: + ADT(audioMasterCallback audioMaster); + ~ADT(); + 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 pL[10000]; + double pR[10000]; + int gcount; + double offsetA; + double offsetB; + + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; +}; + +#endif diff --git a/plugins/WinVST/ADT/ADTProc.cpp b/plugins/WinVST/ADT/ADTProc.cpp new file mode 100755 index 0000000..f963f2f --- /dev/null +++ b/plugins/WinVST/ADT/ADTProc.cpp @@ -0,0 +1,364 @@ +/* ======================================== + * ADT - ADT.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ADT_H +#include "ADT.h" +#endif + +void ADT::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double gain = A * 1.272; + double targetA = pow(B,4) * 4790.0; + double fractionA; + double minusA; + double intensityA = C-0.5; + //first delay + double targetB = (pow(D,4) * 4790.0); + double fractionB; + double minusB; + double intensityB = E-0.5; + //second delay + double output = F*2.0; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + + if (fabs(offsetA - targetA) > 1000) offsetA = targetA; + offsetA = ((offsetA*999.0)+targetA)/1000.0; + fractionA = offsetA - floor(offsetA); + minusA = 1.0 - fractionA; + + if (fabs(offsetB - targetB) > 1000) offsetB = targetB; + offsetB = ((offsetB*999.0)+targetB)/1000.0; + fractionB = offsetB - floor(offsetB); + minusB = 1.0 - fractionB; + //chase delay taps for smooth action + + if (gain > 0) {inputSampleL /= gain; inputSampleR /= gain;} + + if (inputSampleL > 1.2533141373155) inputSampleL = 1.2533141373155; + if (inputSampleL < -1.2533141373155) inputSampleL = -1.2533141373155; + if (inputSampleR > 1.2533141373155) inputSampleR = 1.2533141373155; + if (inputSampleR < -1.2533141373155) inputSampleR = -1.2533141373155; + + inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((inputSampleL == 0.0) ?1:fabs(inputSampleL)); + inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((inputSampleR == 0.0) ?1:fabs(inputSampleR)); + //Spiral: lean out the sound a little when decoded by ConsoleBuss + + if (gcount < 1 || gcount > 4800) {gcount = 4800;} + int count = gcount; + double totalL = 0.0; + double totalR = 0.0; + double tempL; + double tempR; + pL[count+4800] = pL[count] = inputSampleL; + pR[count+4800] = pR[count] = inputSampleR; + //double buffer + + if (intensityA != 0.0) + { + count = (int)(gcount+floor(offsetA)); + + tempL = (pL[count] * minusA); //less as value moves away from .0 + tempL += pL[count+1]; //we can assume always using this in one way or another? + tempL += (pL[count+2] * fractionA); //greater as value moves away from .0 + tempL -= (((pL[count]-pL[count+1])-(pL[count+1]-pL[count+2]))/50); //interpolation hacks 'r us + totalL += (tempL * intensityA); + + tempR = (pR[count] * minusA); //less as value moves away from .0 + tempR += pR[count+1]; //we can assume always using this in one way or another? + tempR += (pR[count+2] * fractionA); //greater as value moves away from .0 + tempR -= (((pR[count]-pR[count+1])-(pR[count+1]-pR[count+2]))/50); //interpolation hacks 'r us + totalR += (tempR * intensityA); + } + + if (intensityB != 0.0) + { + count = (int)(gcount+floor(offsetB)); + + tempL = (pL[count] * minusB); //less as value moves away from .0 + tempL += pL[count+1]; //we can assume always using this in one way or another? + tempL += (pL[count+2] * fractionB); //greater as value moves away from .0 + tempL -= (((pL[count]-pL[count+1])-(pL[count+1]-pL[count+2]))/50); //interpolation hacks 'r us + totalL += (tempL * intensityB); + + tempR = (pR[count] * minusB); //less as value moves away from .0 + tempR += pR[count+1]; //we can assume always using this in one way or another? + tempR += (pR[count+2] * fractionB); //greater as value moves away from .0 + tempR -= (((pR[count]-pR[count+1])-(pR[count+1]-pR[count+2]))/50); //interpolation hacks 'r us + totalR += (tempR * intensityB); + } + + gcount--; + //still scrolling through the samples, remember + + inputSampleL += totalL; + inputSampleR += totalR; + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + //without this, you can get a NaN condition where it spits out DC offset at full blast! + + inputSampleL = asin(inputSampleL); + inputSampleR = asin(inputSampleR); + //amplitude aspect + + inputSampleL *= gain; + inputSampleR *= gain; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + + //noise shaping to 32-bit floating point + float fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} + +void ADT::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double gain = A * 1.272; + double targetA = pow(B,4) * 4790.0; + double fractionA; + double minusA; + double intensityA = C-0.5; + //first delay + double targetB = (pow(D,4) * 4790.0); + double fractionB; + double minusB; + double intensityB = E-0.5; + //second delay + double output = F*2.0; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + + if (fabs(offsetA - targetA) > 1000) offsetA = targetA; + offsetA = ((offsetA*999.0)+targetA)/1000.0; + fractionA = offsetA - floor(offsetA); + minusA = 1.0 - fractionA; + + if (fabs(offsetB - targetB) > 1000) offsetB = targetB; + offsetB = ((offsetB*999.0)+targetB)/1000.0; + fractionB = offsetB - floor(offsetB); + minusB = 1.0 - fractionB; + //chase delay taps for smooth action + + if (gain > 0) {inputSampleL /= gain; inputSampleR /= gain;} + + if (inputSampleL > 1.2533141373155) inputSampleL = 1.2533141373155; + if (inputSampleL < -1.2533141373155) inputSampleL = -1.2533141373155; + if (inputSampleR > 1.2533141373155) inputSampleR = 1.2533141373155; + if (inputSampleR < -1.2533141373155) inputSampleR = -1.2533141373155; + + inputSampleL = sin(inputSampleL * fabs(inputSampleL)) / ((inputSampleL == 0.0) ?1:fabs(inputSampleL)); + inputSampleR = sin(inputSampleR * fabs(inputSampleR)) / ((inputSampleR == 0.0) ?1:fabs(inputSampleR)); + //Spiral: lean out the sound a little when decoded by ConsoleBuss + + if (gcount < 1 || gcount > 4800) {gcount = 4800;} + int count = gcount; + double totalL = 0.0; + double totalR = 0.0; + double tempL; + double tempR; + pL[count+4800] = pL[count] = inputSampleL; + pR[count+4800] = pR[count] = inputSampleR; + //double buffer + + if (intensityA != 0.0) + { + count = (int)(gcount+floor(offsetA)); + + tempL = (pL[count] * minusA); //less as value moves away from .0 + tempL += pL[count+1]; //we can assume always using this in one way or another? + tempL += (pL[count+2] * fractionA); //greater as value moves away from .0 + tempL -= (((pL[count]-pL[count+1])-(pL[count+1]-pL[count+2]))/50); //interpolation hacks 'r us + totalL += (tempL * intensityA); + + tempR = (pR[count] * minusA); //less as value moves away from .0 + tempR += pR[count+1]; //we can assume always using this in one way or another? + tempR += (pR[count+2] * fractionA); //greater as value moves away from .0 + tempR -= (((pR[count]-pR[count+1])-(pR[count+1]-pR[count+2]))/50); //interpolation hacks 'r us + totalR += (tempR * intensityA); + } + + if (intensityB != 0.0) + { + count = (int)(gcount+floor(offsetB)); + + tempL = (pL[count] * minusB); //less as value moves away from .0 + tempL += pL[count+1]; //we can assume always using this in one way or another? + tempL += (pL[count+2] * fractionB); //greater as value moves away from .0 + tempL -= (((pL[count]-pL[count+1])-(pL[count+1]-pL[count+2]))/50); //interpolation hacks 'r us + totalL += (tempL * intensityB); + + tempR = (pR[count] * minusB); //less as value moves away from .0 + tempR += pR[count+1]; //we can assume always using this in one way or another? + tempR += (pR[count+2] * fractionB); //greater as value moves away from .0 + tempR -= (((pR[count]-pR[count+1])-(pR[count+1]-pR[count+2]))/50); //interpolation hacks 'r us + totalR += (tempR * intensityB); + } + + gcount--; + //still scrolling through the samples, remember + + inputSampleL += totalL; + inputSampleR += totalR; + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + //without this, you can get a NaN condition where it spits out DC offset at full blast! + + inputSampleL = asin(inputSampleL); + inputSampleR = asin(inputSampleR); + //amplitude aspect + + inputSampleL *= gain; + inputSampleR *= gain; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + + //noise shaping to 64-bit floating point + double fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 64 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} diff --git a/plugins/WinVST/ADT/VSTProject.sln b/plugins/WinVST/ADT/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ADT/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/ADT/VSTProject.vcxproj b/plugins/WinVST/ADT/VSTProject.vcxproj new file mode 100755 index 0000000..382322e --- /dev/null +++ b/plugins/WinVST/ADT/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ADT.cpp" />
+ <ClCompile Include="ADTProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ADT.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ADT64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADT/VSTProject.vcxproj.filters b/plugins/WinVST/ADT/VSTProject.vcxproj.filters new file mode 100755 index 0000000..30e7640 --- /dev/null +++ b/plugins/WinVST/ADT/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ADT.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ADTProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ADT.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADT/VSTProject.vcxproj.user b/plugins/WinVST/ADT/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ADT/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ADT/vstplug.def b/plugins/WinVST/ADT/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ADT/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/AQuickVoiceClip/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/AQuickVoiceClip/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/AQuickVoiceClip/.vs/VSTProject/v14/.suo b/plugins/WinVST/AQuickVoiceClip/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..42a754f --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp new file mode 100755 index 0000000..9b5ea81 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.cpp @@ -0,0 +1,166 @@ +/* ======================================== + * AQuickVoiceClip - AQuickVoiceClip.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __AQuickVoiceClip_H +#include "AQuickVoiceClip.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new AQuickVoiceClip(audioMaster);} + +AQuickVoiceClip::AQuickVoiceClip(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.42; + LataLast6Sample = LataLast5Sample = LataLast4Sample = 0.0; + LataLast3Sample = LataLast2Sample = LataLast1Sample = 0.0; + LataHalfwaySample = LataHalfDrySample = LataHalfDiffSample = 0.0; + LataDrySample = LataDiffSample = LataPrevDiffSample = 0.0; + + RataLast6Sample = RataLast5Sample = RataLast4Sample = 0.0; + RataLast3Sample = RataLast2Sample = RataLast1Sample = 0.0; + RataHalfwaySample = RataHalfDrySample = RataHalfDiffSample = 0.0; + RataDrySample = RataDiffSample = RataPrevDiffSample = 0.0; + + LlastSample = 0.0; + LlastOutSample = 0.0; + LlastOut2Sample = 0.0; + LlastOut3Sample = 0.0; + LlpDepth = 0.0; + Lovershoot = 0.0; + Loverall = 0; + LiirSampleA = 0.0; + LiirSampleB = 0.0; + LiirSampleC = 0.0; + LiirSampleD = 0.0; + + RlastSample = 0.0; + RlastOutSample = 0.0; + RlastOut2Sample = 0.0; + RlastOut3Sample = 0.0; + RlpDepth = 0.0; + Rovershoot = 0.0; + Roverall = 0; + RiirSampleA = 0.0; + RiirSampleB = 0.0; + RiirSampleC = 0.0; + RiirSampleD = 0.0; + flip = true; + + ataK1 = -0.646; //first FIR shaping of interpolated sample, brightens + ataK2 = 0.311; //second FIR shaping of interpolated sample, thickens + ataK6 = -0.093; //third FIR shaping of interpolated sample, brings air + ataK7 = 0.057; //fourth FIR shaping of interpolated sample, thickens + ataK8 = -0.023; //fifth FIR shaping of interpolated sample, brings air + ataK3 = 0.114; //add raw to interpolated dry, toughens + ataK4 = 0.886; //remainder of interpolated dry, adds up to 1.0 + ataK5 = 0.431; //subtract this much prev. diff sample, brightens. 0.431 becomes flat + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +AQuickVoiceClip::~AQuickVoiceClip() {} +VstInt32 AQuickVoiceClip::getVendorVersion () {return 1000;} +void AQuickVoiceClip::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void AQuickVoiceClip::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 AQuickVoiceClip::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 AQuickVoiceClip::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 AQuickVoiceClip::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float AQuickVoiceClip::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 AQuickVoiceClip::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Highpass", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void AQuickVoiceClip::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((pow(A,3)*2070)+30, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void AQuickVoiceClip::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "hz", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 AQuickVoiceClip::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool AQuickVoiceClip::getEffectName(char* name) { + vst_strncpy(name, "AQuickVoiceClip", kVstMaxProductStrLen); return true; +} + +VstPlugCategory AQuickVoiceClip::getPlugCategory() {return kPlugCategEffect;} + +bool AQuickVoiceClip::getProductString(char* text) { + vst_strncpy (text, "airwindows AQuickVoiceClip", kVstMaxProductStrLen); return true; +} + +bool AQuickVoiceClip::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h new file mode 100755 index 0000000..dc8f5fa --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClip.h @@ -0,0 +1,128 @@ +/* ======================================== + * AQuickVoiceClip - AQuickVoiceClip.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __AQuickVoiceClip_H +#define __AQuickVoiceClip_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'aqvc'; //Change this to what the AU identity is! + +class AQuickVoiceClip : + public AudioEffectX +{ +public: + AQuickVoiceClip(audioMasterCallback audioMaster); + ~AQuickVoiceClip(); + 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 LataLast6Sample; + double LataLast5Sample; + double LataLast4Sample; + double LataLast3Sample; + double LataLast2Sample; + double LataLast1Sample; + double LataHalfwaySample; + double LataHalfDrySample; + double LataHalfDiffSample; + double LataLastDiffSample; + double LataDrySample; + double LataDiffSample; + double LataPrevDiffSample; + + double RataLast6Sample; + double RataLast5Sample; + double RataLast4Sample; + double RataLast3Sample; + double RataLast2Sample; + double RataLast1Sample; + double RataHalfwaySample; + double RataHalfDrySample; + double RataHalfDiffSample; + double RataLastDiffSample; + double RataDrySample; + double RataDiffSample; + double RataPrevDiffSample; + + double ataK1; + double ataK2; + double ataK3; + double ataK4; + double ataK5; + double ataK6; + double ataK7; + double ataK8; //end antialiasing variables + + double LlastSample; + double LlastOutSample; + double LlastOut2Sample; + double LlastOut3Sample; + double LlpDepth; + double Lovershoot; + double Loverall; + double LiirSampleA; + double LiirSampleB; + double LiirSampleC; + double LiirSampleD; + + double RlastSample; + double RlastOutSample; + double RlastOut2Sample; + double RlastOut3Sample; + double RlpDepth; + double Rovershoot; + double Roverall; + double RiirSampleA; + double RiirSampleB; + double RiirSampleC; + double RiirSampleD; + bool flip; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; +}; + +#endif diff --git a/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp new file mode 100755 index 0000000..69dc283 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/AQuickVoiceClipProc.cpp @@ -0,0 +1,900 @@ +/* ======================================== + * AQuickVoiceClip - AQuickVoiceClip.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __AQuickVoiceClip_H +#include "AQuickVoiceClip.h" +#endif + +void AQuickVoiceClip::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 softness = 0.484416; + double hardness = 1.0 - softness; + double iirAmount = ((pow(A,3)*2070)+30)/8000.0; + iirAmount /= overallscale; + double altAmount = (1.0 - iirAmount); + double cancelnew = 0.0682276; + double cancelold = 1.0 - cancelnew; + double lpSpeed = 0.0009; + double cliplevel = 0.98; + double refclip = 0.5; //preset to cut out gain quite a lot. 91%? no touchy unless clip + + double LmaxRecent; + bool LclipOnset; + double LpassThrough; + double LoutputSample; + double LdrySample; + + double RmaxRecent; + bool RclipOnset; + double RpassThrough; + double RoutputSample; + double RdrySample; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + LpassThrough = LataDrySample = inputSampleL; + RpassThrough = RataDrySample = inputSampleR; + + LataHalfDrySample = LataHalfwaySample = (inputSampleL + LataLast1Sample + (LataLast2Sample*ataK1) + (LataLast3Sample*ataK2) + (LataLast4Sample*ataK6) + (LataLast5Sample*ataK7) + (LataLast6Sample*ataK8)) / 2.0; + LataLast6Sample = LataLast5Sample; LataLast5Sample = LataLast4Sample; LataLast4Sample = LataLast3Sample; LataLast3Sample = LataLast2Sample; LataLast2Sample = LataLast1Sample; LataLast1Sample = inputSampleL; + //setting up oversampled special antialiasing + RataHalfDrySample = RataHalfwaySample = (inputSampleR + RataLast1Sample + (RataLast2Sample*ataK1) + (RataLast3Sample*ataK2) + (RataLast4Sample*ataK6) + (RataLast5Sample*ataK7) + (RataLast6Sample*ataK8)) / 2.0; + RataLast6Sample = RataLast5Sample; RataLast5Sample = RataLast4Sample; RataLast4Sample = RataLast3Sample; RataLast3Sample = RataLast2Sample; RataLast2Sample = RataLast1Sample; RataLast1Sample = inputSampleR; + //setting up oversampled special antialiasing + LclipOnset = false; + RclipOnset = false; + + + LmaxRecent = fabs( LataLast6Sample ); + if (fabs( LataLast5Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast5Sample ); + if (fabs( LataLast4Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast4Sample ); + if (fabs( LataLast3Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast3Sample ); + if (fabs( LataLast2Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast2Sample ); + if (fabs( LataLast1Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast1Sample ); + if (fabs( inputSampleL ) > LmaxRecent ) LmaxRecent = fabs( inputSampleL ); + //this gives us something that won't cut out in zero crossings, to interpolate with + + RmaxRecent = fabs( RataLast6Sample ); + if (fabs( RataLast5Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast5Sample ); + if (fabs( RataLast4Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast4Sample ); + if (fabs( RataLast3Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast3Sample ); + if (fabs( RataLast2Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast2Sample ); + if (fabs( RataLast1Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast1Sample ); + if (fabs( inputSampleR ) > RmaxRecent ) RmaxRecent = fabs( inputSampleR ); + //this gives us something that won't cut out in zero crossings, to interpolate with + + LmaxRecent *= 2.0; + RmaxRecent *= 2.0; + //by refclip this is 1.0 and fully into the antialiasing + if (LmaxRecent > 1.0) LmaxRecent = 1.0; + if (RmaxRecent > 1.0) RmaxRecent = 1.0; + //and it tops out at 1. Higher means more antialiasing, lower blends into passThrough without antialiasing + + LataHalfwaySample -= Loverall; + RataHalfwaySample -= Roverall; + //subtract dist-cancel from input after getting raw input, before doing anything + + LdrySample = LataHalfwaySample; + RdrySample = RataHalfwaySample; + + + //begin L channel for the clipper + if (LlastSample >= refclip) + { + LlpDepth += 0.1; + if (LataHalfwaySample < refclip) + { + LlastSample = ((refclip*hardness) + (LataHalfwaySample * softness)); + } + else LlastSample = refclip; + } + + if (LlastSample <= -refclip) + { + LlpDepth += 0.1; + if (LataHalfwaySample > -refclip) + { + LlastSample = ((-refclip*hardness) + (LataHalfwaySample * softness)); + } + else LlastSample = -refclip; + } + + if (LataHalfwaySample > refclip) + { + LlpDepth += 0.1; + if (LlastSample < refclip) + { + LataHalfwaySample = ((refclip*hardness) + (LlastSample * softness)); + } + else LataHalfwaySample = refclip; + } + + if (LataHalfwaySample < -refclip) + { + LlpDepth += 0.1; + if (LlastSample > -refclip) + { + LataHalfwaySample = ((-refclip*hardness) + (LlastSample * softness)); + } + else LataHalfwaySample = -refclip; + } + ///end L channel for the clipper + + //begin R channel for the clipper + if (RlastSample >= refclip) + { + RlpDepth += 0.1; + if (RataHalfwaySample < refclip) + { + RlastSample = ((refclip*hardness) + (RataHalfwaySample * softness)); + } + else RlastSample = refclip; + } + + if (RlastSample <= -refclip) + { + RlpDepth += 0.1; + if (RataHalfwaySample > -refclip) + { + RlastSample = ((-refclip*hardness) + (RataHalfwaySample * softness)); + } + else RlastSample = -refclip; + } + + if (RataHalfwaySample > refclip) + { + RlpDepth += 0.1; + if (RlastSample < refclip) + { + RataHalfwaySample = ((refclip*hardness) + (RlastSample * softness)); + } + else RataHalfwaySample = refclip; + } + + if (RataHalfwaySample < -refclip) + { + RlpDepth += 0.1; + if (RlastSample > -refclip) + { + RataHalfwaySample = ((-refclip*hardness) + (RlastSample * softness)); + } + else RataHalfwaySample = -refclip; + } + ///end R channel for the clipper + + LoutputSample = LlastSample; + RoutputSample = RlastSample; + + LlastSample = LataHalfwaySample; + RlastSample = RataHalfwaySample; + + LataHalfwaySample = LoutputSample; + RataHalfwaySample = RoutputSample; + //swap around in a circle for one final ADClip, + //this time not tracking overshoot anymore + //end interpolated sample + //begin raw sample- inputSample and ataDrySample handled separately here + + inputSampleL -= Loverall; + inputSampleR -= Roverall; + //subtract dist-cancel from input after getting raw input, before doing anything + + LdrySample = inputSampleL; + RdrySample = inputSampleR; + + //begin second L clip + if (LlastSample >= refclip) + { + LlpDepth += 0.1; + if (inputSampleL < refclip) + { + LlastSample = ((refclip*hardness) + (inputSampleL * softness)); + } + else LlastSample = refclip; + } + + if (LlastSample <= -refclip) + { + LlpDepth += 0.1; + if (inputSampleL > -refclip) + { + LlastSample = ((-refclip*hardness) + (inputSampleL * softness)); + } + else LlastSample = -refclip; + } + + if (inputSampleL > refclip) + { + LlpDepth += 0.1; + if (LlastSample < refclip) + { + inputSampleL = ((refclip*hardness) + (LlastSample * softness)); + } + else inputSampleL = refclip; + } + + if (inputSampleL < -refclip) + { + LlpDepth += 0.1; + if (LlastSample > -refclip) + { + inputSampleL = ((-refclip*hardness) + (LlastSample * softness)); + } + else inputSampleL = -refclip; + } + //end second L clip + + //begin second R clip + if (RlastSample >= refclip) + { + RlpDepth += 0.1; + if (inputSampleR < refclip) + { + RlastSample = ((refclip*hardness) + (inputSampleR * softness)); + } + else RlastSample = refclip; + } + + if (RlastSample <= -refclip) + { + RlpDepth += 0.1; + if (inputSampleR > -refclip) + { + RlastSample = ((-refclip*hardness) + (inputSampleR * softness)); + } + else RlastSample = -refclip; + } + + if (inputSampleR > refclip) + { + RlpDepth += 0.1; + if (RlastSample < refclip) + { + inputSampleR = ((refclip*hardness) + (RlastSample * softness)); + } + else inputSampleR = refclip; + } + + if (inputSampleR < -refclip) + { + RlpDepth += 0.1; + if (RlastSample > -refclip) + { + inputSampleR = ((-refclip*hardness) + (RlastSample * softness)); + } + else inputSampleR = -refclip; + } + //end second R clip + + LoutputSample = LlastSample; + RoutputSample = RlastSample; + LlastSample = inputSampleL; + RlastSample = inputSampleR; + inputSampleL = LoutputSample; + inputSampleR = RoutputSample; + + LataHalfDrySample = (LataDrySample*ataK3)+(LataHalfDrySample*ataK4); + LataHalfDiffSample = (LataHalfwaySample - LataHalfDrySample)/2.0; + LataLastDiffSample = LataDiffSample*ataK5; + LataDiffSample = (inputSampleL - LataDrySample)/2.0; + LataDiffSample += LataHalfDiffSample; + LataDiffSample -= LataLastDiffSample; + inputSampleL = LataDrySample; + inputSampleL += LataDiffSample; + + RataHalfDrySample = (RataDrySample*ataK3)+(RataHalfDrySample*ataK4); + RataHalfDiffSample = (RataHalfwaySample - RataHalfDrySample)/2.0; + RataLastDiffSample = RataDiffSample*ataK5; + RataDiffSample = (inputSampleR - RataDrySample)/2.0; + RataDiffSample += RataHalfDiffSample; + RataDiffSample -= RataLastDiffSample; + inputSampleR = RataDrySample; + inputSampleR += RataDiffSample; + + Loverall = (Loverall * cancelold) + (LataDiffSample * cancelnew); + Roverall = (Roverall * cancelold) + (RataDiffSample * cancelnew); + //apply all the diffs to a lowpassed IIR + + + if (flip) + { + LiirSampleA = (LiirSampleA * altAmount) + (inputSampleL * iirAmount); + inputSampleL -= LiirSampleA; + LiirSampleC = (LiirSampleC * altAmount) + (LpassThrough * iirAmount); + LpassThrough -= LiirSampleC; + + RiirSampleA = (RiirSampleA * altAmount) + (inputSampleR * iirAmount); + inputSampleR -= RiirSampleA; + RiirSampleC = (RiirSampleC * altAmount) + (RpassThrough * iirAmount); + RpassThrough -= RiirSampleC; + } + else + { + LiirSampleB = (LiirSampleB * altAmount) + (inputSampleL * iirAmount); + inputSampleL -= LiirSampleB; + LiirSampleD = (LiirSampleD * altAmount) + (LpassThrough * iirAmount); + LpassThrough -= LiirSampleD; + + RiirSampleB = (RiirSampleB * altAmount) + (inputSampleR * iirAmount); + inputSampleR -= RiirSampleB; + RiirSampleD = (RiirSampleD * altAmount) + (RpassThrough * iirAmount); + RpassThrough -= RiirSampleD; + } + flip = !flip; + //highpass section + + LlastOut3Sample = LlastOut2Sample; + LlastOut2Sample = LlastOutSample; + LlastOutSample = inputSampleL; + + RlastOut3Sample = RlastOut2Sample; + RlastOut2Sample = RlastOutSample; + RlastOutSample = inputSampleR; + + + LlpDepth -= lpSpeed; + RlpDepth -= lpSpeed; + + if (LlpDepth > 0.0) + { + if (LlpDepth > 1.0) LlpDepth = 1.0; + inputSampleL *= (1.0-LlpDepth); + inputSampleL += (((LlastOutSample + LlastOut2Sample + LlastOut3Sample) / 3.6)*LlpDepth); + } + + if (RlpDepth > 0.0) + { + if (RlpDepth > 1.0) RlpDepth = 1.0; + inputSampleR *= (1.0-RlpDepth); + inputSampleR += (((RlastOutSample + RlastOut2Sample + RlastOut3Sample) / 3.6)*RlpDepth); + } + + if (LlpDepth < 0.0) LlpDepth = 0.0; + if (RlpDepth < 0.0) RlpDepth = 0.0; + + //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 + + inputSampleL *= (1.0-LmaxRecent); + inputSampleR *= (1.0-RmaxRecent); + inputSampleL += (LpassThrough * LmaxRecent); + inputSampleR += (RpassThrough * RmaxRecent); + //there's our raw signal, without antialiasing. Brings up low level stuff and softens more when hot + + if (inputSampleL > cliplevel) inputSampleL = cliplevel; + if (inputSampleL < -cliplevel) inputSampleL = -cliplevel; + if (inputSampleR > cliplevel) inputSampleR = cliplevel; + if (inputSampleR < -cliplevel) inputSampleR = -cliplevel; + //final iron bar + + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void AQuickVoiceClip::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 softness = 0.484416; + double hardness = 1.0 - softness; + double iirAmount = ((pow(A,3)*2070)+30)/8000.0; + iirAmount /= overallscale; + double altAmount = (1.0 - iirAmount); + double cancelnew = 0.0682276; + double cancelold = 1.0 - cancelnew; + double lpSpeed = 0.0009; + double cliplevel = 0.98; + double refclip = 0.5; //preset to cut out gain quite a lot. 91%? no touchy unless clip + + double LmaxRecent; + bool LclipOnset; + double LpassThrough; + double LoutputSample; + double LdrySample; + + double RmaxRecent; + bool RclipOnset; + double RpassThrough; + double RoutputSample; + double RdrySample; + + 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; + + 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. + } + LpassThrough = LataDrySample = inputSampleL; + RpassThrough = RataDrySample = inputSampleR; + + LataHalfDrySample = LataHalfwaySample = (inputSampleL + LataLast1Sample + (LataLast2Sample*ataK1) + (LataLast3Sample*ataK2) + (LataLast4Sample*ataK6) + (LataLast5Sample*ataK7) + (LataLast6Sample*ataK8)) / 2.0; + LataLast6Sample = LataLast5Sample; LataLast5Sample = LataLast4Sample; LataLast4Sample = LataLast3Sample; LataLast3Sample = LataLast2Sample; LataLast2Sample = LataLast1Sample; LataLast1Sample = inputSampleL; + //setting up oversampled special antialiasing + RataHalfDrySample = RataHalfwaySample = (inputSampleR + RataLast1Sample + (RataLast2Sample*ataK1) + (RataLast3Sample*ataK2) + (RataLast4Sample*ataK6) + (RataLast5Sample*ataK7) + (RataLast6Sample*ataK8)) / 2.0; + RataLast6Sample = RataLast5Sample; RataLast5Sample = RataLast4Sample; RataLast4Sample = RataLast3Sample; RataLast3Sample = RataLast2Sample; RataLast2Sample = RataLast1Sample; RataLast1Sample = inputSampleR; + //setting up oversampled special antialiasing + LclipOnset = false; + RclipOnset = false; + + + LmaxRecent = fabs( LataLast6Sample ); + if (fabs( LataLast5Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast5Sample ); + if (fabs( LataLast4Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast4Sample ); + if (fabs( LataLast3Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast3Sample ); + if (fabs( LataLast2Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast2Sample ); + if (fabs( LataLast1Sample ) > LmaxRecent ) LmaxRecent = fabs( LataLast1Sample ); + if (fabs( inputSampleL ) > LmaxRecent ) LmaxRecent = fabs( inputSampleL ); + //this gives us something that won't cut out in zero crossings, to interpolate with + + RmaxRecent = fabs( RataLast6Sample ); + if (fabs( RataLast5Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast5Sample ); + if (fabs( RataLast4Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast4Sample ); + if (fabs( RataLast3Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast3Sample ); + if (fabs( RataLast2Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast2Sample ); + if (fabs( RataLast1Sample ) > RmaxRecent ) RmaxRecent = fabs( RataLast1Sample ); + if (fabs( inputSampleR ) > RmaxRecent ) RmaxRecent = fabs( inputSampleR ); + //this gives us something that won't cut out in zero crossings, to interpolate with + + LmaxRecent *= 2.0; + RmaxRecent *= 2.0; + //by refclip this is 1.0 and fully into the antialiasing + if (LmaxRecent > 1.0) LmaxRecent = 1.0; + if (RmaxRecent > 1.0) RmaxRecent = 1.0; + //and it tops out at 1. Higher means more antialiasing, lower blends into passThrough without antialiasing + + LataHalfwaySample -= Loverall; + RataHalfwaySample -= Roverall; + //subtract dist-cancel from input after getting raw input, before doing anything + + LdrySample = LataHalfwaySample; + RdrySample = RataHalfwaySample; + + + //begin L channel for the clipper + if (LlastSample >= refclip) + { + LlpDepth += 0.1; + if (LataHalfwaySample < refclip) + { + LlastSample = ((refclip*hardness) + (LataHalfwaySample * softness)); + } + else LlastSample = refclip; + } + + if (LlastSample <= -refclip) + { + LlpDepth += 0.1; + if (LataHalfwaySample > -refclip) + { + LlastSample = ((-refclip*hardness) + (LataHalfwaySample * softness)); + } + else LlastSample = -refclip; + } + + if (LataHalfwaySample > refclip) + { + LlpDepth += 0.1; + if (LlastSample < refclip) + { + LataHalfwaySample = ((refclip*hardness) + (LlastSample * softness)); + } + else LataHalfwaySample = refclip; + } + + if (LataHalfwaySample < -refclip) + { + LlpDepth += 0.1; + if (LlastSample > -refclip) + { + LataHalfwaySample = ((-refclip*hardness) + (LlastSample * softness)); + } + else LataHalfwaySample = -refclip; + } + ///end L channel for the clipper + + //begin R channel for the clipper + if (RlastSample >= refclip) + { + RlpDepth += 0.1; + if (RataHalfwaySample < refclip) + { + RlastSample = ((refclip*hardness) + (RataHalfwaySample * softness)); + } + else RlastSample = refclip; + } + + if (RlastSample <= -refclip) + { + RlpDepth += 0.1; + if (RataHalfwaySample > -refclip) + { + RlastSample = ((-refclip*hardness) + (RataHalfwaySample * softness)); + } + else RlastSample = -refclip; + } + + if (RataHalfwaySample > refclip) + { + RlpDepth += 0.1; + if (RlastSample < refclip) + { + RataHalfwaySample = ((refclip*hardness) + (RlastSample * softness)); + } + else RataHalfwaySample = refclip; + } + + if (RataHalfwaySample < -refclip) + { + RlpDepth += 0.1; + if (RlastSample > -refclip) + { + RataHalfwaySample = ((-refclip*hardness) + (RlastSample * softness)); + } + else RataHalfwaySample = -refclip; + } + ///end R channel for the clipper + + LoutputSample = LlastSample; + RoutputSample = RlastSample; + + LlastSample = LataHalfwaySample; + RlastSample = RataHalfwaySample; + + LataHalfwaySample = LoutputSample; + RataHalfwaySample = RoutputSample; + //swap around in a circle for one final ADClip, + //this time not tracking overshoot anymore + //end interpolated sample + //begin raw sample- inputSample and ataDrySample handled separately here + + inputSampleL -= Loverall; + inputSampleR -= Roverall; + //subtract dist-cancel from input after getting raw input, before doing anything + + LdrySample = inputSampleL; + RdrySample = inputSampleR; + + //begin second L clip + if (LlastSample >= refclip) + { + LlpDepth += 0.1; + if (inputSampleL < refclip) + { + LlastSample = ((refclip*hardness) + (inputSampleL * softness)); + } + else LlastSample = refclip; + } + + if (LlastSample <= -refclip) + { + LlpDepth += 0.1; + if (inputSampleL > -refclip) + { + LlastSample = ((-refclip*hardness) + (inputSampleL * softness)); + } + else LlastSample = -refclip; + } + + if (inputSampleL > refclip) + { + LlpDepth += 0.1; + if (LlastSample < refclip) + { + inputSampleL = ((refclip*hardness) + (LlastSample * softness)); + } + else inputSampleL = refclip; + } + + if (inputSampleL < -refclip) + { + LlpDepth += 0.1; + if (LlastSample > -refclip) + { + inputSampleL = ((-refclip*hardness) + (LlastSample * softness)); + } + else inputSampleL = -refclip; + } + //end second L clip + + //begin second R clip + if (RlastSample >= refclip) + { + RlpDepth += 0.1; + if (inputSampleR < refclip) + { + RlastSample = ((refclip*hardness) + (inputSampleR * softness)); + } + else RlastSample = refclip; + } + + if (RlastSample <= -refclip) + { + RlpDepth += 0.1; + if (inputSampleR > -refclip) + { + RlastSample = ((-refclip*hardness) + (inputSampleR * softness)); + } + else RlastSample = -refclip; + } + + if (inputSampleR > refclip) + { + RlpDepth += 0.1; + if (RlastSample < refclip) + { + inputSampleR = ((refclip*hardness) + (RlastSample * softness)); + } + else inputSampleR = refclip; + } + + if (inputSampleR < -refclip) + { + RlpDepth += 0.1; + if (RlastSample > -refclip) + { + inputSampleR = ((-refclip*hardness) + (RlastSample * softness)); + } + else inputSampleR = -refclip; + } + //end second R clip + + LoutputSample = LlastSample; + RoutputSample = RlastSample; + LlastSample = inputSampleL; + RlastSample = inputSampleR; + inputSampleL = LoutputSample; + inputSampleR = RoutputSample; + + LataHalfDrySample = (LataDrySample*ataK3)+(LataHalfDrySample*ataK4); + LataHalfDiffSample = (LataHalfwaySample - LataHalfDrySample)/2.0; + LataLastDiffSample = LataDiffSample*ataK5; + LataDiffSample = (inputSampleL - LataDrySample)/2.0; + LataDiffSample += LataHalfDiffSample; + LataDiffSample -= LataLastDiffSample; + inputSampleL = LataDrySample; + inputSampleL += LataDiffSample; + + RataHalfDrySample = (RataDrySample*ataK3)+(RataHalfDrySample*ataK4); + RataHalfDiffSample = (RataHalfwaySample - RataHalfDrySample)/2.0; + RataLastDiffSample = RataDiffSample*ataK5; + RataDiffSample = (inputSampleR - RataDrySample)/2.0; + RataDiffSample += RataHalfDiffSample; + RataDiffSample -= RataLastDiffSample; + inputSampleR = RataDrySample; + inputSampleR += RataDiffSample; + + Loverall = (Loverall * cancelold) + (LataDiffSample * cancelnew); + Roverall = (Roverall * cancelold) + (RataDiffSample * cancelnew); + //apply all the diffs to a lowpassed IIR + + + if (flip) + { + LiirSampleA = (LiirSampleA * altAmount) + (inputSampleL * iirAmount); + inputSampleL -= LiirSampleA; + LiirSampleC = (LiirSampleC * altAmount) + (LpassThrough * iirAmount); + LpassThrough -= LiirSampleC; + + RiirSampleA = (RiirSampleA * altAmount) + (inputSampleR * iirAmount); + inputSampleR -= RiirSampleA; + RiirSampleC = (RiirSampleC * altAmount) + (RpassThrough * iirAmount); + RpassThrough -= RiirSampleC; + } + else + { + LiirSampleB = (LiirSampleB * altAmount) + (inputSampleL * iirAmount); + inputSampleL -= LiirSampleB; + LiirSampleD = (LiirSampleD * altAmount) + (LpassThrough * iirAmount); + LpassThrough -= LiirSampleD; + + RiirSampleB = (RiirSampleB * altAmount) + (inputSampleR * iirAmount); + inputSampleR -= RiirSampleB; + RiirSampleD = (RiirSampleD * altAmount) + (RpassThrough * iirAmount); + RpassThrough -= RiirSampleD; + } + flip = !flip; + //highpass section + + LlastOut3Sample = LlastOut2Sample; + LlastOut2Sample = LlastOutSample; + LlastOutSample = inputSampleL; + + RlastOut3Sample = RlastOut2Sample; + RlastOut2Sample = RlastOutSample; + RlastOutSample = inputSampleR; + + + LlpDepth -= lpSpeed; + RlpDepth -= lpSpeed; + + if (LlpDepth > 0.0) + { + if (LlpDepth > 1.0) LlpDepth = 1.0; + inputSampleL *= (1.0-LlpDepth); + inputSampleL += (((LlastOutSample + LlastOut2Sample + LlastOut3Sample) / 3.6)*LlpDepth); + } + + if (RlpDepth > 0.0) + { + if (RlpDepth > 1.0) RlpDepth = 1.0; + inputSampleR *= (1.0-RlpDepth); + inputSampleR += (((RlastOutSample + RlastOut2Sample + RlastOut3Sample) / 3.6)*RlpDepth); + } + + if (LlpDepth < 0.0) LlpDepth = 0.0; + if (RlpDepth < 0.0) RlpDepth = 0.0; + + //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 + + inputSampleL *= (1.0-LmaxRecent); + inputSampleR *= (1.0-RmaxRecent); + inputSampleL += (LpassThrough * LmaxRecent); + inputSampleR += (RpassThrough * RmaxRecent); + //there's our raw signal, without antialiasing. Brings up low level stuff and softens more when hot + + if (inputSampleL > cliplevel) inputSampleL = cliplevel; + if (inputSampleL < -cliplevel) inputSampleL = -cliplevel; + if (inputSampleR > cliplevel) inputSampleR = cliplevel; + if (inputSampleR < -cliplevel) inputSampleR = -cliplevel; + //final iron bar + + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/AQuickVoiceClip/VSTProject.sln b/plugins/WinVST/AQuickVoiceClip/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/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/AQuickVoiceClip/VSTProject.vcxproj b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj new file mode 100755 index 0000000..de8b402 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="AQuickVoiceClip.cpp" />
+ <ClCompile Include="AQuickVoiceClipProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="AQuickVoiceClip.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>AQuickVoiceClip64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.filters b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.filters new file mode 100755 index 0000000..600e15f --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="AQuickVoiceClip.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="AQuickVoiceClipProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="AQuickVoiceClip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.user b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/AQuickVoiceClip/vstplug.def b/plugins/WinVST/AQuickVoiceClip/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/AQuickVoiceClip/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Air/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Air/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Air/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Air/.vs/VSTProject/v14/.suo b/plugins/WinVST/Air/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..5e12ea1 --- /dev/null +++ b/plugins/WinVST/Air/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Air/Air.cpp b/plugins/WinVST/Air/Air.cpp new file mode 100755 index 0000000..ebe8adc --- /dev/null +++ b/plugins/WinVST/Air/Air.cpp @@ -0,0 +1,205 @@ +/* ======================================== + * Air - Air.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Air_H +#include "Air.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Air(audioMaster);} + +Air::Air(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + airPrevAL = 0.0; + airEvenAL = 0.0; + airOddAL = 0.0; + airFactorAL = 0.0; + airPrevBL = 0.0; + airEvenBL = 0.0; + airOddBL = 0.0; + airFactorBL = 0.0; + airPrevCL = 0.0; + airEvenCL = 0.0; + airOddCL = 0.0; + airFactorCL = 0.0; + tripletPrevL = 0.0; + tripletMidL = 0.0; + tripletAL = 0.0; + tripletBL = 0.0; + tripletCL = 0.0; + tripletFactorL = 0.0; + + airPrevAR = 0.0; + airEvenAR = 0.0; + airOddAR = 0.0; + airFactorAR = 0.0; + airPrevBR = 0.0; + airEvenBR = 0.0; + airOddBR = 0.0; + airFactorBR = 0.0; + airPrevCR = 0.0; + airEvenCR = 0.0; + airOddCR = 0.0; + airFactorCR = 0.0; + tripletPrevR = 0.0; + tripletMidR = 0.0; + tripletAR = 0.0; + tripletBR = 0.0; + tripletCR = 0.0; + tripletFactorR = 0.0; + + flipA = false; + flipB = false; + flop = false; + count = 1; + + A = 0.5; + B = 0.5; + C = 0.5; + D = 0.0; + E = 1.0; + F = 1.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Air::~Air() {} +VstInt32 Air::getVendorVersion () {return 1000;} +void Air::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Air::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 Air::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* 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 Air::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* 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 Air::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 + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Air::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; 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 Air::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "22K tap", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "15K tap", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "11K tap", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "filters Q", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Output Level", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Air::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Air::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Air::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Air::getEffectName(char* name) { + vst_strncpy(name, "Air", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Air::getPlugCategory() {return kPlugCategEffect;} + +bool Air::getProductString(char* text) { + vst_strncpy (text, "airwindows Air", kVstMaxProductStrLen); return true; +} + +bool Air::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Air/Air.h b/plugins/WinVST/Air/Air.h new file mode 100755 index 0000000..00c0b76 --- /dev/null +++ b/plugins/WinVST/Air/Air.h @@ -0,0 +1,119 @@ +/* ======================================== + * Air - Air.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Air_H +#define __Air_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'aiyr'; //Change this to what the AU identity is! + +class Air : + public AudioEffectX +{ +public: + Air(audioMasterCallback audioMaster); + ~Air(); + 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 airPrevAL; + double airEvenAL; + double airOddAL; + double airFactorAL; + double airPrevBL; + double airEvenBL; + double airOddBL; + double airFactorBL; + double airPrevCL; + double airEvenCL; + double airOddCL; + double airFactorCL; + double tripletPrevL; + double tripletMidL; + double tripletAL; + double tripletBL; + double tripletCL; + double tripletFactorL; + + double airPrevAR; + double airEvenAR; + double airOddAR; + double airFactorAR; + double airPrevBR; + double airEvenBR; + double airOddBR; + double airFactorBR; + double airPrevCR; + double airEvenCR; + double airOddCR; + double airFactorCR; + double tripletPrevR; + double tripletMidR; + double tripletAR; + double tripletBR; + double tripletCR; + double tripletFactorR; + + bool flipA; + bool flipB; + bool flop; + int count; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + float E; + float F; + +}; + +#endif diff --git a/plugins/WinVST/Air/AirProc.cpp b/plugins/WinVST/Air/AirProc.cpp new file mode 100755 index 0000000..f73e7d8 --- /dev/null +++ b/plugins/WinVST/Air/AirProc.cpp @@ -0,0 +1,574 @@ +/* ======================================== + * Air - Air.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Air_H +#include "Air.h" +#endif + +void Air::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double hiIntensity = -pow(((A*2.0)-1.0),3)*2; + double tripletintensity = -pow(((B*2.0)-1.0),3); + double airIntensity = -pow(((C*2.0)-1.0),3)/2; + double filterQ = 2.1-D; + double output = E; + double wet = F; + double dry = 1.0-wet; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + double correctionL; + double correctionR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + correctionL = 0.0; + correctionR = 0.0; //from here on down, please add L and R to the code + + if (count < 1 || count > 3) count = 1; + tripletFactorL = tripletPrevL - inputSampleL; + tripletFactorR = tripletPrevR - inputSampleR; + switch (count) + { + case 1: + tripletAL += tripletFactorL; + tripletCL -= tripletFactorL; + tripletFactorL = tripletAL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletAR += tripletFactorR; + tripletCR -= tripletFactorR; + tripletFactorR = tripletAR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + case 2: + tripletBL += tripletFactorL; + tripletAL -= tripletFactorL; + tripletFactorL = tripletBL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletBR += tripletFactorR; + tripletAR -= tripletFactorR; + tripletFactorR = tripletBR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + case 3: + tripletCL += tripletFactorL; + tripletBL -= tripletFactorL; + tripletFactorL = tripletCL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletCR += tripletFactorR; + tripletBR -= tripletFactorR; + tripletFactorR = tripletCR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + } + tripletAL /= filterQ; + tripletBL /= filterQ; + tripletCL /= filterQ; + correctionL = correctionL + tripletFactorL; + + tripletAR /= filterQ; + tripletBR /= filterQ; + tripletCR /= filterQ; + correctionR = correctionR + tripletFactorR; + + count++; + //finished Triplet section- 15K + + if (flop) + { + airFactorAL = airPrevAL - inputSampleL; + airFactorAR = airPrevAR - inputSampleR; + if (flipA) + { + airEvenAL += airFactorAL; + airOddAL -= airFactorAL; + airFactorAL = airEvenAL * airIntensity; + + airEvenAR += airFactorAR; + airOddAR -= airFactorAR; + airFactorAR = airEvenAR * airIntensity; + } + else + { + airOddAL += airFactorAL; + airEvenAL -= airFactorAL; + airFactorAL = airOddAL * airIntensity; + + airOddAR += airFactorAR; + airEvenAR -= airFactorAR; + airFactorAR = airOddAR * airIntensity; + } + airOddAL = (airOddAL - ((airOddAL - airEvenAL)/256.0)) / filterQ; + airEvenAL = (airEvenAL - ((airEvenAL - airOddAL)/256.0)) / filterQ; + airPrevAL = inputSampleL; + correctionL = correctionL + airFactorAL; + + airOddAR = (airOddAR - ((airOddAR - airEvenAR)/256.0)) / filterQ; + airEvenAR = (airEvenAR - ((airEvenAR - airOddAR)/256.0)) / filterQ; + airPrevAR = inputSampleR; + correctionR = correctionR + airFactorAR; + + flipA = !flipA; + } + else + { + airFactorBL = airPrevBL - inputSampleL; + airFactorBR = airPrevBR - inputSampleR; + if (flipB) + { + airEvenBL += airFactorBL; + airOddBL -= airFactorBL; + airFactorBL = airEvenBL * airIntensity; + + airEvenBR += airFactorBR; + airOddBR -= airFactorBR; + airFactorBR = airEvenBR * airIntensity; + } + else + { + airOddBL += airFactorBL; + airEvenBL -= airFactorBL; + airFactorBL = airOddBL * airIntensity; + + airOddBR += airFactorBR; + airEvenBR -= airFactorBR; + airFactorBR = airOddBR * airIntensity; + } + airOddBL = (airOddBL - ((airOddBL - airEvenBL)/256.0)) / filterQ; + airEvenBL = (airEvenBL - ((airEvenBL - airOddBL)/256.0)) / filterQ; + airPrevBL = inputSampleL; + correctionL = correctionL + airFactorBL; + + airOddBR = (airOddBR - ((airOddBR - airEvenBR)/256.0)) / filterQ; + airEvenBR = (airEvenBR - ((airEvenBR - airOddBR)/256.0)) / filterQ; + airPrevBR = inputSampleR; + correctionR = correctionR + airFactorBR; + + flipB = !flipB; + } + //11K one + airFactorCL = airPrevCL - inputSampleL; + airFactorCR = airPrevCR - inputSampleR; + if (flop) + { + airEvenCL += airFactorCL; + airOddCL -= airFactorCL; + airFactorCL = airEvenCL * hiIntensity; + + airEvenCR += airFactorCR; + airOddCR -= airFactorCR; + airFactorCR = airEvenCR * hiIntensity; + } + else + { + airOddCL += airFactorCL; + airEvenCL -= airFactorCL; + airFactorCL = airOddCL * hiIntensity; + + airOddCR += airFactorCR; + airEvenCR -= airFactorCR; + airFactorCR = airOddCR * hiIntensity; + } + airOddCL = (airOddCL - ((airOddCL - airEvenCL)/256.0)) / filterQ; + airEvenCL = (airEvenCL - ((airEvenCL - airOddCL)/256.0)) / filterQ; + airPrevCL = inputSampleL; + correctionL = correctionL + airFactorCL; + + airOddCR = (airOddCR - ((airOddCR - airEvenCR)/256.0)) / filterQ; + airEvenCR = (airEvenCR - ((airEvenCR - airOddCR)/256.0)) / filterQ; + airPrevCR = inputSampleR; + correctionR = correctionR + airFactorCR; + + flop = !flop; + + inputSampleL += correctionL; + inputSampleR += correctionR; + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL*dry)+(inputSampleL*wet); + inputSampleR = (drySampleR*dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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 Air::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double hiIntensity = -pow(((A*2.0)-1.0),3)*2; + double tripletintensity = -pow(((B*2.0)-1.0),3); + double airIntensity = -pow(((C*2.0)-1.0),3)/2; + double filterQ = 2.1-D; + double output = E; + double wet = F; + double dry = 1.0-wet; + + 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; + double drySampleL; + double drySampleR; + double correctionL; + double correctionR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + correctionL = 0.0; + correctionR = 0.0; //from here on down, please add L and R to the code + + if (count < 1 || count > 3) count = 1; + tripletFactorL = tripletPrevL - inputSampleL; + tripletFactorR = tripletPrevR - inputSampleR; + switch (count) + { + case 1: + tripletAL += tripletFactorL; + tripletCL -= tripletFactorL; + tripletFactorL = tripletAL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletAR += tripletFactorR; + tripletCR -= tripletFactorR; + tripletFactorR = tripletAR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + case 2: + tripletBL += tripletFactorL; + tripletAL -= tripletFactorL; + tripletFactorL = tripletBL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletBR += tripletFactorR; + tripletAR -= tripletFactorR; + tripletFactorR = tripletBR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + case 3: + tripletCL += tripletFactorL; + tripletBL -= tripletFactorL; + tripletFactorL = tripletCL * tripletintensity; + tripletPrevL = tripletMidL; + tripletMidL = inputSampleL; + + tripletCR += tripletFactorR; + tripletBR -= tripletFactorR; + tripletFactorR = tripletCR * tripletintensity; + tripletPrevR = tripletMidR; + tripletMidR = inputSampleR; + break; + } + tripletAL /= filterQ; + tripletBL /= filterQ; + tripletCL /= filterQ; + correctionL = correctionL + tripletFactorL; + + tripletAR /= filterQ; + tripletBR /= filterQ; + tripletCR /= filterQ; + correctionR = correctionR + tripletFactorR; + + count++; + //finished Triplet section- 15K + + if (flop) + { + airFactorAL = airPrevAL - inputSampleL; + airFactorAR = airPrevAR - inputSampleR; + if (flipA) + { + airEvenAL += airFactorAL; + airOddAL -= airFactorAL; + airFactorAL = airEvenAL * airIntensity; + + airEvenAR += airFactorAR; + airOddAR -= airFactorAR; + airFactorAR = airEvenAR * airIntensity; + } + else + { + airOddAL += airFactorAL; + airEvenAL -= airFactorAL; + airFactorAL = airOddAL * airIntensity; + + airOddAR += airFactorAR; + airEvenAR -= airFactorAR; + airFactorAR = airOddAR * airIntensity; + } + airOddAL = (airOddAL - ((airOddAL - airEvenAL)/256.0)) / filterQ; + airEvenAL = (airEvenAL - ((airEvenAL - airOddAL)/256.0)) / filterQ; + airPrevAL = inputSampleL; + correctionL = correctionL + airFactorAL; + + airOddAR = (airOddAR - ((airOddAR - airEvenAR)/256.0)) / filterQ; + airEvenAR = (airEvenAR - ((airEvenAR - airOddAR)/256.0)) / filterQ; + airPrevAR = inputSampleR; + correctionR = correctionR + airFactorAR; + + flipA = !flipA; + } + else + { + airFactorBL = airPrevBL - inputSampleL; + airFactorBR = airPrevBR - inputSampleR; + if (flipB) + { + airEvenBL += airFactorBL; + airOddBL -= airFactorBL; + airFactorBL = airEvenBL * airIntensity; + + airEvenBR += airFactorBR; + airOddBR -= airFactorBR; + airFactorBR = airEvenBR * airIntensity; + } + else + { + airOddBL += airFactorBL; + airEvenBL -= airFactorBL; + airFactorBL = airOddBL * airIntensity; + + airOddBR += airFactorBR; + airEvenBR -= airFactorBR; + airFactorBR = airOddBR * airIntensity; + } + airOddBL = (airOddBL - ((airOddBL - airEvenBL)/256.0)) / filterQ; + airEvenBL = (airEvenBL - ((airEvenBL - airOddBL)/256.0)) / filterQ; + airPrevBL = inputSampleL; + correctionL = correctionL + airFactorBL; + + airOddBR = (airOddBR - ((airOddBR - airEvenBR)/256.0)) / filterQ; + airEvenBR = (airEvenBR - ((airEvenBR - airOddBR)/256.0)) / filterQ; + airPrevBR = inputSampleR; + correctionR = correctionR + airFactorBR; + + flipB = !flipB; + } + //11K one + airFactorCL = airPrevCL - inputSampleL; + airFactorCR = airPrevCR - inputSampleR; + if (flop) + { + airEvenCL += airFactorCL; + airOddCL -= airFactorCL; + airFactorCL = airEvenCL * hiIntensity; + + airEvenCR += airFactorCR; + airOddCR -= airFactorCR; + airFactorCR = airEvenCR * hiIntensity; + } + else + { + airOddCL += airFactorCL; + airEvenCL -= airFactorCL; + airFactorCL = airOddCL * hiIntensity; + + airOddCR += airFactorCR; + airEvenCR -= airFactorCR; + airFactorCR = airOddCR * hiIntensity; + } + airOddCL = (airOddCL - ((airOddCL - airEvenCL)/256.0)) / filterQ; + airEvenCL = (airEvenCL - ((airEvenCL - airOddCL)/256.0)) / filterQ; + airPrevCL = inputSampleL; + correctionL = correctionL + airFactorCL; + + airOddCR = (airOddCR - ((airOddCR - airEvenCR)/256.0)) / filterQ; + airEvenCR = (airEvenCR - ((airEvenCR - airOddCR)/256.0)) / filterQ; + airPrevCR = inputSampleR; + correctionR = correctionR + airFactorCR; + + flop = !flop; + + inputSampleL += correctionL; + inputSampleR += correctionR; + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL*dry)+(inputSampleL*wet); + inputSampleR = (drySampleR*dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/Air/VSTProject.sln b/plugins/WinVST/Air/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Air/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/Air/VSTProject.vcxproj b/plugins/WinVST/Air/VSTProject.vcxproj new file mode 100755 index 0000000..035b754 --- /dev/null +++ b/plugins/WinVST/Air/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Air.cpp" />
+ <ClCompile Include="AirProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Air.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Air64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Air/VSTProject.vcxproj.filters b/plugins/WinVST/Air/VSTProject.vcxproj.filters new file mode 100755 index 0000000..b01dd2e --- /dev/null +++ b/plugins/WinVST/Air/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Air.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="AirProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Air.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Air/VSTProject.vcxproj.user b/plugins/WinVST/Air/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Air/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Air/vstplug.def b/plugins/WinVST/Air/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Air/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Average/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Average/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Average/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Average/.vs/VSTProject/v14/.suo b/plugins/WinVST/Average/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..24b500e --- /dev/null +++ b/plugins/WinVST/Average/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Average/Average.cpp b/plugins/WinVST/Average/Average.cpp new file mode 100755 index 0000000..945c76c --- /dev/null +++ b/plugins/WinVST/Average/Average.cpp @@ -0,0 +1,133 @@ +/* ======================================== + * Average - Average.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Average_H +#include "Average.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Average(audioMaster);} + +Average::Average(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + + for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Average::~Average() {} +VstInt32 Average::getVendorVersion () {return 1000;} +void Average::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Average::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 Average::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 Average::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 Average::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 Average::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 Average::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Average", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Average::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A * 9.0)+1.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Average::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "taps", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Average::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Average::getEffectName(char* name) { + vst_strncpy(name, "Average", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Average::getPlugCategory() {return kPlugCategEffect;} + +bool Average::getProductString(char* text) { + vst_strncpy (text, "airwindows Average", kVstMaxProductStrLen); return true; +} + +bool Average::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Average/Average.h b/plugins/WinVST/Average/Average.h new file mode 100755 index 0000000..7e4b25e --- /dev/null +++ b/plugins/WinVST/Average/Average.h @@ -0,0 +1,72 @@ +/* ======================================== + * Average - Average.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Average_H +#define __Average_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'aver'; //Change this to what the AU identity is! + +class Average : + public AudioEffectX +{ +public: + Average(audioMasterCallback audioMaster); + ~Average(); + 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 bL[11]; + double f[11]; + double bR[11]; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + +}; + +#endif diff --git a/plugins/WinVST/Average/AverageProc.cpp b/plugins/WinVST/Average/AverageProc.cpp new file mode 100755 index 0000000..2b1c355 --- /dev/null +++ b/plugins/WinVST/Average/AverageProc.cpp @@ -0,0 +1,361 @@ +/* ======================================== + * Average - Average.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Average_H +#include "Average.h" +#endif + +void Average::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double correctionSample; + double accumulatorSampleL; + double accumulatorSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + + double overallscale = (A * 9.0)+1.0; + double wet = B; + double dry = 1.0 - wet; + double gain = overallscale; + + if (gain > 1.0) {f[0] = 1.0; gain -= 1.0;} else {f[0] = gain; gain = 0.0;} + if (gain > 1.0) {f[1] = 1.0; gain -= 1.0;} else {f[1] = gain; gain = 0.0;} + if (gain > 1.0) {f[2] = 1.0; gain -= 1.0;} else {f[2] = gain; gain = 0.0;} + if (gain > 1.0) {f[3] = 1.0; gain -= 1.0;} else {f[3] = gain; gain = 0.0;} + if (gain > 1.0) {f[4] = 1.0; gain -= 1.0;} else {f[4] = gain; gain = 0.0;} + if (gain > 1.0) {f[5] = 1.0; gain -= 1.0;} else {f[5] = gain; gain = 0.0;} + if (gain > 1.0) {f[6] = 1.0; gain -= 1.0;} else {f[6] = gain; gain = 0.0;} + if (gain > 1.0) {f[7] = 1.0; gain -= 1.0;} else {f[7] = gain; gain = 0.0;} + if (gain > 1.0) {f[8] = 1.0; gain -= 1.0;} else {f[8] = gain; gain = 0.0;} + if (gain > 1.0) {f[9] = 1.0; gain -= 1.0;} else {f[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + f[0] /= overallscale; + f[1] /= overallscale; + f[2] /= overallscale; + f[3] /= overallscale; + f[4] /= overallscale; + f[5] /= overallscale; + f[6] /= overallscale; + f[7] /= overallscale; + f[8] /= overallscale; + f[9] /= overallscale; + //and now it's neatly scaled, too + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + 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] = accumulatorSampleL = inputSampleL; + + 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] = accumulatorSampleR = inputSampleR; + //primitive way of doing this: for larger batches of samples, you might + //try using a circular buffer like in a reverb. If you add the new sample + //and subtract the one on the end you can keep a running tally of the samples + //between. Beware of tiny floating-point math errors eventually screwing up + //your system, though! + + accumulatorSampleL *= f[0]; + accumulatorSampleL += (bL[1] * f[1]); + accumulatorSampleL += (bL[2] * f[2]); + accumulatorSampleL += (bL[3] * f[3]); + accumulatorSampleL += (bL[4] * f[4]); + accumulatorSampleL += (bL[5] * f[5]); + accumulatorSampleL += (bL[6] * f[6]); + accumulatorSampleL += (bL[7] * f[7]); + accumulatorSampleL += (bL[8] * f[8]); + accumulatorSampleL += (bL[9] * f[9]); + + accumulatorSampleR *= f[0]; + accumulatorSampleR += (bR[1] * f[1]); + accumulatorSampleR += (bR[2] * f[2]); + accumulatorSampleR += (bR[3] * f[3]); + accumulatorSampleR += (bR[4] * f[4]); + accumulatorSampleR += (bR[5] * f[5]); + accumulatorSampleR += (bR[6] * f[6]); + accumulatorSampleR += (bR[7] * f[7]); + accumulatorSampleR += (bR[8] * f[8]); + accumulatorSampleR += (bR[9] * f[9]); + //we are doing our repetitive calculations on a separate value + + correctionSample = inputSampleL - accumulatorSampleL; + //we're gonna apply the total effect of all these calculations as a single subtract + inputSampleL -= correctionSample; + + correctionSample = inputSampleR - accumulatorSampleR; + inputSampleR -= correctionSample; + //our one math operation on the input data coming in + + if (wet < 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + //dry/wet control only applies if you're using it. We don't do a multiply by 1.0 + //if it 'won't change anything' but our sample might be at a very different scaling + //in the floating point system. + + + //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 Average::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double correctionSample; + double accumulatorSampleL; + double accumulatorSampleR; + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + + double overallscale = (A * 9.0)+1.0; + double wet = B; + double dry = 1.0 - wet; + double gain = overallscale; + + if (gain > 1.0) {f[0] = 1.0; gain -= 1.0;} else {f[0] = gain; gain = 0.0;} + if (gain > 1.0) {f[1] = 1.0; gain -= 1.0;} else {f[1] = gain; gain = 0.0;} + if (gain > 1.0) {f[2] = 1.0; gain -= 1.0;} else {f[2] = gain; gain = 0.0;} + if (gain > 1.0) {f[3] = 1.0; gain -= 1.0;} else {f[3] = gain; gain = 0.0;} + if (gain > 1.0) {f[4] = 1.0; gain -= 1.0;} else {f[4] = gain; gain = 0.0;} + if (gain > 1.0) {f[5] = 1.0; gain -= 1.0;} else {f[5] = gain; gain = 0.0;} + if (gain > 1.0) {f[6] = 1.0; gain -= 1.0;} else {f[6] = gain; gain = 0.0;} + if (gain > 1.0) {f[7] = 1.0; gain -= 1.0;} else {f[7] = gain; gain = 0.0;} + if (gain > 1.0) {f[8] = 1.0; gain -= 1.0;} else {f[8] = gain; gain = 0.0;} + if (gain > 1.0) {f[9] = 1.0; gain -= 1.0;} else {f[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + f[0] /= overallscale; + f[1] /= overallscale; + f[2] /= overallscale; + f[3] /= overallscale; + f[4] /= overallscale; + f[5] /= overallscale; + f[6] /= overallscale; + f[7] /= overallscale; + f[8] /= overallscale; + f[9] /= overallscale; + //and now it's neatly scaled, too + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + 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] = accumulatorSampleL = inputSampleL; + + 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] = accumulatorSampleR = inputSampleR; + //primitive way of doing this: for larger batches of samples, you might + //try using a circular buffer like in a reverb. If you add the new sample + //and subtract the one on the end you can keep a running tally of the samples + //between. Beware of tiny floating-point math errors eventually screwing up + //your system, though! + + accumulatorSampleL *= f[0]; + accumulatorSampleL += (bL[1] * f[1]); + accumulatorSampleL += (bL[2] * f[2]); + accumulatorSampleL += (bL[3] * f[3]); + accumulatorSampleL += (bL[4] * f[4]); + accumulatorSampleL += (bL[5] * f[5]); + accumulatorSampleL += (bL[6] * f[6]); + accumulatorSampleL += (bL[7] * f[7]); + accumulatorSampleL += (bL[8] * f[8]); + accumulatorSampleL += (bL[9] * f[9]); + + accumulatorSampleR *= f[0]; + accumulatorSampleR += (bR[1] * f[1]); + accumulatorSampleR += (bR[2] * f[2]); + accumulatorSampleR += (bR[3] * f[3]); + accumulatorSampleR += (bR[4] * f[4]); + accumulatorSampleR += (bR[5] * f[5]); + accumulatorSampleR += (bR[6] * f[6]); + accumulatorSampleR += (bR[7] * f[7]); + accumulatorSampleR += (bR[8] * f[8]); + accumulatorSampleR += (bR[9] * f[9]); + //we are doing our repetitive calculations on a separate value + + correctionSample = inputSampleL - accumulatorSampleL; + //we're gonna apply the total effect of all these calculations as a single subtract + inputSampleL -= correctionSample; + + correctionSample = inputSampleR - accumulatorSampleR; + inputSampleR -= correctionSample; + //our one math operation on the input data coming in + + if (wet < 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + //dry/wet control only applies if you're using it. We don't do a multiply by 1.0 + //if it 'won't change anything' but our sample might be at a very different scaling + //in the floating point system. + + //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/Average/VSTProject.sln b/plugins/WinVST/Average/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Average/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/Average/VSTProject.vcxproj b/plugins/WinVST/Average/VSTProject.vcxproj new file mode 100755 index 0000000..16bde27 --- /dev/null +++ b/plugins/WinVST/Average/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Average.cpp" />
+ <ClCompile Include="AverageProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Average.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Average64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Average/VSTProject.vcxproj.filters b/plugins/WinVST/Average/VSTProject.vcxproj.filters new file mode 100755 index 0000000..b6c15ea --- /dev/null +++ b/plugins/WinVST/Average/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Average.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="AverageProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Average.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Average/VSTProject.vcxproj.user b/plugins/WinVST/Average/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Average/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Average/vstplug.def b/plugins/WinVST/Average/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Average/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/BassKit/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/BassKit/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/BassKit/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/BassKit/.vs/VSTProject/v14/.suo b/plugins/WinVST/BassKit/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..8b0a466 --- /dev/null +++ b/plugins/WinVST/BassKit/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/BassKit/BassKit.cpp b/plugins/WinVST/BassKit/BassKit.cpp new file mode 100755 index 0000000..008f045 --- /dev/null +++ b/plugins/WinVST/BassKit/BassKit.cpp @@ -0,0 +1,195 @@ +/* ======================================== + * BassKit - BassKit.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __BassKit_H +#include "BassKit.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BassKit(audioMaster);} + +BassKit::BassKit(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + D = 0.5; + + WasNegative = false; + SubOctave = false; + flip = false; + bflip = 0; + iirDriveSampleA = 0.0; + iirDriveSampleB = 0.0; + iirDriveSampleC = 0.0; + iirDriveSampleD = 0.0; + iirDriveSampleE = 0.0; + iirDriveSampleF = 0.0; + + iirHeadBumpA = 0.0; + iirHeadBumpB = 0.0; + iirHeadBumpC = 0.0; + + iirSubBumpA = 0.0; + iirSubBumpB = 0.0; + iirSubBumpC = 0.0; + + lastHeadBump = 0.0; + lastSubBump = 0.0; + + iirSampleA = 0.0; + iirSampleB = 0.0; + iirSampleC = 0.0; + iirSampleD = 0.0; + iirSampleE = 0.0; + iirSampleF = 0.0; + iirSampleG = 0.0; + iirSampleH = 0.0; + iirSampleI = 0.0; + iirSampleJ = 0.0; + iirSampleK = 0.0; + iirSampleL = 0.0; + iirSampleM = 0.0; + iirSampleN = 0.0; + iirSampleO = 0.0; + iirSampleP = 0.0; + iirSampleQ = 0.0; + iirSampleR = 0.0; + iirSampleS = 0.0; + iirSampleT = 0.0; + iirSampleU = 0.0; + iirSampleV = 0.0; + iirSampleW = 0.0; + iirSampleX = 0.0; + iirSampleY = 0.0; + iirSampleZ = 0.0; + + oscGate = 1.0; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; + //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 +} + +BassKit::~BassKit() {} +VstInt32 BassKit::getVendorVersion () {return 1000;} +void BassKit::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void BassKit::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 BassKit::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 BassKit::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 BassKit::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float BassKit::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 BassKit::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Voicing", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "BassOut", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "SubOut", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void BassKit::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string ((D*2.0)-1.0, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void BassKit::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 BassKit::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool BassKit::getEffectName(char* name) { + vst_strncpy(name, "BassKit", kVstMaxProductStrLen); return true; +} + +VstPlugCategory BassKit::getPlugCategory() {return kPlugCategEffect;} + +bool BassKit::getProductString(char* text) { + vst_strncpy (text, "airwindows BassKit", kVstMaxProductStrLen); return true; +} + +bool BassKit::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/BassKit/BassKit.h b/plugins/WinVST/BassKit/BassKit.h new file mode 100755 index 0000000..f421d3d --- /dev/null +++ b/plugins/WinVST/BassKit/BassKit.h @@ -0,0 +1,118 @@ +/* ======================================== + * BassKit - BassKit.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __BassKit_H +#define __BassKit_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'bskt'; //Change this to what the AU identity is! + +class BassKit : + public AudioEffectX +{ +public: + BassKit(audioMasterCallback audioMaster); + ~BassKit(); + 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 iirDriveSampleA; + double iirDriveSampleB; + double iirDriveSampleC; + double iirDriveSampleD; + double iirDriveSampleE; + double iirDriveSampleF; + bool flip; //drive things + + int bflip; + bool WasNegative; + bool SubOctave; + double iirHeadBumpA; + double iirHeadBumpB; + double iirHeadBumpC; + + double iirSubBumpA; + double iirSubBumpB; + double iirSubBumpC; + + double lastHeadBump; + double lastSubBump; + + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; + double oscGate; + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; + float D; +}; + +#endif diff --git a/plugins/WinVST/BassKit/BassKitProc.cpp b/plugins/WinVST/BassKit/BassKitProc.cpp new file mode 100755 index 0000000..df3310e --- /dev/null +++ b/plugins/WinVST/BassKit/BassKitProc.cpp @@ -0,0 +1,460 @@ +/* ======================================== + * BassKit - BassKit.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __BassKit_H +#include "BassKit.h" +#endif + +void BassKit::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 ataLowpass; + double randy; + double invrandy; + double HeadBump = 0.0; + double BassGain = A * 0.1; + double HeadBumpFreq = ((B*0.1)+0.02)/overallscale; + double iirAmount = HeadBumpFreq/44.1; + double BassOutGain = ((C*2.0)-1.0)*fabs(((C*2.0)-1.0)); + double SubBump = 0.0; + double SubOutGain = ((D*2.0)-1.0)*fabs(((D*2.0)-1.0))*4.0; + double clamp = 0.0; + double fuzz = 0.111; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + + ataLowpass = (inputSampleL + inputSampleR) / 2.0; + iirDriveSampleA = (iirDriveSampleA * (1.0 - HeadBumpFreq)) + (ataLowpass * HeadBumpFreq); ataLowpass = iirDriveSampleA; + iirDriveSampleB = (iirDriveSampleB * (1.0 - HeadBumpFreq)) + (ataLowpass * HeadBumpFreq); ataLowpass = iirDriveSampleB; + + + oscGate += fabs(ataLowpass * 10.0); + oscGate -= 0.001; + if (oscGate > 1.0) oscGate = 1.0; + if (oscGate < 0) oscGate = 0; + //got a value that only goes down low when there's silence or near silence on input + clamp = 1.0-oscGate; + clamp *= 0.00001; + //set up the thing to choke off oscillations- belt and suspenders affair + + if (ataLowpass > 0) + {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} + else {WasNegative = true;} + //set up polarities for sub-bass version + randy = (rand()/(double)RAND_MAX)*fuzz; //0 to 1 the noise, may not be needed + invrandy = (1.0-randy); + randy /= 2.0; + //set up the noise + + iirSampleA = (iirSampleA * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleA; + iirSampleB = (iirSampleB * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleB; + iirSampleC = (iirSampleC * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleC; + iirSampleD = (iirSampleD * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleD; + iirSampleE = (iirSampleE * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleE; + iirSampleF = (iirSampleF * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleF; + iirSampleG = (iirSampleG * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleG; + iirSampleH = (iirSampleH * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleH; + iirSampleI = (iirSampleI * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleI; + iirSampleJ = (iirSampleJ * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleJ; + iirSampleK = (iirSampleK * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleK; + iirSampleL = (iirSampleL * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleL; + iirSampleM = (iirSampleM * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleM; + iirSampleN = (iirSampleN * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleN; + iirSampleO = (iirSampleO * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleO; + iirSampleP = (iirSampleP * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleP; + iirSampleQ = (iirSampleQ * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleQ; + iirSampleR = (iirSampleR * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleR; + iirSampleS = (iirSampleS * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleS; + iirSampleT = (iirSampleT * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleT; + iirSampleU = (iirSampleU * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleU; + iirSampleV = (iirSampleV * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleV; + + switch (bflip) + { + case 1: + iirHeadBumpA += (ataLowpass * BassGain); + iirHeadBumpA -= (iirHeadBumpA * iirHeadBumpA * iirHeadBumpA * HeadBumpFreq); + iirHeadBumpA = (invrandy * iirHeadBumpA) + (randy * iirHeadBumpB) + (randy * iirHeadBumpC); + if (iirHeadBumpA > 0) iirHeadBumpA -= clamp; + if (iirHeadBumpA < 0) iirHeadBumpA += clamp; + HeadBump = iirHeadBumpA; + break; + case 2: + iirHeadBumpB += (ataLowpass * BassGain); + iirHeadBumpB -= (iirHeadBumpB * iirHeadBumpB * iirHeadBumpB * HeadBumpFreq); + iirHeadBumpB = (randy * iirHeadBumpA) + (invrandy * iirHeadBumpB) + (randy * iirHeadBumpC); + if (iirHeadBumpB > 0) iirHeadBumpB -= clamp; + if (iirHeadBumpB < 0) iirHeadBumpB += clamp; + HeadBump = iirHeadBumpB; + break; + case 3: + iirHeadBumpC += (ataLowpass * BassGain); + iirHeadBumpC -= (iirHeadBumpC * iirHeadBumpC * iirHeadBumpC * HeadBumpFreq); + iirHeadBumpC = (randy * iirHeadBumpA) + (randy * iirHeadBumpB) + (invrandy * iirHeadBumpC); + if (iirHeadBumpC > 0) iirHeadBumpC -= clamp; + if (iirHeadBumpC < 0) iirHeadBumpC += clamp; + HeadBump = iirHeadBumpC; + break; + } + + iirSampleW = (iirSampleW * (1.0 - iirAmount)) + (HeadBump * iirAmount); HeadBump -= iirSampleW; + iirSampleX = (iirSampleX * (1.0 - iirAmount)) + (HeadBump * iirAmount); HeadBump -= iirSampleX; + + SubBump = HeadBump; + iirSampleY = (iirSampleY * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump -= iirSampleY; + + iirDriveSampleC = (iirDriveSampleC * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirDriveSampleC; + iirDriveSampleD = (iirDriveSampleD * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirDriveSampleD; + + + SubBump = fabs(SubBump); + if (SubOctave == false) {SubBump = -SubBump;} + + switch (bflip) + { + case 1: + iirSubBumpA += SubBump;// * BassGain); + iirSubBumpA -= (iirSubBumpA * iirSubBumpA * iirSubBumpA * HeadBumpFreq); + iirSubBumpA = (invrandy * iirSubBumpA) + (randy * iirSubBumpB) + (randy * iirSubBumpC); + if (iirSubBumpA > 0) iirSubBumpA -= clamp; + if (iirSubBumpA < 0) iirSubBumpA += clamp; + SubBump = iirSubBumpA; + break; + case 2: + iirSubBumpB += SubBump;// * BassGain); + iirSubBumpB -= (iirSubBumpB * iirSubBumpB * iirSubBumpB * HeadBumpFreq); + iirSubBumpB = (randy * iirSubBumpA) + (invrandy * iirSubBumpB) + (randy * iirSubBumpC); + if (iirSubBumpB > 0) iirSubBumpB -= clamp; + if (iirSubBumpB < 0) iirSubBumpB += clamp; + SubBump = iirSubBumpB; + break; + case 3: + iirSubBumpC += SubBump;// * BassGain); + iirSubBumpC -= (iirSubBumpC * iirSubBumpC * iirSubBumpC * HeadBumpFreq); + iirSubBumpC = (randy * iirSubBumpA) + (randy * iirSubBumpB) + (invrandy * iirSubBumpC); + if (iirSubBumpC > 0) iirSubBumpC -= clamp; + if (iirSubBumpC < 0) iirSubBumpC += clamp; + SubBump = iirSubBumpC; + break; + } + + iirSampleZ = (iirSampleZ * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirSampleZ; + iirDriveSampleE = (iirDriveSampleE * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump = iirDriveSampleE; + iirDriveSampleF = (iirDriveSampleF * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump = iirDriveSampleF; + + + inputSampleL += (HeadBump * BassOutGain); + inputSampleL += (SubBump * SubOutGain); + + inputSampleR += (HeadBump * BassOutGain); + inputSampleR += (SubBump * SubOutGain); + + + flip = !flip; + bflip++; + if (bflip < 1 || bflip > 3) bflip = 1; + + //noise shaping to 32-bit floating point + float fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} + +void BassKit::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 ataLowpass; + double randy; + double invrandy; + double HeadBump = 0.0; + double BassGain = A * 0.1; + double HeadBumpFreq = ((B*0.1)+0.02)/overallscale; + double iirAmount = HeadBumpFreq/44.1; + double BassOutGain = ((C*2.0)-1.0)*fabs(((C*2.0)-1.0)); + double SubBump = 0.0; + double SubOutGain = ((D*2.0)-1.0)*fabs(((D*2.0)-1.0))*4.0; + double clamp = 0.0; + double fuzz = 0.111; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + + ataLowpass = (inputSampleL + inputSampleR) / 2.0; + iirDriveSampleA = (iirDriveSampleA * (1.0 - HeadBumpFreq)) + (ataLowpass * HeadBumpFreq); ataLowpass = iirDriveSampleA; + iirDriveSampleB = (iirDriveSampleB * (1.0 - HeadBumpFreq)) + (ataLowpass * HeadBumpFreq); ataLowpass = iirDriveSampleB; + + + oscGate += fabs(ataLowpass * 10.0); + oscGate -= 0.001; + if (oscGate > 1.0) oscGate = 1.0; + if (oscGate < 0) oscGate = 0; + //got a value that only goes down low when there's silence or near silence on input + clamp = 1.0-oscGate; + clamp *= 0.00001; + //set up the thing to choke off oscillations- belt and suspenders affair + + if (ataLowpass > 0) + {if (WasNegative){SubOctave = !SubOctave;} WasNegative = false;} + else {WasNegative = true;} + //set up polarities for sub-bass version + randy = (rand()/(double)RAND_MAX)*fuzz; //0 to 1 the noise, may not be needed + invrandy = (1.0-randy); + randy /= 2.0; + //set up the noise + + iirSampleA = (iirSampleA * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleA; + iirSampleB = (iirSampleB * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleB; + iirSampleC = (iirSampleC * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleC; + iirSampleD = (iirSampleD * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleD; + iirSampleE = (iirSampleE * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleE; + iirSampleF = (iirSampleF * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleF; + iirSampleG = (iirSampleG * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleG; + iirSampleH = (iirSampleH * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleH; + iirSampleI = (iirSampleI * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleI; + iirSampleJ = (iirSampleJ * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleJ; + iirSampleK = (iirSampleK * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleK; + iirSampleL = (iirSampleL * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleL; + iirSampleM = (iirSampleM * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleM; + iirSampleN = (iirSampleN * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleN; + iirSampleO = (iirSampleO * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleO; + iirSampleP = (iirSampleP * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleP; + iirSampleQ = (iirSampleQ * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleQ; + iirSampleR = (iirSampleR * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleR; + iirSampleS = (iirSampleS * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleS; + iirSampleT = (iirSampleT * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleT; + iirSampleU = (iirSampleU * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleU; + iirSampleV = (iirSampleV * (1.0 - iirAmount)) + (ataLowpass * iirAmount); ataLowpass -= iirSampleV; + + switch (bflip) + { + case 1: + iirHeadBumpA += (ataLowpass * BassGain); + iirHeadBumpA -= (iirHeadBumpA * iirHeadBumpA * iirHeadBumpA * HeadBumpFreq); + iirHeadBumpA = (invrandy * iirHeadBumpA) + (randy * iirHeadBumpB) + (randy * iirHeadBumpC); + if (iirHeadBumpA > 0) iirHeadBumpA -= clamp; + if (iirHeadBumpA < 0) iirHeadBumpA += clamp; + HeadBump = iirHeadBumpA; + break; + case 2: + iirHeadBumpB += (ataLowpass * BassGain); + iirHeadBumpB -= (iirHeadBumpB * iirHeadBumpB * iirHeadBumpB * HeadBumpFreq); + iirHeadBumpB = (randy * iirHeadBumpA) + (invrandy * iirHeadBumpB) + (randy * iirHeadBumpC); + if (iirHeadBumpB > 0) iirHeadBumpB -= clamp; + if (iirHeadBumpB < 0) iirHeadBumpB += clamp; + HeadBump = iirHeadBumpB; + break; + case 3: + iirHeadBumpC += (ataLowpass * BassGain); + iirHeadBumpC -= (iirHeadBumpC * iirHeadBumpC * iirHeadBumpC * HeadBumpFreq); + iirHeadBumpC = (randy * iirHeadBumpA) + (randy * iirHeadBumpB) + (invrandy * iirHeadBumpC); + if (iirHeadBumpC > 0) iirHeadBumpC -= clamp; + if (iirHeadBumpC < 0) iirHeadBumpC += clamp; + HeadBump = iirHeadBumpC; + break; + } + + iirSampleW = (iirSampleW * (1.0 - iirAmount)) + (HeadBump * iirAmount); HeadBump -= iirSampleW; + iirSampleX = (iirSampleX * (1.0 - iirAmount)) + (HeadBump * iirAmount); HeadBump -= iirSampleX; + + SubBump = HeadBump; + iirSampleY = (iirSampleY * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump -= iirSampleY; + + iirDriveSampleC = (iirDriveSampleC * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirDriveSampleC; + iirDriveSampleD = (iirDriveSampleD * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirDriveSampleD; + + + SubBump = fabs(SubBump); + if (SubOctave == false) {SubBump = -SubBump;} + + switch (bflip) + { + case 1: + iirSubBumpA += SubBump;// * BassGain); + iirSubBumpA -= (iirSubBumpA * iirSubBumpA * iirSubBumpA * HeadBumpFreq); + iirSubBumpA = (invrandy * iirSubBumpA) + (randy * iirSubBumpB) + (randy * iirSubBumpC); + if (iirSubBumpA > 0) iirSubBumpA -= clamp; + if (iirSubBumpA < 0) iirSubBumpA += clamp; + SubBump = iirSubBumpA; + break; + case 2: + iirSubBumpB += SubBump;// * BassGain); + iirSubBumpB -= (iirSubBumpB * iirSubBumpB * iirSubBumpB * HeadBumpFreq); + iirSubBumpB = (randy * iirSubBumpA) + (invrandy * iirSubBumpB) + (randy * iirSubBumpC); + if (iirSubBumpB > 0) iirSubBumpB -= clamp; + if (iirSubBumpB < 0) iirSubBumpB += clamp; + SubBump = iirSubBumpB; + break; + case 3: + iirSubBumpC += SubBump;// * BassGain); + iirSubBumpC -= (iirSubBumpC * iirSubBumpC * iirSubBumpC * HeadBumpFreq); + iirSubBumpC = (randy * iirSubBumpA) + (randy * iirSubBumpB) + (invrandy * iirSubBumpC); + if (iirSubBumpC > 0) iirSubBumpC -= clamp; + if (iirSubBumpC < 0) iirSubBumpC += clamp; + SubBump = iirSubBumpC; + break; + } + + iirSampleZ = (iirSampleZ * (1.0 - HeadBumpFreq)) + (SubBump * HeadBumpFreq); SubBump = iirSampleZ; + iirDriveSampleE = (iirDriveSampleE * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump = iirDriveSampleE; + iirDriveSampleF = (iirDriveSampleF * (1.0 - iirAmount)) + (SubBump * iirAmount); SubBump = iirDriveSampleF; + + + inputSampleL += (HeadBump * BassOutGain); + inputSampleL += (SubBump * SubOutGain); + + inputSampleR += (HeadBump * BassOutGain); + inputSampleR += (SubBump * SubOutGain); + + + flip = !flip; + bflip++; + if (bflip < 1 || bflip > 3) bflip = 1; + + //noise shaping to 64-bit floating point + double fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 64 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} diff --git a/plugins/WinVST/BassKit/VSTProject.sln b/plugins/WinVST/BassKit/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/BassKit/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/BassKit/VSTProject.vcxproj b/plugins/WinVST/BassKit/VSTProject.vcxproj new file mode 100755 index 0000000..ef5eed7 --- /dev/null +++ b/plugins/WinVST/BassKit/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="BassKit.cpp" />
+ <ClCompile Include="BassKitProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="BassKit.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>BassKit64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BassKit/VSTProject.vcxproj.filters b/plugins/WinVST/BassKit/VSTProject.vcxproj.filters new file mode 100755 index 0000000..2306ddd --- /dev/null +++ b/plugins/WinVST/BassKit/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BassKit.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BassKitProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BassKit.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BassKit/VSTProject.vcxproj.user b/plugins/WinVST/BassKit/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/BassKit/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BassKit/vstplug.def b/plugins/WinVST/BassKit/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/BassKit/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Bite/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Bite/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Bite/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Bite/.vs/VSTProject/v14/.suo b/plugins/WinVST/Bite/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..a8fee43 --- /dev/null +++ b/plugins/WinVST/Bite/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Bite/Bite.cpp b/plugins/WinVST/Bite/Bite.cpp new file mode 100755 index 0000000..b563f54 --- /dev/null +++ b/plugins/WinVST/Bite/Bite.cpp @@ -0,0 +1,150 @@ +/* ======================================== + * Bite - Bite.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Bite_H +#include "Bite.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Bite(audioMaster);} + +Bite::Bite(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 1.0; + sampleAL = 0.0; + sampleBL = 0.0; + sampleCL = 0.0; + sampleDL = 0.0; + sampleEL = 0.0; + sampleFL = 0.0; + sampleGL = 0.0; + sampleHL = 0.0; + sampleIL = 0.0; + + sampleAR = 0.0; + sampleBR = 0.0; + sampleCR = 0.0; + sampleDR = 0.0; + sampleER = 0.0; + sampleFR = 0.0; + sampleGR = 0.0; + sampleHR = 0.0; + sampleIR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Bite::~Bite() {} +VstInt32 Bite::getVendorVersion () {return 1000;} +void Bite::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Bite::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 Bite::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 Bite::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 Bite::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Bite::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 Bite::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Bite", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Output Level", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Bite::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Bite::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Bite::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Bite::getEffectName(char* name) { + vst_strncpy(name, "Bite", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Bite::getPlugCategory() {return kPlugCategEffect;} + +bool Bite::getProductString(char* text) { + vst_strncpy (text, "airwindows Bite", kVstMaxProductStrLen); return true; +} + +bool Bite::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Bite/Bite.h b/plugins/WinVST/Bite/Bite.h new file mode 100755 index 0000000..d6f9e44 --- /dev/null +++ b/plugins/WinVST/Bite/Bite.h @@ -0,0 +1,86 @@ +/* ======================================== + * Bite - Bite.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Bite_H +#define __Bite_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'bite'; //Change this to what the AU identity is! + +class Bite : + public AudioEffectX +{ +public: + Bite(audioMasterCallback audioMaster); + ~Bite(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double sampleAL; + double sampleBL; + double sampleCL; + double sampleDL; + double sampleEL; + double sampleFL; + double sampleGL; + double sampleHL; + double sampleIL; + + double sampleAR; + double sampleBR; + double sampleCR; + double sampleDR; + double sampleER; + double sampleFR; + double sampleGR; + double sampleHR; + double sampleIR; + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Bite/BiteProc.cpp b/plugins/WinVST/Bite/BiteProc.cpp new file mode 100755 index 0000000..690a998 --- /dev/null +++ b/plugins/WinVST/Bite/BiteProc.cpp @@ -0,0 +1,292 @@ +/* ======================================== + * Bite - Bite.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Bite_H +#include "Bite.h" +#endif + +void Bite::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.3; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double gain = ((A*2.0)-1.0)*overallscale; + double outputgain = B; + double midA; + double midB; + double midC; + double midD; + double trigger; + double inputSampleL; + double inputSampleR; + + while (--sampleFrames >= 0) + { + sampleIL = sampleHL; + sampleHL = sampleGL; + sampleGL = sampleFL; + sampleFL = sampleEL; + sampleEL = sampleDL; + sampleDL = sampleCL; + sampleCL = sampleBL; + sampleBL = sampleAL; + sampleAL = *in1; + + sampleIR = sampleHR; + sampleHR = sampleGR; + sampleGR = sampleFR; + sampleFR = sampleER; + sampleER = sampleDR; + sampleDR = sampleCR; + sampleCR = sampleBR; + sampleBR = sampleAR; + sampleAR = *in2; + //rotate the buffer in primitive fashion + if (sampleAL<1.2e-38 && -sampleAL<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; + sampleAL = applyresidue; + } + if (sampleAR<1.2e-38 && -sampleAR<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; + sampleAR = 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. + } + + midA = sampleAL - sampleEL; + midB = sampleIL - sampleEL; + midC = sampleCL - sampleEL; + midD = sampleGL - sampleEL; + midA *= ((((sampleBL + sampleCL + sampleDL)/3) - ((sampleAL + sampleEL)/2.0))*gain); + midB *= ((((sampleFL + sampleGL + sampleHL)/3) - ((sampleEL + sampleIL)/2.0))*gain); + midC *= ((sampleDL - ((sampleCL + sampleEL)/2.0))*gain); + midD *= ((sampleFL - ((sampleEL + sampleGL)/2.0))*gain); + trigger = sin(midA + midB + midC + midD); + inputSampleL = sampleEL + (trigger*8.0); + + midA = sampleAR - sampleER; + midB = sampleIR - sampleER; + midC = sampleCR - sampleER; + midD = sampleGR - sampleER; + midA *= ((((sampleBR + sampleCR + sampleDR)/3) - ((sampleAR + sampleER)/2.0))*gain); + midB *= ((((sampleFR + sampleGR + sampleHR)/3) - ((sampleER + sampleIR)/2.0))*gain); + midC *= ((sampleDR - ((sampleCR + sampleER)/2.0))*gain); + midD *= ((sampleFR - ((sampleER + sampleGR)/2.0))*gain); + trigger = sin(midA + midB + midC + midD); + inputSampleR = sampleER + (trigger*8.0); + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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 Bite::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.3; + 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; + + double gain = ((A*2.0)-1.0)*overallscale; + double outputgain = B; + double midA; + double midB; + double midC; + double midD; + double trigger; + double inputSampleL; + double inputSampleR; + + while (--sampleFrames >= 0) + { + sampleIL = sampleHL; + sampleHL = sampleGL; + sampleGL = sampleFL; + sampleFL = sampleEL; + sampleEL = sampleDL; + sampleDL = sampleCL; + sampleCL = sampleBL; + sampleBL = sampleAL; + sampleAL = *in1; + + sampleIR = sampleHR; + sampleHR = sampleGR; + sampleGR = sampleFR; + sampleFR = sampleER; + sampleER = sampleDR; + sampleDR = sampleCR; + sampleCR = sampleBR; + sampleBR = sampleAR; + sampleAR = *in2; + //rotate the buffer in primitive fashion + if (sampleAL<1.2e-38 && -sampleAL<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; + sampleAL = applyresidue; + } + if (sampleAR<1.2e-38 && -sampleAR<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; + sampleAR = 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. + } + + midA = sampleAL - sampleEL; + midB = sampleIL - sampleEL; + midC = sampleCL - sampleEL; + midD = sampleGL - sampleEL; + midA *= ((((sampleBL + sampleCL + sampleDL)/3) - ((sampleAL + sampleEL)/2.0))*gain); + midB *= ((((sampleFL + sampleGL + sampleHL)/3) - ((sampleEL + sampleIL)/2.0))*gain); + midC *= ((sampleDL - ((sampleCL + sampleEL)/2.0))*gain); + midD *= ((sampleFL - ((sampleEL + sampleGL)/2.0))*gain); + trigger = sin(midA + midB + midC + midD); + inputSampleL = sampleEL + (trigger*8.0); + + midA = sampleAR - sampleER; + midB = sampleIR - sampleER; + midC = sampleCR - sampleER; + midD = sampleGR - sampleER; + midA *= ((((sampleBR + sampleCR + sampleDR)/3) - ((sampleAR + sampleER)/2.0))*gain); + midB *= ((((sampleFR + sampleGR + sampleHR)/3) - ((sampleER + sampleIR)/2.0))*gain); + midC *= ((sampleDR - ((sampleCR + sampleER)/2.0))*gain); + midD *= ((sampleFR - ((sampleER + sampleGR)/2.0))*gain); + trigger = sin(midA + midB + midC + midD); + inputSampleR = sampleER + (trigger*8.0); + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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/Bite/VSTProject.sln b/plugins/WinVST/Bite/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Bite/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/Bite/VSTProject.vcxproj b/plugins/WinVST/Bite/VSTProject.vcxproj new file mode 100755 index 0000000..f3a2743 --- /dev/null +++ b/plugins/WinVST/Bite/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Bite.cpp" />
+ <ClCompile Include="BiteProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Bite.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Bite64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Bite/VSTProject.vcxproj.filters b/plugins/WinVST/Bite/VSTProject.vcxproj.filters new file mode 100755 index 0000000..c9b660a --- /dev/null +++ b/plugins/WinVST/Bite/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Bite.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BiteProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Bite.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Bite/VSTProject.vcxproj.user b/plugins/WinVST/Bite/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Bite/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Bite/vstplug.def b/plugins/WinVST/Bite/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Bite/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/BussColors4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/BussColors4/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/BussColors4/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/BussColors4/.vs/VSTProject/v14/.suo b/plugins/WinVST/BussColors4/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..8ad21ec --- /dev/null +++ b/plugins/WinVST/BussColors4/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/BussColors4/BussColors4.cpp b/plugins/WinVST/BussColors4/BussColors4.cpp new file mode 100755 index 0000000..720dbf9 --- /dev/null +++ b/plugins/WinVST/BussColors4/BussColors4.cpp @@ -0,0 +1,199 @@ +/* ======================================== + * BussColors4 - BussColors4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __BussColors4_H +#include "BussColors4.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BussColors4(audioMaster);} + +BussColors4::BussColors4(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.5; + C = 0.5; + D = 1.0; + + for (int count = 0; count < 174; count++) {bL[count] = 0; bR[count] = 0;} + for (int count = 0; count < 99; count++) {dL[count] = 0; dR[count] = 0;} + for (int count = 0; count < 34; count++) c[count] = count; //initial setup for 44.1K + g[1] = pow(10.0, -5.2 / 14.0); //dark + g[2] = pow(10.0, -6.2 / 14.0); //rock + g[3] = pow(10.0, -2.9 / 14.0); //lush + g[4] = pow(10.0, -1.1 / 14.0); //vibe + g[5] = pow(10.0, -5.1 / 14.0); //holo + g[6] = pow(10.0, -3.6 / 14.0); //punch + g[7] = pow(10.0, -2.3 / 14.0); //steel + g[8] = pow(10.0, -2.9 / 14.0); //tube + //preset gains for models + outg[1] = pow(10.0, -0.3 / 14.0); //dark + outg[2] = pow(10.0, 0.5 / 14.0); //rock + outg[3] = pow(10.0, -0.7 / 14.0); //lush + outg[4] = pow(10.0, -0.6 / 14.0); //vibe + outg[5] = pow(10.0, -0.2 / 14.0); //holo + outg[6] = pow(10.0, 0.3 / 14.0); //punch + outg[7] = pow(10.0, 0.1 / 14.0); //steel + outg[8] = pow(10.0, 0.9 / 14.0); //tube + //preset gains for models + controlL = 0; + controlR = 0; + slowdynL = 0; + slowdynR = 0; + gcount = 0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +BussColors4::~BussColors4() {} +VstInt32 BussColors4::getVendorVersion () {return 1000;} +void BussColors4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void BussColors4::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 BussColors4::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 BussColors4::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 BussColors4::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 + case kParamC: C = value; break; + case kParamD: D = value; break; //this is the popup, stored as a float + 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 BussColors4.h file to do it. + switch((VstInt32)( D * 3.999 )) + { + case 0: fpFlip = true; break; //choice A + case 1: fpFlip = false; break; //choice B + case 2: break; //choice C + case 3: break; //choice D + default: break; //should not happen + } + //this relates to using D as a 'popup' and changing things based on that switch. + //we are using fpFlip just because it's already there globally, as an example. +} + +float BussColors4::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 BussColors4::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Color", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Input Trim", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Output Trim", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void BussColors4::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: switch((VstInt32)( A * 7.999 )) //0 to almost edge of # of params + {case 0: vst_strncpy (text, "Dark", kVstMaxParamStrLen); break; + case 1: vst_strncpy (text, "Rock", kVstMaxParamStrLen); break; + case 2: vst_strncpy (text, "Lush", kVstMaxParamStrLen); break; + case 3: vst_strncpy (text, "Vibe", kVstMaxParamStrLen); break; + case 4: vst_strncpy (text, "Holo", kVstMaxParamStrLen); break; + case 5: vst_strncpy (text, "Punch", kVstMaxParamStrLen); break; + case 6: vst_strncpy (text, "Steel", kVstMaxParamStrLen); break; + case 7: vst_strncpy (text, "Tube", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } break; //completed A 'popup' parameter, exit + case kParamB: float2string ((B * 36.0)-18.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C * 36.0)-18.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void BussColors4::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 BussColors4::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool BussColors4::getEffectName(char* name) { + vst_strncpy(name, "BussColors4", kVstMaxProductStrLen); return true; +} + +VstPlugCategory BussColors4::getPlugCategory() {return kPlugCategEffect;} + +bool BussColors4::getProductString(char* text) { + vst_strncpy (text, "airwindows BussColors4", kVstMaxProductStrLen); return true; +} + +bool BussColors4::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/BussColors4/BussColors4.h b/plugins/WinVST/BussColors4/BussColors4.h new file mode 100755 index 0000000..d07460e --- /dev/null +++ b/plugins/WinVST/BussColors4/BussColors4.h @@ -0,0 +1,85 @@ +/* ======================================== + * BussColors4 - BussColors4.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __BussColors4_H +#define __BussColors4_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'bsc4'; //Change this to what the AU identity is! + +class BussColors4 : + public AudioEffectX +{ +public: + BussColors4(audioMasterCallback audioMaster); + ~BussColors4(); + 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 bL[175]; //full buffer for high sample rates. Scales to 192K + double bR[175]; //full buffer for high sample rates. Scales to 192K + double dL[100]; //buffer for calculating sag as it relates to the dynamic impulse synthesis. To 192K. + double dR[100]; //buffer for calculating sag as it relates to the dynamic impulse synthesis. To 192K. + int c[35]; //just the number of taps we use, doesn't have to scale + double g[9]; //console model + double outg[9]; //console model + double controlL; + double controlR; + double slowdynL; + double slowdynR; + int gcount; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/BussColors4/BussColors4Proc.cpp b/plugins/WinVST/BussColors4/BussColors4Proc.cpp new file mode 100755 index 0000000..2629ee8 --- /dev/null +++ b/plugins/WinVST/BussColors4/BussColors4Proc.cpp @@ -0,0 +1,1644 @@ +/* ======================================== + * BussColors4 - BussColors4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __BussColors4_H +#include "BussColors4.h" +#endif + +void BussColors4::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(); + if (overallscale < 1.0) overallscale = 1.0; + if (overallscale > 4.5) overallscale = 4.5; + const int maxConvolutionBufferSize = (int)(34.0 * overallscale); //we won't use more of the buffer than we have to + for (int count = 0; count < 34; count++) c[count] = (int)(count * overallscale); //assign conv taps + double drySampleL; + double drySampleR; + double applyconvL; + double applyconvR; + int offsetA = 3; + double dynamicconvL = 3.0; + double dynamicconvR = 3.0; + double gain = 0.436; + double outgain = 1.0; + double bridgerectifier; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it + switch (console) + { + case 1: offsetA = 4; gain = g[1]; outgain = outg[1]; break; //Dark (Focusrite) + case 2: offsetA = 3; gain = g[2]; outgain = outg[2]; break; //Rock (SSL) + case 3: offsetA = 5; gain = g[3]; outgain = outg[3]; break; //Lush (Neve) + case 4: offsetA = 8; gain = g[4]; outgain = outg[4]; break; //Vibe (Elation) + case 5: offsetA = 5; gain = g[5]; outgain = outg[5]; break; //Holo (Precision 8) + case 6: offsetA = 7; gain = g[6]; outgain = outg[6]; break; //Punch (API) + case 7: offsetA = 7; gain = g[7]; outgain = outg[7]; break; //Steel (Calibre) + case 8: offsetA = 6; gain = g[8]; outgain = outg[8]; break; //Tube (Manley) + } + offsetA = (int)(offsetA * overallscale); //we extend the sag buffer too, at high sample rates + if (offsetA < 3) offsetA = 3; //are we getting divides by zero? + gain *= pow(10.0,((B * 36.0)-18.0)/14.0); //add adjustment factor + outgain *= pow(10.0,(((C * 36.0)-18.0)+3.3)/14.0); //add adjustment factor + double wet = D; + double dry = 1.0 - wet; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gain != 1.0) { + inputSampleL *= gain; + inputSampleR *= gain; + } + + + bridgerectifier = fabs(inputSampleL); + slowdynL *= 0.999; + slowdynL += bridgerectifier; + if (slowdynL > 1.5) {slowdynL = 1.5;} + //before the iron bar- fry console for crazy behavior + dynamicconvL = 2.5 + slowdynL; + + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //end pre saturation stage L + + bridgerectifier = fabs(inputSampleR); + slowdynR *= 0.999; + slowdynR += bridgerectifier; + if (slowdynR > 1.5) {slowdynR = 1.5;} + //before the iron bar- fry console for crazy behavior + dynamicconvR = 2.5 + slowdynR; + + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //end pre saturation stage R + + if (gcount < 0 || gcount > 44) gcount = 44; + + dL[gcount+44] = dL[gcount] = fabs(inputSampleL); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + if (controlL < 0) controlL = 0; + if (controlL > 100) controlL = 100; + applyconvL = (controlL / offsetA) * dynamicconvL; + //now we have a 'sag' style average to apply to the conv, L + + dR[gcount+44] = dR[gcount] = fabs(inputSampleR); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + if (controlR < 0) controlR = 0; + if (controlR > 100) controlR = 100; + applyconvR = (controlR / offsetA) * dynamicconvR; + //now we have a 'sag' style average to apply to the conv, R + + gcount--; + + //now the convolution + for (int count = maxConvolutionBufferSize; count > 0; --count) {bL[count] = bL[count-1];} //was 173 + //we're only doing assigns, and it saves us an add inside the convolution calculation + //therefore, we'll just assign everything one step along and have our buffer that way. + bL[0] = inputSampleL; + + for (int count = maxConvolutionBufferSize; count > 0; --count) {bR[count] = bR[count-1];} //was 173 + //we're only doing assigns, and it saves us an add inside the convolution calculation + //therefore, we'll just assign everything one step along and have our buffer that way. + bR[0] = inputSampleR; + //The reason these are separate is, since it's just a big assign-fest, it's possible compilers can + //come up with a clever way to do it. Interleaving the samples might make it enough more complicated + //that the compiler wouldn't know to do 'em in batches or whatever. Just a thought, profiling would + //be the correct way to find out this (or indeed, whether doing another add insode the convolutions would + //be the best bet, + + //The convolutions! + + switch (console) + { + case 1: + //begin Cider (Focusrite) MCI + inputSampleL += (bL[c[1]] * (0.61283288942201319 + (0.00024011410669522*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.24036380659761222 - (0.00020789518206241*applyconvL))); + inputSampleL += (bL[c[3]] * (0.09104669761717916 + (0.00012829642741548*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.02378290768554025 - (0.00017673646470440*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.02832818490275965 - (0.00013536187747384*applyconvL))); + inputSampleL += (bL[c[6]] * (0.03268797679215937 + (0.00015035126653359*applyconvL))); + inputSampleL -= (bL[c[7]] * (0.04024464202655586 - (0.00015034923056735*applyconvL))); + inputSampleL += (bL[c[8]] * (0.01864890074318696 + (0.00014513281680642*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.01632731954100322 - (0.00015509089075614*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.00318907090555589 - (0.00014784812076550*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.00208573465221869 - (0.00015350520779465*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.00907033901519614 - (0.00015442964157250*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00199458794148013 - (0.00015595640046297*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.00705979153201755 - (0.00015730069418051*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00429488975412722 - (0.00015743697943505*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.00497724878704936 - (0.00016014760011861*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00506059305562353 - (0.00016194824072466*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00483432223285621 - (0.00016329050124225*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00495100420886005 - (0.00016297509798749*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00489319520555115 - (0.00016472839684661*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00489177657970308 - (0.00016791875866630*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00487900894707044 - (0.00016755993898534*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00486234009335561 - (0.00016968157345446*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00485737490288736 - (0.00017180713324431*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00484106070563455 - (0.00017251073661092*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00483219429408410 - (0.00017321683790891*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00482013597437550 - (0.00017392186866488*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00480949628051497 - (0.00017569098775602*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00479992055604049 - (0.00017746046369449*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00478750757986987 - (0.00017745630047554*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00477828651185740 - (0.00017958043287604*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00476906544384494 - (0.00018170456527653*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00475700712413634 - (0.00018099144598088*applyconvL))); + //end Cider (Focusrite) MCI + break; + case 2: + //begin Rock (SSL) conv + inputSampleL += (bL[c[1]] * (0.67887916185274055 + (0.00068787552301086*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.25671050678827934 + (0.00017691749454490*applyconvL))); + inputSampleL += (bL[c[3]] * (0.15135839896615280 + (0.00007481480365043*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.11813512969090802 + (0.00005191138121359*applyconvL))); + inputSampleL += (bL[c[5]] * (0.08329104347166429 + (0.00001871054659794*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.07663817456103936 + (0.00002751359071705*applyconvL))); + inputSampleL += (bL[c[7]] * (0.05477586152148759 + (0.00000744843212679*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.05547314737187786 + (0.00001025289931145*applyconvL))); + inputSampleL += (bL[c[9]] * (0.03822948356540711 - (0.00000249791561457*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.04199383340841713 - (0.00000067328840674*applyconvL))); + inputSampleL += (bL[c[11]] * (0.02695796542339694 - (0.00000796704606548*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.03228715059431878 - (0.00000579711816722*applyconvL))); + inputSampleL += (bL[c[13]] * (0.01846929689819187 - (0.00000984017804950*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.02528050435045951 - (0.00000701189792484*applyconvL))); + inputSampleL += (bL[c[15]] * (0.01207844846859765 - (0.00001522630289356*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01894464378378515 - (0.00001205456372080*applyconvL))); + inputSampleL += (bL[c[17]] * (0.00667804407593324 - (0.00001343604283817*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.01408418045473130 - (0.00001246443581504*applyconvL))); + inputSampleL += (bL[c[19]] * (0.00228696509481569 - (0.00001506764046927*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.01006277891348454 - (0.00000970723079112*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00132368373546377 + (0.00001188847238761*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00676615715578373 - (0.00001209129844861*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00426288438418556 + (0.00001286836943559*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00408897698639688 - (0.00001102542567911*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00662040619382751 + (0.00001206328529063*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00196101294183599 - (0.00000950703614981*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00845620581010342 + (0.00001279970295678*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00032595215043616 - (0.00000920518241371*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00982957737435458 + (0.00001177745362317*applyconvL))); + inputSampleL += (bL[c[30]] * (0.00086920573760513 + (0.00000913758382404*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.01079020871452061 + (0.00000900750153697*applyconvL))); + inputSampleL += (bL[c[32]] * (0.00167613606334460 + (0.00000732769151038*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.01138050011044332 + (0.00000946908207442*applyconvL))); + //end Rock (SSL) conv + break; + case 3: + //begin Lush (Neve) conv + inputSampleL += (bL[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvL))); + inputSampleL += (bL[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvL))); + inputSampleL += (bL[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvL))); + inputSampleL += (bL[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvL))); + inputSampleL -= (bL[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvL))); + inputSampleL += (bL[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvL))); + inputSampleL += (bL[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvL))); + inputSampleL += (bL[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvL))); + inputSampleL += (bL[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvL))); + inputSampleL += (bL[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvL))); + inputSampleL += (bL[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvL))); + inputSampleL += (bL[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvL))); + inputSampleL += (bL[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvL))); + inputSampleL += (bL[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvL))); + inputSampleL += (bL[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvL))); + inputSampleL += (bL[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvL))); + inputSampleL += (bL[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvL))); + inputSampleL += (bL[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvL))); + inputSampleL += (bL[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvL))); + inputSampleL += (bL[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvL))); + inputSampleL += (bL[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvL))); + inputSampleL += (bL[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvL))); + inputSampleL += (bL[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvL))); + inputSampleL += (bL[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvL))); + inputSampleL += (bL[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvL))); + inputSampleL += (bL[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvL))); + //end Lush (Neve) conv + break; + case 4: + //begin Elation (LA2A) vibe + inputSampleL -= (bL[c[1]] * (0.25867935358656502 - (0.00045755657070112*applyconvL))); + inputSampleL += (bL[c[2]] * (0.11509367290253694 - (0.00017494270657228*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.06709853575891785 - (0.00058913102597723*applyconvL))); + inputSampleL += (bL[c[4]] * (0.01871006356851681 - (0.00003387358004645*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00794797957360465 - (0.00044224784691203*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.01956921817394220 - (0.00006718936750076*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01682120257195205 + (0.00032857446292230*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03401069039824205 - (0.00013634182872897*applyconvL))); + inputSampleL += (bL[c[9]] * (0.02369950268232634 + (0.00023112685751657*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.03477071178117132 - (0.00018029792231600*applyconvL))); + inputSampleL += (bL[c[11]] * (0.02024369717958201 + (0.00017337813374202*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.02819087729102172 - (0.00021438538665420*applyconvL))); + inputSampleL += (bL[c[13]] * (0.01147946743141303 + (0.00014424066034649*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.01894777011468867 - (0.00021549146262408*applyconvL))); + inputSampleL += (bL[c[15]] * (0.00301370330346873 + (0.00013527460148394*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01067147835815486 - (0.00020960689910868*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00402715397506384 - (0.00014421582712470*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00502221703392005 - (0.00019805767015024*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00808788533308497 - (0.00016095444141931*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00232696588842683 - (0.00018384470981829*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00943950821324531 - (0.00017098987347593*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00193709517200834 - (0.00018151995939591*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00899713952612659 - (0.00017385835059948*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00280584331659089 - (0.00017742164162470*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00780381001954970 - (0.00018002500755708*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00400370310490333 - (0.00017471691087957*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00661527728186928 - (0.00018137323370347*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00496545526864518 - (0.00017681872601767*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00580728820997532 - (0.00018186220389790*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00549309984725666 - (0.00017722985399075*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00542194777529239 - (0.00018486900185338*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00565992080998939 - (0.00018005824393118*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00532121562846656 - (0.00018643189636216*applyconvL))); + //end Elation (LA2A) + break; + case 5: + //begin Precious (Precision 8) Holo + inputSampleL += (bL[c[1]] * (0.59188440274551890 - (0.00008361469668405*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.24439750948076133 + (0.00002651678396848*applyconvL))); + inputSampleL += (bL[c[3]] * (0.14109876103205621 - (0.00000840487181372*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.10053507128157971 + (0.00001768100964598*applyconvL))); + inputSampleL += (bL[c[5]] * (0.05859287880626238 - (0.00000361398065989*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.04337406889823660 + (0.00000735941182117*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01589900680531097 + (0.00000207347387987*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.01087234854973281 + (0.00000732123412029*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.00845782429679176 - (0.00000133058605071*applyconvL))); + inputSampleL += (bL[c[10]] * (0.00662278586618295 - (0.00000424594730611*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.02000592193760155 + (0.00000632896879068*applyconvL))); + inputSampleL += (bL[c[12]] * (0.01321157777167565 - (0.00001421171592570*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.02249955362988238 + (0.00000163937127317*applyconvL))); + inputSampleL += (bL[c[14]] * (0.01196492077581504 - (0.00000535385220676*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.01905917427000097 + (0.00000121672882030*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00761909482108073 - (0.00000326242895115*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01362744780256239 + (0.00000359274216003*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00200183122683721 - (0.00000089207452791*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00833042637239315 + (0.00000946767677294*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00258481175207224 - (0.00000087429351464*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00459744479712244 - (0.00000049519758701*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00534277030993820 + (0.00000397547847155*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00272332919605675 + (0.00000040077229097*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00637243782359372 - (0.00000139419072176*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00233001590327504 + (0.00000420129915747*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00623296727793041 + (0.00000019010664856*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00276177096376805 + (0.00000580301901385*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00559184754866264 + (0.00000080597287792*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00343180144395919 - (0.00000243701142085*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00493325428861701 + (0.00000300985740900*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00396140827680823 - (0.00000051459681789*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00448497879902493 + (0.00000744412841743*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00425146888772076 - (0.00000082346016542*applyconvL))); + //end Precious (Precision 8) Holo + break; + case 6: + //begin Punch (API) conv + inputSampleL += (bL[c[1]] * (0.09299870608542582 - (0.00009582362368873*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.11947847710741009 - (0.00004500891602770*applyconvL))); + inputSampleL += (bL[c[3]] * (0.09071606264761795 + (0.00005639498984741*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.08561982770836980 - (0.00004964855606916*applyconvL))); + inputSampleL += (bL[c[5]] * (0.06440549220820363 + (0.00002428052139507*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.05987991812840746 + (0.00000101867082290*applyconvL))); + inputSampleL += (bL[c[7]] * (0.03980233135839382 + (0.00003312430049041*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03648402630896925 - (0.00002116186381142*applyconvL))); + inputSampleL += (bL[c[9]] * (0.01826860869525248 + (0.00003115110025396*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.01723968622495364 - (0.00002450634121718*applyconvL))); + inputSampleL += (bL[c[11]] * (0.00187588812316724 + (0.00002838206198968*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.00381796423957237 - (0.00003155815499462*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00852092214496733 - (0.00001702651162392*applyconvL))); + inputSampleL += (bL[c[14]] * (0.00315560292270588 + (0.00002547861676047*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.01258630914496868 - (0.00004555319243213*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00536435648963575 + (0.00001812393657101*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01272975658159178 - (0.00004103775306121*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00403818975172755 + (0.00003764615492871*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.01042617366897483 - (0.00003605210426041*applyconvL))); + inputSampleL += (bL[c[20]] * (0.00126599583390057 + (0.00004305458668852*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00747876207688339 - (0.00003731207018977*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00149873689175324 - (0.00005086601800791*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00503221309488033 - (0.00003636086782783*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00342998224655821 - (0.00004103091180506*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00355585977903117 - (0.00003698982145400*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00437201792934817 - (0.00002720235666939*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00299217874451556 - (0.00004446954727956*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00457924652487249 - (0.00003859065778860*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00298182934892027 - (0.00002064710931733*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00438838441540584 - (0.00005223008424866*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00323984218794705 - (0.00003397987535887*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00407693981307314 - (0.00003935772436894*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00350435348467321 - (0.00005525463935338*applyconvL))); + //end Punch (API) conv + break; + case 7: + //begin Calibre (?) steel + inputSampleL -= (bL[c[1]] * (0.23505923670562212 - (0.00028312859289245*applyconvL))); + inputSampleL += (bL[c[2]] * (0.08188436704577637 - (0.00008817721351341*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.05075798481700617 - (0.00018817166632483*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.00455811821873093 + (0.00001922902995296*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00027610521433660 - (0.00013252525469291*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.03529246280346626 - (0.00002772989223299*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01784111585586136 + (0.00010230276997291*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.04394950700298298 - (0.00005910607126944*applyconvL))); + inputSampleL += (bL[c[9]] * (0.01990770780547606 + (0.00007640328340556*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.04073629569741782 - (0.00007712327117090*applyconvL))); + inputSampleL += (bL[c[11]] * (0.01349648572795252 + (0.00005959130575917*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.03191590248003717 - (0.00008418000575151*applyconvL))); + inputSampleL += (bL[c[13]] * (0.00348795527924766 + (0.00005489156318238*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.02198496281481767 - (0.00008471601187581*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00504771152505089 - (0.00005525060587917*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01391075698598491 - (0.00007929630732607*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01142762504081717 - (0.00005967036737742*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00893541815021255 - (0.00007535697758141*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.01459704973464936 - (0.00005969199602841*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00694755135226282 - (0.00006930127097865*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.01516695630808575 - (0.00006365800069826*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00705917318113651 - (0.00006497209096539*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.01420501209177591 - (0.00006555654576113*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00815905656808701 - (0.00006105622534761*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.01274326525552961 - (0.00006542652857017*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00937146927845488 - (0.00006051267868722*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.01146573981165209 - (0.00006381511607749*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.01021294359409007 - (0.00005930397856398*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.01065217095323532 - (0.00006371505438319*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.01058751196699751 - (0.00006042857480233*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.01026557827762401 - (0.00006007776163871*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.01060929183604604 - (0.00006114703012726*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.01014533525058528 - (0.00005963567932887*applyconvL))); + //end Calibre (?) + break; + case 8: + //begin Tube (Manley) conv + inputSampleL -= (bL[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvL))); + inputSampleL += (bL[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvL))); + inputSampleL += (bL[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvL))); + inputSampleL += (bL[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvL))); + inputSampleL += (bL[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvL))); + inputSampleL += (bL[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvL))); + inputSampleL += (bL[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvL))); + //end Tube (Manley) conv + break; + } + + switch (console) + { + case 1: + //begin Cider (Focusrite) MCI + inputSampleR += (bR[c[1]] * (0.61283288942201319 + (0.00024011410669522*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.24036380659761222 - (0.00020789518206241*applyconvR))); + inputSampleR += (bR[c[3]] * (0.09104669761717916 + (0.00012829642741548*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.02378290768554025 - (0.00017673646470440*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.02832818490275965 - (0.00013536187747384*applyconvR))); + inputSampleR += (bR[c[6]] * (0.03268797679215937 + (0.00015035126653359*applyconvR))); + inputSampleR -= (bR[c[7]] * (0.04024464202655586 - (0.00015034923056735*applyconvR))); + inputSampleR += (bR[c[8]] * (0.01864890074318696 + (0.00014513281680642*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.01632731954100322 - (0.00015509089075614*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.00318907090555589 - (0.00014784812076550*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.00208573465221869 - (0.00015350520779465*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.00907033901519614 - (0.00015442964157250*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00199458794148013 - (0.00015595640046297*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.00705979153201755 - (0.00015730069418051*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00429488975412722 - (0.00015743697943505*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.00497724878704936 - (0.00016014760011861*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00506059305562353 - (0.00016194824072466*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00483432223285621 - (0.00016329050124225*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00495100420886005 - (0.00016297509798749*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00489319520555115 - (0.00016472839684661*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00489177657970308 - (0.00016791875866630*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00487900894707044 - (0.00016755993898534*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00486234009335561 - (0.00016968157345446*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00485737490288736 - (0.00017180713324431*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00484106070563455 - (0.00017251073661092*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00483219429408410 - (0.00017321683790891*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00482013597437550 - (0.00017392186866488*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00480949628051497 - (0.00017569098775602*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00479992055604049 - (0.00017746046369449*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00478750757986987 - (0.00017745630047554*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00477828651185740 - (0.00017958043287604*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00476906544384494 - (0.00018170456527653*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00475700712413634 - (0.00018099144598088*applyconvR))); + //end Cider (Focusrite) MCI + break; + case 2: + //begin Rock (SSL) conv + inputSampleR += (bR[c[1]] * (0.67887916185274055 + (0.00068787552301086*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.25671050678827934 + (0.00017691749454490*applyconvR))); + inputSampleR += (bR[c[3]] * (0.15135839896615280 + (0.00007481480365043*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.11813512969090802 + (0.00005191138121359*applyconvR))); + inputSampleR += (bR[c[5]] * (0.08329104347166429 + (0.00001871054659794*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.07663817456103936 + (0.00002751359071705*applyconvR))); + inputSampleR += (bR[c[7]] * (0.05477586152148759 + (0.00000744843212679*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.05547314737187786 + (0.00001025289931145*applyconvR))); + inputSampleR += (bR[c[9]] * (0.03822948356540711 - (0.00000249791561457*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.04199383340841713 - (0.00000067328840674*applyconvR))); + inputSampleR += (bR[c[11]] * (0.02695796542339694 - (0.00000796704606548*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.03228715059431878 - (0.00000579711816722*applyconvR))); + inputSampleR += (bR[c[13]] * (0.01846929689819187 - (0.00000984017804950*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.02528050435045951 - (0.00000701189792484*applyconvR))); + inputSampleR += (bR[c[15]] * (0.01207844846859765 - (0.00001522630289356*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01894464378378515 - (0.00001205456372080*applyconvR))); + inputSampleR += (bR[c[17]] * (0.00667804407593324 - (0.00001343604283817*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.01408418045473130 - (0.00001246443581504*applyconvR))); + inputSampleR += (bR[c[19]] * (0.00228696509481569 - (0.00001506764046927*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.01006277891348454 - (0.00000970723079112*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00132368373546377 + (0.00001188847238761*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00676615715578373 - (0.00001209129844861*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00426288438418556 + (0.00001286836943559*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00408897698639688 - (0.00001102542567911*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00662040619382751 + (0.00001206328529063*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00196101294183599 - (0.00000950703614981*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00845620581010342 + (0.00001279970295678*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00032595215043616 - (0.00000920518241371*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00982957737435458 + (0.00001177745362317*applyconvR))); + inputSampleR += (bR[c[30]] * (0.00086920573760513 + (0.00000913758382404*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.01079020871452061 + (0.00000900750153697*applyconvR))); + inputSampleR += (bR[c[32]] * (0.00167613606334460 + (0.00000732769151038*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.01138050011044332 + (0.00000946908207442*applyconvR))); + //end Rock (SSL) conv + break; + case 3: + //begin Lush (Neve) conv + inputSampleR += (bR[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvR))); + inputSampleR += (bR[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvR))); + inputSampleR += (bR[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvR))); + inputSampleR += (bR[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvR))); + inputSampleR -= (bR[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvR))); + inputSampleR += (bR[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvR))); + inputSampleR += (bR[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvR))); + inputSampleR += (bR[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvR))); + inputSampleR += (bR[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvR))); + inputSampleR += (bR[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvR))); + inputSampleR += (bR[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvR))); + inputSampleR += (bR[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvR))); + inputSampleR += (bR[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvR))); + inputSampleR += (bR[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvR))); + inputSampleR += (bR[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvR))); + inputSampleR += (bR[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvR))); + inputSampleR += (bR[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvR))); + inputSampleR += (bR[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvR))); + inputSampleR += (bR[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvR))); + inputSampleR += (bR[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvR))); + inputSampleR += (bR[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvR))); + inputSampleR += (bR[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvR))); + inputSampleR += (bR[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvR))); + inputSampleR += (bR[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvR))); + inputSampleR += (bR[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvR))); + inputSampleR += (bR[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvR))); + //end Lush (Neve) conv + break; + case 4: + //begin Elation (LA2A) vibe + inputSampleR -= (bR[c[1]] * (0.25867935358656502 - (0.00045755657070112*applyconvR))); + inputSampleR += (bR[c[2]] * (0.11509367290253694 - (0.00017494270657228*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.06709853575891785 - (0.00058913102597723*applyconvR))); + inputSampleR += (bR[c[4]] * (0.01871006356851681 - (0.00003387358004645*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00794797957360465 - (0.00044224784691203*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.01956921817394220 - (0.00006718936750076*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01682120257195205 + (0.00032857446292230*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03401069039824205 - (0.00013634182872897*applyconvR))); + inputSampleR += (bR[c[9]] * (0.02369950268232634 + (0.00023112685751657*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.03477071178117132 - (0.00018029792231600*applyconvR))); + inputSampleR += (bR[c[11]] * (0.02024369717958201 + (0.00017337813374202*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.02819087729102172 - (0.00021438538665420*applyconvR))); + inputSampleR += (bR[c[13]] * (0.01147946743141303 + (0.00014424066034649*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.01894777011468867 - (0.00021549146262408*applyconvR))); + inputSampleR += (bR[c[15]] * (0.00301370330346873 + (0.00013527460148394*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01067147835815486 - (0.00020960689910868*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00402715397506384 - (0.00014421582712470*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00502221703392005 - (0.00019805767015024*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00808788533308497 - (0.00016095444141931*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00232696588842683 - (0.00018384470981829*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00943950821324531 - (0.00017098987347593*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00193709517200834 - (0.00018151995939591*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00899713952612659 - (0.00017385835059948*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00280584331659089 - (0.00017742164162470*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00780381001954970 - (0.00018002500755708*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00400370310490333 - (0.00017471691087957*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00661527728186928 - (0.00018137323370347*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00496545526864518 - (0.00017681872601767*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00580728820997532 - (0.00018186220389790*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00549309984725666 - (0.00017722985399075*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00542194777529239 - (0.00018486900185338*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00565992080998939 - (0.00018005824393118*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00532121562846656 - (0.00018643189636216*applyconvR))); + //end Elation (LA2A) + break; + case 5: + //begin Precious (Precision 8) Holo + inputSampleR += (bR[c[1]] * (0.59188440274551890 - (0.00008361469668405*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.24439750948076133 + (0.00002651678396848*applyconvR))); + inputSampleR += (bR[c[3]] * (0.14109876103205621 - (0.00000840487181372*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.10053507128157971 + (0.00001768100964598*applyconvR))); + inputSampleR += (bR[c[5]] * (0.05859287880626238 - (0.00000361398065989*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.04337406889823660 + (0.00000735941182117*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01589900680531097 + (0.00000207347387987*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.01087234854973281 + (0.00000732123412029*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.00845782429679176 - (0.00000133058605071*applyconvR))); + inputSampleR += (bR[c[10]] * (0.00662278586618295 - (0.00000424594730611*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.02000592193760155 + (0.00000632896879068*applyconvR))); + inputSampleR += (bR[c[12]] * (0.01321157777167565 - (0.00001421171592570*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.02249955362988238 + (0.00000163937127317*applyconvR))); + inputSampleR += (bR[c[14]] * (0.01196492077581504 - (0.00000535385220676*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.01905917427000097 + (0.00000121672882030*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00761909482108073 - (0.00000326242895115*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01362744780256239 + (0.00000359274216003*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00200183122683721 - (0.00000089207452791*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00833042637239315 + (0.00000946767677294*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00258481175207224 - (0.00000087429351464*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00459744479712244 - (0.00000049519758701*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00534277030993820 + (0.00000397547847155*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00272332919605675 + (0.00000040077229097*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00637243782359372 - (0.00000139419072176*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00233001590327504 + (0.00000420129915747*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00623296727793041 + (0.00000019010664856*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00276177096376805 + (0.00000580301901385*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00559184754866264 + (0.00000080597287792*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00343180144395919 - (0.00000243701142085*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00493325428861701 + (0.00000300985740900*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00396140827680823 - (0.00000051459681789*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00448497879902493 + (0.00000744412841743*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00425146888772076 - (0.00000082346016542*applyconvR))); + //end Precious (Precision 8) Holo + break; + case 6: + //begin Punch (API) conv + inputSampleR += (bR[c[1]] * (0.09299870608542582 - (0.00009582362368873*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.11947847710741009 - (0.00004500891602770*applyconvR))); + inputSampleR += (bR[c[3]] * (0.09071606264761795 + (0.00005639498984741*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.08561982770836980 - (0.00004964855606916*applyconvR))); + inputSampleR += (bR[c[5]] * (0.06440549220820363 + (0.00002428052139507*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.05987991812840746 + (0.00000101867082290*applyconvR))); + inputSampleR += (bR[c[7]] * (0.03980233135839382 + (0.00003312430049041*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03648402630896925 - (0.00002116186381142*applyconvR))); + inputSampleR += (bR[c[9]] * (0.01826860869525248 + (0.00003115110025396*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.01723968622495364 - (0.00002450634121718*applyconvR))); + inputSampleR += (bR[c[11]] * (0.00187588812316724 + (0.00002838206198968*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.00381796423957237 - (0.00003155815499462*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00852092214496733 - (0.00001702651162392*applyconvR))); + inputSampleR += (bR[c[14]] * (0.00315560292270588 + (0.00002547861676047*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.01258630914496868 - (0.00004555319243213*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00536435648963575 + (0.00001812393657101*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01272975658159178 - (0.00004103775306121*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00403818975172755 + (0.00003764615492871*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.01042617366897483 - (0.00003605210426041*applyconvR))); + inputSampleR += (bR[c[20]] * (0.00126599583390057 + (0.00004305458668852*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00747876207688339 - (0.00003731207018977*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00149873689175324 - (0.00005086601800791*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00503221309488033 - (0.00003636086782783*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00342998224655821 - (0.00004103091180506*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00355585977903117 - (0.00003698982145400*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00437201792934817 - (0.00002720235666939*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00299217874451556 - (0.00004446954727956*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00457924652487249 - (0.00003859065778860*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00298182934892027 - (0.00002064710931733*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00438838441540584 - (0.00005223008424866*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00323984218794705 - (0.00003397987535887*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00407693981307314 - (0.00003935772436894*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00350435348467321 - (0.00005525463935338*applyconvR))); + //end Punch (API) conv + break; + case 7: + //begin Calibre (?) steel + inputSampleR -= (bR[c[1]] * (0.23505923670562212 - (0.00028312859289245*applyconvR))); + inputSampleR += (bR[c[2]] * (0.08188436704577637 - (0.00008817721351341*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.05075798481700617 - (0.00018817166632483*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.00455811821873093 + (0.00001922902995296*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00027610521433660 - (0.00013252525469291*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.03529246280346626 - (0.00002772989223299*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01784111585586136 + (0.00010230276997291*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.04394950700298298 - (0.00005910607126944*applyconvR))); + inputSampleR += (bR[c[9]] * (0.01990770780547606 + (0.00007640328340556*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.04073629569741782 - (0.00007712327117090*applyconvR))); + inputSampleR += (bR[c[11]] * (0.01349648572795252 + (0.00005959130575917*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.03191590248003717 - (0.00008418000575151*applyconvR))); + inputSampleR += (bR[c[13]] * (0.00348795527924766 + (0.00005489156318238*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.02198496281481767 - (0.00008471601187581*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00504771152505089 - (0.00005525060587917*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01391075698598491 - (0.00007929630732607*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01142762504081717 - (0.00005967036737742*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00893541815021255 - (0.00007535697758141*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.01459704973464936 - (0.00005969199602841*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00694755135226282 - (0.00006930127097865*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.01516695630808575 - (0.00006365800069826*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00705917318113651 - (0.00006497209096539*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.01420501209177591 - (0.00006555654576113*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00815905656808701 - (0.00006105622534761*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.01274326525552961 - (0.00006542652857017*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00937146927845488 - (0.00006051267868722*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.01146573981165209 - (0.00006381511607749*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.01021294359409007 - (0.00005930397856398*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.01065217095323532 - (0.00006371505438319*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.01058751196699751 - (0.00006042857480233*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.01026557827762401 - (0.00006007776163871*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.01060929183604604 - (0.00006114703012726*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.01014533525058528 - (0.00005963567932887*applyconvR))); + //end Calibre (?) + break; + case 8: + //begin Tube (Manley) conv + inputSampleR -= (bR[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvR))); + inputSampleR += (bR[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvR))); + inputSampleR += (bR[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvR))); + inputSampleR += (bR[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvR))); + inputSampleR += (bR[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvR))); + inputSampleR += (bR[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvR))); + inputSampleR += (bR[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvR))); + //end Tube (Manley) conv + break; + } + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL -= bridgerectifier; + else inputSampleL += bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR -= bridgerectifier; + else inputSampleR += bridgerectifier; + + + if (outgain != 1.0) { + inputSampleL *= outgain; + inputSampleR *= outgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 BussColors4::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(); + if (overallscale < 1.0) overallscale = 1.0; + if (overallscale > 4.5) overallscale = 4.5; + const int maxConvolutionBufferSize = (int)(34.0 * overallscale); //we won't use more of the buffer than we have to + for (int count = 0; count < 34; count++) c[count] = (int)(count * overallscale); //assign conv taps + double drySampleL; + double drySampleR; + double applyconvL; + double applyconvR; + int offsetA = 3; + double dynamicconvL = 3.0; + double dynamicconvR = 3.0; + double gain = 0.436; + double outgain = 1.0; + double bridgerectifier; + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + int console = (int)( A * 7.999 )+1; //the AU used a 1-8 index, will just keep it + switch (console) + { + case 1: offsetA = 4; gain = g[1]; outgain = outg[1]; break; //Dark (Focusrite) + case 2: offsetA = 3; gain = g[2]; outgain = outg[2]; break; //Rock (SSL) + case 3: offsetA = 5; gain = g[3]; outgain = outg[3]; break; //Lush (Neve) + case 4: offsetA = 8; gain = g[4]; outgain = outg[4]; break; //Vibe (Elation) + case 5: offsetA = 5; gain = g[5]; outgain = outg[5]; break; //Holo (Precision 8) + case 6: offsetA = 7; gain = g[6]; outgain = outg[6]; break; //Punch (API) + case 7: offsetA = 7; gain = g[7]; outgain = outg[7]; break; //Steel (Calibre) + case 8: offsetA = 6; gain = g[8]; outgain = outg[8]; break; //Tube (Manley) + } + offsetA = (int)(offsetA * overallscale); //we extend the sag buffer too, at high sample rates + if (offsetA < 3) offsetA = 3; //are we getting divides by zero? + gain *= pow(10.0,((B * 36.0)-18.0)/14.0); //add adjustment factor + outgain *= pow(10.0,(((C * 36.0)-18.0)+3.3)/14.0); //add adjustment factor + double wet = D; + double dry = 1.0 - wet; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gain != 1.0) { + inputSampleL *= gain; + inputSampleR *= gain; + } + + + bridgerectifier = fabs(inputSampleL); + slowdynL *= 0.999; + slowdynL += bridgerectifier; + if (slowdynL > 1.5) {slowdynL = 1.5;} + //before the iron bar- fry console for crazy behavior + dynamicconvL = 2.5 + slowdynL; + + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //end pre saturation stage L + + bridgerectifier = fabs(inputSampleR); + slowdynR *= 0.999; + slowdynR += bridgerectifier; + if (slowdynR > 1.5) {slowdynR = 1.5;} + //before the iron bar- fry console for crazy behavior + dynamicconvR = 2.5 + slowdynR; + + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //end pre saturation stage R + + if (gcount < 0 || gcount > 44) gcount = 44; + + dL[gcount+44] = dL[gcount] = fabs(inputSampleL); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + if (controlL < 0) controlL = 0; + if (controlL > 100) controlL = 100; + applyconvL = (controlL / offsetA) * dynamicconvL; + //now we have a 'sag' style average to apply to the conv, L + + dR[gcount+44] = dR[gcount] = fabs(inputSampleR); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + if (controlR < 0) controlR = 0; + if (controlR > 100) controlR = 100; + applyconvR = (controlR / offsetA) * dynamicconvR; + //now we have a 'sag' style average to apply to the conv, R + + gcount--; + + //now the convolution + for (int count = maxConvolutionBufferSize; count > 0; --count) {bL[count] = bL[count-1];} //was 173 + //we're only doing assigns, and it saves us an add inside the convolution calculation + //therefore, we'll just assign everything one step along and have our buffer that way. + bL[0] = inputSampleL; + + for (int count = maxConvolutionBufferSize; count > 0; --count) {bR[count] = bR[count-1];} //was 173 + //we're only doing assigns, and it saves us an add inside the convolution calculation + //therefore, we'll just assign everything one step along and have our buffer that way. + bR[0] = inputSampleR; + //The reason these are separate is, since it's just a big assign-fest, it's possible compilers can + //come up with a clever way to do it. Interleaving the samples might make it enough more complicated + //that the compiler wouldn't know to do 'em in batches or whatever. Just a thought, profiling would + //be the correct way to find out this (or indeed, whether doing another add insode the convolutions would + //be the best bet, + + //The convolutions! + + switch (console) + { + case 1: + //begin Cider (Focusrite) MCI + inputSampleL += (bL[c[1]] * (0.61283288942201319 + (0.00024011410669522*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.24036380659761222 - (0.00020789518206241*applyconvL))); + inputSampleL += (bL[c[3]] * (0.09104669761717916 + (0.00012829642741548*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.02378290768554025 - (0.00017673646470440*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.02832818490275965 - (0.00013536187747384*applyconvL))); + inputSampleL += (bL[c[6]] * (0.03268797679215937 + (0.00015035126653359*applyconvL))); + inputSampleL -= (bL[c[7]] * (0.04024464202655586 - (0.00015034923056735*applyconvL))); + inputSampleL += (bL[c[8]] * (0.01864890074318696 + (0.00014513281680642*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.01632731954100322 - (0.00015509089075614*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.00318907090555589 - (0.00014784812076550*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.00208573465221869 - (0.00015350520779465*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.00907033901519614 - (0.00015442964157250*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00199458794148013 - (0.00015595640046297*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.00705979153201755 - (0.00015730069418051*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00429488975412722 - (0.00015743697943505*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.00497724878704936 - (0.00016014760011861*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00506059305562353 - (0.00016194824072466*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00483432223285621 - (0.00016329050124225*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00495100420886005 - (0.00016297509798749*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00489319520555115 - (0.00016472839684661*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00489177657970308 - (0.00016791875866630*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00487900894707044 - (0.00016755993898534*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00486234009335561 - (0.00016968157345446*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00485737490288736 - (0.00017180713324431*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00484106070563455 - (0.00017251073661092*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00483219429408410 - (0.00017321683790891*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00482013597437550 - (0.00017392186866488*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00480949628051497 - (0.00017569098775602*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00479992055604049 - (0.00017746046369449*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00478750757986987 - (0.00017745630047554*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00477828651185740 - (0.00017958043287604*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00476906544384494 - (0.00018170456527653*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00475700712413634 - (0.00018099144598088*applyconvL))); + //end Cider (Focusrite) MCI + break; + case 2: + //begin Rock (SSL) conv + inputSampleL += (bL[c[1]] * (0.67887916185274055 + (0.00068787552301086*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.25671050678827934 + (0.00017691749454490*applyconvL))); + inputSampleL += (bL[c[3]] * (0.15135839896615280 + (0.00007481480365043*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.11813512969090802 + (0.00005191138121359*applyconvL))); + inputSampleL += (bL[c[5]] * (0.08329104347166429 + (0.00001871054659794*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.07663817456103936 + (0.00002751359071705*applyconvL))); + inputSampleL += (bL[c[7]] * (0.05477586152148759 + (0.00000744843212679*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.05547314737187786 + (0.00001025289931145*applyconvL))); + inputSampleL += (bL[c[9]] * (0.03822948356540711 - (0.00000249791561457*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.04199383340841713 - (0.00000067328840674*applyconvL))); + inputSampleL += (bL[c[11]] * (0.02695796542339694 - (0.00000796704606548*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.03228715059431878 - (0.00000579711816722*applyconvL))); + inputSampleL += (bL[c[13]] * (0.01846929689819187 - (0.00000984017804950*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.02528050435045951 - (0.00000701189792484*applyconvL))); + inputSampleL += (bL[c[15]] * (0.01207844846859765 - (0.00001522630289356*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01894464378378515 - (0.00001205456372080*applyconvL))); + inputSampleL += (bL[c[17]] * (0.00667804407593324 - (0.00001343604283817*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.01408418045473130 - (0.00001246443581504*applyconvL))); + inputSampleL += (bL[c[19]] * (0.00228696509481569 - (0.00001506764046927*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.01006277891348454 - (0.00000970723079112*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00132368373546377 + (0.00001188847238761*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00676615715578373 - (0.00001209129844861*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00426288438418556 + (0.00001286836943559*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00408897698639688 - (0.00001102542567911*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00662040619382751 + (0.00001206328529063*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00196101294183599 - (0.00000950703614981*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00845620581010342 + (0.00001279970295678*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00032595215043616 - (0.00000920518241371*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00982957737435458 + (0.00001177745362317*applyconvL))); + inputSampleL += (bL[c[30]] * (0.00086920573760513 + (0.00000913758382404*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.01079020871452061 + (0.00000900750153697*applyconvL))); + inputSampleL += (bL[c[32]] * (0.00167613606334460 + (0.00000732769151038*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.01138050011044332 + (0.00000946908207442*applyconvL))); + //end Rock (SSL) conv + break; + case 3: + //begin Lush (Neve) conv + inputSampleL += (bL[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvL))); + inputSampleL += (bL[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvL))); + inputSampleL += (bL[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvL))); + inputSampleL += (bL[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvL))); + inputSampleL -= (bL[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvL))); + inputSampleL += (bL[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvL))); + inputSampleL += (bL[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvL))); + inputSampleL += (bL[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvL))); + inputSampleL += (bL[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvL))); + inputSampleL += (bL[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvL))); + inputSampleL += (bL[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvL))); + inputSampleL += (bL[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvL))); + inputSampleL += (bL[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvL))); + inputSampleL += (bL[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvL))); + inputSampleL += (bL[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvL))); + inputSampleL += (bL[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvL))); + inputSampleL += (bL[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvL))); + inputSampleL += (bL[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvL))); + inputSampleL += (bL[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvL))); + inputSampleL += (bL[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvL))); + inputSampleL += (bL[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvL))); + inputSampleL += (bL[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvL))); + inputSampleL += (bL[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvL))); + inputSampleL += (bL[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvL))); + inputSampleL += (bL[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvL))); + inputSampleL += (bL[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvL))); + //end Lush (Neve) conv + break; + case 4: + //begin Elation (LA2A) vibe + inputSampleL -= (bL[c[1]] * (0.25867935358656502 - (0.00045755657070112*applyconvL))); + inputSampleL += (bL[c[2]] * (0.11509367290253694 - (0.00017494270657228*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.06709853575891785 - (0.00058913102597723*applyconvL))); + inputSampleL += (bL[c[4]] * (0.01871006356851681 - (0.00003387358004645*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00794797957360465 - (0.00044224784691203*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.01956921817394220 - (0.00006718936750076*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01682120257195205 + (0.00032857446292230*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03401069039824205 - (0.00013634182872897*applyconvL))); + inputSampleL += (bL[c[9]] * (0.02369950268232634 + (0.00023112685751657*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.03477071178117132 - (0.00018029792231600*applyconvL))); + inputSampleL += (bL[c[11]] * (0.02024369717958201 + (0.00017337813374202*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.02819087729102172 - (0.00021438538665420*applyconvL))); + inputSampleL += (bL[c[13]] * (0.01147946743141303 + (0.00014424066034649*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.01894777011468867 - (0.00021549146262408*applyconvL))); + inputSampleL += (bL[c[15]] * (0.00301370330346873 + (0.00013527460148394*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01067147835815486 - (0.00020960689910868*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00402715397506384 - (0.00014421582712470*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00502221703392005 - (0.00019805767015024*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00808788533308497 - (0.00016095444141931*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00232696588842683 - (0.00018384470981829*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00943950821324531 - (0.00017098987347593*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00193709517200834 - (0.00018151995939591*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00899713952612659 - (0.00017385835059948*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00280584331659089 - (0.00017742164162470*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00780381001954970 - (0.00018002500755708*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00400370310490333 - (0.00017471691087957*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00661527728186928 - (0.00018137323370347*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00496545526864518 - (0.00017681872601767*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00580728820997532 - (0.00018186220389790*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00549309984725666 - (0.00017722985399075*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00542194777529239 - (0.00018486900185338*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00565992080998939 - (0.00018005824393118*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00532121562846656 - (0.00018643189636216*applyconvL))); + //end Elation (LA2A) + break; + case 5: + //begin Precious (Precision 8) Holo + inputSampleL += (bL[c[1]] * (0.59188440274551890 - (0.00008361469668405*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.24439750948076133 + (0.00002651678396848*applyconvL))); + inputSampleL += (bL[c[3]] * (0.14109876103205621 - (0.00000840487181372*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.10053507128157971 + (0.00001768100964598*applyconvL))); + inputSampleL += (bL[c[5]] * (0.05859287880626238 - (0.00000361398065989*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.04337406889823660 + (0.00000735941182117*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01589900680531097 + (0.00000207347387987*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.01087234854973281 + (0.00000732123412029*applyconvL))); + inputSampleL -= (bL[c[9]] * (0.00845782429679176 - (0.00000133058605071*applyconvL))); + inputSampleL += (bL[c[10]] * (0.00662278586618295 - (0.00000424594730611*applyconvL))); + inputSampleL -= (bL[c[11]] * (0.02000592193760155 + (0.00000632896879068*applyconvL))); + inputSampleL += (bL[c[12]] * (0.01321157777167565 - (0.00001421171592570*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.02249955362988238 + (0.00000163937127317*applyconvL))); + inputSampleL += (bL[c[14]] * (0.01196492077581504 - (0.00000535385220676*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.01905917427000097 + (0.00000121672882030*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00761909482108073 - (0.00000326242895115*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01362744780256239 + (0.00000359274216003*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00200183122683721 - (0.00000089207452791*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00833042637239315 + (0.00000946767677294*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00258481175207224 - (0.00000087429351464*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00459744479712244 - (0.00000049519758701*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00534277030993820 + (0.00000397547847155*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00272332919605675 + (0.00000040077229097*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00637243782359372 - (0.00000139419072176*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00233001590327504 + (0.00000420129915747*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00623296727793041 + (0.00000019010664856*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00276177096376805 + (0.00000580301901385*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00559184754866264 + (0.00000080597287792*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00343180144395919 - (0.00000243701142085*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00493325428861701 + (0.00000300985740900*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00396140827680823 - (0.00000051459681789*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00448497879902493 + (0.00000744412841743*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00425146888772076 - (0.00000082346016542*applyconvL))); + //end Precious (Precision 8) Holo + break; + case 6: + //begin Punch (API) conv + inputSampleL += (bL[c[1]] * (0.09299870608542582 - (0.00009582362368873*applyconvL))); + inputSampleL -= (bL[c[2]] * (0.11947847710741009 - (0.00004500891602770*applyconvL))); + inputSampleL += (bL[c[3]] * (0.09071606264761795 + (0.00005639498984741*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.08561982770836980 - (0.00004964855606916*applyconvL))); + inputSampleL += (bL[c[5]] * (0.06440549220820363 + (0.00002428052139507*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.05987991812840746 + (0.00000101867082290*applyconvL))); + inputSampleL += (bL[c[7]] * (0.03980233135839382 + (0.00003312430049041*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03648402630896925 - (0.00002116186381142*applyconvL))); + inputSampleL += (bL[c[9]] * (0.01826860869525248 + (0.00003115110025396*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.01723968622495364 - (0.00002450634121718*applyconvL))); + inputSampleL += (bL[c[11]] * (0.00187588812316724 + (0.00002838206198968*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.00381796423957237 - (0.00003155815499462*applyconvL))); + inputSampleL -= (bL[c[13]] * (0.00852092214496733 - (0.00001702651162392*applyconvL))); + inputSampleL += (bL[c[14]] * (0.00315560292270588 + (0.00002547861676047*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.01258630914496868 - (0.00004555319243213*applyconvL))); + inputSampleL += (bL[c[16]] * (0.00536435648963575 + (0.00001812393657101*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01272975658159178 - (0.00004103775306121*applyconvL))); + inputSampleL += (bL[c[18]] * (0.00403818975172755 + (0.00003764615492871*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.01042617366897483 - (0.00003605210426041*applyconvL))); + inputSampleL += (bL[c[20]] * (0.00126599583390057 + (0.00004305458668852*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.00747876207688339 - (0.00003731207018977*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00149873689175324 - (0.00005086601800791*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00503221309488033 - (0.00003636086782783*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00342998224655821 - (0.00004103091180506*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00355585977903117 - (0.00003698982145400*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00437201792934817 - (0.00002720235666939*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00299217874451556 - (0.00004446954727956*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00457924652487249 - (0.00003859065778860*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00298182934892027 - (0.00002064710931733*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00438838441540584 - (0.00005223008424866*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00323984218794705 - (0.00003397987535887*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00407693981307314 - (0.00003935772436894*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00350435348467321 - (0.00005525463935338*applyconvL))); + //end Punch (API) conv + break; + case 7: + //begin Calibre (?) steel + inputSampleL -= (bL[c[1]] * (0.23505923670562212 - (0.00028312859289245*applyconvL))); + inputSampleL += (bL[c[2]] * (0.08188436704577637 - (0.00008817721351341*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.05075798481700617 - (0.00018817166632483*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.00455811821873093 + (0.00001922902995296*applyconvL))); + inputSampleL -= (bL[c[5]] * (0.00027610521433660 - (0.00013252525469291*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.03529246280346626 - (0.00002772989223299*applyconvL))); + inputSampleL += (bL[c[7]] * (0.01784111585586136 + (0.00010230276997291*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.04394950700298298 - (0.00005910607126944*applyconvL))); + inputSampleL += (bL[c[9]] * (0.01990770780547606 + (0.00007640328340556*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.04073629569741782 - (0.00007712327117090*applyconvL))); + inputSampleL += (bL[c[11]] * (0.01349648572795252 + (0.00005959130575917*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.03191590248003717 - (0.00008418000575151*applyconvL))); + inputSampleL += (bL[c[13]] * (0.00348795527924766 + (0.00005489156318238*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.02198496281481767 - (0.00008471601187581*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00504771152505089 - (0.00005525060587917*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.01391075698598491 - (0.00007929630732607*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.01142762504081717 - (0.00005967036737742*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00893541815021255 - (0.00007535697758141*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.01459704973464936 - (0.00005969199602841*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00694755135226282 - (0.00006930127097865*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.01516695630808575 - (0.00006365800069826*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00705917318113651 - (0.00006497209096539*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.01420501209177591 - (0.00006555654576113*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00815905656808701 - (0.00006105622534761*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.01274326525552961 - (0.00006542652857017*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00937146927845488 - (0.00006051267868722*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.01146573981165209 - (0.00006381511607749*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.01021294359409007 - (0.00005930397856398*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.01065217095323532 - (0.00006371505438319*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.01058751196699751 - (0.00006042857480233*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.01026557827762401 - (0.00006007776163871*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.01060929183604604 - (0.00006114703012726*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.01014533525058528 - (0.00005963567932887*applyconvL))); + //end Calibre (?) + break; + case 8: + //begin Tube (Manley) conv + inputSampleL -= (bL[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvL))); + inputSampleL += (bL[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvL))); + inputSampleL -= (bL[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvL))); + inputSampleL -= (bL[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvL))); + inputSampleL += (bL[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvL))); + inputSampleL -= (bL[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvL))); + inputSampleL += (bL[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvL))); + inputSampleL -= (bL[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvL))); + inputSampleL += (bL[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvL))); + inputSampleL -= (bL[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvL))); + inputSampleL += (bL[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvL))); + inputSampleL -= (bL[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvL))); + inputSampleL += (bL[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvL))); + inputSampleL -= (bL[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvL))); + inputSampleL -= (bL[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvL))); + inputSampleL -= (bL[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvL))); + inputSampleL -= (bL[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvL))); + inputSampleL -= (bL[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvL))); + inputSampleL -= (bL[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvL))); + inputSampleL -= (bL[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvL))); + inputSampleL -= (bL[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvL))); + inputSampleL -= (bL[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvL))); + inputSampleL -= (bL[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvL))); + inputSampleL -= (bL[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvL))); + inputSampleL -= (bL[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvL))); + inputSampleL -= (bL[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvL))); + inputSampleL -= (bL[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvL))); + inputSampleL -= (bL[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvL))); + inputSampleL -= (bL[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvL))); + inputSampleL -= (bL[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvL))); + inputSampleL -= (bL[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvL))); + inputSampleL -= (bL[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvL))); + inputSampleL -= (bL[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvL))); + //end Tube (Manley) conv + break; + } + + switch (console) + { + case 1: + //begin Cider (Focusrite) MCI + inputSampleR += (bR[c[1]] * (0.61283288942201319 + (0.00024011410669522*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.24036380659761222 - (0.00020789518206241*applyconvR))); + inputSampleR += (bR[c[3]] * (0.09104669761717916 + (0.00012829642741548*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.02378290768554025 - (0.00017673646470440*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.02832818490275965 - (0.00013536187747384*applyconvR))); + inputSampleR += (bR[c[6]] * (0.03268797679215937 + (0.00015035126653359*applyconvR))); + inputSampleR -= (bR[c[7]] * (0.04024464202655586 - (0.00015034923056735*applyconvR))); + inputSampleR += (bR[c[8]] * (0.01864890074318696 + (0.00014513281680642*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.01632731954100322 - (0.00015509089075614*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.00318907090555589 - (0.00014784812076550*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.00208573465221869 - (0.00015350520779465*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.00907033901519614 - (0.00015442964157250*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00199458794148013 - (0.00015595640046297*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.00705979153201755 - (0.00015730069418051*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00429488975412722 - (0.00015743697943505*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.00497724878704936 - (0.00016014760011861*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00506059305562353 - (0.00016194824072466*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00483432223285621 - (0.00016329050124225*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00495100420886005 - (0.00016297509798749*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00489319520555115 - (0.00016472839684661*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00489177657970308 - (0.00016791875866630*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00487900894707044 - (0.00016755993898534*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00486234009335561 - (0.00016968157345446*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00485737490288736 - (0.00017180713324431*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00484106070563455 - (0.00017251073661092*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00483219429408410 - (0.00017321683790891*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00482013597437550 - (0.00017392186866488*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00480949628051497 - (0.00017569098775602*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00479992055604049 - (0.00017746046369449*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00478750757986987 - (0.00017745630047554*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00477828651185740 - (0.00017958043287604*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00476906544384494 - (0.00018170456527653*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00475700712413634 - (0.00018099144598088*applyconvR))); + //end Cider (Focusrite) MCI + break; + case 2: + //begin Rock (SSL) conv + inputSampleR += (bR[c[1]] * (0.67887916185274055 + (0.00068787552301086*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.25671050678827934 + (0.00017691749454490*applyconvR))); + inputSampleR += (bR[c[3]] * (0.15135839896615280 + (0.00007481480365043*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.11813512969090802 + (0.00005191138121359*applyconvR))); + inputSampleR += (bR[c[5]] * (0.08329104347166429 + (0.00001871054659794*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.07663817456103936 + (0.00002751359071705*applyconvR))); + inputSampleR += (bR[c[7]] * (0.05477586152148759 + (0.00000744843212679*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.05547314737187786 + (0.00001025289931145*applyconvR))); + inputSampleR += (bR[c[9]] * (0.03822948356540711 - (0.00000249791561457*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.04199383340841713 - (0.00000067328840674*applyconvR))); + inputSampleR += (bR[c[11]] * (0.02695796542339694 - (0.00000796704606548*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.03228715059431878 - (0.00000579711816722*applyconvR))); + inputSampleR += (bR[c[13]] * (0.01846929689819187 - (0.00000984017804950*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.02528050435045951 - (0.00000701189792484*applyconvR))); + inputSampleR += (bR[c[15]] * (0.01207844846859765 - (0.00001522630289356*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01894464378378515 - (0.00001205456372080*applyconvR))); + inputSampleR += (bR[c[17]] * (0.00667804407593324 - (0.00001343604283817*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.01408418045473130 - (0.00001246443581504*applyconvR))); + inputSampleR += (bR[c[19]] * (0.00228696509481569 - (0.00001506764046927*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.01006277891348454 - (0.00000970723079112*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00132368373546377 + (0.00001188847238761*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00676615715578373 - (0.00001209129844861*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00426288438418556 + (0.00001286836943559*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00408897698639688 - (0.00001102542567911*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00662040619382751 + (0.00001206328529063*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00196101294183599 - (0.00000950703614981*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00845620581010342 + (0.00001279970295678*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00032595215043616 - (0.00000920518241371*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00982957737435458 + (0.00001177745362317*applyconvR))); + inputSampleR += (bR[c[30]] * (0.00086920573760513 + (0.00000913758382404*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.01079020871452061 + (0.00000900750153697*applyconvR))); + inputSampleR += (bR[c[32]] * (0.00167613606334460 + (0.00000732769151038*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.01138050011044332 + (0.00000946908207442*applyconvR))); + //end Rock (SSL) conv + break; + case 3: + //begin Lush (Neve) conv + inputSampleR += (bR[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvR))); + inputSampleR += (bR[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvR))); + inputSampleR += (bR[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvR))); + inputSampleR += (bR[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvR))); + inputSampleR -= (bR[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvR))); + inputSampleR += (bR[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvR))); + inputSampleR += (bR[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvR))); + inputSampleR += (bR[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvR))); + inputSampleR += (bR[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvR))); + inputSampleR += (bR[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvR))); + inputSampleR += (bR[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvR))); + inputSampleR += (bR[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvR))); + inputSampleR += (bR[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvR))); + inputSampleR += (bR[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvR))); + inputSampleR += (bR[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvR))); + inputSampleR += (bR[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvR))); + inputSampleR += (bR[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvR))); + inputSampleR += (bR[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvR))); + inputSampleR += (bR[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvR))); + inputSampleR += (bR[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvR))); + inputSampleR += (bR[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvR))); + inputSampleR += (bR[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvR))); + inputSampleR += (bR[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvR))); + inputSampleR += (bR[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvR))); + inputSampleR += (bR[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvR))); + inputSampleR += (bR[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvR))); + //end Lush (Neve) conv + break; + case 4: + //begin Elation (LA2A) vibe + inputSampleR -= (bR[c[1]] * (0.25867935358656502 - (0.00045755657070112*applyconvR))); + inputSampleR += (bR[c[2]] * (0.11509367290253694 - (0.00017494270657228*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.06709853575891785 - (0.00058913102597723*applyconvR))); + inputSampleR += (bR[c[4]] * (0.01871006356851681 - (0.00003387358004645*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00794797957360465 - (0.00044224784691203*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.01956921817394220 - (0.00006718936750076*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01682120257195205 + (0.00032857446292230*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03401069039824205 - (0.00013634182872897*applyconvR))); + inputSampleR += (bR[c[9]] * (0.02369950268232634 + (0.00023112685751657*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.03477071178117132 - (0.00018029792231600*applyconvR))); + inputSampleR += (bR[c[11]] * (0.02024369717958201 + (0.00017337813374202*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.02819087729102172 - (0.00021438538665420*applyconvR))); + inputSampleR += (bR[c[13]] * (0.01147946743141303 + (0.00014424066034649*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.01894777011468867 - (0.00021549146262408*applyconvR))); + inputSampleR += (bR[c[15]] * (0.00301370330346873 + (0.00013527460148394*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01067147835815486 - (0.00020960689910868*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00402715397506384 - (0.00014421582712470*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00502221703392005 - (0.00019805767015024*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00808788533308497 - (0.00016095444141931*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00232696588842683 - (0.00018384470981829*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00943950821324531 - (0.00017098987347593*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00193709517200834 - (0.00018151995939591*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00899713952612659 - (0.00017385835059948*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00280584331659089 - (0.00017742164162470*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00780381001954970 - (0.00018002500755708*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00400370310490333 - (0.00017471691087957*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00661527728186928 - (0.00018137323370347*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00496545526864518 - (0.00017681872601767*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00580728820997532 - (0.00018186220389790*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00549309984725666 - (0.00017722985399075*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00542194777529239 - (0.00018486900185338*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00565992080998939 - (0.00018005824393118*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00532121562846656 - (0.00018643189636216*applyconvR))); + //end Elation (LA2A) + break; + case 5: + //begin Precious (Precision 8) Holo + inputSampleR += (bR[c[1]] * (0.59188440274551890 - (0.00008361469668405*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.24439750948076133 + (0.00002651678396848*applyconvR))); + inputSampleR += (bR[c[3]] * (0.14109876103205621 - (0.00000840487181372*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.10053507128157971 + (0.00001768100964598*applyconvR))); + inputSampleR += (bR[c[5]] * (0.05859287880626238 - (0.00000361398065989*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.04337406889823660 + (0.00000735941182117*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01589900680531097 + (0.00000207347387987*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.01087234854973281 + (0.00000732123412029*applyconvR))); + inputSampleR -= (bR[c[9]] * (0.00845782429679176 - (0.00000133058605071*applyconvR))); + inputSampleR += (bR[c[10]] * (0.00662278586618295 - (0.00000424594730611*applyconvR))); + inputSampleR -= (bR[c[11]] * (0.02000592193760155 + (0.00000632896879068*applyconvR))); + inputSampleR += (bR[c[12]] * (0.01321157777167565 - (0.00001421171592570*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.02249955362988238 + (0.00000163937127317*applyconvR))); + inputSampleR += (bR[c[14]] * (0.01196492077581504 - (0.00000535385220676*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.01905917427000097 + (0.00000121672882030*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00761909482108073 - (0.00000326242895115*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01362744780256239 + (0.00000359274216003*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00200183122683721 - (0.00000089207452791*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00833042637239315 + (0.00000946767677294*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00258481175207224 - (0.00000087429351464*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00459744479712244 - (0.00000049519758701*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00534277030993820 + (0.00000397547847155*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00272332919605675 + (0.00000040077229097*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00637243782359372 - (0.00000139419072176*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00233001590327504 + (0.00000420129915747*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00623296727793041 + (0.00000019010664856*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00276177096376805 + (0.00000580301901385*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00559184754866264 + (0.00000080597287792*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00343180144395919 - (0.00000243701142085*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00493325428861701 + (0.00000300985740900*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00396140827680823 - (0.00000051459681789*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00448497879902493 + (0.00000744412841743*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00425146888772076 - (0.00000082346016542*applyconvR))); + //end Precious (Precision 8) Holo + break; + case 6: + //begin Punch (API) conv + inputSampleR += (bR[c[1]] * (0.09299870608542582 - (0.00009582362368873*applyconvR))); + inputSampleR -= (bR[c[2]] * (0.11947847710741009 - (0.00004500891602770*applyconvR))); + inputSampleR += (bR[c[3]] * (0.09071606264761795 + (0.00005639498984741*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.08561982770836980 - (0.00004964855606916*applyconvR))); + inputSampleR += (bR[c[5]] * (0.06440549220820363 + (0.00002428052139507*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.05987991812840746 + (0.00000101867082290*applyconvR))); + inputSampleR += (bR[c[7]] * (0.03980233135839382 + (0.00003312430049041*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03648402630896925 - (0.00002116186381142*applyconvR))); + inputSampleR += (bR[c[9]] * (0.01826860869525248 + (0.00003115110025396*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.01723968622495364 - (0.00002450634121718*applyconvR))); + inputSampleR += (bR[c[11]] * (0.00187588812316724 + (0.00002838206198968*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.00381796423957237 - (0.00003155815499462*applyconvR))); + inputSampleR -= (bR[c[13]] * (0.00852092214496733 - (0.00001702651162392*applyconvR))); + inputSampleR += (bR[c[14]] * (0.00315560292270588 + (0.00002547861676047*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.01258630914496868 - (0.00004555319243213*applyconvR))); + inputSampleR += (bR[c[16]] * (0.00536435648963575 + (0.00001812393657101*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01272975658159178 - (0.00004103775306121*applyconvR))); + inputSampleR += (bR[c[18]] * (0.00403818975172755 + (0.00003764615492871*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.01042617366897483 - (0.00003605210426041*applyconvR))); + inputSampleR += (bR[c[20]] * (0.00126599583390057 + (0.00004305458668852*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.00747876207688339 - (0.00003731207018977*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00149873689175324 - (0.00005086601800791*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00503221309488033 - (0.00003636086782783*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00342998224655821 - (0.00004103091180506*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00355585977903117 - (0.00003698982145400*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00437201792934817 - (0.00002720235666939*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00299217874451556 - (0.00004446954727956*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00457924652487249 - (0.00003859065778860*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00298182934892027 - (0.00002064710931733*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00438838441540584 - (0.00005223008424866*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00323984218794705 - (0.00003397987535887*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00407693981307314 - (0.00003935772436894*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00350435348467321 - (0.00005525463935338*applyconvR))); + //end Punch (API) conv + break; + case 7: + //begin Calibre (?) steel + inputSampleR -= (bR[c[1]] * (0.23505923670562212 - (0.00028312859289245*applyconvR))); + inputSampleR += (bR[c[2]] * (0.08188436704577637 - (0.00008817721351341*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.05075798481700617 - (0.00018817166632483*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.00455811821873093 + (0.00001922902995296*applyconvR))); + inputSampleR -= (bR[c[5]] * (0.00027610521433660 - (0.00013252525469291*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.03529246280346626 - (0.00002772989223299*applyconvR))); + inputSampleR += (bR[c[7]] * (0.01784111585586136 + (0.00010230276997291*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.04394950700298298 - (0.00005910607126944*applyconvR))); + inputSampleR += (bR[c[9]] * (0.01990770780547606 + (0.00007640328340556*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.04073629569741782 - (0.00007712327117090*applyconvR))); + inputSampleR += (bR[c[11]] * (0.01349648572795252 + (0.00005959130575917*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.03191590248003717 - (0.00008418000575151*applyconvR))); + inputSampleR += (bR[c[13]] * (0.00348795527924766 + (0.00005489156318238*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.02198496281481767 - (0.00008471601187581*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00504771152505089 - (0.00005525060587917*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.01391075698598491 - (0.00007929630732607*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.01142762504081717 - (0.00005967036737742*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00893541815021255 - (0.00007535697758141*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.01459704973464936 - (0.00005969199602841*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00694755135226282 - (0.00006930127097865*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.01516695630808575 - (0.00006365800069826*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00705917318113651 - (0.00006497209096539*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.01420501209177591 - (0.00006555654576113*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00815905656808701 - (0.00006105622534761*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.01274326525552961 - (0.00006542652857017*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00937146927845488 - (0.00006051267868722*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.01146573981165209 - (0.00006381511607749*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.01021294359409007 - (0.00005930397856398*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.01065217095323532 - (0.00006371505438319*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.01058751196699751 - (0.00006042857480233*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.01026557827762401 - (0.00006007776163871*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.01060929183604604 - (0.00006114703012726*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.01014533525058528 - (0.00005963567932887*applyconvR))); + //end Calibre (?) + break; + case 8: + //begin Tube (Manley) conv + inputSampleR -= (bR[c[1]] * (0.20641602693167951 - (0.00078952185394898*applyconvR))); + inputSampleR += (bR[c[2]] * (0.07601816702459827 + (0.00022786334179951*applyconvR))); + inputSampleR -= (bR[c[3]] * (0.03929765560019285 - (0.00054517993246352*applyconvR))); + inputSampleR -= (bR[c[4]] * (0.00298333157711103 - (0.00033083756545638*applyconvR))); + inputSampleR += (bR[c[5]] * (0.00724006282304610 + (0.00045483683460812*applyconvR))); + inputSampleR -= (bR[c[6]] * (0.03073108963506036 - (0.00038190060537423*applyconvR))); + inputSampleR += (bR[c[7]] * (0.02332434692533051 + (0.00040347288688932*applyconvR))); + inputSampleR -= (bR[c[8]] * (0.03792606869061214 - (0.00039673687335892*applyconvR))); + inputSampleR += (bR[c[9]] * (0.02437059376675688 + (0.00037221210539535*applyconvR))); + inputSampleR -= (bR[c[10]] * (0.03416764311979521 - (0.00040314850796953*applyconvR))); + inputSampleR += (bR[c[11]] * (0.01761669868102127 + (0.00035989484330131*applyconvR))); + inputSampleR -= (bR[c[12]] * (0.02538237753523052 - (0.00040149119125394*applyconvR))); + inputSampleR += (bR[c[13]] * (0.00770737340728377 + (0.00035462118723555*applyconvR))); + inputSampleR -= (bR[c[14]] * (0.01580706228482803 - (0.00037563141307594*applyconvR))); + inputSampleR -= (bR[c[15]] * (0.00055119240005586 - (0.00035409299268971*applyconvR))); + inputSampleR -= (bR[c[16]] * (0.00818552143438768 - (0.00036507661042180*applyconvR))); + inputSampleR -= (bR[c[17]] * (0.00661842703548304 - (0.00034550528559056*applyconvR))); + inputSampleR -= (bR[c[18]] * (0.00362447476272098 - (0.00035553012761240*applyconvR))); + inputSampleR -= (bR[c[19]] * (0.00957098027225745 - (0.00034091691045338*applyconvR))); + inputSampleR -= (bR[c[20]] * (0.00193621774016660 - (0.00034554529131668*applyconvR))); + inputSampleR -= (bR[c[21]] * (0.01005433027357935 - (0.00033878223153845*applyconvR))); + inputSampleR -= (bR[c[22]] * (0.00221712428802004 - (0.00033481410137711*applyconvR))); + inputSampleR -= (bR[c[23]] * (0.00911255639207995 - (0.00033263425232666*applyconvR))); + inputSampleR -= (bR[c[24]] * (0.00339667169034909 - (0.00032634428038430*applyconvR))); + inputSampleR -= (bR[c[25]] * (0.00774096948249924 - (0.00032599868802996*applyconvR))); + inputSampleR -= (bR[c[26]] * (0.00463907626773794 - (0.00032131993173361*applyconvR))); + inputSampleR -= (bR[c[27]] * (0.00658222997260378 - (0.00032014977430211*applyconvR))); + inputSampleR -= (bR[c[28]] * (0.00550347079924993 - (0.00031557153256653*applyconvR))); + inputSampleR -= (bR[c[29]] * (0.00588754981375325 - (0.00032041307242303*applyconvR))); + inputSampleR -= (bR[c[30]] * (0.00590293898419892 - (0.00030457857428714*applyconvR))); + inputSampleR -= (bR[c[31]] * (0.00558952010441800 - (0.00030448053548086*applyconvR))); + inputSampleR -= (bR[c[32]] * (0.00598183557634295 - (0.00030715064323181*applyconvR))); + inputSampleR -= (bR[c[33]] * (0.00555223929714115 - (0.00030319367948553*applyconvR))); + //end Tube (Manley) conv + break; + } + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL -= bridgerectifier; + else inputSampleL += bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR -= bridgerectifier; + else inputSampleR += bridgerectifier; + + + if (outgain != 1.0) { + inputSampleL *= outgain; + inputSampleR *= outgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/BussColors4/VSTProject.sln b/plugins/WinVST/BussColors4/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/BussColors4/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/BussColors4/VSTProject.vcxproj b/plugins/WinVST/BussColors4/VSTProject.vcxproj new file mode 100755 index 0000000..5ea4a2c --- /dev/null +++ b/plugins/WinVST/BussColors4/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="BussColors4.cpp" />
+ <ClCompile Include="BussColors4Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="BussColors4.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>BussColors464</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BussColors4/VSTProject.vcxproj.filters b/plugins/WinVST/BussColors4/VSTProject.vcxproj.filters new file mode 100755 index 0000000..b3d011a --- /dev/null +++ b/plugins/WinVST/BussColors4/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BussColors4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="BussColors4Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="BussColors4.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BussColors4/VSTProject.vcxproj.user b/plugins/WinVST/BussColors4/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/BussColors4/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/BussColors4/vstplug.def b/plugins/WinVST/BussColors4/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/BussColors4/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/CStrip/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/CStrip/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/CStrip/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/CStrip/.vs/VSTProject/v14/.suo b/plugins/WinVST/CStrip/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..36fe57d --- /dev/null +++ b/plugins/WinVST/CStrip/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/CStrip/CStrip.cpp b/plugins/WinVST/CStrip/CStrip.cpp new file mode 100755 index 0000000..1c24d1b --- /dev/null +++ b/plugins/WinVST/CStrip/CStrip.cpp @@ -0,0 +1,339 @@ +/* ======================================== + * CStrip - CStrip.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __CStrip_H +#include "CStrip.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new CStrip(audioMaster);} + +CStrip::CStrip(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; //Treble -12 to 12 + B = 0.5; //Mid -12 to 12 + C = 0.5; //Bass -12 to 12 + D = 1.0; //Lowpass 16.0K log 1 to 16 defaulting to 16K + E = 0.4; //TrebFrq 6.0 log 1 to 16 defaulting to 6K + F = 0.4; //BassFrq 100.0 log 30 to 1600 defaulting to 100 hz + G = 0.0; //Hipass 30.0 log 30 to 1600 defaulting to 30 + H = 0.0; //Gate 0-1 + I = 0.0; //Compres 0-1 + J = 0.0; //CompSpd 0-1 + K = 0.0; //TimeLag 0-1 + L = 0.5; //OutGain -18 to 18 + + lastSampleL = 0.0; + last2SampleL = 0.0; + lastSampleR = 0.0; + last2SampleR = 0.0; + + iirHighSampleLA = 0.0; + iirHighSampleLB = 0.0; + iirHighSampleLC = 0.0; + iirHighSampleLD = 0.0; + iirHighSampleLE = 0.0; + iirLowSampleLA = 0.0; + iirLowSampleLB = 0.0; + iirLowSampleLC = 0.0; + iirLowSampleLD = 0.0; + iirLowSampleLE = 0.0; + iirHighSampleL = 0.0; + iirLowSampleL = 0.0; + + iirHighSampleRA = 0.0; + iirHighSampleRB = 0.0; + iirHighSampleRC = 0.0; + iirHighSampleRD = 0.0; + iirHighSampleRE = 0.0; + iirLowSampleRA = 0.0; + iirLowSampleRB = 0.0; + iirLowSampleRC = 0.0; + iirLowSampleRD = 0.0; + iirLowSampleRE = 0.0; + iirHighSampleR = 0.0; + iirLowSampleR = 0.0; + + tripletLA = 0.0; + tripletLB = 0.0; + tripletLC = 0.0; + tripletFactorL = 0.0; + + tripletRA = 0.0; + tripletRB = 0.0; + tripletRC = 0.0; + tripletFactorR = 0.0; + + lowpassSampleLAA = 0.0; + lowpassSampleLAB = 0.0; + lowpassSampleLBA = 0.0; + lowpassSampleLBB = 0.0; + lowpassSampleLCA = 0.0; + lowpassSampleLCB = 0.0; + lowpassSampleLDA = 0.0; + lowpassSampleLDB = 0.0; + lowpassSampleLE = 0.0; + lowpassSampleLF = 0.0; + lowpassSampleLG = 0.0; + + lowpassSampleRAA = 0.0; + lowpassSampleRAB = 0.0; + lowpassSampleRBA = 0.0; + lowpassSampleRBB = 0.0; + lowpassSampleRCA = 0.0; + lowpassSampleRCB = 0.0; + lowpassSampleRDA = 0.0; + lowpassSampleRDB = 0.0; + lowpassSampleRE = 0.0; + lowpassSampleRF = 0.0; + lowpassSampleRG = 0.0; + + highpassSampleLAA = 0.0; + highpassSampleLAB = 0.0; + highpassSampleLBA = 0.0; + highpassSampleLBB = 0.0; + highpassSampleLCA = 0.0; + highpassSampleLCB = 0.0; + highpassSampleLDA = 0.0; + highpassSampleLDB = 0.0; + highpassSampleLE = 0.0; + highpassSampleLF = 0.0; + + highpassSampleRAA = 0.0; + highpassSampleRAB = 0.0; + highpassSampleRBA = 0.0; + highpassSampleRBB = 0.0; + highpassSampleRCA = 0.0; + highpassSampleRCB = 0.0; + highpassSampleRDA = 0.0; + highpassSampleRDB = 0.0; + highpassSampleRE = 0.0; + highpassSampleRF = 0.0; + + flip = false; + flipthree = 0; + //end EQ + + //begin Gate + WasNegativeL = false; + ZeroCrossL = 0; + gaterollerL = 0.0; + gateL = 0.0; + + WasNegativeR = false; + ZeroCrossR = 0; + gaterollerR = 0.0; + gateR = 0.0; + //end Gate + + //begin Timing + for(int fcount = 0; fcount < 4098; fcount++) {pL[fcount] = 0.0; pR[fcount] = 0.0;} + count = 0; + //end Timing + + //begin ButterComp + controlAposL = 1.0; + controlAnegL = 1.0; + controlBposL = 1.0; + controlBnegL = 1.0; + targetposL = 1.0; + targetnegL = 1.0; + avgLA = avgLB = 0.0; + nvgLA = nvgLB = 0.0; + + controlAposR = 1.0; + controlAnegR = 1.0; + controlBposR = 1.0; + controlBnegR = 1.0; + targetposR = 1.0; + targetnegR = 1.0; + avgRA = avgRB = 0.0; + nvgRA = nvgRB = 0.0; + //end ButterComp + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +CStrip::~CStrip() {} +VstInt32 CStrip::getVendorVersion () {return 1000;} +void CStrip::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void CStrip::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 CStrip::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + chunkData[6] = G; + chunkData[7] = H; + chunkData[8] = I; + chunkData[9] = J; + chunkData[10] = K; + chunkData[11] = L; + /* 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 CStrip::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + G = pinParameter(chunkData[6]); + H = pinParameter(chunkData[7]); + I = pinParameter(chunkData[8]); + J = pinParameter(chunkData[9]); + K = pinParameter(chunkData[10]); + L = pinParameter(chunkData[11]); + /* 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 CStrip::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + case kParamG: G = value; break; + case kParamH: H = value; break; + case kParamI: I = value; break; + case kParamJ: J = value; break; + case kParamK: K = value; break; + case kParamL: L = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float CStrip::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; break; + case kParamG: return G; break; + case kParamH: return H; break; + case kParamI: return I; break; + case kParamJ: return J; break; + case kParamK: return K; break; + case kParamL: return L; 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 CStrip::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Treble", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Mid", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Bass", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "TrebFrq", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "BassFrq", kVstMaxParamStrLen); break; + case kParamG: vst_strncpy (text, "Hipass", kVstMaxParamStrLen); break; + case kParamH: vst_strncpy (text, "Gate", kVstMaxParamStrLen); break; + case kParamI: vst_strncpy (text, "Compres", kVstMaxParamStrLen); break; + case kParamJ: vst_strncpy (text, "CompSpd", kVstMaxParamStrLen); break; + case kParamK: vst_strncpy (text, "TimeLag", kVstMaxParamStrLen); break; + case kParamL: vst_strncpy (text, "OutGain", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void CStrip::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*24.0)-12.0, text, kVstMaxParamStrLen); break; //Treble -12 to 12 + case kParamB: float2string ((B*24.0)-12.0, text, kVstMaxParamStrLen); break; //Mid -12 to 12 + case kParamC: float2string ((C*24.0)-12.0, text, kVstMaxParamStrLen); break; //Bass -12 to 12 + case kParamD: float2string ((D*D*15.0)+1.0, text, kVstMaxParamStrLen); break; //Lowpass 16.0K log 1 to 16 defaulting to 16K + case kParamE: float2string ((E*E*15.0)+1.0, text, kVstMaxParamStrLen); break; //TrebFrq 6.0 log 1 to 16 defaulting to 6K + case kParamF: float2string ((F*F*1570.0)+30.0, text, kVstMaxParamStrLen); break; //BassFrq 100.0 log 30 to 1600 defaulting to 100 hz + case kParamG: float2string ((G*G*1570.0)+30.0, text, kVstMaxParamStrLen); break; //Hipass 30.0 log 30 to 1600 defaulting to 30 + case kParamH: float2string (H, text, kVstMaxParamStrLen); break; //Gate 0-1 + case kParamI: float2string (I, text, kVstMaxParamStrLen); break; //Compres 0-1 + case kParamJ: float2string (J, text, kVstMaxParamStrLen); break; //CompSpd 0-1 + case kParamK: float2string (K, text, kVstMaxParamStrLen); break; //TimeLag 0-1 + case kParamL: float2string ((L*36.0)-18.0, text, kVstMaxParamStrLen); break; //OutGain -18 to 18 + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void CStrip::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Khz", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Khz", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "hz", kVstMaxParamStrLen); break; + case kParamG: vst_strncpy (text, "hz", kVstMaxParamStrLen); break; + case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamI: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamJ: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamK: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamL: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 CStrip::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool CStrip::getEffectName(char* name) { + vst_strncpy(name, "CStrip", kVstMaxProductStrLen); return true; +} + +VstPlugCategory CStrip::getPlugCategory() {return kPlugCategEffect;} + +bool CStrip::getProductString(char* text) { + vst_strncpy (text, "airwindows CStrip", kVstMaxProductStrLen); return true; +} + +bool CStrip::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/CStrip/CStrip.h b/plugins/WinVST/CStrip/CStrip.h new file mode 100755 index 0000000..10f6729 --- /dev/null +++ b/plugins/WinVST/CStrip/CStrip.h @@ -0,0 +1,223 @@ +/* ======================================== + * CStrip - CStrip.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __CStrip_H +#define __CStrip_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kParamG = 6, + kParamH = 7, + kParamI = 8, + kParamJ = 9, + kParamK = 10, + kParamL = 11, + kNumParameters = 12 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'cstr'; //Change this to what the AU identity is! + +class CStrip : + public AudioEffectX +{ +public: + CStrip(audioMasterCallback audioMaster); + ~CStrip(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double lastSampleL; + double last2SampleL; + double lastSampleR; + double last2SampleR; + + //begin EQ + double iirHighSampleLA; + double iirHighSampleLB; + double iirHighSampleLC; + double iirHighSampleLD; + double iirHighSampleLE; + double iirLowSampleLA; + double iirLowSampleLB; + double iirLowSampleLC; + double iirLowSampleLD; + double iirLowSampleLE; + double iirHighSampleL; + double iirLowSampleL; + + double iirHighSampleRA; + double iirHighSampleRB; + double iirHighSampleRC; + double iirHighSampleRD; + double iirHighSampleRE; + double iirLowSampleRA; + double iirLowSampleRB; + double iirLowSampleRC; + double iirLowSampleRD; + double iirLowSampleRE; + double iirHighSampleR; + double iirLowSampleR; + + double tripletLA; + double tripletLB; + double tripletLC; + double tripletFactorL; + + double tripletRA; + double tripletRB; + double tripletRC; + double tripletFactorR; + + double lowpassSampleLAA; + double lowpassSampleLAB; + double lowpassSampleLBA; + double lowpassSampleLBB; + double lowpassSampleLCA; + double lowpassSampleLCB; + double lowpassSampleLDA; + double lowpassSampleLDB; + double lowpassSampleLE; + double lowpassSampleLF; + double lowpassSampleLG; + + double lowpassSampleRAA; + double lowpassSampleRAB; + double lowpassSampleRBA; + double lowpassSampleRBB; + double lowpassSampleRCA; + double lowpassSampleRCB; + double lowpassSampleRDA; + double lowpassSampleRDB; + double lowpassSampleRE; + double lowpassSampleRF; + double lowpassSampleRG; + + double highpassSampleLAA; + double highpassSampleLAB; + double highpassSampleLBA; + double highpassSampleLBB; + double highpassSampleLCA; + double highpassSampleLCB; + double highpassSampleLDA; + double highpassSampleLDB; + double highpassSampleLE; + double highpassSampleLF; + + double highpassSampleRAA; + double highpassSampleRAB; + double highpassSampleRBA; + double highpassSampleRBB; + double highpassSampleRCA; + double highpassSampleRCB; + double highpassSampleRDA; + double highpassSampleRDB; + double highpassSampleRE; + double highpassSampleRF; + + bool flip; + int flipthree; + //end EQ + + //begin Gate + bool WasNegativeL; + int ZeroCrossL; + double gaterollerL; + double gateL; + + bool WasNegativeR; + int ZeroCrossR; + double gaterollerR; + double gateR; + //end Gate + + //begin Timing + double pL[4099]; + double pR[4099]; + int count; + //end Timing + + //begin ButterComp + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double avgLA; + double avgLB; + double nvgLA; + double nvgLB; + + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double avgRA; + double avgRB; + double nvgRA; + double nvgRB; + //end ButterComp + //flip is already covered in EQ + + float A; + float B; + float C; + float D; + float E; + float F; + float G; + float H; + float I; + float J; + float K; + float L; + +}; + +#endif diff --git a/plugins/WinVST/CStrip/CStripProc.cpp b/plugins/WinVST/CStrip/CStripProc.cpp new file mode 100755 index 0000000..272b9b6 --- /dev/null +++ b/plugins/WinVST/CStrip/CStripProc.cpp @@ -0,0 +1,1510 @@ +/* ======================================== + * CStrip - CStrip.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __CStrip_H +#include "CStrip.h" +#endif + +void CStrip::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; + double compscale = overallscale; + overallscale = getSampleRate(); + compscale = compscale * overallscale; + //compscale is the one that's 1 or something like 2.2 for 96K rates + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + double highSampleL = 0.0; + double midSampleL = 0.0; + double bassSampleL = 0.0; + + double highSampleR = 0.0; + double midSampleR = 0.0; + double bassSampleR = 0.0; + + double densityA = (A*12.0)-6.0; + double densityB = (B*12.0)-6.0; + double densityC = (C*12.0)-6.0; + bool engageEQ = true; + if ( (0.0 == densityA) && (0.0 == densityB) && (0.0 == densityC) ) engageEQ = false; + + densityA = pow(10.0,densityA/20.0)-1.0; + densityB = pow(10.0,densityB/20.0)-1.0; + densityC = pow(10.0,densityC/20.0)-1.0; + //convert to 0 to X multiplier with 1.0 being O db + //minus one gives nearly -1 to ? (should top out at 1) + //calibrate so that X db roughly equals X db with maximum topping out at 1 internally + + double tripletIntensity = -densityA; + + double iirAmountC = (((D*D*15.0)+1.0)*0.0188) + 0.7; + if (iirAmountC > 1.0) iirAmountC = 1.0; + bool engageLowpass = false; + if (((D*D*15.0)+1.0) < 15.99) engageLowpass = true; + + double iirAmountA = (((E*E*15.0)+1.0)*1000)/overallscale; + double iirAmountB = (((F*F*1570.0)+30.0)*10)/overallscale; + double iirAmountD = (((G*G*1570.0)+30.0)*1.0)/overallscale; + bool engageHighpass = false; + if (((G*G*1570.0)+30.0) > 30.01) engageHighpass = true; + //bypass the highpass and lowpass if set to extremes + double bridgerectifier; + double outA = fabs(densityA); + double outB = fabs(densityB); + double outC = fabs(densityC); + //end EQ + //begin Gate + double onthreshold = (pow(H,4)/3)+0.00018; + double offthreshold = onthreshold * 1.1; + bool engageGate = false; + if (onthreshold > 0.00018) engageGate = true; + + double release = 0.028331119964586; + double absmax = 220.9; + //speed to be compensated w.r.t sample rate + //end Gate + //begin Timing + double offset = pow(K,5) * 700; + int near = (int)floor(fabs(offset)); + double farLevel = fabs(offset) - near; + int far = near + 1; + double nearLevel = 1.0 - farLevel; + bool engageTiming = false; + if (offset > 0.0) engageTiming = true; + //end Timing + //begin ButterComp + double inputpos; + double inputneg; + double calcpos; + double calcneg; + double outputpos; + double outputneg; + double totalmultiplier; + double inputgain = (pow(I,4)*35)+1.0; + double compoutgain = inputgain; + compoutgain -= 1.0; + compoutgain /= 1.2; + compoutgain += 1.0; + double divisor = (0.008 * pow(J,2))+0.0004; + //originally 0.012 + divisor /= compscale; + double remainder = divisor; + divisor = 1.0 - divisor; + bool engageComp = false; + if (inputgain > 1.0) engageComp = true; + //end ButterComp + double outputgain = pow(10.0,((L*36.0)-18.0)/20.0); + + + 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. + } + + last2SampleL = lastSampleL; + lastSampleL = inputSampleL; + + last2SampleR = lastSampleR; + lastSampleR = inputSampleR; + + //begin Gate + if (engageGate) + { + if (inputSampleL > 0) + {if (WasNegativeL == true){ZeroCrossL = absmax * 0.3;} + WasNegativeL = false;} + else + {ZeroCrossL += 1; WasNegativeL = true;} + + if (inputSampleR > 0) + {if (WasNegativeR == true){ZeroCrossR = absmax * 0.3;} + WasNegativeR = false;} + else + {ZeroCrossR += 1; WasNegativeR = true;} + + if (ZeroCrossL > absmax) + {ZeroCrossL = absmax;} + + if (ZeroCrossR > absmax) + {ZeroCrossR = absmax;} + + if (gateL == 0.0) + { + //if gate is totally silent + if (fabs(inputSampleL) > onthreshold) + { + if (gaterollerL == 0.0) gaterollerL = ZeroCrossL; + else gaterollerL -= release; + // trigger from total silence only- if we're active then signal must clear offthreshold + } + else gaterollerL -= release; + } + else + { + //gate is not silent but closing + if (fabs(inputSampleL) > offthreshold) + { + if (gaterollerL < ZeroCrossL) gaterollerL = ZeroCrossL; + else gaterollerL -= release; + //always trigger if gate is over offthreshold, otherwise close anyway + } + else gaterollerL -= release; + } + + if (gateR == 0.0) + { + //if gate is totally silent + if (fabs(inputSampleR) > onthreshold) + { + if (gaterollerR == 0.0) gaterollerR = ZeroCrossR; + else gaterollerR -= release; + // trigger from total silence only- if we're active then signal must clear offthreshold + } + else gaterollerR -= release; + } + else + { + //gate is not silent but closing + if (fabs(inputSampleR) > offthreshold) + { + if (gaterollerR < ZeroCrossR) gaterollerR = ZeroCrossR; + else gaterollerR -= release; + //always trigger if gate is over offthreshold, otherwise close anyway + } + else gaterollerR -= release; + } + + if (gaterollerL < 0.0) + {gaterollerL = 0.0;} + if (gaterollerR < 0.0) + {gaterollerR = 0.0;} + + if (gaterollerL < 1.0) + { + gateL = gaterollerL; + bridgerectifier = 1-cos(fabs(inputSampleL)); + if (inputSampleL > 0) inputSampleL = (inputSampleL*gateL)+(bridgerectifier*(1.0-gateL)); + else inputSampleL = (inputSampleL*gateL)-(bridgerectifier*(1.0-gateL)); + if (gateL == 0.0) inputSampleL = 0.0; + } + else + {gateL = 1.0;} + + if (gaterollerR < 1.0) + { + gateR = gaterollerR; + bridgerectifier = 1-cos(fabs(inputSampleR)); + if (inputSampleR > 0) inputSampleR = (inputSampleR*gateR)+(bridgerectifier*(1.0-gateR)); + else inputSampleR = (inputSampleR*gateR)-(bridgerectifier*(1.0-gateR)); + if (gateR == 0.0) inputSampleR = 0.0; + } + else + {gateR = 1.0;} + } + //end Gate, begin antialiasing + + flip = !flip; + flipthree++; + if (flipthree < 1 || flipthree > 3) flipthree = 1; + //counters + + //begin highpass + if (engageHighpass) + { + if (flip) + { + highpassSampleLAA = (highpassSampleLAA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLAA; + highpassSampleLBA = (highpassSampleLBA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLBA; + highpassSampleLCA = (highpassSampleLCA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLCA; + highpassSampleLDA = (highpassSampleLDA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLDA; + } + else + { + highpassSampleLAB = (highpassSampleLAB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLAB; + highpassSampleLBB = (highpassSampleLBB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLBB; + highpassSampleLCB = (highpassSampleLCB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLCB; + highpassSampleLDB = (highpassSampleLDB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLDB; + } + highpassSampleLE = (highpassSampleLE * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLE; + highpassSampleLF = (highpassSampleLF * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLF; + + if (flip) + { + highpassSampleRAA = (highpassSampleRAA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRAA; + highpassSampleRBA = (highpassSampleRBA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRBA; + highpassSampleRCA = (highpassSampleRCA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRCA; + highpassSampleRDA = (highpassSampleRDA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRDA; + } + else + { + highpassSampleRAB = (highpassSampleRAB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRAB; + highpassSampleRBB = (highpassSampleRBB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRBB; + highpassSampleRCB = (highpassSampleRCB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRCB; + highpassSampleRDB = (highpassSampleRDB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRDB; + } + highpassSampleRE = (highpassSampleRE * (1 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRE; + highpassSampleRF = (highpassSampleRF * (1 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRF; + + } + //end highpass + + //begin compressor + if (engageComp) + { + //begin L + inputSampleL *= inputgain; + + inputpos = (inputSampleL * fpOld) + (avgLA * fpNew) + 1.0; + avgLA = inputSampleL; + + if (inputpos < 0.0) inputpos = 0.0; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + targetposL *= divisor; + targetposL += (inputpos * remainder); + calcpos = pow((1.0/targetposL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgLA * fpNew) + 1.0; + nvgLA = -inputSampleL; + + if (inputneg < 0.0) inputneg = 0.0; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + targetnegL *= divisor; + targetnegL += (inputneg * remainder); + calcneg = pow((1.0/targetnegL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + + if (inputSampleL > 0) + { //working on pos + if (true == flip) + { + controlAposL *= divisor; + controlAposL += (calcpos*remainder); + + } + else + { + controlBposL *= divisor; + controlBposL += (calcpos*remainder); + } + } + else + { //working on neg + if (true == flip) + { + controlAnegL *= divisor; + controlAnegL += (calcneg*remainder); + } + else + { + controlBnegL *= divisor; + controlBnegL += (calcneg*remainder); + } + } + //this causes each of the four to update only when active and in the correct 'flip' + + if (true == flip) + {totalmultiplier = (controlAposL * outputpos) + (controlAnegL * outputneg);} + else + {totalmultiplier = (controlBposL * outputpos) + (controlBnegL * outputneg);} + //this combines the sides according to flip, blending relative to the input value + + inputSampleL *= totalmultiplier; + inputSampleL /= compoutgain; + //end L + + //begin R + inputSampleR *= inputgain; + + inputpos = (inputSampleR * fpOld) + (avgRA * fpNew) + 1.0; + avgRA = inputSampleR; + + if (inputpos < 0.0) inputpos = 0.0; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + targetposR *= divisor; + targetposR += (inputpos * remainder); + calcpos = pow((1.0/targetposR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgRA * fpNew) + 1.0; + nvgRA = -inputSampleR; + + if (inputneg < 0.0) inputneg = 0.0; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + targetnegR *= divisor; + targetnegR += (inputneg * remainder); + calcneg = pow((1.0/targetnegR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + + if (inputSampleR > 0) + { //working on pos + if (true == flip) + { + controlAposR *= divisor; + controlAposR += (calcpos*remainder); + + } + else + { + controlBposR *= divisor; + controlBposR += (calcpos*remainder); + } + } + else + { //working on neg + if (true == flip) + { + controlAnegR *= divisor; + controlAnegR += (calcneg*remainder); + } + else + { + controlBnegR *= divisor; + controlBnegR += (calcneg*remainder); + } + } + //this causes each of the four to update only when active and in the correct 'flip' + + if (true == flip) + {totalmultiplier = (controlAposR * outputpos) + (controlAnegR * outputneg);} + else + {totalmultiplier = (controlBposR * outputpos) + (controlBnegR * outputneg);} + //this combines the sides according to flip, blending relative to the input value + + inputSampleR *= totalmultiplier; + inputSampleR /= compoutgain; + //end R + } + //end compressor + + //begin EQ + if (engageEQ) + { + switch (flipthree) + { + case 1: + tripletFactorL = last2SampleL - inputSampleL; + tripletLA += tripletFactorL; + tripletLC -= tripletFactorL; + tripletFactorL = tripletLA * tripletIntensity; + iirHighSampleLC = (iirHighSampleLC * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLC; + iirLowSampleLC = (iirLowSampleLC * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLC; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRA += tripletFactorR; + tripletRC -= tripletFactorR; + tripletFactorR = tripletRA * tripletIntensity; + iirHighSampleRC = (iirHighSampleRC * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRC; + iirLowSampleRC = (iirLowSampleRC * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRC; + break; + case 2: + tripletFactorL = last2SampleL - inputSampleL; + tripletLB += tripletFactorL; + tripletLA -= tripletFactorL; + tripletFactorL = tripletLB * tripletIntensity; + iirHighSampleLD = (iirHighSampleLD * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLD; + iirLowSampleLD = (iirLowSampleLD * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLD; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRB += tripletFactorR; + tripletRA -= tripletFactorR; + tripletFactorR = tripletRB * tripletIntensity; + iirHighSampleRD = (iirHighSampleRD * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRD; + iirLowSampleRD = (iirLowSampleRD * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRD; + break; + case 3: + tripletFactorL = last2SampleL - inputSampleL; + tripletLC += tripletFactorL; + tripletLB -= tripletFactorL; + tripletFactorL = tripletLC * tripletIntensity; + iirHighSampleLE = (iirHighSampleLE * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLE; + iirLowSampleLE = (iirLowSampleLE * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLE; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRC += tripletFactorR; + tripletRB -= tripletFactorR; + tripletFactorR = tripletRC * tripletIntensity; + iirHighSampleRE = (iirHighSampleRE * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRE; + iirLowSampleRE = (iirLowSampleRE * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRE; + break; + } + tripletLA /= 2.0; + tripletLB /= 2.0; + tripletLC /= 2.0; + highSampleL = highSampleL + tripletFactorL; + + tripletRA /= 2.0; + tripletRB /= 2.0; + tripletRC /= 2.0; + highSampleR = highSampleR + tripletFactorR; + + if (flip) + { + iirHighSampleLA = (iirHighSampleLA * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleLA; + iirLowSampleLA = (iirLowSampleLA * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleLA; + + iirHighSampleRA = (iirHighSampleRA * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleRA; + iirLowSampleRA = (iirLowSampleRA * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleRA; + } + else + { + iirHighSampleLB = (iirHighSampleLB * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleLB; + iirLowSampleLB = (iirLowSampleLB * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleLB; + + iirHighSampleRB = (iirHighSampleRB * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleRB; + iirLowSampleRB = (iirLowSampleRB * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleRB; + } + + iirHighSampleL = (iirHighSampleL * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleL; + iirLowSampleL = (iirLowSampleL * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleL; + + iirHighSampleR = (iirHighSampleR * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleR; + iirLowSampleR = (iirLowSampleR * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleR; + + midSampleL = (inputSampleL-bassSampleL)-highSampleL; + midSampleR = (inputSampleR-bassSampleR)-highSampleR; + + //drive section + highSampleL *= (densityA+1.0); + bridgerectifier = fabs(highSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityA > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (highSampleL > 0) highSampleL = (highSampleL*(1-outA))+(bridgerectifier*outA); + else highSampleL = (highSampleL*(1-outA))-(bridgerectifier*outA); + //blend according to densityA control + + highSampleR *= (densityA+1.0); + bridgerectifier = fabs(highSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityA > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (highSampleR > 0) highSampleR = (highSampleR*(1-outA))+(bridgerectifier*outA); + else highSampleR = (highSampleR*(1-outA))-(bridgerectifier*outA); + //blend according to densityA control + + midSampleL *= (densityB+1.0); + bridgerectifier = fabs(midSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityB > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (midSampleL > 0) midSampleL = (midSampleL*(1-outB))+(bridgerectifier*outB); + else midSampleL = (midSampleL*(1-outB))-(bridgerectifier*outB); + //blend according to densityB control + + midSampleR *= (densityB+1.0); + bridgerectifier = fabs(midSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityB > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (midSampleR > 0) midSampleR = (midSampleR*(1-outB))+(bridgerectifier*outB); + else midSampleR = (midSampleR*(1-outB))-(bridgerectifier*outB); + //blend according to densityB control + + bassSampleL *= (densityC+1.0); + bridgerectifier = fabs(bassSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityC > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (bassSampleL > 0) bassSampleL = (bassSampleL*(1-outC))+(bridgerectifier*outC); + else bassSampleL = (bassSampleL*(1-outC))-(bridgerectifier*outC); + //blend according to densityC control + + bassSampleR *= (densityC+1.0); + bridgerectifier = fabs(bassSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityC > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (bassSampleR > 0) bassSampleR = (bassSampleR*(1-outC))+(bridgerectifier*outC); + else bassSampleR = (bassSampleR*(1-outC))-(bridgerectifier*outC); + //blend according to densityC control + + inputSampleL = midSampleL; + inputSampleL += highSampleL; + inputSampleL += bassSampleL; + + inputSampleR = midSampleR; + inputSampleR += highSampleR; + inputSampleR += bassSampleR; + } + //end EQ + + //begin Timing + if (engageTiming = true) + { + if (count < 1 || count > 2048) count = 2048; + + pL[count+2048] = pL[count] = inputSampleL; + pR[count+2048] = pR[count] = inputSampleR; + + inputSampleL = pL[count+near]*nearLevel; + inputSampleR = pR[count+near]*nearLevel; + + inputSampleL += pL[count+far]*farLevel; + inputSampleR += pR[count+far]*farLevel; + + count -= 1; + //consider adding third sample just to bring out superhighs subtly, like old interpolation hacks + //or third and fifth samples, ditto + } + //end Timing + + //EQ lowpass is after all processing like the compressor that might produce hash + if (engageLowpass) + { + if (flip) + { + lowpassSampleLAA = (lowpassSampleLAA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLAA; + lowpassSampleLBA = (lowpassSampleLBA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLBA; + lowpassSampleLCA = (lowpassSampleLCA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLCA; + lowpassSampleLDA = (lowpassSampleLDA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLDA; + lowpassSampleLE = (lowpassSampleLE * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLE; + + lowpassSampleRAA = (lowpassSampleRAA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRAA; + lowpassSampleRBA = (lowpassSampleRBA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRBA; + lowpassSampleRCA = (lowpassSampleRCA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRCA; + lowpassSampleRDA = (lowpassSampleRDA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRDA; + lowpassSampleRE = (lowpassSampleRE * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRE; + } + else + { + lowpassSampleLAB = (lowpassSampleLAB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLAB; + lowpassSampleLBB = (lowpassSampleLBB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLBB; + lowpassSampleLCB = (lowpassSampleLCB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLCB; + lowpassSampleLDB = (lowpassSampleLDB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLDB; + lowpassSampleLF = (lowpassSampleLF * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLF; + + lowpassSampleRAB = (lowpassSampleRAB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRAB; + lowpassSampleRBB = (lowpassSampleRBB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRBB; + lowpassSampleRCB = (lowpassSampleRCB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRCB; + lowpassSampleRDB = (lowpassSampleRDB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRDB; + lowpassSampleRF = (lowpassSampleRF * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRF; + } + lowpassSampleLG = (lowpassSampleLG * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + lowpassSampleRG = (lowpassSampleRG * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + + inputSampleL = (lowpassSampleLG * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleR = (lowpassSampleRG * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + } + + //built in output trim and dry/wet if desired + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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 CStrip::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; + double compscale = overallscale; + overallscale = getSampleRate(); + compscale = compscale * overallscale; + //compscale is the one that's 1 or something like 2.2 for 96K rates + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + double highSampleL = 0.0; + double midSampleL = 0.0; + double bassSampleL = 0.0; + + double highSampleR = 0.0; + double midSampleR = 0.0; + double bassSampleR = 0.0; + + double densityA = (A*12.0)-6.0; + double densityB = (B*12.0)-6.0; + double densityC = (C*12.0)-6.0; + bool engageEQ = true; + if ( (0.0 == densityA) && (0.0 == densityB) && (0.0 == densityC) ) engageEQ = false; + + densityA = pow(10.0,densityA/20.0)-1.0; + densityB = pow(10.0,densityB/20.0)-1.0; + densityC = pow(10.0,densityC/20.0)-1.0; + //convert to 0 to X multiplier with 1.0 being O db + //minus one gives nearly -1 to ? (should top out at 1) + //calibrate so that X db roughly equals X db with maximum topping out at 1 internally + + double tripletIntensity = -densityA; + + double iirAmountC = (((D*D*15.0)+1.0)*0.0188) + 0.7; + if (iirAmountC > 1.0) iirAmountC = 1.0; + bool engageLowpass = false; + if (((D*D*15.0)+1.0) < 15.99) engageLowpass = true; + + double iirAmountA = (((E*E*15.0)+1.0)*1000)/overallscale; + double iirAmountB = (((F*F*1570.0)+30.0)*10)/overallscale; + double iirAmountD = (((G*G*1570.0)+30.0)*1.0)/overallscale; + bool engageHighpass = false; + if (((G*G*1570.0)+30.0) > 30.01) engageHighpass = true; + //bypass the highpass and lowpass if set to extremes + double bridgerectifier; + double outA = fabs(densityA); + double outB = fabs(densityB); + double outC = fabs(densityC); + //end EQ + //begin Gate + double onthreshold = (pow(H,4)/3)+0.00018; + double offthreshold = onthreshold * 1.1; + bool engageGate = false; + if (onthreshold > 0.00018) engageGate = true; + + double release = 0.028331119964586; + double absmax = 220.9; + //speed to be compensated w.r.t sample rate + //end Gate + //begin Timing + double offset = pow(K,5) * 700; + int near = (int)floor(fabs(offset)); + double farLevel = fabs(offset) - near; + int far = near + 1; + double nearLevel = 1.0 - farLevel; + bool engageTiming = false; + if (offset > 0.0) engageTiming = true; + //end Timing + //begin ButterComp + double inputpos; + double inputneg; + double calcpos; + double calcneg; + double outputpos; + double outputneg; + double totalmultiplier; + double inputgain = (pow(I,4)*35)+1.0; + double compoutgain = inputgain; + compoutgain -= 1.0; + compoutgain /= 1.2; + compoutgain += 1.0; + double divisor = (0.008 * pow(J,2))+0.0004; + //originally 0.012 + divisor /= compscale; + double remainder = divisor; + divisor = 1.0 - divisor; + bool engageComp = false; + if (inputgain > 1.0) engageComp = true; + //end ButterComp + double outputgain = pow(10.0,((L*36.0)-18.0)/20.0); + + + 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. + } + + last2SampleL = lastSampleL; + lastSampleL = inputSampleL; + + last2SampleR = lastSampleR; + lastSampleR = inputSampleR; + + //begin Gate + if (engageGate) + { + if (inputSampleL > 0) + {if (WasNegativeL == true){ZeroCrossL = absmax * 0.3;} + WasNegativeL = false;} + else + {ZeroCrossL += 1; WasNegativeL = true;} + + if (inputSampleR > 0) + {if (WasNegativeR == true){ZeroCrossR = absmax * 0.3;} + WasNegativeR = false;} + else + {ZeroCrossR += 1; WasNegativeR = true;} + + if (ZeroCrossL > absmax) + {ZeroCrossL = absmax;} + + if (ZeroCrossR > absmax) + {ZeroCrossR = absmax;} + + if (gateL == 0.0) + { + //if gate is totally silent + if (fabs(inputSampleL) > onthreshold) + { + if (gaterollerL == 0.0) gaterollerL = ZeroCrossL; + else gaterollerL -= release; + // trigger from total silence only- if we're active then signal must clear offthreshold + } + else gaterollerL -= release; + } + else + { + //gate is not silent but closing + if (fabs(inputSampleL) > offthreshold) + { + if (gaterollerL < ZeroCrossL) gaterollerL = ZeroCrossL; + else gaterollerL -= release; + //always trigger if gate is over offthreshold, otherwise close anyway + } + else gaterollerL -= release; + } + + if (gateR == 0.0) + { + //if gate is totally silent + if (fabs(inputSampleR) > onthreshold) + { + if (gaterollerR == 0.0) gaterollerR = ZeroCrossR; + else gaterollerR -= release; + // trigger from total silence only- if we're active then signal must clear offthreshold + } + else gaterollerR -= release; + } + else + { + //gate is not silent but closing + if (fabs(inputSampleR) > offthreshold) + { + if (gaterollerR < ZeroCrossR) gaterollerR = ZeroCrossR; + else gaterollerR -= release; + //always trigger if gate is over offthreshold, otherwise close anyway + } + else gaterollerR -= release; + } + + if (gaterollerL < 0.0) + {gaterollerL = 0.0;} + if (gaterollerR < 0.0) + {gaterollerR = 0.0;} + + if (gaterollerL < 1.0) + { + gateL = gaterollerL; + bridgerectifier = 1-cos(fabs(inputSampleL)); + if (inputSampleL > 0) inputSampleL = (inputSampleL*gateL)+(bridgerectifier*(1.0-gateL)); + else inputSampleL = (inputSampleL*gateL)-(bridgerectifier*(1.0-gateL)); + if (gateL == 0.0) inputSampleL = 0.0; + } + else + {gateL = 1.0;} + + if (gaterollerR < 1.0) + { + gateR = gaterollerR; + bridgerectifier = 1-cos(fabs(inputSampleR)); + if (inputSampleR > 0) inputSampleR = (inputSampleR*gateR)+(bridgerectifier*(1.0-gateR)); + else inputSampleR = (inputSampleR*gateR)-(bridgerectifier*(1.0-gateR)); + if (gateR == 0.0) inputSampleR = 0.0; + } + else + {gateR = 1.0;} + } + //end Gate, begin antialiasing + + flip = !flip; + flipthree++; + if (flipthree < 1 || flipthree > 3) flipthree = 1; + //counters + + //begin highpass + if (engageHighpass) + { + if (flip) + { + highpassSampleLAA = (highpassSampleLAA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLAA; + highpassSampleLBA = (highpassSampleLBA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLBA; + highpassSampleLCA = (highpassSampleLCA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLCA; + highpassSampleLDA = (highpassSampleLDA * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLDA; + } + else + { + highpassSampleLAB = (highpassSampleLAB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLAB; + highpassSampleLBB = (highpassSampleLBB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLBB; + highpassSampleLCB = (highpassSampleLCB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLCB; + highpassSampleLDB = (highpassSampleLDB * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLDB; + } + highpassSampleLE = (highpassSampleLE * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLE; + highpassSampleLF = (highpassSampleLF * (1.0 - iirAmountD)) + (inputSampleL * iirAmountD); + inputSampleL -= highpassSampleLF; + + if (flip) + { + highpassSampleRAA = (highpassSampleRAA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRAA; + highpassSampleRBA = (highpassSampleRBA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRBA; + highpassSampleRCA = (highpassSampleRCA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRCA; + highpassSampleRDA = (highpassSampleRDA * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRDA; + } + else + { + highpassSampleRAB = (highpassSampleRAB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRAB; + highpassSampleRBB = (highpassSampleRBB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRBB; + highpassSampleRCB = (highpassSampleRCB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRCB; + highpassSampleRDB = (highpassSampleRDB * (1.0 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRDB; + } + highpassSampleRE = (highpassSampleRE * (1 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRE; + highpassSampleRF = (highpassSampleRF * (1 - iirAmountD)) + (inputSampleR * iirAmountD); + inputSampleR -= highpassSampleRF; + + } + //end highpass + + //begin compressor + if (engageComp) + { + //begin L + inputSampleL *= inputgain; + + inputpos = (inputSampleL * fpOld) + (avgLA * fpNew) + 1.0; + avgLA = inputSampleL; + + if (inputpos < 0.0) inputpos = 0.0; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + targetposL *= divisor; + targetposL += (inputpos * remainder); + calcpos = pow((1.0/targetposL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgLA * fpNew) + 1.0; + nvgLA = -inputSampleL; + + if (inputneg < 0.0) inputneg = 0.0; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + targetnegL *= divisor; + targetnegL += (inputneg * remainder); + calcneg = pow((1.0/targetnegL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + + if (inputSampleL > 0) + { //working on pos + if (true == flip) + { + controlAposL *= divisor; + controlAposL += (calcpos*remainder); + + } + else + { + controlBposL *= divisor; + controlBposL += (calcpos*remainder); + } + } + else + { //working on neg + if (true == flip) + { + controlAnegL *= divisor; + controlAnegL += (calcneg*remainder); + } + else + { + controlBnegL *= divisor; + controlBnegL += (calcneg*remainder); + } + } + //this causes each of the four to update only when active and in the correct 'flip' + + if (true == flip) + {totalmultiplier = (controlAposL * outputpos) + (controlAnegL * outputneg);} + else + {totalmultiplier = (controlBposL * outputpos) + (controlBnegL * outputneg);} + //this combines the sides according to flip, blending relative to the input value + + inputSampleL *= totalmultiplier; + inputSampleL /= compoutgain; + //end L + + //begin R + inputSampleR *= inputgain; + + inputpos = (inputSampleR * fpOld) + (avgRA * fpNew) + 1.0; + avgRA = inputSampleR; + + if (inputpos < 0.0) inputpos = 0.0; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + targetposR *= divisor; + targetposR += (inputpos * remainder); + calcpos = pow((1.0/targetposR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgRA * fpNew) + 1.0; + nvgRA = -inputSampleR; + + if (inputneg < 0.0) inputneg = 0.0; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + targetnegR *= divisor; + targetnegR += (inputneg * remainder); + calcneg = pow((1.0/targetnegR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + + if (inputSampleR > 0) + { //working on pos + if (true == flip) + { + controlAposR *= divisor; + controlAposR += (calcpos*remainder); + + } + else + { + controlBposR *= divisor; + controlBposR += (calcpos*remainder); + } + } + else + { //working on neg + if (true == flip) + { + controlAnegR *= divisor; + controlAnegR += (calcneg*remainder); + } + else + { + controlBnegR *= divisor; + controlBnegR += (calcneg*remainder); + } + } + //this causes each of the four to update only when active and in the correct 'flip' + + if (true == flip) + {totalmultiplier = (controlAposR * outputpos) + (controlAnegR * outputneg);} + else + {totalmultiplier = (controlBposR * outputpos) + (controlBnegR * outputneg);} + //this combines the sides according to flip, blending relative to the input value + + inputSampleR *= totalmultiplier; + inputSampleR /= compoutgain; + //end R + } + //end compressor + + //begin EQ + if (engageEQ) + { + switch (flipthree) + { + case 1: + tripletFactorL = last2SampleL - inputSampleL; + tripletLA += tripletFactorL; + tripletLC -= tripletFactorL; + tripletFactorL = tripletLA * tripletIntensity; + iirHighSampleLC = (iirHighSampleLC * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLC; + iirLowSampleLC = (iirLowSampleLC * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLC; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRA += tripletFactorR; + tripletRC -= tripletFactorR; + tripletFactorR = tripletRA * tripletIntensity; + iirHighSampleRC = (iirHighSampleRC * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRC; + iirLowSampleRC = (iirLowSampleRC * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRC; + break; + case 2: + tripletFactorL = last2SampleL - inputSampleL; + tripletLB += tripletFactorL; + tripletLA -= tripletFactorL; + tripletFactorL = tripletLB * tripletIntensity; + iirHighSampleLD = (iirHighSampleLD * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLD; + iirLowSampleLD = (iirLowSampleLD * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLD; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRB += tripletFactorR; + tripletRA -= tripletFactorR; + tripletFactorR = tripletRB * tripletIntensity; + iirHighSampleRD = (iirHighSampleRD * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRD; + iirLowSampleRD = (iirLowSampleRD * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRD; + break; + case 3: + tripletFactorL = last2SampleL - inputSampleL; + tripletLC += tripletFactorL; + tripletLB -= tripletFactorL; + tripletFactorL = tripletLC * tripletIntensity; + iirHighSampleLE = (iirHighSampleLE * (1.0 - iirAmountA)) + (inputSampleL * iirAmountA); + highSampleL = inputSampleL - iirHighSampleLE; + iirLowSampleLE = (iirLowSampleLE * (1.0 - iirAmountB)) + (inputSampleL * iirAmountB); + bassSampleL = iirLowSampleLE; + + tripletFactorR = last2SampleR - inputSampleR; + tripletRC += tripletFactorR; + tripletRB -= tripletFactorR; + tripletFactorR = tripletRC * tripletIntensity; + iirHighSampleRE = (iirHighSampleRE * (1.0 - iirAmountA)) + (inputSampleR * iirAmountA); + highSampleR = inputSampleR - iirHighSampleRE; + iirLowSampleRE = (iirLowSampleRE * (1.0 - iirAmountB)) + (inputSampleR * iirAmountB); + bassSampleR = iirLowSampleRE; + break; + } + tripletLA /= 2.0; + tripletLB /= 2.0; + tripletLC /= 2.0; + highSampleL = highSampleL + tripletFactorL; + + tripletRA /= 2.0; + tripletRB /= 2.0; + tripletRC /= 2.0; + highSampleR = highSampleR + tripletFactorR; + + if (flip) + { + iirHighSampleLA = (iirHighSampleLA * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleLA; + iirLowSampleLA = (iirLowSampleLA * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleLA; + + iirHighSampleRA = (iirHighSampleRA * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleRA; + iirLowSampleRA = (iirLowSampleRA * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleRA; + } + else + { + iirHighSampleLB = (iirHighSampleLB * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleLB; + iirLowSampleLB = (iirLowSampleLB * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleLB; + + iirHighSampleRB = (iirHighSampleRB * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleRB; + iirLowSampleRB = (iirLowSampleRB * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleRB; + } + + iirHighSampleL = (iirHighSampleL * (1.0 - iirAmountA)) + (highSampleL * iirAmountA); + highSampleL -= iirHighSampleL; + iirLowSampleL = (iirLowSampleL * (1.0 - iirAmountB)) + (bassSampleL * iirAmountB); + bassSampleL = iirLowSampleL; + + iirHighSampleR = (iirHighSampleR * (1.0 - iirAmountA)) + (highSampleR * iirAmountA); + highSampleR -= iirHighSampleR; + iirLowSampleR = (iirLowSampleR * (1.0 - iirAmountB)) + (bassSampleR * iirAmountB); + bassSampleR = iirLowSampleR; + + midSampleL = (inputSampleL-bassSampleL)-highSampleL; + midSampleR = (inputSampleR-bassSampleR)-highSampleR; + + //drive section + highSampleL *= (densityA+1.0); + bridgerectifier = fabs(highSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityA > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (highSampleL > 0) highSampleL = (highSampleL*(1-outA))+(bridgerectifier*outA); + else highSampleL = (highSampleL*(1-outA))-(bridgerectifier*outA); + //blend according to densityA control + + highSampleR *= (densityA+1.0); + bridgerectifier = fabs(highSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityA > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (highSampleR > 0) highSampleR = (highSampleR*(1-outA))+(bridgerectifier*outA); + else highSampleR = (highSampleR*(1-outA))-(bridgerectifier*outA); + //blend according to densityA control + + midSampleL *= (densityB+1.0); + bridgerectifier = fabs(midSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityB > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (midSampleL > 0) midSampleL = (midSampleL*(1-outB))+(bridgerectifier*outB); + else midSampleL = (midSampleL*(1-outB))-(bridgerectifier*outB); + //blend according to densityB control + + midSampleR *= (densityB+1.0); + bridgerectifier = fabs(midSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityB > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (midSampleR > 0) midSampleR = (midSampleR*(1-outB))+(bridgerectifier*outB); + else midSampleR = (midSampleR*(1-outB))-(bridgerectifier*outB); + //blend according to densityB control + + bassSampleL *= (densityC+1.0); + bridgerectifier = fabs(bassSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityC > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (bassSampleL > 0) bassSampleL = (bassSampleL*(1-outC))+(bridgerectifier*outC); + else bassSampleL = (bassSampleL*(1-outC))-(bridgerectifier*outC); + //blend according to densityC control + + bassSampleR *= (densityC+1.0); + bridgerectifier = fabs(bassSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (densityC > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (bassSampleR > 0) bassSampleR = (bassSampleR*(1-outC))+(bridgerectifier*outC); + else bassSampleR = (bassSampleR*(1-outC))-(bridgerectifier*outC); + //blend according to densityC control + + inputSampleL = midSampleL; + inputSampleL += highSampleL; + inputSampleL += bassSampleL; + + inputSampleR = midSampleR; + inputSampleR += highSampleR; + inputSampleR += bassSampleR; + } + //end EQ + + //begin Timing + if (engageTiming = true) + { + if (count < 1 || count > 2048) count = 2048; + + pL[count+2048] = pL[count] = inputSampleL; + pR[count+2048] = pR[count] = inputSampleR; + + inputSampleL = pL[count+near]*nearLevel; + inputSampleR = pR[count+near]*nearLevel; + + inputSampleL += pL[count+far]*farLevel; + inputSampleR += pR[count+far]*farLevel; + + count -= 1; + //consider adding third sample just to bring out superhighs subtly, like old interpolation hacks + //or third and fifth samples, ditto + } + //end Timing + + //EQ lowpass is after all processing like the compressor that might produce hash + if (engageLowpass) + { + if (flip) + { + lowpassSampleLAA = (lowpassSampleLAA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLAA; + lowpassSampleLBA = (lowpassSampleLBA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLBA; + lowpassSampleLCA = (lowpassSampleLCA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLCA; + lowpassSampleLDA = (lowpassSampleLDA * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLDA; + lowpassSampleLE = (lowpassSampleLE * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLE; + + lowpassSampleRAA = (lowpassSampleRAA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRAA; + lowpassSampleRBA = (lowpassSampleRBA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRBA; + lowpassSampleRCA = (lowpassSampleRCA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRCA; + lowpassSampleRDA = (lowpassSampleRDA * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRDA; + lowpassSampleRE = (lowpassSampleRE * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRE; + } + else + { + lowpassSampleLAB = (lowpassSampleLAB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLAB; + lowpassSampleLBB = (lowpassSampleLBB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLBB; + lowpassSampleLCB = (lowpassSampleLCB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLCB; + lowpassSampleLDB = (lowpassSampleLDB * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLDB; + lowpassSampleLF = (lowpassSampleLF * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleL = lowpassSampleLF; + + lowpassSampleRAB = (lowpassSampleRAB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRAB; + lowpassSampleRBB = (lowpassSampleRBB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRBB; + lowpassSampleRCB = (lowpassSampleRCB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRCB; + lowpassSampleRDB = (lowpassSampleRDB * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRDB; + lowpassSampleRF = (lowpassSampleRF * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + inputSampleR = lowpassSampleRF; + } + lowpassSampleLG = (lowpassSampleLG * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + lowpassSampleRG = (lowpassSampleRG * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + + inputSampleL = (lowpassSampleLG * (1.0 - iirAmountC)) + (inputSampleL * iirAmountC); + inputSampleR = (lowpassSampleRG * (1.0 - iirAmountC)) + (inputSampleR * iirAmountC); + } + + //built in output trim and dry/wet if desired + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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/CStrip/VSTProject.sln b/plugins/WinVST/CStrip/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/CStrip/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/CStrip/VSTProject.vcxproj b/plugins/WinVST/CStrip/VSTProject.vcxproj new file mode 100755 index 0000000..3041b88 --- /dev/null +++ b/plugins/WinVST/CStrip/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="CStrip.cpp" />
+ <ClCompile Include="CStripProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="CStrip.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>CStrip64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/CStrip/VSTProject.vcxproj.filters b/plugins/WinVST/CStrip/VSTProject.vcxproj.filters new file mode 100755 index 0000000..d39bb37 --- /dev/null +++ b/plugins/WinVST/CStrip/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="CStrip.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="CStripProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="CStrip.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/CStrip/VSTProject.vcxproj.user b/plugins/WinVST/CStrip/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/CStrip/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/CStrip/vstplug.def b/plugins/WinVST/CStrip/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/CStrip/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Capacitor/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Capacitor/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Capacitor/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Capacitor/.vs/VSTProject/v14/.suo b/plugins/WinVST/Capacitor/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..28e146c --- /dev/null +++ b/plugins/WinVST/Capacitor/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Capacitor/Capacitor.cpp b/plugins/WinVST/Capacitor/Capacitor.cpp new file mode 100755 index 0000000..2a62df6 --- /dev/null +++ b/plugins/WinVST/Capacitor/Capacitor.cpp @@ -0,0 +1,179 @@ +/* ======================================== + * Capacitor - Capacitor.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Capacitor_H +#include "Capacitor.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Capacitor(audioMaster);} + +Capacitor::Capacitor(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 0.0; + C = 1.0; + iirHighpassAL = 0.0; + iirHighpassBL = 0.0; + iirHighpassCL = 0.0; + iirHighpassDL = 0.0; + iirHighpassEL = 0.0; + iirHighpassFL = 0.0; + iirLowpassAL = 0.0; + iirLowpassBL = 0.0; + iirLowpassCL = 0.0; + iirLowpassDL = 0.0; + iirLowpassEL = 0.0; + iirLowpassFL = 0.0; + + iirHighpassAR = 0.0; + iirHighpassBR = 0.0; + iirHighpassCR = 0.0; + iirHighpassDR = 0.0; + iirHighpassER = 0.0; + iirHighpassFR = 0.0; + iirLowpassAR = 0.0; + iirLowpassBR = 0.0; + iirLowpassCR = 0.0; + iirLowpassDR = 0.0; + iirLowpassER = 0.0; + iirLowpassFR = 0.0; + count = 0; + lowpassChase = 0.0; + highpassChase = 0.0; + wetChase = 0.0; + lowpassAmount = 1.0; + highpassAmount = 0.0; + wet = 1.0; + lastLowpass = 1000.0; + lastHighpass = 1000.0; + lastWet = 1000.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Capacitor::~Capacitor() {} +VstInt32 Capacitor::getVendorVersion () {return 1000;} +void Capacitor::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Capacitor::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 Capacitor::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Capacitor::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Capacitor::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 + case kParamC: C = value; break; + 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 Capacitor.h file to do it. +} + +float Capacitor::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Capacitor::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Highpass", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Capacitor::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Capacitor::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Capacitor::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Capacitor::getEffectName(char* name) { + vst_strncpy(name, "Capacitor", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Capacitor::getPlugCategory() {return kPlugCategEffect;} + +bool Capacitor::getProductString(char* text) { + vst_strncpy (text, "airwindows Capacitor", kVstMaxProductStrLen); return true; +} + +bool Capacitor::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Capacitor/Capacitor.h b/plugins/WinVST/Capacitor/Capacitor.h new file mode 100755 index 0000000..d80c676 --- /dev/null +++ b/plugins/WinVST/Capacitor/Capacitor.h @@ -0,0 +1,109 @@ +/* ======================================== + * Capacitor - Capacitor.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Capacitor_H +#define __Capacitor_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'capa'; //Change this to what the AU identity is! + +class Capacitor : + public AudioEffectX +{ +public: + Capacitor(audioMasterCallback audioMaster); + ~Capacitor(); + 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 iirHighpassAL; + double iirHighpassBL; + double iirHighpassCL; + double iirHighpassDL; + double iirHighpassEL; + double iirHighpassFL; + double iirLowpassAL; + double iirLowpassBL; + double iirLowpassCL; + double iirLowpassDL; + double iirLowpassEL; + double iirLowpassFL; + + double iirHighpassAR; + double iirHighpassBR; + double iirHighpassCR; + double iirHighpassDR; + double iirHighpassER; + double iirHighpassFR; + double iirLowpassAR; + double iirLowpassBR; + double iirLowpassCR; + double iirLowpassDR; + double iirLowpassER; + double iirLowpassFR; + + int count; + + double lowpassChase; + double highpassChase; + double wetChase; + + double lowpassAmount; + double highpassAmount; + double wet; + + double lastLowpass; + double lastHighpass; + double lastWet; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/Capacitor/CapacitorProc.cpp b/plugins/WinVST/Capacitor/CapacitorProc.cpp new file mode 100755 index 0000000..6accb0d --- /dev/null +++ b/plugins/WinVST/Capacitor/CapacitorProc.cpp @@ -0,0 +1,418 @@ +/* ======================================== + * Capacitor - Capacitor.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Capacitor_H +#include "Capacitor.h" +#endif + +void Capacitor::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + lowpassChase = pow(A,2); + highpassChase = pow(B,2); + wetChase = C; + //should not scale with sample rate, because values reaching 1 are important + //to its ability to bypass when set to max + double lowpassSpeed = 300 / (fabs( lastLowpass - lowpassChase)+1.0); + double highpassSpeed = 300 / (fabs( lastHighpass - highpassChase)+1.0); + double wetSpeed = 300 / (fabs( lastWet - wetChase)+1.0); + lastLowpass = lowpassChase; + lastHighpass = highpassChase; + lastWet = wetChase; + + double invLowpass; + double invHighpass; + double dry; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + float drySampleL; + float drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + lowpassAmount = (((lowpassAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); invLowpass = 1.0 - lowpassAmount; + highpassAmount = (((highpassAmount*highpassSpeed)+highpassChase)/(highpassSpeed + 1.0)); invHighpass = 1.0 - highpassAmount; + wet = (((wet*wetSpeed)+wetChase)/(wetSpeed+1.0)); dry = 1.0 - wet; + + count++; if (count > 5) count = 0; switch (count) + { + case 0: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassDL = (iirHighpassDL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassDL; + iirLowpassDL = (iirLowpassDL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassDL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassDR = (iirHighpassDR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassDR; + iirLowpassDR = (iirLowpassDR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassDR; + break; + case 1: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassEL = (iirHighpassEL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassEL; + iirLowpassEL = (iirLowpassEL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassEL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassER = (iirHighpassER * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassER; + iirLowpassER = (iirLowpassER * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassER; + break; + case 2: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassFL = (iirHighpassFL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassFL; + iirLowpassFL = (iirLowpassFL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassFL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassFR = (iirHighpassFR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassFR; + iirLowpassFR = (iirLowpassFR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassFR; + break; + case 3: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassDL = (iirHighpassDL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassDL; + iirLowpassDL = (iirLowpassDL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassDL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassDR = (iirHighpassDR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassDR; + iirLowpassDR = (iirLowpassDR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassDR; + break; + case 4: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassEL = (iirHighpassEL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassEL; + iirLowpassEL = (iirLowpassEL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassEL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassER = (iirHighpassER * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassER; + iirLowpassER = (iirLowpassER * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassER; + break; + case 5: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassFL = (iirHighpassFL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassFL; + iirLowpassFL = (iirLowpassFL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassFL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassFR = (iirHighpassFR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassFR; + iirLowpassFR = (iirLowpassFR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassFR; + break; + } + //Highpass Filter chunk. This is three poles of IIR highpass, with a 'gearbox' that progressively + //steepens the filter after minimizing artifacts. + + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //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 Capacitor::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + lowpassChase = pow(A,2); + highpassChase = pow(B,2); + wetChase = C; + //should not scale with sample rate, because values reaching 1 are important + //to its ability to bypass when set to max + double lowpassSpeed = 300 / (fabs( lastLowpass - lowpassChase)+1.0); + double highpassSpeed = 300 / (fabs( lastHighpass - highpassChase)+1.0); + double wetSpeed = 300 / (fabs( lastWet - wetChase)+1.0); + lastLowpass = lowpassChase; + lastHighpass = highpassChase; + lastWet = wetChase; + + double invLowpass; + double invHighpass; + double dry; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + lowpassAmount = (((lowpassAmount*lowpassSpeed)+lowpassChase)/(lowpassSpeed + 1.0)); invLowpass = 1.0 - lowpassAmount; + highpassAmount = (((highpassAmount*highpassSpeed)+highpassChase)/(highpassSpeed + 1.0)); invHighpass = 1.0 - highpassAmount; + wet = (((wet*wetSpeed)+wetChase)/(wetSpeed+1.0)); dry = 1.0 - wet; + + count++; if (count > 5) count = 0; switch (count) + { + case 0: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassDL = (iirHighpassDL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassDL; + iirLowpassDL = (iirLowpassDL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassDL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassDR = (iirHighpassDR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassDR; + iirLowpassDR = (iirLowpassDR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassDR; + break; + case 1: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassEL = (iirHighpassEL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassEL; + iirLowpassEL = (iirLowpassEL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassEL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassER = (iirHighpassER * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassER; + iirLowpassER = (iirLowpassER * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassER; + break; + case 2: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassFL = (iirHighpassFL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassFL; + iirLowpassFL = (iirLowpassFL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassFL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassFR = (iirHighpassFR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassFR; + iirLowpassFR = (iirLowpassFR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassFR; + break; + case 3: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassDL = (iirHighpassDL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassDL; + iirLowpassDL = (iirLowpassDL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassDL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassDR = (iirHighpassDR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassDR; + iirLowpassDR = (iirLowpassDR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassDR; + break; + case 4: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassBL = (iirHighpassBL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassBL; + iirLowpassBL = (iirLowpassBL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassBL; + iirHighpassEL = (iirHighpassEL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassEL; + iirLowpassEL = (iirLowpassEL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassEL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassBR = (iirHighpassBR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassBR; + iirLowpassBR = (iirLowpassBR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassBR; + iirHighpassER = (iirHighpassER * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassER; + iirLowpassER = (iirLowpassER * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassER; + break; + case 5: + iirHighpassAL = (iirHighpassAL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassAL; + iirLowpassAL = (iirLowpassAL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassAL; + iirHighpassCL = (iirHighpassCL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassCL; + iirLowpassCL = (iirLowpassCL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassCL; + iirHighpassFL = (iirHighpassFL * invHighpass) + (inputSampleL * highpassAmount); inputSampleL -= iirHighpassFL; + iirLowpassFL = (iirLowpassFL * invLowpass) + (inputSampleL * lowpassAmount); inputSampleL = iirLowpassFL; + iirHighpassAR = (iirHighpassAR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassAR; + iirLowpassAR = (iirLowpassAR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassAR; + iirHighpassCR = (iirHighpassCR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassCR; + iirLowpassCR = (iirLowpassCR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassCR; + iirHighpassFR = (iirHighpassFR * invHighpass) + (inputSampleR * highpassAmount); inputSampleR -= iirHighpassFR; + iirLowpassFR = (iirLowpassFR * invLowpass) + (inputSampleR * lowpassAmount); inputSampleR = iirLowpassFR; + break; + } + //Highpass Filter chunk. This is three poles of IIR highpass, with a 'gearbox' that progressively + //steepens the filter after minimizing artifacts. + + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //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/Capacitor/VSTProject.sln b/plugins/WinVST/Capacitor/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Capacitor/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/Capacitor/VSTProject.vcxproj b/plugins/WinVST/Capacitor/VSTProject.vcxproj new file mode 100755 index 0000000..6cf3f30 --- /dev/null +++ b/plugins/WinVST/Capacitor/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Capacitor.cpp" />
+ <ClCompile Include="CapacitorProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Capacitor.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Capacitor64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Capacitor/VSTProject.vcxproj.filters b/plugins/WinVST/Capacitor/VSTProject.vcxproj.filters new file mode 100755 index 0000000..97a2f4c --- /dev/null +++ b/plugins/WinVST/Capacitor/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Capacitor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="CapacitorProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Capacitor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Capacitor/VSTProject.vcxproj.user b/plugins/WinVST/Capacitor/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Capacitor/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Capacitor/vstplug.def b/plugins/WinVST/Capacitor/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Capacitor/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Chorus/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Chorus/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Chorus/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Chorus/.vs/VSTProject/v14/.suo b/plugins/WinVST/Chorus/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..6891b3b --- /dev/null +++ b/plugins/WinVST/Chorus/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Chorus/Chorus.cpp b/plugins/WinVST/Chorus/Chorus.cpp new file mode 100755 index 0000000..a0699ec --- /dev/null +++ b/plugins/WinVST/Chorus/Chorus.cpp @@ -0,0 +1,151 @@ +/* ======================================== + * Chorus - Chorus.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Chorus_H +#include "Chorus.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Chorus(audioMaster);} + +Chorus::Chorus(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + + for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0; dR[count] = 0;} + sweep = 3.141592653589793238 / 2.0; + gcount = 0; + airPrevL = 0.0; + airEvenL = 0.0; + airOddL = 0.0; + airFactorL = 0.0; + airPrevR = 0.0; + airEvenR = 0.0; + airOddR = 0.0; + airFactorR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Chorus::~Chorus() {} +VstInt32 Chorus::getVendorVersion () {return 1000;} +void Chorus::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Chorus::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 Chorus::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Chorus::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Chorus::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Chorus::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Chorus::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Range", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Chorus::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Chorus::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Chorus::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Chorus::getEffectName(char* name) { + vst_strncpy(name, "Chorus", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Chorus::getPlugCategory() {return kPlugCategEffect;} + +bool Chorus::getProductString(char* text) { + vst_strncpy (text, "airwindows Chorus", kVstMaxProductStrLen); return true; +} + +bool Chorus::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Chorus/Chorus.h b/plugins/WinVST/Chorus/Chorus.h new file mode 100755 index 0000000..fb2fb44 --- /dev/null +++ b/plugins/WinVST/Chorus/Chorus.h @@ -0,0 +1,83 @@ +/* ======================================== + * Chorus - Chorus.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Chorus_H +#define __Chorus_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'chor'; //Change this to what the AU identity is! + +class Chorus : + public AudioEffectX +{ +public: + Chorus(audioMasterCallback audioMaster); + ~Chorus(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + const static int totalsamples = 16386; + float dL[totalsamples]; + float dR[totalsamples]; + double sweep; + int gcount; + double airPrevL; + double airEvenL; + double airOddL; + double airFactorL; + double airPrevR; + double airEvenR; + double airOddR; + double airFactorR; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/Chorus/ChorusProc.cpp b/plugins/WinVST/Chorus/ChorusProc.cpp new file mode 100755 index 0000000..aed2bc0 --- /dev/null +++ b/plugins/WinVST/Chorus/ChorusProc.cpp @@ -0,0 +1,324 @@ +/* ======================================== + * Chorus - Chorus.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Chorus_H +#include "Chorus.h" +#endif + +void Chorus::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 speed = pow(A,4) * 0.001; + speed *= overallscale; + int loopLimit = (int)(totalsamples * 0.499); + int count; + double range = pow(B,4) * loopLimit * 0.499; + double wet = C; + double modulation = range*wet; + double dry = 1.0 - wet; + double tupi = 3.141592653589793238 * 2.0; + double offset; + //this is a double buffer so we will be splitting it in two + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*wet); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*wet); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > loopLimit) {gcount = loopLimit;} + count = gcount; + dL[count+loopLimit] = dL[count] = inputSampleL; + dR[count+loopLimit] = dR[count] = inputSampleR; + gcount--; + //double buffer + + offset = range + (modulation * sin(sweep)); + count += (int)floor(offset); + + inputSampleL = dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR = dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + inputSampleL *= 0.5; //to get a comparable level + inputSampleR *= 0.5; //to get a comparable level + //sliding + + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 Chorus::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 speed = pow(A,4) * 0.001; + speed *= overallscale; + int loopLimit = (int)(totalsamples * 0.499); + int count; + double range = pow(B,4) * loopLimit * 0.499; + double wet = C; + double modulation = range*wet; + double dry = 1.0 - wet; + double tupi = 3.141592653589793238 * 2.0; + double offset; + //this is a double buffer so we will be splitting it in two + + 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; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*wet); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*wet); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > loopLimit) {gcount = loopLimit;} + count = gcount; + dL[count+loopLimit] = dL[count] = inputSampleL; + dR[count+loopLimit] = dR[count] = inputSampleR; + gcount--; + //double buffer + + offset = range + (modulation * sin(sweep)); + count += (int)floor(offset); + + inputSampleL = dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR = dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + inputSampleL *= 0.5; //to get a comparable level + inputSampleR *= 0.5; //to get a comparable level + //sliding + + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/Chorus/VSTProject.sln b/plugins/WinVST/Chorus/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Chorus/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/Chorus/VSTProject.vcxproj b/plugins/WinVST/Chorus/VSTProject.vcxproj new file mode 100755 index 0000000..41a2380 --- /dev/null +++ b/plugins/WinVST/Chorus/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Chorus.cpp" />
+ <ClCompile Include="ChorusProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Chorus.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Chorus64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Chorus/VSTProject.vcxproj.filters b/plugins/WinVST/Chorus/VSTProject.vcxproj.filters new file mode 100755 index 0000000..20e96c0 --- /dev/null +++ b/plugins/WinVST/Chorus/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Chorus.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ChorusProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Chorus.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Chorus/VSTProject.vcxproj.user b/plugins/WinVST/Chorus/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Chorus/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Chorus/vstplug.def b/plugins/WinVST/Chorus/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Chorus/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ChorusEnsemble/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ChorusEnsemble/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ChorusEnsemble/.vs/VSTProject/v14/.suo b/plugins/WinVST/ChorusEnsemble/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..169e939 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp new file mode 100755 index 0000000..b1012f9 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.cpp @@ -0,0 +1,151 @@ +/* ======================================== + * ChorusEnsemble - ChorusEnsemble.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ChorusEnsemble_H +#include "ChorusEnsemble.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ChorusEnsemble(audioMaster);} + +ChorusEnsemble::ChorusEnsemble(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.8; + + for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0; dR[count] = 0;} + sweep = 3.141592653589793238 / 2.0; + gcount = 0; + airPrevL = 0.0; + airEvenL = 0.0; + airOddL = 0.0; + airFactorL = 0.0; + airPrevR = 0.0; + airEvenR = 0.0; + airOddR = 0.0; + airFactorR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +ChorusEnsemble::~ChorusEnsemble() {} +VstInt32 ChorusEnsemble::getVendorVersion () {return 1000;} +void ChorusEnsemble::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ChorusEnsemble::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 ChorusEnsemble::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 ChorusEnsemble::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 ChorusEnsemble::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ChorusEnsemble::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 ChorusEnsemble::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Range", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ChorusEnsemble::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void ChorusEnsemble::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ChorusEnsemble::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ChorusEnsemble::getEffectName(char* name) { + vst_strncpy(name, "ChorusEnsemble", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ChorusEnsemble::getPlugCategory() {return kPlugCategEffect;} + +bool ChorusEnsemble::getProductString(char* text) { + vst_strncpy (text, "airwindows ChorusEnsemble", kVstMaxProductStrLen); return true; +} + +bool ChorusEnsemble::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h new file mode 100755 index 0000000..bd442ab --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsemble.h @@ -0,0 +1,83 @@ +/* ======================================== + * ChorusEnsemble - ChorusEnsemble.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ChorusEnsemble_H +#define __ChorusEnsemble_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'chen'; //Change this to what the AU identity is! + +class ChorusEnsemble : + public AudioEffectX +{ +public: + ChorusEnsemble(audioMasterCallback audioMaster); + ~ChorusEnsemble(); + 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; + + const static int totalsamples = 16386; + float dL[totalsamples]; + float dR[totalsamples]; + double sweep; + int gcount; + double airPrevL; + double airEvenL; + double airOddL; + double airFactorL; + double airPrevR; + double airEvenR; + double airOddR; + double airFactorR; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp b/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp new file mode 100755 index 0000000..2a783dd --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/ChorusEnsembleProc.cpp @@ -0,0 +1,406 @@ +/* ======================================== + * ChorusEnsemble - ChorusEnsemble.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ChorusEnsemble_H +#include "ChorusEnsemble.h" +#endif + +void ChorusEnsemble::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; + + double speed = pow(A,3) * 0.001; + speed *= overallscale; + int loopLimit = (int)(totalsamples * 0.499); + int count; + double range = pow(B,3) * loopLimit * 0.12; + double wet = C; + double modulation = range*wet; + double dry = 1.0 - wet; + double tupi = 3.141592653589793238 * 2.0; + double offset; + double start[4]; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + //now we'll precalculate some stuff that needn't be in every sample + start[0] = range; + start[1] = range * 2; + start[2] = range * 3; + start[3] = range * 4; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*wet); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*wet); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > loopLimit) {gcount = loopLimit;} + count = gcount; + dL[count+loopLimit] = dL[count] = inputSampleL; + dR[count+loopLimit] = dR[count] = inputSampleR; + gcount--; + //double buffer + + offset = start[0] + (modulation * sin(sweep)); + count = gcount + (int)floor(offset); + inputSampleL = dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR = dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + offset = start[1] + (modulation * sin(sweep + 1.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + + offset = start[2] + (modulation * sin(sweep + 2.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + + offset = start[3] + (modulation * sin(sweep + 3.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + inputSampleL *= 0.125; //to get a comparable level + inputSampleR *= 0.125; //to get a comparable level + + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + + //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 ChorusEnsemble::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; + + double speed = pow(A,3) * 0.001; + speed *= overallscale; + int loopLimit = (int)(totalsamples * 0.499); + int count; + double range = pow(B,3) * loopLimit * 0.12; + double wet = C; + double modulation = range*wet; + double dry = 1.0 - wet; + double tupi = 3.141592653589793238 * 2.0; + double offset; + double start[4]; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + //now we'll precalculate some stuff that needn't be in every sample + start[0] = range; + start[1] = range * 2; + start[2] = range * 3; + start[3] = range * 4; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*wet); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*wet); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > loopLimit) {gcount = loopLimit;} + count = gcount; + dL[count+loopLimit] = dL[count] = inputSampleL; + dR[count+loopLimit] = dR[count] = inputSampleR; + gcount--; + //double buffer + + offset = start[0] + (modulation * sin(sweep)); + count = gcount + (int)floor(offset); + inputSampleL = dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR = dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + offset = start[1] + (modulation * sin(sweep + 1.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + + offset = start[2] + (modulation * sin(sweep + 2.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + + offset = start[3] + (modulation * sin(sweep + 3.0)); + count = gcount + (int)floor(offset); + inputSampleL += dL[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleL += dL[count+1]; //we can assume always using this in one way or another? + inputSampleL += (dL[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleL -= (((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50); //interpolation hacks 'r us + + inputSampleR += dR[count] * (1-(offset-floor(offset))); //less as value moves away from .0 + inputSampleR += dR[count+1]; //we can assume always using this in one way or another? + inputSampleR += (dR[count+2] * (offset-floor(offset))); //greater as value moves away from .0 + inputSampleR -= (((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50); //interpolation hacks 'r us + + inputSampleL *= 0.125; //to get a comparable level + inputSampleR *= 0.125; //to get a comparable level + + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + + //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/ChorusEnsemble/VSTProject.sln b/plugins/WinVST/ChorusEnsemble/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/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/ChorusEnsemble/VSTProject.vcxproj b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj new file mode 100755 index 0000000..7675af0 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ChorusEnsemble.cpp" />
+ <ClCompile Include="ChorusEnsembleProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ChorusEnsemble.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ChorusEnsemble64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.filters b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.filters new file mode 100755 index 0000000..e238353 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ChorusEnsemble.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ChorusEnsembleProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ChorusEnsemble.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.user b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ChorusEnsemble/vstplug.def b/plugins/WinVST/ChorusEnsemble/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ChorusEnsemble/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ClipOnly/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ClipOnly/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ClipOnly/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ClipOnly/.vs/VSTProject/v14/.suo b/plugins/WinVST/ClipOnly/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..0762d52 --- /dev/null +++ b/plugins/WinVST/ClipOnly/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ClipOnly/ClipOnly.cpp b/plugins/WinVST/ClipOnly/ClipOnly.cpp new file mode 100755 index 0000000..7913ce4 --- /dev/null +++ b/plugins/WinVST/ClipOnly/ClipOnly.cpp @@ -0,0 +1,59 @@ +/* ======================================== + * ClipOnly - ClipOnly.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ClipOnly_H +#include "ClipOnly.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ClipOnly(audioMaster);} + +ClipOnly::ClipOnly(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + lastSampleL = 0.0; + wasPosClipL = false; + wasNegClipL = false; + + lastSampleR = 0.0; + wasPosClipR = false; + wasNegClipR = 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 +} + +ClipOnly::~ClipOnly() {} +VstInt32 ClipOnly::getVendorVersion () {return 1000;} +void ClipOnly::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ClipOnly::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! + + +VstInt32 ClipOnly::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ClipOnly::getEffectName(char* name) { + vst_strncpy(name, "ClipOnly", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ClipOnly::getPlugCategory() {return kPlugCategEffect;} + +bool ClipOnly::getProductString(char* text) { + vst_strncpy (text, "airwindows ClipOnly", kVstMaxProductStrLen); return true; +} + +bool ClipOnly::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ClipOnly/ClipOnly.h b/plugins/WinVST/ClipOnly/ClipOnly.h new file mode 100755 index 0000000..c3a7fdd --- /dev/null +++ b/plugins/WinVST/ClipOnly/ClipOnly.h @@ -0,0 +1,57 @@ +/* ======================================== + * ClipOnly - ClipOnly.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ClipOnly_H +#define __ClipOnly_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'cloy'; //Change this to what the AU identity is! + +class ClipOnly : + public AudioEffectX +{ +public: + ClipOnly(audioMasterCallback audioMaster); + ~ClipOnly(); + 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 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + float lastSampleL; + bool wasPosClipL; + bool wasNegClipL; + + float lastSampleR; + bool wasPosClipR; + bool wasNegClipR; + +}; + +#endif diff --git a/plugins/WinVST/ClipOnly/ClipOnlyProc.cpp b/plugins/WinVST/ClipOnly/ClipOnlyProc.cpp new file mode 100755 index 0000000..a060ea1 --- /dev/null +++ b/plugins/WinVST/ClipOnly/ClipOnlyProc.cpp @@ -0,0 +1,268 @@ +/* ======================================== + * ClipOnly - ClipOnly.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ClipOnly_H +#include "ClipOnly.h" +#endif + +void ClipOnly::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double hardness = 0.7390851332151606; // x == cos(x) + double softness = 1.0 - hardness; + double refclip = 0.9549925859; // -0.2dB + + float inputSampleL; + float inputSampleR; + + 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. + } + + if (inputSampleL > 4.0) inputSampleL = 4.0; + if (inputSampleL < -4.0) inputSampleL = -4.0; + if (inputSampleR > 4.0) inputSampleR = 4.0; + if (inputSampleR < -4.0) inputSampleR = -4.0; + + if (wasPosClipL == true) { //current will be over + if (inputSampleL < lastSampleL) { //next one will NOT be over + lastSampleL = ((refclip*hardness) + (inputSampleL * softness)); + } + else { //still clipping, still chasing the target + lastSampleL = ((lastSampleL*hardness) + (refclip * softness)); + } + } + wasPosClipL = false; + if (inputSampleL > refclip) { //next will be over the true clip level. otherwise we directly use it + wasPosClipL = true; //set the clip flag + inputSampleL = ((refclip*hardness) + (lastSampleL * softness)); + } + + if (wasNegClipL == true) { //current will be -over + if (inputSampleL > lastSampleL) { //next one will NOT be -over + lastSampleL = ((-refclip*hardness) + (inputSampleL * softness)); + } + else { //still clipping, still chasing the target + lastSampleL = ((lastSampleL*hardness) + (-refclip * softness)); + } + } + wasNegClipL = false; + if (inputSampleL < -refclip) { //next will be -refclip. otherwise we directly use it + wasNegClipL = true; //set the clip flag + inputSampleL = ((-refclip*hardness) + (lastSampleL * softness)); + } + + if (wasPosClipR == true) { //current will be over + if (inputSampleR < lastSampleR) { //next one will NOT be over + lastSampleR = ((refclip*hardness) + (inputSampleR * softness)); + } + else { //still clipping, still chasing the target + lastSampleR = ((lastSampleR*hardness) + (refclip * softness)); + } + } + wasPosClipR = false; + if (inputSampleR > refclip) { //next will be over the true clip level. otherwise we directly use it + wasPosClipR = true; //set the clip flag + inputSampleR = ((refclip*hardness) + (lastSampleR * softness)); + } + + if (wasNegClipR == true) { //current will be -over + if (inputSampleR > lastSampleR) { //next one will NOT be -over + lastSampleR = ((-refclip*hardness) + (inputSampleR * softness)); + } + else { //still clipping, still chasing the target + lastSampleR = ((lastSampleR*hardness) + (-refclip * softness)); + } + } + wasNegClipR = false; + if (inputSampleR < -refclip) { //next will be -refclip. otherwise we directly use it + wasNegClipR = true; //set the clip flag + inputSampleR = ((-refclip*hardness) + (lastSampleR * softness)); + } + + *out1 = lastSampleL; + *out2 = lastSampleR; + lastSampleL = inputSampleL; + lastSampleR = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void ClipOnly::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double hardness = 0.7390851332151606; // x == cos(x) + double softness = 1.0 - hardness; + double refclip = 0.9549925859; // -0.2dB + + double inputSampleL; + double inputSampleR; + + 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. + } + + if (inputSampleL > 4.0) inputSampleL = 4.0; + if (inputSampleL < -4.0) inputSampleL = -4.0; + if (inputSampleR > 4.0) inputSampleR = 4.0; + if (inputSampleR < -4.0) inputSampleR = -4.0; + + if (wasPosClipL == true) { //current will be over + if (inputSampleL < lastSampleL) { //next one will NOT be over + lastSampleL = ((refclip*hardness) + (inputSampleL * softness)); + } + else { //still clipping, still chasing the target + lastSampleL = ((lastSampleL*hardness) + (refclip * softness)); + } + } + wasPosClipL = false; + if (inputSampleL > refclip) { //next will be over the true clip level. otherwise we directly use it + wasPosClipL = true; //set the clip flag + inputSampleL = ((refclip*hardness) + (lastSampleL * softness)); + } + + if (wasNegClipL == true) { //current will be -over + if (inputSampleL > lastSampleL) { //next one will NOT be -over + lastSampleL = ((-refclip*hardness) + (inputSampleL * softness)); + } + else { //still clipping, still chasing the target + lastSampleL = ((lastSampleL*hardness) + (-refclip * softness)); + } + } + wasNegClipL = false; + if (inputSampleL < -refclip) { //next will be -refclip. otherwise we directly use it + wasNegClipL = true; //set the clip flag + inputSampleL = ((-refclip*hardness) + (lastSampleL * softness)); + } + + if (wasPosClipR == true) { //current will be over + if (inputSampleR < lastSampleR) { //next one will NOT be over + lastSampleR = ((refclip*hardness) + (inputSampleR * softness)); + } + else { //still clipping, still chasing the target + lastSampleR = ((lastSampleR*hardness) + (refclip * softness)); + } + } + wasPosClipR = false; + if (inputSampleR > refclip) { //next will be over the true clip level. otherwise we directly use it + wasPosClipR = true; //set the clip flag + inputSampleR = ((refclip*hardness) + (lastSampleR * softness)); + } + + if (wasNegClipR == true) { //current will be -over + if (inputSampleR > lastSampleR) { //next one will NOT be -over + lastSampleR = ((-refclip*hardness) + (inputSampleR * softness)); + } + else { //still clipping, still chasing the target + lastSampleR = ((lastSampleR*hardness) + (-refclip * softness)); + } + } + wasNegClipR = false; + if (inputSampleR < -refclip) { //next will be -refclip. otherwise we directly use it + wasNegClipR = true; //set the clip flag + inputSampleR = ((-refclip*hardness) + (lastSampleR * softness)); + } + + *out1 = lastSampleL; + *out2 = lastSampleR; + lastSampleL = inputSampleL; + lastSampleR = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/ClipOnly/VSTProject.sln b/plugins/WinVST/ClipOnly/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ClipOnly/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/ClipOnly/VSTProject.vcxproj b/plugins/WinVST/ClipOnly/VSTProject.vcxproj new file mode 100755 index 0000000..30dbc0e --- /dev/null +++ b/plugins/WinVST/ClipOnly/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ClipOnly.cpp" />
+ <ClCompile Include="ClipOnlyProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ClipOnly.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ClipOnly64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ClipOnly/VSTProject.vcxproj.filters b/plugins/WinVST/ClipOnly/VSTProject.vcxproj.filters new file mode 100755 index 0000000..91dc8e3 --- /dev/null +++ b/plugins/WinVST/ClipOnly/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ClipOnly.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ClipOnlyProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ClipOnly.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ClipOnly/VSTProject.vcxproj.user b/plugins/WinVST/ClipOnly/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ClipOnly/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ClipOnly/vstplug.def b/plugins/WinVST/ClipOnly/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ClipOnly/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Console4Buss/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Console4Buss/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Console4Buss/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Console4Buss/.vs/VSTProject/v14/.suo b/plugins/WinVST/Console4Buss/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..82160f2 --- /dev/null +++ b/plugins/WinVST/Console4Buss/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Console4Buss/Console4Buss.cpp b/plugins/WinVST/Console4Buss/Console4Buss.cpp new file mode 100755 index 0000000..79c7f6f --- /dev/null +++ b/plugins/WinVST/Console4Buss/Console4Buss.cpp @@ -0,0 +1,193 @@ +/* ======================================== + * Console4Buss - Console4Buss.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Buss_H +#include "Console4Buss.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) +{ + return new Console4Buss(audioMaster); +} + +Console4Buss::Console4Buss(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + gain = 1.0; + lastSampleL = 0.0; + lastSampleR = 0.0; + gainchase = -90.0; + settingchase = -90.0; + chasespeed = 350.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + + // TODO: uncomment canDo entries according to your plugin's capabilities +// _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. +// _canDo.insert("sendVstMidiEvent"); // plug-in will send MIDI events to Host. +// _canDo.insert("sendVstTimeInfo"); // unknown +// _canDo.insert("receiveVstEvents"); // plug-in can receive Vst events from Host. +// _canDo.insert("receiveVstMidiEvent"); // plug-in can receive MIDI events from Host. +// _canDo.insert("receiveVstTimeInfo"); // plug-in can receive Time info from Host. +// _canDo.insert("offline"); // plug-in supports offline functions (#offlineNotify, #offlinePrepare, #offlineRun). + _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("mixDryWet"); // dry/wet mix control +// _canDo.insert("noRealTime"); // no real-time processing +// _canDo.insert("multipass"); // unknown +// _canDo.insert("metapass"); // unknown +// _canDo.insert("x1in1out"); +// _canDo.insert("x1in2out"); +// _canDo.insert("x2in1out"); + _canDo.insert("x2in2out"); +// _canDo.insert("x2in4out"); +// _canDo.insert("x4in2out"); +// _canDo.insert("x4in4out"); +// _canDo.insert("x4in8out"); // 4:2 matrix to surround bus +// _canDo.insert("x8in4out"); // surround bus to 4:2 matrix +// _canDo.insert("x8in8out"); +// _canDo.insert("midiProgramNames"); // plug-in supports function #getMidiProgramName(). +// _canDo.insert("conformsToWindowRules"); // mac: doesn't mess with grafport. +// _canDo.insert("bypass"); // plug-in supports function #setBypass(). + + + // these configuration values are established in the header + 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 +} + +Console4Buss::~Console4Buss() +{ +} + +VstInt32 Console4Buss::getVendorVersion () +{ + // TODO: return version number + return 1000; +} + +void Console4Buss::setProgramName(char *name) { + vst_strncpy (_programName, name, kVstMaxProgNameLen); +} + +void Console4Buss::getProgramName(char *name) { + vst_strncpy (name, _programName, kVstMaxProgNameLen); +} + +static float pinParameter(float data) +{ + if (data < 0.0f) return 0.0f; + if (data > 1.0f) return 1.0f; + return data; +} + +VstInt32 Console4Buss::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = gain; + /* 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 Console4Buss::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + gain = pinParameter(chunkData[0]); + /* 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 Console4Buss::setParameter(VstInt32 index, float value) { + switch (index) { + case kConsole4BussParam: + gain = value; + break; + default: // unknown parameter, shouldn't happen! + throw; + } +} + +float Console4Buss::getParameter(VstInt32 index) { + switch (index) { + case kConsole4BussParam: + return gain; + break; + default: // unknown parameter, shouldn't happen! + break; + } + return 0.0; +} + +void Console4Buss::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kConsole4BussParam: + vst_strncpy (text, "Trim", kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +void Console4Buss::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kConsole4BussParam: + float2string (gain, text, kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +void Console4Buss::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kConsole4BussParam: + vst_strncpy (text, " ", kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +VstInt32 Console4Buss::canDo(char *text) +{ + // 1 = yes, -1 = no, 0 = don't know + return (_canDo.find(text) == _canDo.end()) ? 0 : 1; +} + +bool Console4Buss::getEffectName(char* name) { + vst_strncpy(name, "Console4Buss", kVstMaxProductStrLen); + return true; +} + +VstPlugCategory Console4Buss::getPlugCategory() { + return kPlugCategEffect; +} + +bool Console4Buss::getProductString(char* text) { + vst_strncpy (text, "Console4Buss", kVstMaxProductStrLen); + return true; +} + +bool Console4Buss::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); + return true; +} diff --git a/plugins/WinVST/Console4Buss/Console4Buss.h b/plugins/WinVST/Console4Buss/Console4Buss.h new file mode 100755 index 0000000..b19e6f2 --- /dev/null +++ b/plugins/WinVST/Console4Buss/Console4Buss.h @@ -0,0 +1,92 @@ +/* ======================================== + * Console4Buss - Console4Buss.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Buss_H +#define __Console4Buss_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +// TODO: Change kFirstParameter to your first parameter and add any additional parameters. +enum { + kConsole4BussParam = 0, + kNumParameters = 1 +}; + +// TODO: Add other macros or preprocessor defines here + +// TODO: Change to reflect your plugin +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'coni'; //Change this to what the AU identity is! + +class Console4Buss : + public AudioEffectX +{ +public: + Console4Buss(audioMasterCallback audioMaster); + ~Console4Buss(); + + // Configuration + 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 + // when the plug-in is registered with them. + + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + + // Processing + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + + // Programs and parameters + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + + 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 + + // parameter values are all 0.0f to 1.0f + 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 + + // Capabilities + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; + bool fpFlip; + //default stuff + double lastSampleL; + double lastSampleR; + double gainchase; + double settingchase; + double chasespeed; + + float gain; + + + +}; + +#endif diff --git a/plugins/WinVST/Console4Buss/Console4BussProc.cpp b/plugins/WinVST/Console4Buss/Console4BussProc.cpp new file mode 100755 index 0000000..712e496 --- /dev/null +++ b/plugins/WinVST/Console4Buss/Console4BussProc.cpp @@ -0,0 +1,299 @@ +/* ======================================== + * Console4Buss - Console4Buss.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Buss_H +#include "Console4Buss.h" +#endif + +void Console4Buss::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; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double half; + long double falf; + long double slewcompensation; + if (settingchase != gain) { + chasespeed *= 2.0; + settingchase = gain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = gain; + + + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+gain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) {inputSampleL *= gainchase; inputSampleR *= gainchase;} + //done with trim control + + half = inputSampleL; + falf = fabs(half); + half *= falf; + half *= falf; + slewcompensation = fabs(inputSampleL - lastSampleL) * overallscale; + //magnify effect at high sample rate so it will still register when inter-sample changes + //are very small at high rates. + if (slewcompensation > 1.0) slewcompensation = 1.0; + //let's not invert the effect: maximum application is to cancel out half entirely + half *= (1.0 - slewcompensation); + //apply it + lastSampleL = inputSampleL; + inputSampleL += half; + //this is the inverse processing for Console: boosts but not so much if there's slew. + //is this too subtle an effect? + + + half = inputSampleR; + falf = fabs(half); + half *= falf; + half *= falf; + slewcompensation = fabs(inputSampleR - lastSampleR) * overallscale; + //magnify effect at high sample rate so it will still register when inter-sample changes + //are very small at high rates. + if (slewcompensation > 1.0) slewcompensation = 1.0; + //let's not invert the effect: maximum application is to cancel out half entirely + half *= (1.0 - slewcompensation); + //apply it + lastSampleR = inputSampleR; + inputSampleR += half; + //this is the inverse processing for Console: boosts but not so much if there's slew. + //is this too subtle an effect? + + //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 Console4Buss::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 half; + long double falf; + long double slewcompensation; + if (settingchase != gain) { + chasespeed *= 2.0; + settingchase = gain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = gain; + + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+gain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) {inputSampleL *= gainchase; inputSampleR *= gainchase;} + //done with trim control + + half = inputSampleL; + falf = fabs(half); + half *= falf; + half *= falf; + slewcompensation = fabs(inputSampleL - lastSampleL) * overallscale; + //magnify effect at high sample rate so it will still register when inter-sample changes + //are very small at high rates. + if (slewcompensation > 1.0) slewcompensation = 1.0; + //let's not invert the effect: maximum application is to cancel out half entirely + half *= (1.0 - slewcompensation); + //apply it + lastSampleL = inputSampleL; + inputSampleL += half; + //this is the inverse processing for Console: boosts but not so much if there's slew. + //is this too subtle an effect? + + + half = inputSampleR; + falf = fabs(half); + half *= falf; + half *= falf; + slewcompensation = fabs(inputSampleR - lastSampleR) * overallscale; + //magnify effect at high sample rate so it will still register when inter-sample changes + //are very small at high rates. + if (slewcompensation > 1.0) slewcompensation = 1.0; + //let's not invert the effect: maximum application is to cancel out half entirely + half *= (1.0 - slewcompensation); + //apply it + lastSampleR = inputSampleR; + inputSampleR += half; + //this is the inverse processing for Console: boosts but not so much if there's slew. + //is this too subtle an effect? + + //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/Console4Buss/VSTProject.sln b/plugins/WinVST/Console4Buss/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Console4Buss/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/Console4Buss/VSTProject.vcxproj b/plugins/WinVST/Console4Buss/VSTProject.vcxproj new file mode 100755 index 0000000..16ec11b --- /dev/null +++ b/plugins/WinVST/Console4Buss/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Console4Buss.cpp" />
+ <ClCompile Include="Console4BussProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Console4Buss.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Console4Buss64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Buss/VSTProject.vcxproj.filters b/plugins/WinVST/Console4Buss/VSTProject.vcxproj.filters new file mode 100755 index 0000000..204714f --- /dev/null +++ b/plugins/WinVST/Console4Buss/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console4Buss.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console4BussProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Console4Buss.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Buss/VSTProject.vcxproj.user b/plugins/WinVST/Console4Buss/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Console4Buss/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Buss/vstplug.def b/plugins/WinVST/Console4Buss/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Console4Buss/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Console4Channel/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Console4Channel/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Console4Channel/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Console4Channel/.vs/VSTProject/v14/.suo b/plugins/WinVST/Console4Channel/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..e9e8200 --- /dev/null +++ b/plugins/WinVST/Console4Channel/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Console4Channel/Console4Channel.cpp b/plugins/WinVST/Console4Channel/Console4Channel.cpp new file mode 100755 index 0000000..52f6190 --- /dev/null +++ b/plugins/WinVST/Console4Channel/Console4Channel.cpp @@ -0,0 +1,191 @@ +/* ======================================== + * Console4Channel - Console4Channel.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Channel_H +#include "Console4Channel.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) +{ + return new Console4Channel(audioMaster); +} + +Console4Channel::Console4Channel(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + gain = 1.0; + gainchase = -90.0; + settingchase = -90.0; + chasespeed = 350.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + + // TODO: uncomment canDo entries according to your plugin's capabilities +// _canDo.insert("sendVstEvents"); // plug-in will send Vst events to Host. +// _canDo.insert("sendVstMidiEvent"); // plug-in will send MIDI events to Host. +// _canDo.insert("sendVstTimeInfo"); // unknown +// _canDo.insert("receiveVstEvents"); // plug-in can receive Vst events from Host. +// _canDo.insert("receiveVstMidiEvent"); // plug-in can receive MIDI events from Host. +// _canDo.insert("receiveVstTimeInfo"); // plug-in can receive Time info from Host. +// _canDo.insert("offline"); // plug-in supports offline functions (#offlineNotify, #offlinePrepare, #offlineRun). + _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("mixDryWet"); // dry/wet mix control +// _canDo.insert("noRealTime"); // no real-time processing +// _canDo.insert("multipass"); // unknown +// _canDo.insert("metapass"); // unknown +// _canDo.insert("x1in1out"); +// _canDo.insert("x1in2out"); +// _canDo.insert("x2in1out"); + _canDo.insert("x2in2out"); +// _canDo.insert("x2in4out"); +// _canDo.insert("x4in2out"); +// _canDo.insert("x4in4out"); +// _canDo.insert("x4in8out"); // 4:2 matrix to surround bus +// _canDo.insert("x8in4out"); // surround bus to 4:2 matrix +// _canDo.insert("x8in8out"); +// _canDo.insert("midiProgramNames"); // plug-in supports function #getMidiProgramName(). +// _canDo.insert("conformsToWindowRules"); // mac: doesn't mess with grafport. +// _canDo.insert("bypass"); // plug-in supports function #setBypass(). + + + // these configuration values are established in the header + 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 +} + +Console4Channel::~Console4Channel() +{ +} + +VstInt32 Console4Channel::getVendorVersion () +{ + // TODO: return version number + return 1000; +} + +void Console4Channel::setProgramName(char *name) { + vst_strncpy (_programName, name, kVstMaxProgNameLen); +} + +void Console4Channel::getProgramName(char *name) { + vst_strncpy (name, _programName, kVstMaxProgNameLen); +} + +static float pinParameter(float data) +{ + if (data < 0.0f) return 0.0f; + if (data > 1.0f) return 1.0f; + return data; +} + +VstInt32 Console4Channel::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = gain; + /* 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 Console4Channel::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + gain = pinParameter(chunkData[0]); + /* 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 Console4Channel::setParameter(VstInt32 index, float value) { + switch (index) { + case kConsole4ChannelParam: + gain = value; + break; + default: // unknown parameter, shouldn't happen! + throw; + } +} + +float Console4Channel::getParameter(VstInt32 index) { + switch (index) { + case kConsole4ChannelParam: + return gain; + break; + default: // unknown parameter, shouldn't happen! + break; + } + return 0.0; +} + +void Console4Channel::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kConsole4ChannelParam: + vst_strncpy (text, "Trim", kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +void Console4Channel::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kConsole4ChannelParam: + float2string (gain, text, kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +void Console4Channel::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kConsole4ChannelParam: + vst_strncpy (text, " ", kVstMaxParamStrLen); + break; + default: // unknown parameter, shouldn't happen! + break; + } +} + +VstInt32 Console4Channel::canDo(char *text) +{ + // 1 = yes, -1 = no, 0 = don't know + return (_canDo.find(text) == _canDo.end()) ? 0 : 1; +} + +bool Console4Channel::getEffectName(char* name) { + vst_strncpy(name, "Console4Channel", kVstMaxProductStrLen); + return true; +} + +VstPlugCategory Console4Channel::getPlugCategory() { + return kPlugCategEffect; +} + +bool Console4Channel::getProductString(char* text) { + vst_strncpy (text, "Console4Channel", kVstMaxProductStrLen); + return true; +} + +bool Console4Channel::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); + return true; +} diff --git a/plugins/WinVST/Console4Channel/Console4Channel.h b/plugins/WinVST/Console4Channel/Console4Channel.h new file mode 100755 index 0000000..861ebe3 --- /dev/null +++ b/plugins/WinVST/Console4Channel/Console4Channel.h @@ -0,0 +1,88 @@ +/* ======================================== + * Console4Channel - Console4Channel.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Channel_H +#define __Console4Channel_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + + +// TODO: Change kFirstParameter to your first parameter and add any additional parameters. +enum { + kConsole4ChannelParam = 0, + kNumParameters = 1 +}; + +// TODO: Add other macros or preprocessor defines here + +// TODO: Change to reflect your plugin +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'conh'; //Change this to what the AU identity is! + +class Console4Channel : + public AudioEffectX +{ +public: + Console4Channel(audioMasterCallback audioMaster); + ~Console4Channel(); + + // Configuration + 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 + // when the plug-in is registered with them. + + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + + // Processing + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + + // Programs and parameters + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + + 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 + + // parameter values are all 0.0f to 1.0f + 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 + + // Capabilities + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + double gainchase; + double settingchase; + double chasespeed; + + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; + bool fpFlip; + //default stuff + float gain; +}; + +#endif diff --git a/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp b/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp new file mode 100755 index 0000000..9bf7244 --- /dev/null +++ b/plugins/WinVST/Console4Channel/Console4ChannelProc.cpp @@ -0,0 +1,263 @@ +/* ======================================== + * Console4Channel - Console4Channel.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console4Channel_H +#include "Console4Channel.h" +#endif + +void Console4Channel::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; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double half; + long double falf; + // replace inputgain with gain, serves same purpose. Stereo inputsample. + if (settingchase != gain) { + chasespeed *= 2.0; + settingchase = gain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = gain; + //settings section from AU + + 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. + } + + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+gain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) {inputSampleL *= gainchase; inputSampleR *= gainchase;} + //done with trim control + + half = inputSampleL; + falf = fabs(half); + half *= falf; + half *= falf; + inputSampleL -= half; + + half = inputSampleR; + falf = fabs(half); + half *= falf; + half *= falf; + inputSampleR -= half; + //entire audio code. kthxbai! + //this is part of the Purest line: stuff that is on every track + //needs to be DAMN LOW ON MATH srsly guys + + //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 Console4Channel::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 half; + long double falf; + + if (settingchase != gain) { + chasespeed *= 2.0; + settingchase = gain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = gain; + + + 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. + } + + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+gain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) {inputSampleL *= gainchase; inputSampleR *= gainchase;} + //done with trim control + + half = inputSampleL; + falf = fabs(half); + half *= falf; + half *= falf; + inputSampleL -= half; + + half = inputSampleR; + falf = fabs(half); + half *= falf; + half *= falf; + inputSampleR -= half; + //entire audio code. kthxbai! + //this is part of the Purest line: stuff that is on every track + //needs to be DAMN LOW ON MATH srsly guys + + //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/Console4Channel/VSTProject.sln b/plugins/WinVST/Console4Channel/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Console4Channel/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/Console4Channel/VSTProject.vcxproj b/plugins/WinVST/Console4Channel/VSTProject.vcxproj new file mode 100755 index 0000000..3c325cb --- /dev/null +++ b/plugins/WinVST/Console4Channel/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Console4Channel.cpp" />
+ <ClCompile Include="Console4ChannelProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Console4Channel.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Console4Channel64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Channel/VSTProject.vcxproj.filters b/plugins/WinVST/Console4Channel/VSTProject.vcxproj.filters new file mode 100755 index 0000000..fe0493f --- /dev/null +++ b/plugins/WinVST/Console4Channel/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console4Channel.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console4ChannelProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Console4Channel.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Channel/VSTProject.vcxproj.user b/plugins/WinVST/Console4Channel/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Console4Channel/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console4Channel/vstplug.def b/plugins/WinVST/Console4Channel/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Console4Channel/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Console5Buss/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Console5Buss/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Console5Buss/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Console5Buss/.vs/VSTProject/v14/.suo b/plugins/WinVST/Console5Buss/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..f8fc15a --- /dev/null +++ b/plugins/WinVST/Console5Buss/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Console5Buss/Console5Buss.cpp b/plugins/WinVST/Console5Buss/Console5Buss.cpp new file mode 100755 index 0000000..7f1c915 --- /dev/null +++ b/plugins/WinVST/Console5Buss/Console5Buss.cpp @@ -0,0 +1,131 @@ +/* ======================================== + * Console5Buss - Console5Buss.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5Buss_H +#include "Console5Buss.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Console5Buss(audioMaster);} + +Console5Buss::Console5Buss(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + lastSampleBussL = 0.0; + lastSampleBussR = 0.0; + lastFXBussL = 0.0; + lastFXBussR = 0.0; + iirCorrectL = 0.0; + iirCorrectR = 0.0; + gainchase = -90.0; + settingchase = -90.0; + chasespeed = 350.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Console5Buss::~Console5Buss() {} +VstInt32 Console5Buss::getVendorVersion () {return 1000;} +void Console5Buss::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Console5Buss::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 Console5Buss::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 Console5Buss::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 Console5Buss::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Console5Buss::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 Console5Buss::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Console5Buss::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Console5Buss::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Console5Buss::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Console5Buss::getEffectName(char* name) { + vst_strncpy(name, "Console5Buss", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Console5Buss::getPlugCategory() {return kPlugCategEffect;} + +bool Console5Buss::getProductString(char* text) { + vst_strncpy (text, "airwindows Console5Buss", kVstMaxProductStrLen); return true; +} + +bool Console5Buss::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Console5Buss/Console5Buss.h b/plugins/WinVST/Console5Buss/Console5Buss.h new file mode 100755 index 0000000..6ece284 --- /dev/null +++ b/plugins/WinVST/Console5Buss/Console5Buss.h @@ -0,0 +1,74 @@ +/* ======================================== + * Console5Buss - Console5Buss.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console5Buss_H +#define __Console5Buss_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'conk'; //Change this to what the AU identity is! + +class Console5Buss : + public AudioEffectX +{ +public: + Console5Buss(audioMasterCallback audioMaster); + ~Console5Buss(); + 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 lastSampleBussL; + double lastFXBussL; + double lastSampleBussR; + double lastFXBussR; + double iirCorrectL; + double iirCorrectR; + double gainchase; + double settingchase; + double chasespeed; + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; +}; + +#endif diff --git a/plugins/WinVST/Console5Buss/Console5BussProc.cpp b/plugins/WinVST/Console5Buss/Console5BussProc.cpp new file mode 100755 index 0000000..28b4980 --- /dev/null +++ b/plugins/WinVST/Console5Buss/Console5BussProc.cpp @@ -0,0 +1,356 @@ +/* ======================================== + * Console5Buss - Console5Buss.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5Buss_H +#include "Console5Buss.h" +#endif + +void Console5Buss::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; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + inputSampleL = asin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + inputSampleR = asin(inputSampleR); + //amplitude aspect + + differenceL = lastSampleBussL - inputSampleL; + differenceR = lastSampleBussR - inputSampleR; + lastSampleBussL = inputSampleL; + lastSampleBussR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.57079633) differenceL = 1.57079633; + if (differenceL < -1.57079633) differenceL = -1.57079633; + if (differenceR > 1.57079633) differenceR = 1.57079633; + if (differenceR < -1.57079633) differenceR = -1.57079633; + + differenceL = lastFXBussL + sin(differenceL); + differenceR = lastFXBussR + sin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleL = differenceL; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXBussL = inputSampleL; + lastFXBussR = inputSampleR; + if (lastFXBussL > 1.0) lastFXBussL = 1.0; + if (lastFXBussL < -1.0) lastFXBussL = -1.0; + if (lastFXBussR > 1.0) lastFXBussR = 1.0; + if (lastFXBussR < -1.0) lastFXBussR = -1.0; + //build new signal off what was present in output last time + + nearZeroL = pow(fabs(fabs(lastFXBussL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXBussR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXBussL += (iirCorrectL * 0.0000005); + lastFXBussR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXBussL *= (1.0 - (nearZeroL * bassTrim)); + lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + //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 Console5Buss::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + inputSampleL = asin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + inputSampleR = asin(inputSampleR); + //amplitude aspect + + differenceL = lastSampleBussL - inputSampleL; + differenceR = lastSampleBussR - inputSampleR; + lastSampleBussL = inputSampleL; + lastSampleBussR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.57079633) differenceL = 1.57079633; + if (differenceL < -1.57079633) differenceL = -1.57079633; + if (differenceR > 1.57079633) differenceR = 1.57079633; + if (differenceR < -1.57079633) differenceR = -1.57079633; + + differenceL = lastFXBussL + sin(differenceL); + differenceR = lastFXBussR + sin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleL = differenceL; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXBussL = inputSampleL; + lastFXBussR = inputSampleR; + if (lastFXBussL > 1.0) lastFXBussL = 1.0; + if (lastFXBussL < -1.0) lastFXBussL = -1.0; + if (lastFXBussR > 1.0) lastFXBussR = 1.0; + if (lastFXBussR < -1.0) lastFXBussR = -1.0; + //build new signal off what was present in output last time + + nearZeroL = pow(fabs(fabs(lastFXBussL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXBussR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXBussL += (iirCorrectL * 0.0000005); + lastFXBussR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXBussL *= (1.0 - (nearZeroL * bassTrim)); + lastFXBussR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + //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/Console5Buss/VSTProject.sln b/plugins/WinVST/Console5Buss/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Console5Buss/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/Console5Buss/VSTProject.vcxproj b/plugins/WinVST/Console5Buss/VSTProject.vcxproj new file mode 100755 index 0000000..6f52ac3 --- /dev/null +++ b/plugins/WinVST/Console5Buss/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Console5Buss.cpp" />
+ <ClCompile Include="Console5BussProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Console5Buss.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Console5Buss64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Buss/VSTProject.vcxproj.filters b/plugins/WinVST/Console5Buss/VSTProject.vcxproj.filters new file mode 100755 index 0000000..72ce4ff --- /dev/null +++ b/plugins/WinVST/Console5Buss/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5Buss.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5BussProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Console5Buss.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Buss/VSTProject.vcxproj.user b/plugins/WinVST/Console5Buss/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Console5Buss/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Buss/vstplug.def b/plugins/WinVST/Console5Buss/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Console5Buss/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Console5Channel/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Console5Channel/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Console5Channel/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Console5Channel/.vs/VSTProject/v14/.suo b/plugins/WinVST/Console5Channel/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..ac0d461 --- /dev/null +++ b/plugins/WinVST/Console5Channel/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Console5Channel/Console5Channel.cpp b/plugins/WinVST/Console5Channel/Console5Channel.cpp new file mode 100755 index 0000000..9305bf4 --- /dev/null +++ b/plugins/WinVST/Console5Channel/Console5Channel.cpp @@ -0,0 +1,131 @@ +/* ======================================== + * Console5Channel - Console5Channel.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5Channel_H +#include "Console5Channel.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Console5Channel(audioMaster);} + +Console5Channel::Console5Channel(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + lastSampleChannelL = 0.0; + lastSampleChannelR = 0.0; + lastFXChannelL = 0.0; + lastFXChannelR = 0.0; + iirCorrectL = 0.0; + iirCorrectR = 0.0; + gainchase = -90.0; + settingchase = -90.0; + chasespeed = 350.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Console5Channel::~Console5Channel() {} +VstInt32 Console5Channel::getVendorVersion () {return 1000;} +void Console5Channel::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Console5Channel::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 Console5Channel::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 Console5Channel::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 Console5Channel::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Console5Channel::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 Console5Channel::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Console5Channel::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Console5Channel::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Console5Channel::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Console5Channel::getEffectName(char* name) { + vst_strncpy(name, "Console5Channel", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Console5Channel::getPlugCategory() {return kPlugCategEffect;} + +bool Console5Channel::getProductString(char* text) { + vst_strncpy (text, "airwindows Console5Channel", kVstMaxProductStrLen); return true; +} + +bool Console5Channel::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Console5Channel/Console5Channel.h b/plugins/WinVST/Console5Channel/Console5Channel.h new file mode 100755 index 0000000..59e7950 --- /dev/null +++ b/plugins/WinVST/Console5Channel/Console5Channel.h @@ -0,0 +1,74 @@ +/* ======================================== + * Console5Channel - Console5Channel.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console5Channel_H +#define __Console5Channel_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'conj'; //Change this to what the AU identity is! + +class Console5Channel : + public AudioEffectX +{ +public: + Console5Channel(audioMasterCallback audioMaster); + ~Console5Channel(); + 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 lastSampleChannelL; + double lastSampleChannelR; + double lastFXChannelL; + double lastFXChannelR; + double iirCorrectL; + double iirCorrectR; + double gainchase; + double settingchase; + double chasespeed; + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; +}; + +#endif diff --git a/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp b/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp new file mode 100755 index 0000000..428e5e4 --- /dev/null +++ b/plugins/WinVST/Console5Channel/Console5ChannelProc.cpp @@ -0,0 +1,358 @@ +/* ======================================== + * Console5Channel - Console5Channel.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5Channel_H +#include "Console5Channel.h" +#endif + +void Console5Channel::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; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + differenceL = lastSampleChannelL - inputSampleL; + lastSampleChannelL = inputSampleL; + differenceR = lastSampleChannelR - inputSampleR; + lastSampleChannelR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.0) differenceL = 1.0; + if (differenceL < -1.0) differenceL = -1.0; + if (differenceR > 1.0) differenceR = 1.0; + if (differenceR < -1.0) differenceR = -1.0; + //clamp the slew correction to prevent invalid math results + + differenceL = lastFXChannelL + asin(differenceL); + differenceR = lastFXChannelR + asin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + inputSampleL = differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXChannelL = inputSampleL; + lastFXChannelR = inputSampleR; + if (lastFXChannelL > 1.0) lastFXChannelL = 1.0; + if (lastFXChannelL < -1.0) lastFXChannelL = -1.0; + if (lastFXChannelR > 1.0) lastFXChannelR = 1.0; + if (lastFXChannelR < -1.0) lastFXChannelR = -1.0; + //store current sample as new base for next offset + + nearZeroL = pow(fabs(fabs(lastFXChannelL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXChannelR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXChannelL += (iirCorrectL * 0.0000005); + lastFXChannelR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXChannelL *= (1.0 - (nearZeroL * bassTrim)); + lastFXChannelR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + if (inputSampleL > 1.57079633) inputSampleL= 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + inputSampleL = sin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + inputSampleR = sin(inputSampleR); + //amplitude aspect + + //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 Console5Channel::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + differenceL = lastSampleChannelL - inputSampleL; + lastSampleChannelL = inputSampleL; + differenceR = lastSampleChannelR - inputSampleR; + lastSampleChannelR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.0) differenceL = 1.0; + if (differenceL < -1.0) differenceL = -1.0; + if (differenceR > 1.0) differenceR = 1.0; + if (differenceR < -1.0) differenceR = -1.0; + //clamp the slew correction to prevent invalid math results + + differenceL = lastFXChannelL + asin(differenceL); + differenceR = lastFXChannelR + asin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + inputSampleL = differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXChannelL = inputSampleL; + lastFXChannelR = inputSampleR; + if (lastFXChannelL > 1.0) lastFXChannelL = 1.0; + if (lastFXChannelL < -1.0) lastFXChannelL = -1.0; + if (lastFXChannelR > 1.0) lastFXChannelR = 1.0; + if (lastFXChannelR < -1.0) lastFXChannelR = -1.0; + //store current sample as new base for next offset + + nearZeroL = pow(fabs(fabs(lastFXChannelL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXChannelR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXChannelL += (iirCorrectL * 0.0000005); + lastFXChannelR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXChannelL *= (1.0 - (nearZeroL * bassTrim)); + lastFXChannelR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + if (inputSampleL > 1.57079633) inputSampleL= 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + inputSampleL = sin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + inputSampleR = sin(inputSampleR); + //amplitude aspect + + //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/Console5Channel/VSTProject.sln b/plugins/WinVST/Console5Channel/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Console5Channel/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/Console5Channel/VSTProject.vcxproj b/plugins/WinVST/Console5Channel/VSTProject.vcxproj new file mode 100755 index 0000000..b6b934d --- /dev/null +++ b/plugins/WinVST/Console5Channel/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Console5Channel.cpp" />
+ <ClCompile Include="Console5ChannelProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Console5Channel.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Console5Channel64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Channel/VSTProject.vcxproj.filters b/plugins/WinVST/Console5Channel/VSTProject.vcxproj.filters new file mode 100755 index 0000000..635b151 --- /dev/null +++ b/plugins/WinVST/Console5Channel/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5Channel.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5ChannelProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Console5Channel.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Channel/VSTProject.vcxproj.user b/plugins/WinVST/Console5Channel/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Console5Channel/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5Channel/vstplug.def b/plugins/WinVST/Console5Channel/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Console5Channel/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Console5DarkCh/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Console5DarkCh/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Console5DarkCh/.vs/VSTProject/v14/.suo b/plugins/WinVST/Console5DarkCh/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..1473e4d --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp b/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp new file mode 100755 index 0000000..0d613a9 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/Console5DarkCh.cpp @@ -0,0 +1,131 @@ +/* ======================================== + * Console5DarkCh - Console5DarkCh.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5DarkCh_H +#include "Console5DarkCh.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Console5DarkCh(audioMaster);} + +Console5DarkCh::Console5DarkCh(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + lastSampleChannelL = 0.0; + lastSampleChannelR = 0.0; + lastFXChannelL = 0.0; + lastFXChannelR = 0.0; + iirCorrectL = 0.0; + iirCorrectR = 0.0; + gainchase = -90.0; + settingchase = -90.0; + chasespeed = 350.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Console5DarkCh::~Console5DarkCh() {} +VstInt32 Console5DarkCh::getVendorVersion () {return 1000;} +void Console5DarkCh::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Console5DarkCh::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 Console5DarkCh::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 Console5DarkCh::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 Console5DarkCh::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Console5DarkCh::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 Console5DarkCh::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Console5DarkCh::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Console5DarkCh::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Console5DarkCh::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Console5DarkCh::getEffectName(char* name) { + vst_strncpy(name, "Console5DarkCh", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Console5DarkCh::getPlugCategory() {return kPlugCategEffect;} + +bool Console5DarkCh::getProductString(char* text) { + vst_strncpy (text, "airwindows Console5DarkCh", kVstMaxProductStrLen); return true; +} + +bool Console5DarkCh::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkCh.h b/plugins/WinVST/Console5DarkCh/Console5DarkCh.h new file mode 100755 index 0000000..558e4f7 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/Console5DarkCh.h @@ -0,0 +1,74 @@ +/* ======================================== + * Console5DarkCh - Console5DarkCh.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Console5DarkCh_H +#define __Console5DarkCh_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'conl'; //Change this to what the AU identity is! + +class Console5DarkCh : + public AudioEffectX +{ +public: + Console5DarkCh(audioMasterCallback audioMaster); + ~Console5DarkCh(); + 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 lastSampleChannelL; + double lastSampleChannelR; + double lastFXChannelL; + double lastFXChannelR; + double iirCorrectL; + double iirCorrectR; + double gainchase; + double settingchase; + double chasespeed; + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; +}; + +#endif diff --git a/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp b/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp new file mode 100755 index 0000000..e17ff88c --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/Console5DarkChProc.cpp @@ -0,0 +1,358 @@ +/* ======================================== + * Console5DarkCh - Console5DarkCh.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Console5DarkCh_H +#include "Console5DarkCh.h" +#endif + +void Console5DarkCh::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; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + differenceL = lastSampleChannelL - inputSampleL; + lastSampleChannelL = inputSampleL; + differenceR = lastSampleChannelR - inputSampleR; + lastSampleChannelR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.0) differenceL = 1.0; + if (differenceL < -1.0) differenceL = -1.0; + if (differenceR > 1.0) differenceR = 1.0; + if (differenceR < -1.0) differenceR = -1.0; + //clamp the slew correction to prevent invalid math results + + differenceL = lastFXChannelL + sin(differenceL); + differenceR = lastFXChannelR + sin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + inputSampleL = differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXChannelL = inputSampleL; + lastFXChannelR = inputSampleR; + if (lastFXChannelL > 1.0) lastFXChannelL = 1.0; + if (lastFXChannelL < -1.0) lastFXChannelL = -1.0; + if (lastFXChannelR > 1.0) lastFXChannelR = 1.0; + if (lastFXChannelR < -1.0) lastFXChannelR = -1.0; + //store current sample as new base for next offset + + nearZeroL = pow(fabs(fabs(lastFXChannelL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXChannelR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXChannelL += (iirCorrectL * 0.0000005); + lastFXChannelR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXChannelL *= (1.0 - (nearZeroL * bassTrim)); + lastFXChannelR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + if (inputSampleL > 1.57079633) inputSampleL= 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + inputSampleL = sin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + inputSampleR = sin(inputSampleR); + //amplitude aspect + + //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 Console5DarkCh::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputgain = A; + double differenceL; + double differenceR; + double nearZeroL; + double nearZeroR; + double servoTrim = 0.0000001 / overallscale; + double bassTrim = 0.005 / overallscale; + long double inputSampleL; + long double inputSampleR; + + if (settingchase != inputgain) { + chasespeed *= 2.0; + settingchase = inputgain; + } + if (chasespeed > 2500.0) chasespeed = 2500.0; + if (gainchase < 0.0) gainchase = inputgain; + + 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. + } + + chasespeed *= 0.9999; + chasespeed -= 0.01; + if (chasespeed < 350.0) chasespeed = 350.0; + //we have our chase speed compensated for recent fader activity + + gainchase = (((gainchase*chasespeed)+inputgain)/(chasespeed+1.0)); + //gainchase is chasing the target, as a simple multiply gain factor + + if (1.0 != gainchase) { + inputSampleL *= gainchase; + inputSampleR *= gainchase; + } + //done with trim control + + differenceL = lastSampleChannelL - inputSampleL; + lastSampleChannelL = inputSampleL; + differenceR = lastSampleChannelR - inputSampleR; + lastSampleChannelR = inputSampleR; + //derive slew part off direct sample measurement + from last time + + if (differenceL > 1.0) differenceL = 1.0; + if (differenceL < -1.0) differenceL = -1.0; + if (differenceR > 1.0) differenceR = 1.0; + if (differenceR < -1.0) differenceR = -1.0; + //clamp the slew correction to prevent invalid math results + + differenceL = lastFXChannelL + sin(differenceL); + differenceR = lastFXChannelR + sin(differenceR); + //we're about to use this twice and then not use difference again, so we'll reuse it + //enhance slew is arcsin(): cutting it back is sin() + + iirCorrectL += inputSampleL - differenceL; + inputSampleL = differenceL; + iirCorrectR += inputSampleR - differenceR; + inputSampleR = differenceR; + //apply the slew to stored value: can develop DC offsets. + //store the change we made so we can dial it back + + lastFXChannelL = inputSampleL; + lastFXChannelR = inputSampleR; + if (lastFXChannelL > 1.0) lastFXChannelL = 1.0; + if (lastFXChannelL < -1.0) lastFXChannelL = -1.0; + if (lastFXChannelR > 1.0) lastFXChannelR = 1.0; + if (lastFXChannelR < -1.0) lastFXChannelR = -1.0; + //store current sample as new base for next offset + + nearZeroL = pow(fabs(fabs(lastFXChannelL)-1.0), 2); + nearZeroR = pow(fabs(fabs(lastFXChannelR)-1.0), 2); + //if the sample is very near zero this number is higher. + if (iirCorrectL > 0) iirCorrectL -= servoTrim; + if (iirCorrectL < 0) iirCorrectL += servoTrim; + if (iirCorrectR > 0) iirCorrectR -= servoTrim; + if (iirCorrectR < 0) iirCorrectR += servoTrim; + //cut back the servo by which we're pulling back the DC + lastFXChannelL += (iirCorrectL * 0.0000005); + lastFXChannelR += (iirCorrectR * 0.0000005); + //apply the servo to the stored value, pulling back the DC + lastFXChannelL *= (1.0 - (nearZeroL * bassTrim)); + lastFXChannelR *= (1.0 - (nearZeroR * bassTrim)); + //this cuts back the DC offset directly, relative to how near zero we are + + if (inputSampleL > 1.57079633) inputSampleL= 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + inputSampleL = sin(inputSampleL); + //amplitude aspect + + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + inputSampleR = sin(inputSampleR); + //amplitude aspect + + //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/Console5DarkCh/VSTProject.sln b/plugins/WinVST/Console5DarkCh/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/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/Console5DarkCh/VSTProject.vcxproj b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj new file mode 100755 index 0000000..4e549d1 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Console5DarkCh.cpp" />
+ <ClCompile Include="Console5DarkChProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Console5DarkCh.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Console5DarkCh64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.filters b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.filters new file mode 100755 index 0000000..4788a20 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5DarkCh.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Console5DarkChProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Console5DarkCh.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.user b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Console5DarkCh/vstplug.def b/plugins/WinVST/Console5DarkCh/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Console5DarkCh/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/DCVoltage/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/DCVoltage/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/DCVoltage/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/DCVoltage/.vs/VSTProject/v14/.suo b/plugins/WinVST/DCVoltage/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..35085c6 --- /dev/null +++ b/plugins/WinVST/DCVoltage/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/DCVoltage/DCVoltage.cpp b/plugins/WinVST/DCVoltage/DCVoltage.cpp new file mode 100755 index 0000000..9b70015 --- /dev/null +++ b/plugins/WinVST/DCVoltage/DCVoltage.cpp @@ -0,0 +1,117 @@ +/* ======================================== + * DCVoltage - DCVoltage.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DCVoltage_H +#include "DCVoltage.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new DCVoltage(audioMaster);} + +DCVoltage::DCVoltage(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + //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 +} + +DCVoltage::~DCVoltage() {} +VstInt32 DCVoltage::getVendorVersion () {return 1000;} +void DCVoltage::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void DCVoltage::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 DCVoltage::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 DCVoltage::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 DCVoltage::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float DCVoltage::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 DCVoltage::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Voltage", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void DCVoltage::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*2.0)-1.0, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void DCVoltage::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 DCVoltage::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool DCVoltage::getEffectName(char* name) { + vst_strncpy(name, "DCVoltage", kVstMaxProductStrLen); return true; +} + +VstPlugCategory DCVoltage::getPlugCategory() {return kPlugCategEffect;} + +bool DCVoltage::getProductString(char* text) { + vst_strncpy (text, "airwindows DCVoltage", kVstMaxProductStrLen); return true; +} + +bool DCVoltage::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/DCVoltage/DCVoltage.h b/plugins/WinVST/DCVoltage/DCVoltage.h new file mode 100755 index 0000000..b347487 --- /dev/null +++ b/plugins/WinVST/DCVoltage/DCVoltage.h @@ -0,0 +1,58 @@ +/* ======================================== + * DCVoltage - DCVoltage.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __DCVoltage_H +#define __DCVoltage_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dcvo'; //Change this to what the AU identity is! + +class DCVoltage : + public AudioEffectX +{ +public: + DCVoltage(audioMasterCallback audioMaster); + ~DCVoltage(); + 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; + + float A; +}; + +#endif diff --git a/plugins/WinVST/DCVoltage/DCVoltageProc.cpp b/plugins/WinVST/DCVoltage/DCVoltageProc.cpp new file mode 100755 index 0000000..b419acc --- /dev/null +++ b/plugins/WinVST/DCVoltage/DCVoltageProc.cpp @@ -0,0 +1,50 @@ +/* ======================================== + * DCVoltage - DCVoltage.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DCVoltage_H +#include "DCVoltage.h" +#endif + +void DCVoltage::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double voltage = (A*2.0)-1.0; + + while (--sampleFrames >= 0) + { + *out1 = *in1 + voltage; + *out2 = *in2 + voltage; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void DCVoltage::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double voltage = (A*2.0)-1.0; + + while (--sampleFrames >= 0) + { + *out1 = *in1 + voltage; + *out2 = *in2 + voltage; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/DCVoltage/VSTProject.sln b/plugins/WinVST/DCVoltage/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/DCVoltage/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/DCVoltage/VSTProject.vcxproj b/plugins/WinVST/DCVoltage/VSTProject.vcxproj new file mode 100755 index 0000000..2a82812 --- /dev/null +++ b/plugins/WinVST/DCVoltage/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="DCVoltage.cpp" />
+ <ClCompile Include="DCVoltageProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="DCVoltage.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>DCVoltage64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DCVoltage/VSTProject.vcxproj.filters b/plugins/WinVST/DCVoltage/VSTProject.vcxproj.filters new file mode 100755 index 0000000..0059665 --- /dev/null +++ b/plugins/WinVST/DCVoltage/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DCVoltage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DCVoltageProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DCVoltage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DCVoltage/VSTProject.vcxproj.user b/plugins/WinVST/DCVoltage/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/DCVoltage/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DCVoltage/vstplug.def b/plugins/WinVST/DCVoltage/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/DCVoltage/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/DeEss/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/DeEss/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/DeEss/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/DeEss/.vs/VSTProject/v14/.suo b/plugins/WinVST/DeEss/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..bf3a84e --- /dev/null +++ b/plugins/WinVST/DeEss/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/DeEss/DeEss.cpp b/plugins/WinVST/DeEss/DeEss.cpp new file mode 100755 index 0000000..64a9503 --- /dev/null +++ b/plugins/WinVST/DeEss/DeEss.cpp @@ -0,0 +1,152 @@ +/* ======================================== + * DeEss - DeEss.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DeEss_H +#include "DeEss.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new DeEss(audioMaster);} + +DeEss::DeEss(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.5; //-48.0 to 0.0 + C = 0.5; + + s1L = s2L = s3L = s4L = s5L = s6L= s7L = 0.0; + m1L = m2L = m3L = m4L = m5L = m6L = 0.0; + c1L = c2L = c3L = c4L = c5L = 0.0; + ratioAL = ratioBL = 1.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + + s1R = s2R = s3R = s4R = s5R = s6R = s7R = 0.0; + m1R = m2R = m3R = m4R = m5R = m6R = 0.0; + c1R = c2R = c3R = c4R = c5R = 0.0; + ratioAR = ratioBR = 1.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + + flip = false; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; + //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 +} + +DeEss::~DeEss() {} +VstInt32 DeEss::getVendorVersion () {return 1000;} +void DeEss::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void DeEss::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 DeEss::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 DeEss::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 DeEss::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float DeEss::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 DeEss::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Intense", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Max DS", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Freq", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void DeEss::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B-1.0)*48.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void DeEss::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 DeEss::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool DeEss::getEffectName(char* name) { + vst_strncpy(name, "DeEss", kVstMaxProductStrLen); return true; +} + +VstPlugCategory DeEss::getPlugCategory() {return kPlugCategEffect;} + +bool DeEss::getProductString(char* text) { + vst_strncpy (text, "airwindows DeEss", kVstMaxProductStrLen); return true; +} + +bool DeEss::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/DeEss/DeEss.h b/plugins/WinVST/DeEss/DeEss.h new file mode 100755 index 0000000..dcab1e6 --- /dev/null +++ b/plugins/WinVST/DeEss/DeEss.h @@ -0,0 +1,115 @@ +/* ======================================== + * DeEss - DeEss.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __DeEss_H +#define __DeEss_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dess'; //Change this to what the AU identity is! + +class DeEss : + public AudioEffectX +{ +public: + DeEss(audioMasterCallback audioMaster); + ~DeEss(); + 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 s1L; + double s2L; + double s3L; + double s4L; + double s5L; + double s6L; + double s7L; + double m1L; + double m2L; + double m3L; + double m4L; + double m5L; + double m6L; + double c1L; + double c2L; + double c3L; + double c4L; + double c5L; + double ratioAL; + double ratioBL; + double iirSampleAL; + double iirSampleBL; + + double s1R; + double s2R; + double s3R; + double s4R; + double s5R; + double s6R; + double s7R; + double m1R; + double m2R; + double m3R; + double m4R; + double m5R; + double m6R; + double c1R; + double c2R; + double c3R; + double c4R; + double c5R; + double ratioAR; + double ratioBR; + double iirSampleAR; + double iirSampleBR; + + + bool flip; + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/DeEss/DeEssProc.cpp b/plugins/WinVST/DeEss/DeEssProc.cpp new file mode 100755 index 0000000..9a8e14b --- /dev/null +++ b/plugins/WinVST/DeEss/DeEssProc.cpp @@ -0,0 +1,348 @@ +/* ======================================== + * DeEss - DeEss.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DeEss_H +#include "DeEss.h" +#endif + +void DeEss::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 intensity = pow(A,5)*(8192/overallscale); + double maxdess = 1.0 / pow(10.0,((B-1.0)*48.0)/20); + double iirAmount = pow(C,2)/overallscale; + double offset; + double sense; + double recovery; + double attackspeed; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it aDeEss. We want a 'air' hiss + + s3L = s2L; + s2L = s1L; + s1L = inputSampleL; + m1L = (s1L-s2L)*((s1L-s2L)/1.3); + m2L = (s2L-s3L)*((s1L-s2L)/1.3); + sense = fabs((m1L-m2L)*((m1L-m2L)/1.3)); + //this will be 0 for smooth, high for SSS + attackspeed = 7.0+(sense*1024); + //this does not vary with intensity, but it does react to onset transients + + sense = 1.0+(intensity*intensity*sense); + if (sense > intensity) {sense = intensity;} + //this will be 1 for smooth, 'intensity' for SSS + recovery = 1.0+(0.01/sense); + //this will be 1.1 for smooth, 1.0000000...1 for SSS + + offset = 1.0-fabs(inputSampleL); + + if (flip) { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + if (ratioAL < sense) + {ratioAL = ((ratioAL*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioAL = 1.0+((ratioAL-1.0)/recovery);} + //returny to 1/1 code + if (ratioAL > maxdess){ratioAL = maxdess;} + inputSampleL = iirSampleAL+((inputSampleL-iirSampleAL)/ratioAL); + } + else { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + if (ratioBL < sense) + {ratioBL = ((ratioBL*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioBL = 1.0+((ratioBL-1.0)/recovery);} + //returny to 1/1 code + if (ratioBL > maxdess){ratioBL = maxdess;} + inputSampleL = iirSampleBL+((inputSampleL-iirSampleBL)/ratioBL); + } //have the ratio chase Sense + + s3R = s2R; + s2R = s1R; + s1R = inputSampleR; + m1R = (s1R-s2R)*((s1R-s2R)/1.3); + m2R = (s2R-s3R)*((s1R-s2R)/1.3); + sense = fabs((m1R-m2R)*((m1R-m2R)/1.3)); + //this will be 0 for smooth, high for SSS + attackspeed = 7.0+(sense*1024); + //this does not vary with intensity, but it does react to onset transients + + sense = 1.0+(intensity*intensity*sense); + if (sense > intensity) {sense = intensity;} + //this will be 1 for smooth, 'intensity' for SSS + recovery = 1.0+(0.01/sense); + //this will be 1.1 for smooth, 1.0000000...1 for SSS + + offset = 1.0-fabs(inputSampleR); + + if (flip) { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + if (ratioAR < sense) + {ratioAR = ((ratioAR*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioAR = 1.0+((ratioAR-1.0)/recovery);} + //returny to 1/1 code + if (ratioAR > maxdess){ratioAR = maxdess;} + inputSampleR = iirSampleAR+((inputSampleR-iirSampleAR)/ratioAR); + } + else { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + if (ratioBR < sense) + {ratioBR = ((ratioBR*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioBR = 1.0+((ratioBR-1.0)/recovery);} + //returny to 1/1 code + if (ratioBR > maxdess){ratioBR = maxdess;} + inputSampleR = iirSampleBR+((inputSampleR-iirSampleBR)/ratioBR); + } //have the ratio chase Sense + + flip = !flip; + + //noise shaping to 32-bit floating point + float fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} + +void DeEss::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 intensity = pow(A,5)*(8192/overallscale); + double maxdess = 1.0 / pow(10.0,((B-1.0)*48.0)/20); + double iirAmount = pow(C,2)/overallscale; + double offset; + double sense; + double recovery; + double attackspeed; + + while (--sampleFrames >= 0) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it aDeEss. We want a 'air' hiss + + s3L = s2L; + s2L = s1L; + s1L = inputSampleL; + m1L = (s1L-s2L)*((s1L-s2L)/1.3); + m2L = (s2L-s3L)*((s1L-s2L)/1.3); + sense = fabs((m1L-m2L)*((m1L-m2L)/1.3)); + //this will be 0 for smooth, high for SSS + attackspeed = 7.0+(sense*1024); + //this does not vary with intensity, but it does react to onset transients + + sense = 1.0+(intensity*intensity*sense); + if (sense > intensity) {sense = intensity;} + //this will be 1 for smooth, 'intensity' for SSS + recovery = 1.0+(0.01/sense); + //this will be 1.1 for smooth, 1.0000000...1 for SSS + + offset = 1.0-fabs(inputSampleL); + + if (flip) { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + if (ratioAL < sense) + {ratioAL = ((ratioAL*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioAL = 1.0+((ratioAL-1.0)/recovery);} + //returny to 1/1 code + if (ratioAL > maxdess){ratioAL = maxdess;} + inputSampleL = iirSampleAL+((inputSampleL-iirSampleAL)/ratioAL); + } + else { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + if (ratioBL < sense) + {ratioBL = ((ratioBL*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioBL = 1.0+((ratioBL-1.0)/recovery);} + //returny to 1/1 code + if (ratioBL > maxdess){ratioBL = maxdess;} + inputSampleL = iirSampleBL+((inputSampleL-iirSampleBL)/ratioBL); + } //have the ratio chase Sense + + s3R = s2R; + s2R = s1R; + s1R = inputSampleR; + m1R = (s1R-s2R)*((s1R-s2R)/1.3); + m2R = (s2R-s3R)*((s1R-s2R)/1.3); + sense = fabs((m1R-m2R)*((m1R-m2R)/1.3)); + //this will be 0 for smooth, high for SSS + attackspeed = 7.0+(sense*1024); + //this does not vary with intensity, but it does react to onset transients + + sense = 1.0+(intensity*intensity*sense); + if (sense > intensity) {sense = intensity;} + //this will be 1 for smooth, 'intensity' for SSS + recovery = 1.0+(0.01/sense); + //this will be 1.1 for smooth, 1.0000000...1 for SSS + + offset = 1.0-fabs(inputSampleR); + + if (flip) { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + if (ratioAR < sense) + {ratioAR = ((ratioAR*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioAR = 1.0+((ratioAR-1.0)/recovery);} + //returny to 1/1 code + if (ratioAR > maxdess){ratioAR = maxdess;} + inputSampleR = iirSampleAR+((inputSampleR-iirSampleAR)/ratioAR); + } + else { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + if (ratioBR < sense) + {ratioBR = ((ratioBR*attackspeed)+sense)/(attackspeed+1.0);} + else + {ratioBR = 1.0+((ratioBR-1.0)/recovery);} + //returny to 1/1 code + if (ratioBR > maxdess){ratioBR = maxdess;} + inputSampleR = iirSampleBR+((inputSampleR-iirSampleBR)/ratioBR); + } //have the ratio chase Sense + + flip = !flip; + + //noise shaping to 64-bit floating point + double fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 64 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} diff --git a/plugins/WinVST/DeEss/VSTProject.sln b/plugins/WinVST/DeEss/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/DeEss/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/DeEss/VSTProject.vcxproj b/plugins/WinVST/DeEss/VSTProject.vcxproj new file mode 100755 index 0000000..62be2cf --- /dev/null +++ b/plugins/WinVST/DeEss/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="DeEss.cpp" />
+ <ClCompile Include="DeEssProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="DeEss.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>DeEss64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DeEss/VSTProject.vcxproj.filters b/plugins/WinVST/DeEss/VSTProject.vcxproj.filters new file mode 100755 index 0000000..6c43e45 --- /dev/null +++ b/plugins/WinVST/DeEss/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DeEss.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DeEssProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DeEss.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DeEss/VSTProject.vcxproj.user b/plugins/WinVST/DeEss/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/DeEss/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DeEss/vstplug.def b/plugins/WinVST/DeEss/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/DeEss/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Density/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Density/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Density/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Density/.vs/VSTProject/v14/.suo b/plugins/WinVST/Density/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..ac31fc9 --- /dev/null +++ b/plugins/WinVST/Density/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Density/Density.cpp b/plugins/WinVST/Density/Density.cpp new file mode 100755 index 0000000..1ecafde --- /dev/null +++ b/plugins/WinVST/Density/Density.cpp @@ -0,0 +1,151 @@ +/* ======================================== + * Density - Density.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Density_H +#include "Density.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Density(audioMaster);} + +Density::Density(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.2; //equivalent of 0.0 in VST 0-1 scale for 'Density' control + B = 0.0; + C = 1.0; + D = 1.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Density::~Density() {} +VstInt32 Density::getVendorVersion () {return 1000;} +void Density::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Density::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 Density::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Density::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Density::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 + case kParamC: C = value; break; + case kParamD: D = value; break; //this is the popup, stored as a float + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Density::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Density::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Density", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Highpass", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Out Level", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Density::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*5.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Density::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the popup + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Density::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Density::getEffectName(char* name) { + vst_strncpy(name, "Density", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Density::getPlugCategory() {return kPlugCategEffect;} + +bool Density::getProductString(char* text) { + vst_strncpy (text, "airwindows Density", kVstMaxProductStrLen); return true; +} + +bool Density::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Density/Density.h b/plugins/WinVST/Density/Density.h new file mode 100755 index 0000000..377d25d --- /dev/null +++ b/plugins/WinVST/Density/Density.h @@ -0,0 +1,76 @@ +/* ======================================== + * Density - Density.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Density_H +#define __Density_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dens'; //Change this to what the AU identity is! + +class Density : + public AudioEffectX +{ +public: + Density(audioMasterCallback audioMaster); + ~Density(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/Density/DensityProc.cpp b/plugins/WinVST/Density/DensityProc.cpp new file mode 100755 index 0000000..1e968c7 --- /dev/null +++ b/plugins/WinVST/Density/DensityProc.cpp @@ -0,0 +1,354 @@ +/* ======================================== + * Density - Density.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Density_H +#include "Density.h" +#endif + +void Density::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 density = (A*5.0)-1.0; + double iirAmount = pow(B,3)/overallscale; + double output = C; + double wet = D; + double dry = 1.0-wet; + double bridgerectifier; + double out = fabs(density); + density = density * fabs(density); + double count; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleAL; + iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleBL; + iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleBR; + } + //highpass section + + count = density; + while (count > 1.0) + { + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + count = count - 1.0; + } + //we have now accounted for any really high density settings. + + while (out > 1.0) out = out - 1.0; + + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1.0-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1.0-out))-(bridgerectifier*out); + //blend according to density control + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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 Density::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 density = (A*5.0)-1.0; + double iirAmount = pow(B,3)/overallscale; + double output = C; + double wet = D; + double dry = 1.0-wet; + double bridgerectifier; + double out = fabs(density); + density = density * fabs(density); + double count; + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleAL; + iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleBL; + iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleBR; + } + //highpass section + + count = density; + while (count > 1.0) + { + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + count = count - 1.0; + } + //we have now accounted for any really high density settings. + + while (out > 1.0) out = out - 1.0; + + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1.0-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1.0-out))-(bridgerectifier*out); + //blend according to density control + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/Density/VSTProject.sln b/plugins/WinVST/Density/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Density/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/Density/VSTProject.vcxproj b/plugins/WinVST/Density/VSTProject.vcxproj new file mode 100755 index 0000000..086d2cc --- /dev/null +++ b/plugins/WinVST/Density/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Density.cpp" />
+ <ClCompile Include="DensityProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Density.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Density64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Density/VSTProject.vcxproj.filters b/plugins/WinVST/Density/VSTProject.vcxproj.filters new file mode 100755 index 0000000..9323ca7 --- /dev/null +++ b/plugins/WinVST/Density/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Density.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DensityProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Density.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Density/VSTProject.vcxproj.user b/plugins/WinVST/Density/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Density/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Density/vstplug.def b/plugins/WinVST/Density/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Density/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Desk/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Desk/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Desk/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Desk/.vs/VSTProject/v14/.suo b/plugins/WinVST/Desk/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..9006873 --- /dev/null +++ b/plugins/WinVST/Desk/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Desk/Desk.cpp b/plugins/WinVST/Desk/Desk.cpp new file mode 100755 index 0000000..7a30943 --- /dev/null +++ b/plugins/WinVST/Desk/Desk.cpp @@ -0,0 +1,88 @@ +/* ======================================== + * Desk - Desk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Desk_H +#include "Desk.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Desk(audioMaster);} + +Desk::Desk(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + lastSampleL = 0.0; + lastOutSampleL = 0.0; + lastSlewL = 0.0; + lastSampleR = 0.0; + lastOutSampleR = 0.0; + lastSlewR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Desk::~Desk() {} +VstInt32 Desk::getVendorVersion () {return 1000;} +void Desk::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Desk::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! + +VstInt32 Desk::getChunk (void** data, bool isPreset) +{ + return kNumParameters * sizeof(float); +} + +VstInt32 Desk::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + return 0; +} + +void Desk::setParameter(VstInt32 index, float value) { +} + +float Desk::getParameter(VstInt32 index) { + return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void Desk::getParameterName(VstInt32 index, char *text) { +} + +void Desk::getParameterDisplay(VstInt32 index, char *text) { +} + +void Desk::getParameterLabel(VstInt32 index, char *text) { +} + +VstInt32 Desk::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Desk::getEffectName(char* name) { + vst_strncpy(name, "Desk", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Desk::getPlugCategory() {return kPlugCategEffect;} + +bool Desk::getProductString(char* text) { + vst_strncpy (text, "airwindows Desk", kVstMaxProductStrLen); return true; +} + +bool Desk::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Desk/Desk.h b/plugins/WinVST/Desk/Desk.h new file mode 100755 index 0000000..8c5c398 --- /dev/null +++ b/plugins/WinVST/Desk/Desk.h @@ -0,0 +1,70 @@ +/* ======================================== + * Desk - Desk.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Desk_H +#define __Desk_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'desk'; //Change this to what the AU identity is! + +class Desk : + public AudioEffectX +{ +public: + Desk(audioMasterCallback audioMaster); + ~Desk(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + long double lastSampleL; + long double lastOutSampleL; + double lastSlewL; + long double lastSampleR; + long double lastOutSampleR; + double lastSlewR; + +}; + +#endif diff --git a/plugins/WinVST/Desk/DeskProc.cpp b/plugins/WinVST/Desk/DeskProc.cpp new file mode 100755 index 0000000..a2bc92c --- /dev/null +++ b/plugins/WinVST/Desk/DeskProc.cpp @@ -0,0 +1,356 @@ +/* ======================================== + * Desk - Desk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Desk_H +#include "Desk.h" +#endif + +void Desk::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double gain = 0.135; + double slewgain = 0.208; + double prevslew = 0.333; + double balanceB = 0.0001; + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combsample; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + //begin L + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + + combsample = fabs(drySampleL*lastSampleL); + if (combsample > 1.0) combsample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combsample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end L + + //begin R + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + + combsample = fabs(drySampleR*lastSampleR); + if (combsample > 1.0) combsample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combsample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end R + + //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 Desk::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double gain = 0.135; + double slewgain = 0.208; + double prevslew = 0.333; + double balanceB = 0.0001; + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combsample; + + 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 drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + //begin L + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + + combsample = fabs(drySampleL*lastSampleL); + if (combsample > 1.0) combsample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combsample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end L + + //begin R + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + + combsample = fabs(drySampleR*lastSampleR); + if (combsample > 1.0) combsample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combsample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end R + + //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/Desk/VSTProject.sln b/plugins/WinVST/Desk/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Desk/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/Desk/VSTProject.vcxproj b/plugins/WinVST/Desk/VSTProject.vcxproj new file mode 100755 index 0000000..496fadb --- /dev/null +++ b/plugins/WinVST/Desk/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Desk.cpp" />
+ <ClCompile Include="DeskProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Desk.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Desk64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk/VSTProject.vcxproj.filters b/plugins/WinVST/Desk/VSTProject.vcxproj.filters new file mode 100755 index 0000000..cf71738 --- /dev/null +++ b/plugins/WinVST/Desk/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Desk.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DeskProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Desk.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk/VSTProject.vcxproj.user b/plugins/WinVST/Desk/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Desk/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk/vstplug.def b/plugins/WinVST/Desk/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Desk/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Desk4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Desk4/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Desk4/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Desk4/.vs/VSTProject/v14/.suo b/plugins/WinVST/Desk4/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..a020b8d --- /dev/null +++ b/plugins/WinVST/Desk4/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Desk4/Desk4.cpp b/plugins/WinVST/Desk4/Desk4.cpp new file mode 100755 index 0000000..a8e20a7 --- /dev/null +++ b/plugins/WinVST/Desk4/Desk4.cpp @@ -0,0 +1,174 @@ +/* ======================================== + * Desk4 - Desk4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Desk4_H +#include "Desk4.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Desk4(audioMaster);} + +Desk4::Desk4(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.27; + B = 0.18; + C = 0.26; + D = 0.54; + E = 0.84; + F = 1.0; + + for(int count = 0; count < 9999; count++) {dL[count] = 0; dR[count] = 0;} + controlL = 0; + lastSampleL = 0.0; + lastOutSampleL = 0.0; + lastSlewL = 0.0; + controlR = 0; + lastSampleR = 0.0; + lastOutSampleR = 0.0; + lastSlewR = 0.0; + gcount = 0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Desk4::~Desk4() {} +VstInt32 Desk4::getVendorVersion () {return 1000;} +void Desk4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Desk4::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 Desk4::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* 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 Desk4::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* 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 Desk4::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Desk4::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; 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 Desk4::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Overdrive", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Hi Choke", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Power Sag", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Frequency", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Output Trim", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Desk4::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Desk4::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Desk4::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Desk4::getEffectName(char* name) { + vst_strncpy(name, "Desk4", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Desk4::getPlugCategory() {return kPlugCategEffect;} + +bool Desk4::getProductString(char* text) { + vst_strncpy (text, "airwindows Desk4", kVstMaxProductStrLen); return true; +} + +bool Desk4::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Desk4/Desk4.h b/plugins/WinVST/Desk4/Desk4.h new file mode 100755 index 0000000..fa09cd0 --- /dev/null +++ b/plugins/WinVST/Desk4/Desk4.h @@ -0,0 +1,88 @@ +/* ======================================== + * Desk4 - Desk4.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Desk4_H +#define __Desk4_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dkti'; //Change this to what the AU identity is! + +class Desk4 : + public AudioEffectX +{ +public: + Desk4(audioMasterCallback audioMaster); + ~Desk4(); + 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 dL[10000]; + double controlL; + double lastSampleL; + double lastOutSampleL; + double lastSlewL; + + double dR[10000]; + double controlR; + double lastSampleR; + double lastOutSampleR; + double lastSlewR; + + int gcount; + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; +}; + +#endif diff --git a/plugins/WinVST/Desk4/Desk4Proc.cpp b/plugins/WinVST/Desk4/Desk4Proc.cpp new file mode 100755 index 0000000..515436c --- /dev/null +++ b/plugins/WinVST/Desk4/Desk4Proc.cpp @@ -0,0 +1,512 @@ +/* ======================================== + * Desk4 - Desk4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Desk4_H +#include "Desk4.h" +#endif + +void Desk4::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; + + double gain = (pow(A,2)*10)+0.0001; + double gaintrim = (pow(A,2)*2)+1.0; + double slewgain = (pow(B,3)*40)+0.0001; + double prevslew = 0.105; + double intensity = (pow(C,6)*15)+0.0001; + double depthA = (pow(D,4)*940)+0.00001; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 4880) offsetA = 4880; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double outputgain = E; + double wet = F; + double dry = 1.0 - wet; + + double clampL; + double clampR; + double thicknessL; + double thicknessR; + double out; + double balanceA = 1.0 - balanceB; + double bridgerectifier; + double slewL; + double slewR; + double combSampleL; + double combSampleR; + double drySampleL; + double drySampleR; + long double inputSampleL; + long double inputSampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gcount < 0 || gcount > 4900) {gcount = 4900;} + + dL[gcount+4900] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clampL = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clampL -= (controlL - 1); controlL = 1;} + if (clampL < 0.5) {clampL = 0.5;} + + dR[gcount+4900] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clampR = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clampR -= (controlR - 1); controlR = 1;} + if (clampR < 0.5) {clampR = 0.5;} + + + gcount--; + //control = 0 to 1 + thicknessL = ((1.0 - controlL) * 2.0) - 1.0; + thicknessR = ((1.0 - controlR) * 2.0) - 1.0; + + out = fabs(thicknessL); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thicknessL > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + out = fabs(thicknessR); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thicknessR > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + + inputSampleL *= clampL; + inputSampleR *= clampR; + + slewL = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + + slewR = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + + bridgerectifier = fabs(slewL*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slewL > 0) slewL = bridgerectifier/slewgain; + else slewL = -(bridgerectifier/slewgain); + + bridgerectifier = fabs(slewR*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slewR > 0) slewR = bridgerectifier/slewgain; + else slewR = -(bridgerectifier/slewgain); + + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slewL; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slewR; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + + combSampleL = fabs(drySampleL*lastSampleL); + if (combSampleL > 1.0) combSampleL = 1.0; + //bailout for very high input gains + + combSampleR = fabs(drySampleR*lastSampleR); + if (combSampleR > 1.0) combSampleR = 1.0; + //bailout for very high input gains + + inputSampleL -= (lastSlewL * combSampleL * prevslew); + lastSlewL = slewL; + //slew interaction with previous slew + + inputSampleR -= (lastSlewR * combSampleR * prevslew); + lastSlewR = slewR; + //slew interaction with previous slew + + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + inputSampleL *= gaintrim; + //end of Desk section + + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + inputSampleR *= gaintrim; + //end of Desk section + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + + //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 Desk4::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; + + double gain = (pow(A,2)*10)+0.0001; + double gaintrim = (pow(A,2)*2)+1.0; + double slewgain = (pow(B,3)*40)+0.0001; + double prevslew = 0.105; + double intensity = (pow(C,6)*15)+0.0001; + double depthA = (pow(D,4)*940)+0.00001; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 4880) offsetA = 4880; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double outputgain = E; + double wet = F; + double dry = 1.0 - wet; + + double clampL; + double clampR; + double thicknessL; + double thicknessR; + double out; + double balanceA = 1.0 - balanceB; + double bridgerectifier; + double slewL; + double slewR; + double combSampleL; + double combSampleR; + double drySampleL; + double drySampleR; + long double inputSampleL; + long double inputSampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gcount < 0 || gcount > 4900) {gcount = 4900;} + + dL[gcount+4900] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clampL = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clampL -= (controlL - 1); controlL = 1;} + if (clampL < 0.5) {clampL = 0.5;} + + dR[gcount+4900] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clampR = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clampR -= (controlR - 1); controlR = 1;} + if (clampR < 0.5) {clampR = 0.5;} + + + gcount--; + //control = 0 to 1 + thicknessL = ((1.0 - controlL) * 2.0) - 1.0; + thicknessR = ((1.0 - controlR) * 2.0) - 1.0; + + out = fabs(thicknessL); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thicknessL > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + out = fabs(thicknessR); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thicknessR > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + + inputSampleL *= clampL; + inputSampleR *= clampR; + + slewL = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + + slewR = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + + bridgerectifier = fabs(slewL*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slewL > 0) slewL = bridgerectifier/slewgain; + else slewL = -(bridgerectifier/slewgain); + + bridgerectifier = fabs(slewR*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slewR > 0) slewR = bridgerectifier/slewgain; + else slewR = -(bridgerectifier/slewgain); + + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slewL; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slewR; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + + combSampleL = fabs(drySampleL*lastSampleL); + if (combSampleL > 1.0) combSampleL = 1.0; + //bailout for very high input gains + + combSampleR = fabs(drySampleR*lastSampleR); + if (combSampleR > 1.0) combSampleR = 1.0; + //bailout for very high input gains + + inputSampleL -= (lastSlewL * combSampleL * prevslew); + lastSlewL = slewL; + //slew interaction with previous slew + + inputSampleR -= (lastSlewR * combSampleR * prevslew); + lastSlewR = slewR; + //slew interaction with previous slew + + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + inputSampleL *= gaintrim; + //end of Desk section + + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + inputSampleR *= gaintrim; + //end of Desk section + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + + //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/Desk4/VSTProject.sln b/plugins/WinVST/Desk4/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Desk4/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/Desk4/VSTProject.vcxproj b/plugins/WinVST/Desk4/VSTProject.vcxproj new file mode 100755 index 0000000..1d05fc8 --- /dev/null +++ b/plugins/WinVST/Desk4/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Desk4.cpp" />
+ <ClCompile Include="Desk4Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Desk4.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Desk464</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk4/VSTProject.vcxproj.filters b/plugins/WinVST/Desk4/VSTProject.vcxproj.filters new file mode 100755 index 0000000..a4416b7 --- /dev/null +++ b/plugins/WinVST/Desk4/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Desk4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Desk4Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Desk4.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk4/VSTProject.vcxproj.user b/plugins/WinVST/Desk4/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Desk4/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Desk4/vstplug.def b/plugins/WinVST/Desk4/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Desk4/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Distance/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Distance/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Distance/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Distance/.vs/VSTProject/v14/.suo b/plugins/WinVST/Distance/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..4359323 --- /dev/null +++ b/plugins/WinVST/Distance/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Distance/Distance.cpp b/plugins/WinVST/Distance/Distance.cpp new file mode 100755 index 0000000..bae55c1 --- /dev/null +++ b/plugins/WinVST/Distance/Distance.cpp @@ -0,0 +1,132 @@ +/* ======================================== + * Distance - Distance.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Distance_H +#include "Distance.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Distance(audioMaster);} + +Distance::Distance(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + thirdresultL = prevresultL = lastclampL = clampL = changeL = lastL = 0.0; + thirdresultR = prevresultR = lastclampR = clampR = changeR = lastR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Distance::~Distance() {} +VstInt32 Distance::getVendorVersion () {return 1000;} +void Distance::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Distance::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 Distance::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 Distance::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 Distance::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 Distance::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 Distance::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Distance", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Distance::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*2.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Distance::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "miles", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Distance::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Distance::getEffectName(char* name) { + vst_strncpy(name, "Distance", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Distance::getPlugCategory() {return kPlugCategEffect;} + +bool Distance::getProductString(char* text) { + vst_strncpy (text, "airwindows Distance", kVstMaxProductStrLen); return true; +} + +bool Distance::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Distance/Distance.h b/plugins/WinVST/Distance/Distance.h new file mode 100755 index 0000000..52ecc14 --- /dev/null +++ b/plugins/WinVST/Distance/Distance.h @@ -0,0 +1,81 @@ +/* ======================================== + * Distance - Distance.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Distance_H +#define __Distance_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dist'; //Change this to what the AU identity is! + +class Distance : + public AudioEffectX +{ +public: + Distance(audioMasterCallback audioMaster); + ~Distance(); + 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 lastclampL; + double clampL; + double changeL; + double thirdresultL; + double prevresultL; + double lastL; + + double lastclampR; + double clampR; + double changeR; + double thirdresultR; + double prevresultR; + double lastR; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Distance/DistanceProc.cpp b/plugins/WinVST/Distance/DistanceProc.cpp new file mode 100755 index 0000000..bdf3c13 --- /dev/null +++ b/plugins/WinVST/Distance/DistanceProc.cpp @@ -0,0 +1,306 @@ +/* ======================================== + * Distance - Distance.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Distance_H +#include "Distance.h" +#endif + +void Distance::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 softslew = (pow(A*2.0,3.0)*12.0)+0.6; + softslew *= overallscale; + double filtercorrect = softslew / 2.0; + double thirdfilter = softslew / 3.0; + double levelcorrect = 1.0 + (softslew / 6.0); + double postfilter; + double wet = B; + double dry = 1.0-wet; + double bridgerectifier; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= softslew; + lastclampL = clampL; + clampL = inputSampleL - lastL; + postfilter = changeL = fabs(clampL - lastclampL); + postfilter += filtercorrect; + if (changeL > 1.5707963267949) changeL = 1.5707963267949; + bridgerectifier = (1.0-sin(changeL)); + if (bridgerectifier < 0.0) bridgerectifier = 0.0; + inputSampleL = lastL + (clampL * bridgerectifier); + lastL = inputSampleL; + inputSampleL /= softslew; + inputSampleL += (thirdresultL * thirdfilter); + inputSampleL /= (thirdfilter + 1.0); + inputSampleL += (prevresultL * postfilter); + inputSampleL /= (postfilter + 1.0); + //do an IIR like thing to further squish superdistant stuff + thirdresultL = prevresultL; + prevresultL = inputSampleL; + inputSampleL *= levelcorrect; + + inputSampleR *= softslew; + lastclampR = clampR; + clampR = inputSampleR - lastR; + postfilter = changeR = fabs(clampR - lastclampR); + postfilter += filtercorrect; + if (changeR > 1.5707963267949) changeR = 1.5707963267949; + bridgerectifier = (1.0-sin(changeR)); + if (bridgerectifier < 0.0) bridgerectifier = 0.0; + inputSampleR = lastR + (clampR * bridgerectifier); + lastR = inputSampleR; + inputSampleR /= softslew; + inputSampleR += (thirdresultR * thirdfilter); + inputSampleR /= (thirdfilter + 1.0); + inputSampleR += (prevresultR * postfilter); + inputSampleR /= (postfilter + 1.0); + //do an IIR like thing to further squish superdistant stuff + thirdresultR = prevresultR; + prevresultR = inputSampleR; + inputSampleR *= levelcorrect; + + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + + //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 Distance::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 softslew = (pow(A*2.0,3.0)*12.0)+0.6; + softslew *= overallscale; + double filtercorrect = softslew / 2.0; + double thirdfilter = softslew / 3.0; + double levelcorrect = 1.0 + (softslew / 6.0); + double postfilter; + double wet = B; + double dry = 1.0-wet; + double bridgerectifier; + + 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 drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= softslew; + lastclampL = clampL; + clampL = inputSampleL - lastL; + postfilter = changeL = fabs(clampL - lastclampL); + postfilter += filtercorrect; + if (changeL > 1.5707963267949) changeL = 1.5707963267949; + bridgerectifier = (1.0-sin(changeL)); + if (bridgerectifier < 0.0) bridgerectifier = 0.0; + inputSampleL = lastL + (clampL * bridgerectifier); + lastL = inputSampleL; + inputSampleL /= softslew; + inputSampleL += (thirdresultL * thirdfilter); + inputSampleL /= (thirdfilter + 1.0); + inputSampleL += (prevresultL * postfilter); + inputSampleL /= (postfilter + 1.0); + //do an IIR like thing to further squish superdistant stuff + thirdresultL = prevresultL; + prevresultL = inputSampleL; + inputSampleL *= levelcorrect; + + inputSampleR *= softslew; + lastclampR = clampR; + clampR = inputSampleR - lastR; + postfilter = changeR = fabs(clampR - lastclampR); + postfilter += filtercorrect; + if (changeR > 1.5707963267949) changeR = 1.5707963267949; + bridgerectifier = (1.0-sin(changeR)); + if (bridgerectifier < 0.0) bridgerectifier = 0.0; + inputSampleR = lastR + (clampR * bridgerectifier); + lastR = inputSampleR; + inputSampleR /= softslew; + inputSampleR += (thirdresultR * thirdfilter); + inputSampleR /= (thirdfilter + 1.0); + inputSampleR += (prevresultR * postfilter); + inputSampleR /= (postfilter + 1.0); + //do an IIR like thing to further squish superdistant stuff + thirdresultR = prevresultR; + prevresultR = inputSampleR; + inputSampleR *= levelcorrect; + + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + + //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/Distance/VSTProject.sln b/plugins/WinVST/Distance/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Distance/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/Distance/VSTProject.vcxproj b/plugins/WinVST/Distance/VSTProject.vcxproj new file mode 100755 index 0000000..eb8b379 --- /dev/null +++ b/plugins/WinVST/Distance/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Distance.cpp" />
+ <ClCompile Include="DistanceProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Distance.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Distance64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Distance/VSTProject.vcxproj.filters b/plugins/WinVST/Distance/VSTProject.vcxproj.filters new file mode 100755 index 0000000..f7e300a --- /dev/null +++ b/plugins/WinVST/Distance/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Distance.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DistanceProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Distance.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Distance/VSTProject.vcxproj.user b/plugins/WinVST/Distance/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Distance/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Distance/vstplug.def b/plugins/WinVST/Distance/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Distance/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Drive/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Drive/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Drive/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Drive/.vs/VSTProject/v14/.suo b/plugins/WinVST/Drive/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..da1c31d --- /dev/null +++ b/plugins/WinVST/Drive/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Drive/Drive.cpp b/plugins/WinVST/Drive/Drive.cpp new file mode 100755 index 0000000..35d0594 --- /dev/null +++ b/plugins/WinVST/Drive/Drive.cpp @@ -0,0 +1,151 @@ +/* ======================================== + * Drive - Drive.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Drive_H +#include "Drive.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Drive(audioMaster);} + +Drive::Drive(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.0; + C = 1.0; + D = 1.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Drive::~Drive() {} +VstInt32 Drive::getVendorVersion () {return 1000;} +void Drive::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Drive::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 Drive::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Drive::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Drive::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 + case kParamC: C = value; break; + case kParamD: D = value; break; //this is the popup, stored as a float + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Drive::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Drive::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Highpass", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Out Level", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Drive::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*100.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Drive::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "%", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the popup + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Drive::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Drive::getEffectName(char* name) { + vst_strncpy(name, "Drive", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Drive::getPlugCategory() {return kPlugCategEffect;} + +bool Drive::getProductString(char* text) { + vst_strncpy (text, "airwindows Drive", kVstMaxProductStrLen); return true; +} + +bool Drive::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Drive/Drive.h b/plugins/WinVST/Drive/Drive.h new file mode 100755 index 0000000..c7039c5 --- /dev/null +++ b/plugins/WinVST/Drive/Drive.h @@ -0,0 +1,76 @@ +/* ======================================== + * Drive - Drive.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Drive_H +#define __Drive_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'driv'; //Change this to what the AU identity is! + +class Drive : + public AudioEffectX +{ +public: + Drive(audioMasterCallback audioMaster); + ~Drive(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/Drive/DriveProc.cpp b/plugins/WinVST/Drive/DriveProc.cpp new file mode 100755 index 0000000..3670e85 --- /dev/null +++ b/plugins/WinVST/Drive/DriveProc.cpp @@ -0,0 +1,312 @@ +/* ======================================== + * Drive - Drive.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Drive_H +#include "Drive.h" +#endif + +void Drive::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 driveone = pow(A*2.0,2); + double iirAmount = pow(B,3)/overallscale; + double output = C; + double wet = D; + double dry = 1.0-wet; + double glitch = 0.60; + double out; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleAL; + iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleBL; + iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleBR; + } + //highpass section + + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + + out = driveone; + while (out > glitch) + { + out -= glitch; + inputSampleL -= (inputSampleL * (fabs(inputSampleL) * glitch) * (fabs(inputSampleL) * glitch) ); + inputSampleL *= (1.0+glitch); + inputSampleR -= (inputSampleR * (fabs(inputSampleR) * glitch) * (fabs(inputSampleR) * glitch) ); + inputSampleR *= (1.0+glitch); + } + //that's taken care of the really high gain stuff + + inputSampleL -= (inputSampleL * (fabs(inputSampleL) * out) * (fabs(inputSampleL) * out) ); + inputSampleL *= (1.0+out); + inputSampleR -= (inputSampleR * (fabs(inputSampleR) * out) * (fabs(inputSampleR) * out) ); + inputSampleR *= (1.0+out); + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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 Drive::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 driveone = pow(A*2.0,2); + double iirAmount = pow(B,3)/overallscale; + double output = C; + double wet = D; + double dry = 1.0-wet; + double glitch = 0.60; + double out; + + 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 drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleAL; + iirSampleAR = (iirSampleAR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1.0 - iirAmount)) + (inputSampleL * iirAmount); + inputSampleL -= iirSampleBL; + iirSampleBR = (iirSampleBR * (1.0 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleR -= iirSampleBR; + } + //highpass section + + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + + out = driveone; + while (out > glitch) + { + out -= glitch; + inputSampleL -= (inputSampleL * (fabs(inputSampleL) * glitch) * (fabs(inputSampleL) * glitch) ); + inputSampleL *= (1.0+glitch); + inputSampleR -= (inputSampleR * (fabs(inputSampleR) * glitch) * (fabs(inputSampleR) * glitch) ); + inputSampleR *= (1.0+glitch); + } + //that's taken care of the really high gain stuff + + inputSampleL -= (inputSampleL * (fabs(inputSampleL) * out) * (fabs(inputSampleL) * out) ); + inputSampleL *= (1.0+out); + inputSampleR -= (inputSampleR * (fabs(inputSampleR) * out) * (fabs(inputSampleR) * out) ); + inputSampleR *= (1.0+out); + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/Drive/VSTProject.sln b/plugins/WinVST/Drive/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Drive/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/Drive/VSTProject.vcxproj b/plugins/WinVST/Drive/VSTProject.vcxproj new file mode 100755 index 0000000..8e1bb55 --- /dev/null +++ b/plugins/WinVST/Drive/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Drive.cpp" />
+ <ClCompile Include="DriveProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Drive.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Drive64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Drive/VSTProject.vcxproj.filters b/plugins/WinVST/Drive/VSTProject.vcxproj.filters new file mode 100755 index 0000000..9a3a913 --- /dev/null +++ b/plugins/WinVST/Drive/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Drive.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DriveProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Drive.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Drive/VSTProject.vcxproj.user b/plugins/WinVST/Drive/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Drive/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Drive/vstplug.def b/plugins/WinVST/Drive/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Drive/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/DustBunny/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/DustBunny/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/DustBunny/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/DustBunny/.vs/VSTProject/v14/.suo b/plugins/WinVST/DustBunny/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..03ccec9 --- /dev/null +++ b/plugins/WinVST/DustBunny/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/DustBunny/DustBunny.cpp b/plugins/WinVST/DustBunny/DustBunny.cpp new file mode 100755 index 0000000..aba4a80 --- /dev/null +++ b/plugins/WinVST/DustBunny/DustBunny.cpp @@ -0,0 +1,131 @@ +/* ======================================== + * DustBunny - DustBunny.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DustBunny_H +#include "DustBunny.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new DustBunny(audioMaster);} + +DustBunny::DustBunny(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + + LataLast3Sample = LataLast2Sample = LataLast1Sample = 0.0; + LataHalfwaySample = LataHalfDrySample = LataHalfDiffSample = 0.0; + LataA = LataB = LataC = LataDrySample = LataDiffSample = LataPrevDiffSample = 0.0; + LataUpsampleHighTweak = 0.0414213562373095048801688; //more adds treble to upsampling + LataDecay = 0.915965594177219015; //Catalan's constant, more adds focus and clarity + + RataLast3Sample = RataLast2Sample = RataLast1Sample = 0.0; + RataHalfwaySample = RataHalfDrySample = RataHalfDiffSample = 0.0; + RataA = RataB = RataC = RataDrySample = RataDiffSample = RataPrevDiffSample = 0.0; + RataUpsampleHighTweak = 0.0414213562373095048801688; //more adds treble to upsampling + RataDecay = 0.915965594177219015; //CRatalan's constant, more adds focus and clarity + LataFlip = false; //end reset of antialias parameters + RataFlip = false; //end reset of antialias parameters + //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 +} + +DustBunny::~DustBunny() {} +VstInt32 DustBunny::getVendorVersion () {return 1000;} +void DustBunny::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void DustBunny::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 DustBunny::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 DustBunny::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 DustBunny::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float DustBunny::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 DustBunny::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Bunny", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void DustBunny::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void DustBunny::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 DustBunny::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool DustBunny::getEffectName(char* name) { + vst_strncpy(name, "DustBunny", kVstMaxProductStrLen); return true; +} + +VstPlugCategory DustBunny::getPlugCategory() {return kPlugCategEffect;} + +bool DustBunny::getProductString(char* text) { + vst_strncpy (text, "airwindows DustBunny", kVstMaxProductStrLen); return true; +} + +bool DustBunny::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/DustBunny/DustBunny.h b/plugins/WinVST/DustBunny/DustBunny.h new file mode 100755 index 0000000..0e75e78 --- /dev/null +++ b/plugins/WinVST/DustBunny/DustBunny.h @@ -0,0 +1,91 @@ +/* ======================================== + * DustBunny - DustBunny.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __DustBunny_H +#define __DustBunny_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'dbny'; //Change this to what the AU identity is! + +class DustBunny : + public AudioEffectX +{ +public: + DustBunny(audioMasterCallback audioMaster); + ~DustBunny(); + 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; + + float LataLast3Sample; + float LataLast2Sample; + float LataLast1Sample; + float LataHalfwaySample; + float LataHalfDrySample; + float LataHalfDiffSample; + float LataA; + float LataB; + float LataC; + float LataDecay; + float LataUpsampleHighTweak; + float LataDrySample; + float LataDiffSample; + float LataPrevDiffSample; + + float RataLast3Sample; + float RataLast2Sample; + float RataLast1Sample; + float RataHalfwaySample; + float RataHalfDrySample; + float RataHalfDiffSample; + float RataA; + float RataB; + float RataC; + float RataDecay; + float RataUpsampleHighTweak; + float RataDrySample; + float RataDiffSample; + float RataPrevDiffSample; + + bool LataFlip; //end defining of antialiasing variables + bool RataFlip; //end defining of antialiasing variables + + float A; +}; + +#endif diff --git a/plugins/WinVST/DustBunny/DustBunnyProc.cpp b/plugins/WinVST/DustBunny/DustBunnyProc.cpp new file mode 100755 index 0000000..27a8d66 --- /dev/null +++ b/plugins/WinVST/DustBunny/DustBunnyProc.cpp @@ -0,0 +1,262 @@ +/* ======================================== + * DustBunny - DustBunny.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __DustBunny_H +#include "DustBunny.h" +#endif + +void DustBunny::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); + bunny = (bunny*bunny); + + float inputSampleL; + float inputSampleR; + + while (--sampleFrames >= 0) + { + inputSampleL = *in1; + inputSampleR = *in2; + //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. + 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. + } + LataDrySample = inputSampleL; + RataDrySample = inputSampleR; + + LataHalfDrySample = LataHalfwaySample = (inputSampleL + LataLast1Sample + ((-LataLast2Sample + LataLast3Sample) * LataUpsampleHighTweak)) / 2.0; + LataLast3Sample = LataLast2Sample; LataLast2Sample = LataLast1Sample; LataLast1Sample = inputSampleL; + //setting up oversampled special antialiasing + //begin first half- change inputSample -> LataHalfwaySample, LataDrySample -> LataHalfDrySample + + if (((*(unsigned int*)&LataHalfwaySample)&bunny)==0) LataHalfwaySample=0.0; + + //end first half + //begin antialiasing section for halfway sample + LataC = LataHalfwaySample - LataHalfDrySample; + if (LataFlip) {LataA *= LataDecay; LataB *= LataDecay; LataA += LataC; LataB -= LataC; LataC = LataA;} + else {LataB *= LataDecay; LataA *= LataDecay; LataB += LataC; LataA -= LataC; LataC = LataB;} + LataHalfDiffSample = (LataC * LataDecay); LataFlip = !LataFlip; + //end antialiasing section for halfway sample + //begin second half- inputSample and LataDrySample handled separately here + + if (((*(unsigned int*)&inputSampleL)&bunny)==0) inputSampleL=0.0; + + //end second half + //begin antialiasing section for input sample + LataC = inputSampleL - LataDrySample; + if (LataFlip) {LataA *= LataDecay; LataB *= LataDecay; LataA += LataC; LataB -= LataC; LataC = LataA;} + else {LataB *= LataDecay; LataA *= LataDecay; LataB += LataC; LataA -= LataC; LataC = LataB;} + LataDiffSample = (LataC * LataDecay); LataFlip = !LataFlip; + //end antialiasing section for input sample + inputSampleL = LataDrySample; inputSampleL += ((LataDiffSample + LataHalfDiffSample + LataPrevDiffSample) / 2.5); + LataPrevDiffSample = LataDiffSample / 2.0; + //apply processing as difference to non-oversampled raw input + + RataHalfDrySample = RataHalfwaySample = (inputSampleR + RataLast1Sample + ((-RataLast2Sample + RataLast3Sample) * RataUpsampleHighTweak)) / 2.0; + RataLast3Sample = RataLast2Sample; RataLast2Sample = RataLast1Sample; RataLast1Sample = inputSampleR; + //setting up oversampled special antialiasing + //begin first half- change inputSample -> RataHalfwaySample, RataDrySample -> RataHalfDrySample + + if (((*(unsigned int*)&RataHalfwaySample)&bunny)==0) RataHalfwaySample=0.0; + + //end first half + //begin antialiasing section for halfway sample + RataC = RataHalfwaySample - RataHalfDrySample; + if (RataFlip) {RataA *= RataDecay; RataB *= RataDecay; RataA += RataC; RataB -= RataC; RataC = RataA;} + else {RataB *= RataDecay; RataA *= RataDecay; RataB += RataC; RataA -= RataC; RataC = RataB;} + RataHalfDiffSample = (RataC * RataDecay); RataFlip = !RataFlip; + //end antialiasing section for halfway sample + //begin second half- inputSample and RataDrySample handled separately here + + if (((*(unsigned int*)&inputSampleR)&bunny)==0) inputSampleR=0.0; + + //end second half + //begin antialiasing section for input sample + RataC = inputSampleR - RataDrySample; + if (RataFlip) {RataA *= RataDecay; RataB *= RataDecay; RataA += RataC; RataB -= RataC; RataC = RataA;} + else {RataB *= RataDecay; RataA *= RataDecay; RataB += RataC; RataA -= RataC; RataC = RataB;} + RataDiffSample = (RataC * RataDecay); RataFlip = !RataFlip; + //end antialiasing section for input sample + inputSampleR = RataDrySample; inputSampleR += ((RataDiffSample + RataHalfDiffSample + RataPrevDiffSample) / 2.5); + RataPrevDiffSample = RataDiffSample / 2.0; + //apply processing as difference to non-oversampled raw input + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void DustBunny::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + unsigned int bunny = (unsigned int)(pow((1.255-A),5)*1000); + bunny = (bunny*bunny); + + long double inputSampleL; + long double inputSampleR; + + while (--sampleFrames >= 0) + { + inputSampleL = *in1; + inputSampleR = *in2; + //note: this algorithm does goofy stuff with bit masks, so the 64-bit buss will use floats for processing to produce the same output. + 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. + } + LataDrySample = inputSampleL; + RataDrySample = inputSampleR; + + LataHalfDrySample = LataHalfwaySample = (inputSampleL + LataLast1Sample + ((-LataLast2Sample + LataLast3Sample) * LataUpsampleHighTweak)) / 2.0; + LataLast3Sample = LataLast2Sample; LataLast2Sample = LataLast1Sample; LataLast1Sample = inputSampleL; + //setting up oversampled special antialiasing + //begin first half- change inputSample -> LataHalfwaySample, LataDrySample -> LataHalfDrySample + + if (((*(unsigned int*)&LataHalfwaySample)&bunny)==0) LataHalfwaySample=0.0; + + //end first half + //begin antialiasing section for halfway sample + LataC = LataHalfwaySample - LataHalfDrySample; + if (LataFlip) {LataA *= LataDecay; LataB *= LataDecay; LataA += LataC; LataB -= LataC; LataC = LataA;} + else {LataB *= LataDecay; LataA *= LataDecay; LataB += LataC; LataA -= LataC; LataC = LataB;} + LataHalfDiffSample = (LataC * LataDecay); LataFlip = !LataFlip; + //end antialiasing section for halfway sample + //begin second half- inputSample and LataDrySample handled separately here + + if (((*(unsigned int*)&inputSampleL)&bunny)==0) inputSampleL=0.0; + + //end second half + //begin antialiasing section for input sample + LataC = inputSampleL - LataDrySample; + if (LataFlip) {LataA *= LataDecay; LataB *= LataDecay; LataA += LataC; LataB -= LataC; LataC = LataA;} + else {LataB *= LataDecay; LataA *= LataDecay; LataB += LataC; LataA -= LataC; LataC = LataB;} + LataDiffSample = (LataC * LataDecay); LataFlip = !LataFlip; + //end antialiasing section for input sample + inputSampleL = LataDrySample; inputSampleL += ((LataDiffSample + LataHalfDiffSample + LataPrevDiffSample) / 0.734); + LataPrevDiffSample = LataDiffSample / 2.0; + //apply processing as difference to non-oversampled raw input + + RataHalfDrySample = RataHalfwaySample = (inputSampleR + RataLast1Sample + ((-RataLast2Sample + RataLast3Sample) * RataUpsampleHighTweak)) / 2.0; + RataLast3Sample = RataLast2Sample; RataLast2Sample = RataLast1Sample; RataLast1Sample = inputSampleR; + //setting up oversampled special antialiasing + //begin first half- change inputSample -> RataHalfwaySample, RataDrySample -> RataHalfDrySample + + if (((*(unsigned int*)&RataHalfwaySample)&bunny)==0) RataHalfwaySample=0.0; + + //end first half + //begin antialiasing section for halfway sample + RataC = RataHalfwaySample - RataHalfDrySample; + if (RataFlip) {RataA *= RataDecay; RataB *= RataDecay; RataA += RataC; RataB -= RataC; RataC = RataA;} + else {RataB *= RataDecay; RataA *= RataDecay; RataB += RataC; RataA -= RataC; RataC = RataB;} + RataHalfDiffSample = (RataC * RataDecay); RataFlip = !RataFlip; + //end antialiasing section for halfway sample + //begin second half- inputSample and RataDrySample handled separately here + + if (((*(unsigned int*)&inputSampleR)&bunny)==0) inputSampleR=0.0; + + //end second half + //begin antialiasing section for input sample + RataC = inputSampleR - RataDrySample; + if (RataFlip) {RataA *= RataDecay; RataB *= RataDecay; RataA += RataC; RataB -= RataC; RataC = RataA;} + else {RataB *= RataDecay; RataA *= RataDecay; RataB += RataC; RataA -= RataC; RataC = RataB;} + RataDiffSample = (RataC * RataDecay); RataFlip = !RataFlip; + //end antialiasing section for input sample + inputSampleR = RataDrySample; inputSampleR += ((RataDiffSample + RataHalfDiffSample + RataPrevDiffSample) / 0.734); + RataPrevDiffSample = RataDiffSample / 2.0; + //apply processing as difference to non-oversampled raw input + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/DustBunny/VSTProject.sln b/plugins/WinVST/DustBunny/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/DustBunny/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/DustBunny/VSTProject.vcxproj b/plugins/WinVST/DustBunny/VSTProject.vcxproj new file mode 100755 index 0000000..b2130b2 --- /dev/null +++ b/plugins/WinVST/DustBunny/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="DustBunny.cpp" />
+ <ClCompile Include="DustBunnyProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="DustBunny.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>DustBunny64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DustBunny/VSTProject.vcxproj.filters b/plugins/WinVST/DustBunny/VSTProject.vcxproj.filters new file mode 100755 index 0000000..b78c869 --- /dev/null +++ b/plugins/WinVST/DustBunny/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DustBunny.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="DustBunnyProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="DustBunny.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DustBunny/VSTProject.vcxproj.user b/plugins/WinVST/DustBunny/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/DustBunny/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/DustBunny/vstplug.def b/plugins/WinVST/DustBunny/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/DustBunny/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/EdIsDim/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/EdIsDim/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/EdIsDim/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/EdIsDim/.vs/VSTProject/v14/.suo b/plugins/WinVST/EdIsDim/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..d170019 --- /dev/null +++ b/plugins/WinVST/EdIsDim/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/EdIsDim/EdIsDim.cpp b/plugins/WinVST/EdIsDim/EdIsDim.cpp new file mode 100755 index 0000000..6af5dd4 --- /dev/null +++ b/plugins/WinVST/EdIsDim/EdIsDim.cpp @@ -0,0 +1,122 @@ +/* ======================================== + * EdIsDim - EdIsDim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __EdIsDim_H +#include "EdIsDim.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new EdIsDim(audioMaster);} + +EdIsDim::EdIsDim(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +EdIsDim::~EdIsDim() {} +VstInt32 EdIsDim::getVendorVersion () {return 1000;} +void EdIsDim::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void EdIsDim::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 EdIsDim::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 EdIsDim::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 EdIsDim::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float EdIsDim::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 EdIsDim::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "ediS/diM", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void EdIsDim::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void EdIsDim::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 EdIsDim::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool EdIsDim::getEffectName(char* name) { + vst_strncpy(name, "EdIsDim", kVstMaxProductStrLen); return true; +} + +VstPlugCategory EdIsDim::getPlugCategory() {return kPlugCategEffect;} + +bool EdIsDim::getProductString(char* text) { + vst_strncpy (text, "airwindows EdIsDim", kVstMaxProductStrLen); return true; +} + +bool EdIsDim::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/EdIsDim/EdIsDim.h b/plugins/WinVST/EdIsDim/EdIsDim.h new file mode 100755 index 0000000..8c51883 --- /dev/null +++ b/plugins/WinVST/EdIsDim/EdIsDim.h @@ -0,0 +1,65 @@ +/* ======================================== + * EdIsDim - EdIsDim.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __EdIsDim_H +#define __EdIsDim_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'eddm'; //Change this to what the AU identity is! + +class EdIsDim : + public AudioEffectX +{ +public: + EdIsDim(audioMasterCallback audioMaster); + ~EdIsDim(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; +}; + +#endif diff --git a/plugins/WinVST/EdIsDim/EdIsDimProc.cpp b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp new file mode 100755 index 0000000..8ee927d --- /dev/null +++ b/plugins/WinVST/EdIsDim/EdIsDimProc.cpp @@ -0,0 +1,205 @@ +/* ======================================== + * EdIsDim - EdIsDim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __EdIsDim_H +#include "EdIsDim.h" +#endif + +void EdIsDim::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double mid; + long double side; + + double midgain = A * 2.0; + double sidegain = 2.0 - midgain; + + 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. + } + + inputSampleL *= midgain; + inputSampleR *= sidegain; + + mid = (inputSampleL+inputSampleR)/2.0; + side = (inputSampleL-inputSampleR)/2.0; + + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = mid; + fpNShapeLA = (fpNShapeLA*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLA; + fpTemp = side; + fpNShapeRA = (fpNShapeRA*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRA; + } + else { + fpTemp = mid; + fpNShapeLB = (fpNShapeLB*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLB; + fpTemp = side; + fpNShapeRB = (fpNShapeRB*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = mid; + *out2 = side; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void EdIsDim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + 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 mid; + long double side; + + double midgain = A * 2.0; + double sidegain = 2.0 - midgain; + + 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. + } + + + inputSampleL *= midgain; + inputSampleR *= sidegain; + + mid = (inputSampleL+inputSampleR)/2.0; + side = (inputSampleL-inputSampleR)/2.0; + + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = mid; + fpNShapeLA = (fpNShapeLA*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLA; + fpTemp = side; + fpNShapeRA = (fpNShapeRA*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRA; + } + else { + fpTemp = mid; + fpNShapeLB = (fpNShapeLB*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLB; + fpTemp = side; + fpNShapeRB = (fpNShapeRB*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 64 bit output + + *out1 = mid; + *out2 = side; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/EdIsDim/VSTProject.sln b/plugins/WinVST/EdIsDim/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/EdIsDim/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/EdIsDim/VSTProject.vcxproj b/plugins/WinVST/EdIsDim/VSTProject.vcxproj new file mode 100755 index 0000000..85893ac --- /dev/null +++ b/plugins/WinVST/EdIsDim/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="EdIsDim.cpp" />
+ <ClCompile Include="EdIsDimProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="EdIsDim.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>EdIsDim64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EdIsDim/VSTProject.vcxproj.filters b/plugins/WinVST/EdIsDim/VSTProject.vcxproj.filters new file mode 100755 index 0000000..d1478bc --- /dev/null +++ b/plugins/WinVST/EdIsDim/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EdIsDim.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EdIsDimProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="EdIsDim.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EdIsDim/VSTProject.vcxproj.user b/plugins/WinVST/EdIsDim/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/EdIsDim/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EdIsDim/vstplug.def b/plugins/WinVST/EdIsDim/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/EdIsDim/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Ensemble/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Ensemble/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Ensemble/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Ensemble/.vs/VSTProject/v14/.suo b/plugins/WinVST/Ensemble/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..6022e68 --- /dev/null +++ b/plugins/WinVST/Ensemble/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Ensemble/Ensemble.cpp b/plugins/WinVST/Ensemble/Ensemble.cpp new file mode 100755 index 0000000..be624b2 --- /dev/null +++ b/plugins/WinVST/Ensemble/Ensemble.cpp @@ -0,0 +1,159 @@ +/* ======================================== + * Ensemble - Ensemble.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Ensemble_H +#include "Ensemble.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Ensemble(audioMaster);} + +Ensemble::Ensemble(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.0; + C = 1.0; + D = 1.0; + + for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0; dR[count] = 0;} + for(int count = 0; count < 49; count++) {sweep[count] = 3.141592653589793238 / 2.0;} + gcount = 0; + airPrevL = 0.0; + airEvenL = 0.0; + airOddL = 0.0; + airFactorL = 0.0; + airPrevR = 0.0; + airEvenR = 0.0; + airOddR = 0.0; + airFactorR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Ensemble::~Ensemble() {} +VstInt32 Ensemble::getVendorVersion () {return 1000;} +void Ensemble::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Ensemble::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 Ensemble::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Ensemble::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Ensemble::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Ensemble::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Ensemble::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Ensemble", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Fullness", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Brighten", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Ensemble::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (floor((A*46.0)+2.9), text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Ensemble::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "vox", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Ensemble::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Ensemble::getEffectName(char* name) { + vst_strncpy(name, "Ensemble", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Ensemble::getPlugCategory() {return kPlugCategEffect;} + +bool Ensemble::getProductString(char* text) { + vst_strncpy (text, "airwindows Ensemble", kVstMaxProductStrLen); return true; +} + +bool Ensemble::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Ensemble/Ensemble.h b/plugins/WinVST/Ensemble/Ensemble.h new file mode 100755 index 0000000..32ba8c0 --- /dev/null +++ b/plugins/WinVST/Ensemble/Ensemble.h @@ -0,0 +1,85 @@ +/* ======================================== + * Ensemble - Ensemble.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Ensemble_H +#define __Ensemble_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'ensm'; //Change this to what the AU identity is! + +class Ensemble : + public AudioEffectX +{ +public: + Ensemble(audioMasterCallback audioMaster); + ~Ensemble(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + const static int totalsamples = 65540; + float dL[totalsamples]; + float dR[totalsamples]; + double sweep[49]; + int gcount; + double airPrevL; + double airEvenL; + double airOddL; + double airFactorL; + double airPrevR; + double airEvenR; + double airOddR; + double airFactorR; + + float A; + float B; + float C; + float D; + +}; + +#endif diff --git a/plugins/WinVST/Ensemble/EnsembleProc.cpp b/plugins/WinVST/Ensemble/EnsembleProc.cpp new file mode 100755 index 0000000..679e868 --- /dev/null +++ b/plugins/WinVST/Ensemble/EnsembleProc.cpp @@ -0,0 +1,364 @@ +/* ======================================== + * Ensemble - Ensemble.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Ensemble_H +#include "Ensemble.h" +#endif + +void Ensemble::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 spd = pow(0.4+(B/12),10); + spd *= overallscale; + double depth = 0.002 / spd; + double tupi = 3.141592653589793238 * 2.0; + double taps = floor((A*46.0)+2.9); + double brighten = C; + double wet = D; + double dry = 1.0 - wet; + double hapi = 3.141592653589793238 / taps; + double offset; + double floffset; + double start[49]; + double sinoffset[49]; + double speed[49]; + int count; + int ensemble; + double tempL; + double tempR; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + //now we'll precalculate some stuff that needn't be in every sample + + for(count = 1; count <= taps; count++) + { + start[count] = depth * count; + sinoffset[count] = hapi * (count-1); + speed[count] = spd / (1 + (count/taps)); + } + //that's for speeding up things in the sample-processing area + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*brighten); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*brighten); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > 32767) {gcount = 32767;} + count = gcount; + dL[count+32767] = dL[count] = tempL = inputSampleL; + dR[count+32767] = dR[count] = tempR = inputSampleR; + //double buffer + + for(ensemble = 1; ensemble <= taps; ensemble++) + { + offset = start[ensemble] + (depth * sin(sweep[ensemble]+sinoffset[ensemble])); + floffset = offset-floor(offset); + count = gcount + (int)floor(offset); + + tempL += dL[count] * (1-floffset); //less as value moves away from .0 + tempL += dL[count+1]; //we can assume always using this in one way or another? + tempL += dL[count+2] * floffset; //greater as value moves away from .0 + tempL -= ((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50; //interpolation hacks 'r us + + tempR += dR[count] * (1-floffset); //less as value moves away from .0 + tempR += dR[count+1]; //we can assume always using this in one way or another? + tempR += dR[count+2] * floffset; //greater as value moves away from .0 + tempR -= ((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50; //interpolation hacks 'r us + + sweep[ensemble] += speed[ensemble]; + if (sweep[ensemble] > tupi){sweep[ensemble] -= tupi;} + } + gcount--; + //still scrolling through the samples, remember + + inputSampleL = tempL/(4.0*sqrt(taps)); + inputSampleR = tempR/(4.0*sqrt(taps)); + + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 Ensemble::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 spd = pow(0.4+(B/12),10); + spd *= overallscale; + double depth = 0.002 / spd; + double tupi = 3.141592653589793238 * 2.0; + double taps = floor((A*46.0)+2.9); + double brighten = C; + double wet = D; + double dry = 1.0 - wet; + double hapi = 3.141592653589793238 / taps; + double offset; + double floffset; + double start[49]; + double sinoffset[49]; + double speed[49]; + int count; + int ensemble; + double tempL; + double tempR; + + 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; + double drySampleL; + double drySampleR; + //now we'll precalculate some stuff that needn't be in every sample + + for(count = 1; count <= taps; count++) + { + start[count] = depth * count; + sinoffset[count] = hapi * (count-1); + speed[count] = spd / (1 + (count/taps)); + } + //that's for speeding up things in the sample-processing area + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + airFactorL = airPrevL - inputSampleL; + if (fpFlip) {airEvenL += airFactorL; airOddL -= airFactorL; airFactorL = airEvenL;} + else {airOddL += airFactorL; airEvenL -= airFactorL; airFactorL = airOddL;} + airOddL = (airOddL - ((airOddL - airEvenL)/256.0)) / 1.0001; + airEvenL = (airEvenL - ((airEvenL - airOddL)/256.0)) / 1.0001; + airPrevL = inputSampleL; + inputSampleL += (airFactorL*brighten); + //air, compensates for loss of highs in flanger's interpolation + + airFactorR = airPrevR - inputSampleR; + if (fpFlip) {airEvenR += airFactorR; airOddR -= airFactorR; airFactorR = airEvenR;} + else {airOddR += airFactorR; airEvenR -= airFactorR; airFactorR = airOddR;} + airOddR = (airOddR - ((airOddR - airEvenR)/256.0)) / 1.0001; + airEvenR = (airEvenR - ((airEvenR - airOddR)/256.0)) / 1.0001; + airPrevR = inputSampleR; + inputSampleR += (airFactorR*brighten); + //air, compensates for loss of highs in flanger's interpolation + + if (gcount < 1 || gcount > 32767) {gcount = 32767;} + count = gcount; + dL[count+32767] = dL[count] = tempL = inputSampleL; + dR[count+32767] = dR[count] = tempR = inputSampleR; + //double buffer + + for(ensemble = 1; ensemble <= taps; ensemble++) + { + offset = start[ensemble] + (depth * sin(sweep[ensemble]+sinoffset[ensemble])); + floffset = offset-floor(offset); + count = gcount + (int)floor(offset); + + tempL += dL[count] * (1-floffset); //less as value moves away from .0 + tempL += dL[count+1]; //we can assume always using this in one way or another? + tempL += dL[count+2] * floffset; //greater as value moves away from .0 + tempL -= ((dL[count]-dL[count+1])-(dL[count+1]-dL[count+2]))/50; //interpolation hacks 'r us + + tempR += dR[count] * (1-floffset); //less as value moves away from .0 + tempR += dR[count+1]; //we can assume always using this in one way or another? + tempR += dR[count+2] * floffset; //greater as value moves away from .0 + tempR -= ((dR[count]-dR[count+1])-(dR[count+1]-dR[count+2]))/50; //interpolation hacks 'r us + + sweep[ensemble] += speed[ensemble]; + if (sweep[ensemble] > tupi){sweep[ensemble] -= tupi;} + } + gcount--; + //still scrolling through the samples, remember + + inputSampleL = tempL/(4.0*sqrt(taps)); + inputSampleR = tempR/(4.0*sqrt(taps)); + + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/Ensemble/VSTProject.sln b/plugins/WinVST/Ensemble/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Ensemble/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/Ensemble/VSTProject.vcxproj b/plugins/WinVST/Ensemble/VSTProject.vcxproj new file mode 100755 index 0000000..68c0f70 --- /dev/null +++ b/plugins/WinVST/Ensemble/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Ensemble.cpp" />
+ <ClCompile Include="EnsembleProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Ensemble.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Ensemble64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Ensemble/VSTProject.vcxproj.filters b/plugins/WinVST/Ensemble/VSTProject.vcxproj.filters new file mode 100755 index 0000000..8a94e00 --- /dev/null +++ b/plugins/WinVST/Ensemble/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Ensemble.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EnsembleProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Ensemble.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Ensemble/VSTProject.vcxproj.user b/plugins/WinVST/Ensemble/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Ensemble/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Ensemble/vstplug.def b/plugins/WinVST/Ensemble/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Ensemble/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/EveryTrim/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/EveryTrim/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/EveryTrim/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/EveryTrim/.vs/VSTProject/v14/.suo b/plugins/WinVST/EveryTrim/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..649aa5c --- /dev/null +++ b/plugins/WinVST/EveryTrim/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/EveryTrim/EveryTrim.cpp b/plugins/WinVST/EveryTrim/EveryTrim.cpp new file mode 100755 index 0000000..1e81d35 --- /dev/null +++ b/plugins/WinVST/EveryTrim/EveryTrim.cpp @@ -0,0 +1,155 @@ +/* ======================================== + * EveryTrim - EveryTrim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __EveryTrim_H +#include "EveryTrim.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new EveryTrim(audioMaster);} + +EveryTrim::EveryTrim(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + D = 0.5; + E = 0.5; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +EveryTrim::~EveryTrim() {} +VstInt32 EveryTrim::getVendorVersion () {return 1000;} +void EveryTrim::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void EveryTrim::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 EveryTrim::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + /* 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 EveryTrim::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + /* 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 EveryTrim::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float EveryTrim::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; 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 EveryTrim::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Left", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Right", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Mid", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Side", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Master", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void EveryTrim::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string ((D*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamE: float2string ((E*24.0)-12.0, text, kVstMaxParamStrLen); break; + + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void EveryTrim::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 EveryTrim::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool EveryTrim::getEffectName(char* name) { + vst_strncpy(name, "EveryTrim", kVstMaxProductStrLen); return true; +} + +VstPlugCategory EveryTrim::getPlugCategory() {return kPlugCategEffect;} + +bool EveryTrim::getProductString(char* text) { + vst_strncpy (text, "airwindows EveryTrim", kVstMaxProductStrLen); return true; +} + +bool EveryTrim::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/EveryTrim/EveryTrim.h b/plugins/WinVST/EveryTrim/EveryTrim.h new file mode 100755 index 0000000..28d9c27 --- /dev/null +++ b/plugins/WinVST/EveryTrim/EveryTrim.h @@ -0,0 +1,74 @@ +/* ======================================== + * EveryTrim - EveryTrim.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __EveryTrim_H +#define __EveryTrim_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kNumParameters = 5 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'evtr'; //Change this to what the AU identity is! + +class EveryTrim : + public AudioEffectX +{ +public: + EveryTrim(audioMasterCallback audioMaster); + ~EveryTrim(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/EveryTrim/EveryTrimProc.cpp b/plugins/WinVST/EveryTrim/EveryTrimProc.cpp new file mode 100755 index 0000000..30d764f --- /dev/null +++ b/plugins/WinVST/EveryTrim/EveryTrimProc.cpp @@ -0,0 +1,220 @@ +/* ======================================== + * EveryTrim - EveryTrim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __EveryTrim_H +#include "EveryTrim.h" +#endif + +void EveryTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double leftgain = pow(10.0,((A*24.0)-12.0)/20.0); + double rightgain = pow(10.0,((B*24.0)-12.0)/20.0); + double midgain = pow(10.0,((C*24.0)-12.0)/20.0); + double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); + double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; + + long double inputSampleL; + long double inputSampleR; + long double mid; + long double side; + + leftgain *= mastergain; + rightgain *= mastergain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + mid *= midgain; + side *= sidegain; + inputSampleL = (mid+side) * leftgain; + inputSampleR = (mid-side) * rightgain; + //contains mastergain and the gain trim fixing the mid/side + + //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 EveryTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double leftgain = pow(10.0,((A*24.0)-12.0)/20.0); + double rightgain = pow(10.0,((B*24.0)-12.0)/20.0); + double midgain = pow(10.0,((C*24.0)-12.0)/20.0); + double sidegain = pow(10.0,((D*24.0)-12.0)/20.0); + double mastergain = pow(10.0,((E*24.0)-12.0)/20.0) * 0.5; + + long double inputSampleL; + long double inputSampleR; + long double mid; + long double side; + + leftgain *= mastergain; + rightgain *= mastergain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + mid *= midgain; + side *= sidegain; + inputSampleL = (mid+side) * leftgain; + inputSampleR = (mid-side) * rightgain; + //contains mastergain and the gain trim fixing the mid/side + + //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/EveryTrim/VSTProject.sln b/plugins/WinVST/EveryTrim/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/EveryTrim/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/EveryTrim/VSTProject.vcxproj b/plugins/WinVST/EveryTrim/VSTProject.vcxproj new file mode 100755 index 0000000..253b89c --- /dev/null +++ b/plugins/WinVST/EveryTrim/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="EveryTrim.cpp" />
+ <ClCompile Include="EveryTrimProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="EveryTrim.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>EveryTrim64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EveryTrim/VSTProject.vcxproj.filters b/plugins/WinVST/EveryTrim/VSTProject.vcxproj.filters new file mode 100755 index 0000000..337fdc7 --- /dev/null +++ b/plugins/WinVST/EveryTrim/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EveryTrim.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="EveryTrimProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="EveryTrim.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EveryTrim/VSTProject.vcxproj.user b/plugins/WinVST/EveryTrim/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/EveryTrim/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/EveryTrim/vstplug.def b/plugins/WinVST/EveryTrim/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/EveryTrim/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/FathomFive/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/FathomFive/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/FathomFive/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/FathomFive/.vs/VSTProject/v14/.suo b/plugins/WinVST/FathomFive/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..42015e9 --- /dev/null +++ b/plugins/WinVST/FathomFive/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/FathomFive/FathomFive.cpp b/plugins/WinVST/FathomFive/FathomFive.cpp new file mode 100755 index 0000000..8cd3f52 --- /dev/null +++ b/plugins/WinVST/FathomFive/FathomFive.cpp @@ -0,0 +1,170 @@ +/* ======================================== + * FathomFive - FathomFive.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __FathomFive_H +#include "FathomFive.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new FathomFive(audioMaster);} + +FathomFive::FathomFive(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 0.0; + C = 0.5; + D = 1.0; + WasNegativeL = false; + SubOctaveL = false; + iirSampleLA = 0.0; + iirSampleLB = 0.0; + iirSampleLC = 0.0; + iirSampleLD = 0.0; + WasNegativeR = false; + SubOctaveR = false; + iirSampleRA = 0.0; + iirSampleRB = 0.0; + iirSampleRC = 0.0; + iirSampleRD = 0.0; + + + //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 +} + +FathomFive::~FathomFive() {} +VstInt32 FathomFive::getVendorVersion () {return 1000;} +void FathomFive::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void FathomFive::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 FathomFive::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 FathomFive::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 FathomFive::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + 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 FathomFive.h file to do it. +// switch((VstInt32)( D * 3.999 )) +// { +// case 0: fpFlip = true; break; //choice A +// case 1: fpFlip = false; break; //choice B +// case 2: break; //choice C +// case 3: break; //choice D +// default: break; //should not happen +// } + //this relates to using D as a 'popup' and changing things based on that switch. + //we are using fpFlip just because it's already there globally, as an example. +} + +float FathomFive::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 FathomFive::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Root Note", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "SubOctave", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Frequency", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void FathomFive::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void FathomFive::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 FathomFive::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1 : 1; } // 1 = yes, -1 = no, 0 = don't know + +bool FathomFive::getEffectName(char* name) { + vst_strncpy(name, "FathomFive", kVstMaxProductStrLen); return true; +} + +VstPlugCategory FathomFive::getPlugCategory() {return kPlugCategEffect;} + +bool FathomFive::getProductString(char* text) { + vst_strncpy (text, "airwindows FathomFive", kVstMaxProductStrLen); return true; +} + +bool FathomFive::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/FathomFive/FathomFive.h b/plugins/WinVST/FathomFive/FathomFive.h new file mode 100755 index 0000000..51b9f4e --- /dev/null +++ b/plugins/WinVST/FathomFive/FathomFive.h @@ -0,0 +1,79 @@ +/* ======================================== + * FathomFive - FathomFive.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __FathomFive_H +#define __FathomFive_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 1; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'fatm'; //Change this to what the AU identity is! + +class FathomFive : + public AudioEffectX +{ +public: + FathomFive(audioMasterCallback audioMaster); + ~FathomFive(); + 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; + + bool WasNegativeL; + bool SubOctaveL; + double iirSampleLA; + double iirSampleLB; + double iirSampleLC; + double iirSampleLD; + + bool WasNegativeR; + bool SubOctaveR; + double iirSampleRA; + double iirSampleRB; + double iirSampleRC; + double iirSampleRD; + + float A; //Root Note + float B; //SubOctave + float C; //Frequency + float D; //Dry/Wet + //parameters. Always 0-1, and we scale/alter them elsewhere. +}; + +#endif diff --git a/plugins/WinVST/FathomFive/FathomFiveProc.cpp b/plugins/WinVST/FathomFive/FathomFiveProc.cpp new file mode 100755 index 0000000..f509c21 --- /dev/null +++ b/plugins/WinVST/FathomFive/FathomFiveProc.cpp @@ -0,0 +1,244 @@ +/* ======================================== + * FathomFive - FathomFive.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __FathomFive_H +#include "FathomFive.h" +#endif + +void FathomFive::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double EQ = 0.01+((pow(C,4) / getSampleRate())*32000.0); + double dcblock = EQ / 320.0; + double wet = D*2.0; + double dry = 2.0 - wet; + double bridgerectifier; + double tempL; + double tempR; + double basstrim = (0.01/EQ)+1.0; + if (wet > 1.0) wet = 1.0; + if (dry > 1.0) dry = 1.0; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (inputSampleL > 0) + {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} + else {WasNegativeL = true;} + if (inputSampleR > 0) + {if (WasNegativeR){SubOctaveR = !SubOctaveR;} WasNegativeR = false;} + else {WasNegativeR = true;} + + iirSampleLD = (iirSampleLD * (1 - EQ)) + (inputSampleL * EQ); + bridgerectifier = fabs(iirSampleLD); + if (SubOctaveL) tempL = bridgerectifier*B; + else tempL = -bridgerectifier*B; + iirSampleRD = (iirSampleRD * (1 - EQ)) + (inputSampleR * EQ); + bridgerectifier = fabs(iirSampleRD); + if (SubOctaveR) tempR = bridgerectifier*B; + else tempR = -bridgerectifier*B; + + tempL += (inputSampleL*A); + tempR += (inputSampleR*A); + + iirSampleLA += (tempL * EQ); + iirSampleLA -= (iirSampleLA * iirSampleLA * iirSampleLA * EQ); + if (iirSampleLA > 0) iirSampleLA -= dcblock; + else iirSampleLA += dcblock; + tempL = iirSampleLA*basstrim; + + iirSampleRA += (tempR * EQ); + iirSampleRA -= (iirSampleRA * iirSampleRA * iirSampleRA * EQ); + if (iirSampleRA > 0) iirSampleRA -= dcblock; + else iirSampleRA += dcblock; + tempR = iirSampleRA*basstrim; + + iirSampleLB = (iirSampleLB * (1 - EQ)) + (tempL * EQ); + tempL = iirSampleLB; + iirSampleRB = (iirSampleRB * (1 - EQ)) + (tempR * EQ); + tempR = iirSampleRB; + + iirSampleLC = (iirSampleLC * (1 - EQ)) + (tempL * EQ); + tempL = iirSampleLC; + iirSampleRC = (iirSampleRC * (1 - EQ)) + (tempR * EQ); + tempR = iirSampleRC; + + inputSampleL = (inputSampleL*dry) + (tempL*wet); + inputSampleR = (inputSampleR*dry) + (tempR*wet); + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void FathomFive::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double EQ = 0.01+((pow(C,4) / getSampleRate())*32000.0); + double dcblock = EQ / 320.0; + double wet = D*2.0; + double dry = 2.0 - wet; + double bridgerectifier; + double tempL; + double tempR; + double basstrim = (0.01/EQ)+1.0; + if (wet > 1.0) wet = 1.0; + if (dry > 1.0) dry = 1.0; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (inputSampleL > 0) + {if (WasNegativeL){SubOctaveL = !SubOctaveL;} WasNegativeL = false;} + else {WasNegativeL = true;} + if (inputSampleR > 0) + {if (WasNegativeR){SubOctaveR = !SubOctaveR;} WasNegativeR = false;} + else {WasNegativeR = true;} + + iirSampleLD = (iirSampleLD * (1 - EQ)) + (inputSampleL * EQ); + bridgerectifier = fabs(iirSampleLD); + if (SubOctaveL) tempL = bridgerectifier*B; + else tempL = -bridgerectifier*B; + iirSampleRD = (iirSampleRD * (1 - EQ)) + (inputSampleR * EQ); + bridgerectifier = fabs(iirSampleRD); + if (SubOctaveR) tempR = bridgerectifier*B; + else tempR = -bridgerectifier*B; + + tempL += (inputSampleL*A); + tempR += (inputSampleR*A); + + iirSampleLA += (tempL * EQ); + iirSampleLA -= (iirSampleLA * iirSampleLA * iirSampleLA * EQ); + if (iirSampleLA > 0) iirSampleLA -= dcblock; + else iirSampleLA += dcblock; + tempL = iirSampleLA*basstrim; + + iirSampleRA += (tempR * EQ); + iirSampleRA -= (iirSampleRA * iirSampleRA * iirSampleRA * EQ); + if (iirSampleRA > 0) iirSampleRA -= dcblock; + else iirSampleRA += dcblock; + tempR = iirSampleRA*basstrim; + + iirSampleLB = (iirSampleLB * (1 - EQ)) + (tempL * EQ); + tempL = iirSampleLB; + iirSampleRB = (iirSampleRB * (1 - EQ)) + (tempR * EQ); + tempR = iirSampleRB; + + iirSampleLC = (iirSampleLC * (1 - EQ)) + (tempL * EQ); + tempL = iirSampleLC; + iirSampleRC = (iirSampleRC * (1 - EQ)) + (tempR * EQ); + tempR = iirSampleRC; + + inputSampleL = (inputSampleL*dry) + (tempL*wet); + inputSampleR = (inputSampleR*dry) + (tempR*wet); + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/FathomFive/VSTProject.sln b/plugins/WinVST/FathomFive/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/FathomFive/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/FathomFive/VSTProject.vcxproj b/plugins/WinVST/FathomFive/VSTProject.vcxproj new file mode 100755 index 0000000..b32111b --- /dev/null +++ b/plugins/WinVST/FathomFive/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="FathomFive.cpp" />
+ <ClCompile Include="FathomFiveProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="FathomFive.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>FathomFive64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FathomFive/VSTProject.vcxproj.filters b/plugins/WinVST/FathomFive/VSTProject.vcxproj.filters new file mode 100755 index 0000000..3135aa2 --- /dev/null +++ b/plugins/WinVST/FathomFive/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FathomFive.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FathomFiveProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FathomFive.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FathomFive/VSTProject.vcxproj.user b/plugins/WinVST/FathomFive/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/FathomFive/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FathomFive/vstplug.def b/plugins/WinVST/FathomFive/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/FathomFive/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Floor/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Floor/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Floor/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Floor/.vs/VSTProject/v14/.suo b/plugins/WinVST/Floor/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..9ba9265 --- /dev/null +++ b/plugins/WinVST/Floor/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Floor/Floor.cpp b/plugins/WinVST/Floor/Floor.cpp new file mode 100755 index 0000000..ff12e69 --- /dev/null +++ b/plugins/WinVST/Floor/Floor.cpp @@ -0,0 +1,159 @@ +/* ======================================== + * Floor - Floor.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Floor_H +#include "Floor.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Floor(audioMaster);} + +Floor::Floor(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.0; + C = 1.0; + + flip = false; + iirSample1AL = 0.0; + iirSample1BL = 0.0; + iirSample1CL = 0.0; + iirSample1DL = 0.0; + iirSample1EL = 0.0; + iirSample2AL = 0.0; + iirSample2BL = 0.0; + iirSample2CL = 0.0; + iirSample2DL = 0.0; + iirSample2EL = 0.0; + + iirSample1AR = 0.0; + iirSample1BR = 0.0; + iirSample1CR = 0.0; + iirSample1DR = 0.0; + iirSample1ER = 0.0; + iirSample2AR = 0.0; + iirSample2BR = 0.0; + iirSample2CR = 0.0; + iirSample2DR = 0.0; + iirSample2ER = 0.0; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; + //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 +} + +Floor::~Floor() {} +VstInt32 Floor::getVendorVersion () {return 1000;} +void Floor::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Floor::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 Floor::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Floor::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Floor::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Floor::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Floor::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Floor", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Floor::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Floor::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Floor::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Floor::getEffectName(char* name) { + vst_strncpy(name, "Floor", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Floor::getPlugCategory() {return kPlugCategEffect;} + +bool Floor::getProductString(char* text) { + vst_strncpy (text, "airwindows Floor", kVstMaxProductStrLen); return true; +} + +bool Floor::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Floor/Floor.h b/plugins/WinVST/Floor/Floor.h new file mode 100755 index 0000000..dc6b58c --- /dev/null +++ b/plugins/WinVST/Floor/Floor.h @@ -0,0 +1,90 @@ +/* ======================================== + * Floor - Floor.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Floor_H +#define __Floor_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'flor'; //Change this to what the AU identity is! + +class Floor : + public AudioEffectX +{ +public: + Floor(audioMasterCallback audioMaster); + ~Floor(); + 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; + + bool flip; //end defining of antialiasing variables + + double iirSample1AL; + double iirSample1BL; + double iirSample1CL; + double iirSample1DL; + double iirSample1EL; + double iirSample2AL; + double iirSample2BL; + double iirSample2CL; + double iirSample2DL; + double iirSample2EL; + + double iirSample1AR; + double iirSample1BR; + double iirSample1CR; + double iirSample1DR; + double iirSample1ER; + double iirSample2AR; + double iirSample2BR; + double iirSample2CR; + double iirSample2DR; + double iirSample2ER; + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/Floor/FloorProc.cpp b/plugins/WinVST/Floor/FloorProc.cpp new file mode 100755 index 0000000..69a2ccb --- /dev/null +++ b/plugins/WinVST/Floor/FloorProc.cpp @@ -0,0 +1,546 @@ +/* ======================================== + * Floor - Floor.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Floor_H +#include "Floor.h" +#endif + +void Floor::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 setting = pow(A,2); + double iirAmount = (setting/4.0)/overallscale; + double tight = -1.0; + double gaintrim = 1.0 + (setting/4.0); + double offset; + double lows; + double density = B; + double bridgerectifier; + double temp; + iirAmount += (iirAmount * tight * tight); + tight /= 3.0; + 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) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + long double drySampleL = inputSampleL; + long double drySampleR = inputSampleR; + + //begin left channel + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1AL = (iirSample1AL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1AL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1BL = (iirSample1BL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1BL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1CL = (iirSample1CL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1CL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1DL = (iirSample1DL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1DL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1EL = (iirSample1EL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1EL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + //end left channel + + //begin right channel + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1AR = (iirSample1AR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1AR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1BR = (iirSample1BR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1BR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1CR = (iirSample1CR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1CR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1DR = (iirSample1DR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1DR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1ER = (iirSample1ER * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1ER; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + //end right channel + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + bridgerectifier = fabs(inputSampleL)*1.57079633; + bridgerectifier = sin(bridgerectifier)*1.57079633; + bridgerectifier = (fabs(inputSampleL)*(1-density))+(bridgerectifier*density); + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); + else inputSampleL = (inputSampleL*(1-density))-(bridgerectifier*density); + //drive section, left + + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + bridgerectifier = fabs(inputSampleR)*1.57079633; + bridgerectifier = sin(bridgerectifier)*1.57079633; + bridgerectifier = (fabs(inputSampleR)*(1-density))+(bridgerectifier*density); + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-density))+(bridgerectifier*density); + else inputSampleR = (inputSampleR*(1-density))-(bridgerectifier*density); + //drive section, right + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //noise shaping to 32-bit floating point + float fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} + +void Floor::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 setting = pow(A,2); + double iirAmount = (setting/4.0)/overallscale; + double tight = -1.0; + double gaintrim = 1.0 + (setting/4.0); + double offset; + double lows; + double density = B; + double bridgerectifier; + double temp; + iirAmount += (iirAmount * tight * tight); + tight /= 3.0; + 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) + { + long double inputSampleL = *in1; + long double inputSampleR = *in2; + + static int noisesourceL = 0; + static int noisesourceR = 850010; + int residue; + double applyresidue; + + noisesourceL = noisesourceL % 1700021; noisesourceL++; + residue = noisesourceL * noisesourceL; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleL += applyresidue; + if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) { + inputSampleL -= applyresidue; + } + + noisesourceR = noisesourceR % 1700021; noisesourceR++; + residue = noisesourceR * noisesourceR; + residue = residue % 170003; residue *= residue; + residue = residue % 17011; residue *= residue; + residue = residue % 1709; residue *= residue; + residue = residue % 173; residue *= residue; + residue = residue % 17; + applyresidue = residue; + applyresidue *= 0.00000001; + applyresidue *= 0.00000001; + inputSampleR += applyresidue; + if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) { + inputSampleR -= applyresidue; + } + //for live air, we always apply the dither noise. Then, if our result is + //effectively digital black, we'll subtract it again. We want a 'air' hiss + long double drySampleL = inputSampleL; + long double drySampleR = inputSampleR; + + //begin left channel + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1AL = (iirSample1AL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1AL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1BL = (iirSample1BL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1BL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1CL = (iirSample1CL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1CL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1DL = (iirSample1DL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1DL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1EL = (iirSample1EL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + lows = iirSample1EL; + inputSampleL -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleL += lows; + inputSampleL *= gaintrim; + //end left channel + + //begin right channel + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1AR = (iirSample1AR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1AR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1BR = (iirSample1BR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1BR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1CR = (iirSample1CR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1CR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1DR = (iirSample1DR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1DR; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + iirSample1ER = (iirSample1ER * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + lows = iirSample1ER; + inputSampleR -= lows; + temp = lows; + if (lows < 0) {lows = -sin(-lows*1.5707963267949);} + if (lows > 0) {lows = sin(lows*1.5707963267949);} + lows -= temp; + inputSampleR += lows; + inputSampleR *= gaintrim; + //end right channel + + if (inputSampleL > 1.0) inputSampleL = 1.0; + if (inputSampleL < -1.0) inputSampleL = -1.0; + bridgerectifier = fabs(inputSampleL)*1.57079633; + bridgerectifier = sin(bridgerectifier)*1.57079633; + bridgerectifier = (fabs(inputSampleL)*(1-density))+(bridgerectifier*density); + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-density))+(bridgerectifier*density); + else inputSampleL = (inputSampleL*(1-density))-(bridgerectifier*density); + //drive section, left + + if (inputSampleR > 1.0) inputSampleR = 1.0; + if (inputSampleR < -1.0) inputSampleR = -1.0; + bridgerectifier = fabs(inputSampleR)*1.57079633; + bridgerectifier = sin(bridgerectifier)*1.57079633; + bridgerectifier = (fabs(inputSampleR)*(1-density))+(bridgerectifier*density); + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-density))+(bridgerectifier*density); + else inputSampleR = (inputSampleR*(1-density))-(bridgerectifier*density); + //drive section, right + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //noise shaping to 64-bit floating point + double fpTemp = inputSampleL; + fpNShapeL += (inputSampleL-fpTemp); + inputSampleL += fpNShapeL; + //if this confuses you look at the wordlength for fpTemp :) + fpTemp = inputSampleR; + fpNShapeR += (inputSampleR-fpTemp); + inputSampleR += fpNShapeR; + //for deeper space and warmth, we try a non-oscillating noise shaping + //that is kind of ruthless: it will forever retain the rounding errors + //except we'll dial it back a hair at the end of every buffer processed + //end noise shaping on 64 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } + fpNShapeL *= 0.999999; + fpNShapeR *= 0.999999; + //we will just delicately dial back the FP noise shaping, not even every sample + //this is a good place to put subtle 'no runaway' calculations, though bear in mind + //that it will be called more often when you use shorter sample buffers in the DAW. + //So, very low latency operation will call these calculations more often. +} diff --git a/plugins/WinVST/Floor/VSTProject.sln b/plugins/WinVST/Floor/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Floor/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/Floor/VSTProject.vcxproj b/plugins/WinVST/Floor/VSTProject.vcxproj new file mode 100755 index 0000000..b28ff8d --- /dev/null +++ b/plugins/WinVST/Floor/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Floor.cpp" />
+ <ClCompile Include="FloorProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Floor.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Floor64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Floor/VSTProject.vcxproj.filters b/plugins/WinVST/Floor/VSTProject.vcxproj.filters new file mode 100755 index 0000000..71a75a8 --- /dev/null +++ b/plugins/WinVST/Floor/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Floor.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FloorProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Floor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Floor/VSTProject.vcxproj.user b/plugins/WinVST/Floor/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Floor/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Floor/vstplug.def b/plugins/WinVST/Floor/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Floor/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Fracture/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Fracture/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Fracture/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Fracture/.vs/VSTProject/v14/.suo b/plugins/WinVST/Fracture/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..f5e4242 --- /dev/null +++ b/plugins/WinVST/Fracture/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Fracture/Fracture.cpp b/plugins/WinVST/Fracture/Fracture.cpp new file mode 100755 index 0000000..255475a --- /dev/null +++ b/plugins/WinVST/Fracture/Fracture.cpp @@ -0,0 +1,146 @@ +/* ======================================== + * Fracture - Fracture.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Fracture_H +#include "Fracture.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Fracture(audioMaster);} + +Fracture::Fracture(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.25; //1 from 0 to 4: A*4 + B = 0.5; //2 from 1 to 3: (B*2.999)+1 + C = 1.0; + D = 1.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Fracture::~Fracture() {} +VstInt32 Fracture::getVendorVersion () {return 1000;} +void Fracture::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Fracture::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 Fracture::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Fracture::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Fracture::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Fracture::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Fracture::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Fracture", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Out Lvl", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Fracture::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*4), text, kVstMaxParamStrLen); break; + case kParamB: int2string ((VstInt32)floor(B * 2.999)+1, text, kVstMaxParamStrLen); break; + case kParamC: dB2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Fracture::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the popup + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Fracture::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Fracture::getEffectName(char* name) { + vst_strncpy(name, "Fracture", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Fracture::getPlugCategory() {return kPlugCategEffect;} + +bool Fracture::getProductString(char* text) { + vst_strncpy (text, "airwindows Fracture", kVstMaxProductStrLen); return true; +} + +bool Fracture::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Fracture/Fracture.h b/plugins/WinVST/Fracture/Fracture.h new file mode 100755 index 0000000..659f94b --- /dev/null +++ b/plugins/WinVST/Fracture/Fracture.h @@ -0,0 +1,72 @@ +/* ======================================== + * Fracture - Fracture.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Fracture_H +#define __Fracture_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'frct'; //Change this to what the AU identity is! + +class Fracture : + public AudioEffectX +{ +public: + Fracture(audioMasterCallback audioMaster); + ~Fracture(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/Fracture/FractureProc.cpp b/plugins/WinVST/Fracture/FractureProc.cpp new file mode 100755 index 0000000..8e217d8 --- /dev/null +++ b/plugins/WinVST/Fracture/FractureProc.cpp @@ -0,0 +1,259 @@ +/* ======================================== + * Fracture - Fracture.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Fracture_H +#include "Fracture.h" +#endif + +void Fracture::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double density = A*4; + double fracture = (((B*2.999)+1)*3.14159265358979); + double output = C; + double wet = D; + double dry = 1.0-wet; + double bridgerectifier; + density = density * fabs(density); + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= density; + inputSampleR *= density; + + bridgerectifier = fabs(inputSampleL)*fracture; + if (bridgerectifier > fracture) bridgerectifier = fracture; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*fracture; + if (bridgerectifier > fracture) bridgerectifier = fracture; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //blend according to density control + + inputSampleL *= output; + inputSampleR *= output; + + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + + //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 Fracture::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; + + double density = A*4; + double fracture = (((B*2.999)+1)*3.14159265358979); + double output = C; + double wet = D; + double dry = 1.0-wet; + double bridgerectifier; + density = density * fabs(density); + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= density; + inputSampleR *= density; + + bridgerectifier = fabs(inputSampleL)*fracture; + if (bridgerectifier > fracture) bridgerectifier = fracture; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*fracture; + if (bridgerectifier > fracture) bridgerectifier = fracture; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //blend according to density control + + inputSampleL *= output; + inputSampleR *= output; + + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + + //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/Fracture/VSTProject.sln b/plugins/WinVST/Fracture/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Fracture/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/Fracture/VSTProject.vcxproj b/plugins/WinVST/Fracture/VSTProject.vcxproj new file mode 100755 index 0000000..c51aa07 --- /dev/null +++ b/plugins/WinVST/Fracture/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Fracture.cpp" />
+ <ClCompile Include="FractureProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Fracture.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Fracture64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Fracture/VSTProject.vcxproj.filters b/plugins/WinVST/Fracture/VSTProject.vcxproj.filters new file mode 100755 index 0000000..69b8134 --- /dev/null +++ b/plugins/WinVST/Fracture/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Fracture.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FractureProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Fracture.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Fracture/VSTProject.vcxproj.user b/plugins/WinVST/Fracture/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Fracture/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Fracture/vstplug.def b/plugins/WinVST/Fracture/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Fracture/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/FromTape/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/FromTape/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/FromTape/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/FromTape/.vs/VSTProject/v14/.suo b/plugins/WinVST/FromTape/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..f635737 --- /dev/null +++ b/plugins/WinVST/FromTape/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/FromTape/FromTape.cpp b/plugins/WinVST/FromTape/FromTape.cpp new file mode 100755 index 0000000..55c5ced --- /dev/null +++ b/plugins/WinVST/FromTape/FromTape.cpp @@ -0,0 +1,219 @@ +/* ======================================== + * FromTape - FromTape.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __FromTape_H +#include "FromTape.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new FromTape(audioMaster);} + +FromTape::FromTape(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + D = 0.5; + E = 1.0; + + iirMidRollerAL = 0.0; + iirMidRollerBL = 0.0; + iirMidRollerCL = 0.0; + + iirMidRollerAR = 0.0; + iirMidRollerBR = 0.0; + iirMidRollerCR = 0.0; + + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleCL = 0.0; + iirSampleDL = 0.0; + iirSampleEL = 0.0; + iirSampleFL = 0.0; + iirSampleGL = 0.0; + iirSampleHL = 0.0; + iirSampleIL = 0.0; + iirSampleJL = 0.0; + iirSampleKL = 0.0; + iirSampleLL = 0.0; + iirSampleML = 0.0; + iirSampleNL = 0.0; + iirSampleOL = 0.0; + iirSamplePL = 0.0; + iirSampleQL = 0.0; + iirSampleRL = 0.0; + iirSampleSL = 0.0; + iirSampleTL = 0.0; + iirSampleUL = 0.0; + iirSampleVL = 0.0; + iirSampleWL = 0.0; + iirSampleXL = 0.0; + iirSampleYL = 0.0; + iirSampleZL = 0.0; + + iirSampleAR = 0.0; + iirSampleBR = 0.0; + iirSampleCR = 0.0; + iirSampleDR = 0.0; + iirSampleER = 0.0; + iirSampleFR = 0.0; + iirSampleGR = 0.0; + iirSampleHR = 0.0; + iirSampleIR = 0.0; + iirSampleJR = 0.0; + iirSampleKR = 0.0; + iirSampleLR = 0.0; + iirSampleMR = 0.0; + iirSampleNR = 0.0; + iirSampleOR = 0.0; + iirSamplePR = 0.0; + iirSampleQR = 0.0; + iirSampleRR = 0.0; + iirSampleSR = 0.0; + iirSampleTR = 0.0; + iirSampleUR = 0.0; + iirSampleVR = 0.0; + iirSampleWR = 0.0; + iirSampleXR = 0.0; + iirSampleYR = 0.0; + iirSampleZR = 0.0; + + flip = 0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +FromTape::~FromTape() {} +VstInt32 FromTape::getVendorVersion () {return 1000;} +void FromTape::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void FromTape::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 FromTape::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + /* 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 FromTape::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + /* 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 FromTape::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float FromTape::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; 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 FromTape::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Louder", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Softer", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Weight", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void FromTape::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*2, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D*2, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void FromTape::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 FromTape::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool FromTape::getEffectName(char* name) { + vst_strncpy(name, "FromTape", kVstMaxProductStrLen); return true; +} + +VstPlugCategory FromTape::getPlugCategory() {return kPlugCategEffect;} + +bool FromTape::getProductString(char* text) { + vst_strncpy (text, "airwindows FromTape", kVstMaxProductStrLen); return true; +} + +bool FromTape::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/FromTape/FromTape.h b/plugins/WinVST/FromTape/FromTape.h new file mode 100755 index 0000000..376b767 --- /dev/null +++ b/plugins/WinVST/FromTape/FromTape.h @@ -0,0 +1,138 @@ +/* ======================================== + * FromTape - FromTape.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __FromTape_H +#define __FromTape_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kNumParameters = 5 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'frts'; //Change this to what the AU identity is! + +class FromTape : + public AudioEffectX +{ +public: + FromTape(audioMasterCallback audioMaster); + ~FromTape(); + 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; + + int flip; + + double iirMidRollerAL; + double iirMidRollerBL; + double iirMidRollerCL; + + double iirMidRollerAR; + double iirMidRollerBR; + double iirMidRollerCR; + + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleGL; + double iirSampleHL; + double iirSampleIL; + double iirSampleJL; + double iirSampleKL; + double iirSampleLL; + double iirSampleML; + double iirSampleNL; + double iirSampleOL; + double iirSamplePL; + double iirSampleQL; + double iirSampleRL; + double iirSampleSL; + double iirSampleTL; + double iirSampleUL; + double iirSampleVL; + double iirSampleWL; + double iirSampleXL; + double iirSampleYL; + double iirSampleZL; + + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double iirSampleGR; + double iirSampleHR; + double iirSampleIR; + double iirSampleJR; + double iirSampleKR; + double iirSampleLR; + double iirSampleMR; + double iirSampleNR; + double iirSampleOR; + double iirSamplePR; + double iirSampleQR; + double iirSampleRR; + double iirSampleSR; + double iirSampleTR; + double iirSampleUR; + double iirSampleVR; + double iirSampleWR; + double iirSampleXR; + double iirSampleYR; + double iirSampleZR; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; + +}; + +#endif diff --git a/plugins/WinVST/FromTape/FromTapeProc.cpp b/plugins/WinVST/FromTape/FromTapeProc.cpp new file mode 100755 index 0000000..42753e5 --- /dev/null +++ b/plugins/WinVST/FromTape/FromTapeProc.cpp @@ -0,0 +1,502 @@ +/* ======================================== + * FromTape - FromTape.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __FromTape_H +#include "FromTape.h" +#endif + +void FromTape::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 inputgain = A*2.0; + double SoftenControl = B; + double RollAmount = (1.0-SoftenControl)/overallscale; + double iirAmount = (0.004*(1.0-C))/overallscale; + double altAmount = 1.0 - iirAmount; + double outputgain = D*2.0; + double wet = E; + double dry = 1.0 - wet; + double HighsSampleL = 0.0; + double SubtractL; + double bridgerectifierL; + double tempSampleL; + double drySampleL; + double HighsSampleR = 0.0; + double SubtractR; + double bridgerectifierR; + double tempSampleR; + double drySampleR; + double randy; + double invrandy; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + randy = (rand()/(double)RAND_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 + + SubtractL = 0.0; + SubtractR = 0.0; + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + iirSampleAL = (iirSampleAL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleAL; SubtractL += iirSampleAL; + iirSampleBL = (iirSampleBL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleBL; SubtractL += iirSampleBL; + iirSampleCL = (iirSampleCL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleCL; SubtractL += iirSampleCL; + iirSampleDL = (iirSampleDL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleDL; SubtractL += iirSampleDL; + iirSampleEL = (iirSampleEL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleEL; SubtractL += iirSampleEL; + iirSampleFL = (iirSampleFL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleFL; SubtractL += iirSampleFL; + iirSampleGL = (iirSampleGL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleGL; SubtractL += iirSampleGL; + iirSampleHL = (iirSampleHL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleHL; SubtractL += iirSampleHL; + iirSampleIL = (iirSampleIL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleIL; SubtractL += iirSampleIL; + iirSampleJL = (iirSampleJL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleJL; SubtractL += iirSampleJL; + iirSampleKL = (iirSampleKL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleKL; SubtractL += iirSampleKL; + iirSampleLL = (iirSampleLL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleLL; SubtractL += iirSampleLL; + iirSampleML = (iirSampleML * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleML; SubtractL += iirSampleML; + iirSampleNL = (iirSampleNL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleNL; SubtractL += iirSampleNL; + iirSampleOL = (iirSampleOL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleOL; SubtractL += iirSampleOL; + iirSamplePL = (iirSamplePL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSamplePL; SubtractL += iirSamplePL; + iirSampleQL = (iirSampleQL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleQL; SubtractL += iirSampleQL; + iirSampleRL = (iirSampleRL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleRL; SubtractL += iirSampleRL; + iirSampleSL = (iirSampleSL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleSL; SubtractL += iirSampleSL; + iirSampleTL = (iirSampleTL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleTL; SubtractL += iirSampleTL; + iirSampleUL = (iirSampleUL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleUL; SubtractL += iirSampleUL; + iirSampleVL = (iirSampleVL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleVL; SubtractL += iirSampleVL; + iirSampleWL = (iirSampleWL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleWL; SubtractL += iirSampleWL; + iirSampleXL = (iirSampleXL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleXL; SubtractL += iirSampleXL; + iirSampleYL = (iirSampleYL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleYL; SubtractL += iirSampleYL; + iirSampleZL = (iirSampleZL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleZL; SubtractL += iirSampleZL; + + iirSampleAR = (iirSampleAR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleAR; SubtractR += iirSampleAR; + iirSampleBR = (iirSampleBR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleBR; SubtractR += iirSampleBR; + iirSampleCR = (iirSampleCR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleCR; SubtractR += iirSampleCR; + iirSampleDR = (iirSampleDR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleDR; SubtractR += iirSampleDR; + iirSampleER = (iirSampleER * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleER; SubtractR += iirSampleER; + iirSampleFR = (iirSampleFR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleFR; SubtractR += iirSampleFR; + iirSampleGR = (iirSampleGR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleGR; SubtractR += iirSampleGR; + iirSampleHR = (iirSampleHR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleHR; SubtractR += iirSampleHR; + iirSampleIR = (iirSampleIR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleIR; SubtractR += iirSampleIR; + iirSampleJR = (iirSampleJR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleJR; SubtractR += iirSampleJR; + iirSampleKR = (iirSampleKR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleKR; SubtractR += iirSampleKR; + iirSampleLR = (iirSampleLR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleLR; SubtractR += iirSampleLR; + iirSampleMR = (iirSampleMR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleMR; SubtractR += iirSampleMR; + iirSampleNR = (iirSampleNR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleNR; SubtractR += iirSampleNR; + iirSampleOR = (iirSampleOR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleOR; SubtractR += iirSampleOR; + iirSamplePR = (iirSamplePR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSamplePR; SubtractR += iirSamplePR; + iirSampleQR = (iirSampleQR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleQR; SubtractR += iirSampleQR; + iirSampleRR = (iirSampleRR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleRR; SubtractR += iirSampleRR; + iirSampleSR = (iirSampleSR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleSR; SubtractR += iirSampleSR; + iirSampleTR = (iirSampleTR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleTR; SubtractR += iirSampleTR; + iirSampleUR = (iirSampleUR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleUR; SubtractR += iirSampleUR; + iirSampleVR = (iirSampleVR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleVR; SubtractR += iirSampleVR; + iirSampleWR = (iirSampleWR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleWR; SubtractR += iirSampleWR; + iirSampleXR = (iirSampleXR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleXR; SubtractR += iirSampleXR; + iirSampleYR = (iirSampleYR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleYR; SubtractR += iirSampleYR; + iirSampleZR = (iirSampleZR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleZR; SubtractR += iirSampleZR; + //do the IIR on a dummy sample, and store up the correction in a variable at the same scale as the very low level + //numbers being used. Don't keep doing it against the possibly high level signal number. + //This has been known to add a resonant quality to the cutoff, which we're using on purpose. + inputSampleL -= SubtractL; + inputSampleR -= SubtractR; + //apply stored up tiny corrections. + + + if (flip < 1 || flip > 3) flip = 1; + switch (flip) + { + case 1: + iirMidRollerAL = (iirMidRollerAL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerAL = (invrandy * iirMidRollerAL) + (randy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerAL; + iirMidRollerAR = (iirMidRollerAR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerAR = (invrandy * iirMidRollerAR) + (randy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerAR; + break; + case 2: + iirMidRollerBL = (iirMidRollerBL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerBL = (randy * iirMidRollerAL) + (invrandy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerBL; + iirMidRollerBR = (iirMidRollerBR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerBR = (randy * iirMidRollerAR) + (invrandy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerBR; + break; + case 3: + iirMidRollerCL = (iirMidRollerCL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerCL = (randy * iirMidRollerAL) + (randy * iirMidRollerBL) + (invrandy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerCL; + iirMidRollerCR = (iirMidRollerCR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerCR = (randy * iirMidRollerAR) + (randy * iirMidRollerBR) + (invrandy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerCR; + break; + } + flip++; //increment the triplet counter + + SubtractL = HighsSampleL; + bridgerectifierL = fabs(SubtractL)*1.57079633; + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = 1-cos(bridgerectifierL); + if (SubtractL > 0) SubtractL = bridgerectifierL; + if (SubtractL < 0) SubtractL = -bridgerectifierL; + inputSampleL -= SubtractL; + + SubtractR = HighsSampleR; + bridgerectifierR = fabs(SubtractR)*1.57079633; + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = 1-cos(bridgerectifierR); + if (SubtractR > 0) SubtractR = bridgerectifierR; + if (SubtractR < 0) SubtractR = -bridgerectifierR; + inputSampleR -= SubtractR; + //Soften works using the MidRoller stuff, defining a bright parallel channel that we apply negative Density + //to, and then subtract from the main audio. That makes the 'highs channel subtract' hit only the loudest + //transients, plus we are subtracting any artifacts we got from the negative Density. + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 FromTape::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 inputgain = A*2.0; + double SoftenControl = B; + double RollAmount = (1.0-SoftenControl)/overallscale; + double iirAmount = (0.004*(1.0-C))/overallscale; + double altAmount = 1.0 - iirAmount; + double outputgain = D*2.0; + double wet = E; + double dry = 1.0 - wet; + double HighsSampleL = 0.0; + double SubtractL; + double bridgerectifierL; + double tempSampleL; + double drySampleL; + double HighsSampleR = 0.0; + double SubtractR; + double bridgerectifierR; + double tempSampleR; + double drySampleR; + double randy; + double invrandy; + 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; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + randy = (rand()/(double)RAND_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 + + SubtractL = 0.0; + SubtractR = 0.0; + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + iirSampleAL = (iirSampleAL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleAL; SubtractL += iirSampleAL; + iirSampleBL = (iirSampleBL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleBL; SubtractL += iirSampleBL; + iirSampleCL = (iirSampleCL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleCL; SubtractL += iirSampleCL; + iirSampleDL = (iirSampleDL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleDL; SubtractL += iirSampleDL; + iirSampleEL = (iirSampleEL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleEL; SubtractL += iirSampleEL; + iirSampleFL = (iirSampleFL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleFL; SubtractL += iirSampleFL; + iirSampleGL = (iirSampleGL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleGL; SubtractL += iirSampleGL; + iirSampleHL = (iirSampleHL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleHL; SubtractL += iirSampleHL; + iirSampleIL = (iirSampleIL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleIL; SubtractL += iirSampleIL; + iirSampleJL = (iirSampleJL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleJL; SubtractL += iirSampleJL; + iirSampleKL = (iirSampleKL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleKL; SubtractL += iirSampleKL; + iirSampleLL = (iirSampleLL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleLL; SubtractL += iirSampleLL; + iirSampleML = (iirSampleML * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleML; SubtractL += iirSampleML; + iirSampleNL = (iirSampleNL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleNL; SubtractL += iirSampleNL; + iirSampleOL = (iirSampleOL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleOL; SubtractL += iirSampleOL; + iirSamplePL = (iirSamplePL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSamplePL; SubtractL += iirSamplePL; + iirSampleQL = (iirSampleQL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleQL; SubtractL += iirSampleQL; + iirSampleRL = (iirSampleRL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleRL; SubtractL += iirSampleRL; + iirSampleSL = (iirSampleSL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleSL; SubtractL += iirSampleSL; + iirSampleTL = (iirSampleTL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleTL; SubtractL += iirSampleTL; + iirSampleUL = (iirSampleUL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleUL; SubtractL += iirSampleUL; + iirSampleVL = (iirSampleVL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleVL; SubtractL += iirSampleVL; + iirSampleWL = (iirSampleWL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleWL; SubtractL += iirSampleWL; + iirSampleXL = (iirSampleXL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleXL; SubtractL += iirSampleXL; + iirSampleYL = (iirSampleYL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleYL; SubtractL += iirSampleYL; + iirSampleZL = (iirSampleZL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleZL; SubtractL += iirSampleZL; + + iirSampleAR = (iirSampleAR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleAR; SubtractR += iirSampleAR; + iirSampleBR = (iirSampleBR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleBR; SubtractR += iirSampleBR; + iirSampleCR = (iirSampleCR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleCR; SubtractR += iirSampleCR; + iirSampleDR = (iirSampleDR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleDR; SubtractR += iirSampleDR; + iirSampleER = (iirSampleER * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleER; SubtractR += iirSampleER; + iirSampleFR = (iirSampleFR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleFR; SubtractR += iirSampleFR; + iirSampleGR = (iirSampleGR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleGR; SubtractR += iirSampleGR; + iirSampleHR = (iirSampleHR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleHR; SubtractR += iirSampleHR; + iirSampleIR = (iirSampleIR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleIR; SubtractR += iirSampleIR; + iirSampleJR = (iirSampleJR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleJR; SubtractR += iirSampleJR; + iirSampleKR = (iirSampleKR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleKR; SubtractR += iirSampleKR; + iirSampleLR = (iirSampleLR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleLR; SubtractR += iirSampleLR; + iirSampleMR = (iirSampleMR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleMR; SubtractR += iirSampleMR; + iirSampleNR = (iirSampleNR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleNR; SubtractR += iirSampleNR; + iirSampleOR = (iirSampleOR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleOR; SubtractR += iirSampleOR; + iirSamplePR = (iirSamplePR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSamplePR; SubtractR += iirSamplePR; + iirSampleQR = (iirSampleQR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleQR; SubtractR += iirSampleQR; + iirSampleRR = (iirSampleRR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleRR; SubtractR += iirSampleRR; + iirSampleSR = (iirSampleSR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleSR; SubtractR += iirSampleSR; + iirSampleTR = (iirSampleTR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleTR; SubtractR += iirSampleTR; + iirSampleUR = (iirSampleUR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleUR; SubtractR += iirSampleUR; + iirSampleVR = (iirSampleVR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleVR; SubtractR += iirSampleVR; + iirSampleWR = (iirSampleWR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleWR; SubtractR += iirSampleWR; + iirSampleXR = (iirSampleXR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleXR; SubtractR += iirSampleXR; + iirSampleYR = (iirSampleYR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleYR; SubtractR += iirSampleYR; + iirSampleZR = (iirSampleZR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleZR; SubtractR += iirSampleZR; + //do the IIR on a dummy sample, and store up the correction in a variable at the same scale as the very low level + //numbers being used. Don't keep doing it against the possibly high level signal number. + //This has been known to add a resonant quality to the cutoff, which we're using on purpose. + inputSampleL -= SubtractL; + inputSampleR -= SubtractR; + //apply stored up tiny corrections. + + + if (flip < 1 || flip > 3) flip = 1; + switch (flip) + { + case 1: + iirMidRollerAL = (iirMidRollerAL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerAL = (invrandy * iirMidRollerAL) + (randy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerAL; + iirMidRollerAR = (iirMidRollerAR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerAR = (invrandy * iirMidRollerAR) + (randy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerAR; + break; + case 2: + iirMidRollerBL = (iirMidRollerBL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerBL = (randy * iirMidRollerAL) + (invrandy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerBL; + iirMidRollerBR = (iirMidRollerBR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerBR = (randy * iirMidRollerAR) + (invrandy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerBR; + break; + case 3: + iirMidRollerCL = (iirMidRollerCL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerCL = (randy * iirMidRollerAL) + (randy * iirMidRollerBL) + (invrandy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerCL; + iirMidRollerCR = (iirMidRollerCR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerCR = (randy * iirMidRollerAR) + (randy * iirMidRollerBR) + (invrandy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerCR; + break; + } + flip++; //increment the triplet counter + + SubtractL = HighsSampleL; + bridgerectifierL = fabs(SubtractL)*1.57079633; + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = 1-cos(bridgerectifierL); + if (SubtractL > 0) SubtractL = bridgerectifierL; + if (SubtractL < 0) SubtractL = -bridgerectifierL; + inputSampleL -= SubtractL; + + SubtractR = HighsSampleR; + bridgerectifierR = fabs(SubtractR)*1.57079633; + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = 1-cos(bridgerectifierR); + if (SubtractR > 0) SubtractR = bridgerectifierR; + if (SubtractR < 0) SubtractR = -bridgerectifierR; + inputSampleR -= SubtractR; + //Soften works using the MidRoller stuff, defining a bright parallel channel that we apply negative Density + //to, and then subtract from the main audio. That makes the 'highs channel subtract' hit only the loudest + //transients, plus we are subtracting any artifacts we got from the negative Density. + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/FromTape/VSTProject.sln b/plugins/WinVST/FromTape/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/FromTape/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/FromTape/VSTProject.vcxproj b/plugins/WinVST/FromTape/VSTProject.vcxproj new file mode 100755 index 0000000..544c37c --- /dev/null +++ b/plugins/WinVST/FromTape/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="FromTape.cpp" />
+ <ClCompile Include="FromTapeProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="FromTape.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>FromTape64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FromTape/VSTProject.vcxproj.filters b/plugins/WinVST/FromTape/VSTProject.vcxproj.filters new file mode 100755 index 0000000..3fb2141 --- /dev/null +++ b/plugins/WinVST/FromTape/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FromTape.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FromTapeProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FromTape.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FromTape/VSTProject.vcxproj.user b/plugins/WinVST/FromTape/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/FromTape/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/FromTape/vstplug.def b/plugins/WinVST/FromTape/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/FromTape/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo b/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..9e37109 --- /dev/null +++ b/plugins/WinVST/GuitarConditioner/.vs/VSTProject/v14/.suo 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 <set> +#include <string> +#include <math.h> + +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 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="GuitarConditioner.cpp" />
+ <ClCompile Include="GuitarConditionerProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="GuitarConditioner.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>GuitarConditioner64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ 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 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="GuitarConditioner.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="GuitarConditionerProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="GuitarConditioner.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ 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 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ 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 diff --git a/plugins/WinVST/HermeTrim/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/HermeTrim/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/HermeTrim/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/HermeTrim/.vs/VSTProject/v14/.suo b/plugins/WinVST/HermeTrim/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..d06b803 --- /dev/null +++ b/plugins/WinVST/HermeTrim/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/HermeTrim/HermeTrim.cpp b/plugins/WinVST/HermeTrim/HermeTrim.cpp new file mode 100755 index 0000000..562df2c --- /dev/null +++ b/plugins/WinVST/HermeTrim/HermeTrim.cpp @@ -0,0 +1,154 @@ +/* ======================================== + * HermeTrim - HermeTrim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __HermeTrim_H +#include "HermeTrim.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new HermeTrim(audioMaster);} + +HermeTrim::HermeTrim(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + D = 0.5; + E = 0.5; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +HermeTrim::~HermeTrim() {} +VstInt32 HermeTrim::getVendorVersion () {return 1000;} +void HermeTrim::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void HermeTrim::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 HermeTrim::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + /* 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 HermeTrim::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + /* 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 HermeTrim::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float HermeTrim::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; 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 HermeTrim::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Left", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Right", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Mid", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Side", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Master", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void HermeTrim::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*3.0)-1.5, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B*3.0)-1.5, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*3.0)-1.5, text, kVstMaxParamStrLen); break; + case kParamD: float2string ((D*3.0)-1.5, text, kVstMaxParamStrLen); break; + case kParamE: float2string ((E*3.0)-1.5, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void HermeTrim::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 HermeTrim::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool HermeTrim::getEffectName(char* name) { + vst_strncpy(name, "HermeTrim", kVstMaxProductStrLen); return true; +} + +VstPlugCategory HermeTrim::getPlugCategory() {return kPlugCategEffect;} + +bool HermeTrim::getProductString(char* text) { + vst_strncpy (text, "airwindows HermeTrim", kVstMaxProductStrLen); return true; +} + +bool HermeTrim::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/HermeTrim/HermeTrim.h b/plugins/WinVST/HermeTrim/HermeTrim.h new file mode 100755 index 0000000..b8503ca --- /dev/null +++ b/plugins/WinVST/HermeTrim/HermeTrim.h @@ -0,0 +1,74 @@ +/* ======================================== + * HermeTrim - HermeTrim.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __HermeTrim_H +#define __HermeTrim_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kNumParameters = 5 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'hmtr'; //Change this to what the AU identity is! + +class HermeTrim : + public AudioEffectX +{ +public: + HermeTrim(audioMasterCallback audioMaster); + ~HermeTrim(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/HermeTrim/HermeTrimProc.cpp b/plugins/WinVST/HermeTrim/HermeTrimProc.cpp new file mode 100755 index 0000000..d920843 --- /dev/null +++ b/plugins/WinVST/HermeTrim/HermeTrimProc.cpp @@ -0,0 +1,220 @@ +/* ======================================== + * HermeTrim - HermeTrim.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __HermeTrim_H +#include "HermeTrim.h" +#endif + +void HermeTrim::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double leftgain = pow(10.0,((A*3.0)-1.5)/20.0); + double rightgain = pow(10.0,((B*3.0)-1.5)/20.0); + double midgain = pow(10.0,((C*3.0)-1.5)/20.0); + double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); + double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; + + long double inputSampleL; + long double inputSampleR; + long double mid; + long double side; + + leftgain *= mastergain; + rightgain *= mastergain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + mid *= midgain; + side *= sidegain; + inputSampleL = (mid+side) * leftgain; + inputSampleR = (mid-side) * rightgain; + //contains mastergain and the gain trim fixing the mid/side + + //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 HermeTrim::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double leftgain = pow(10.0,((A*3.0)-1.5)/20.0); + double rightgain = pow(10.0,((B*3.0)-1.5)/20.0); + double midgain = pow(10.0,((C*3.0)-1.5)/20.0); + double sidegain = pow(10.0,((D*3.0)-1.5)/20.0); + double mastergain = pow(10.0,((E*3.0)-1.5)/20.0) * 0.5; + + long double inputSampleL; + long double inputSampleR; + long double mid; + long double side; + + leftgain *= mastergain; + rightgain *= mastergain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + mid *= midgain; + side *= sidegain; + inputSampleL = (mid+side) * leftgain; + inputSampleR = (mid-side) * rightgain; + //contains mastergain and the gain trim fixing the mid/side + + //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/HermeTrim/VSTProject.sln b/plugins/WinVST/HermeTrim/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/HermeTrim/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/HermeTrim/VSTProject.vcxproj b/plugins/WinVST/HermeTrim/VSTProject.vcxproj new file mode 100755 index 0000000..54adfec --- /dev/null +++ b/plugins/WinVST/HermeTrim/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="HermeTrim.cpp" />
+ <ClCompile Include="HermeTrimProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="HermeTrim.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>HermeTrim64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HermeTrim/VSTProject.vcxproj.filters b/plugins/WinVST/HermeTrim/VSTProject.vcxproj.filters new file mode 100755 index 0000000..40cf728 --- /dev/null +++ b/plugins/WinVST/HermeTrim/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HermeTrim.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HermeTrimProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="HermeTrim.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HermeTrim/VSTProject.vcxproj.user b/plugins/WinVST/HermeTrim/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/HermeTrim/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HermeTrim/vstplug.def b/plugins/WinVST/HermeTrim/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/HermeTrim/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Hermepass/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Hermepass/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Hermepass/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Hermepass/.vs/VSTProject/v14/.suo b/plugins/WinVST/Hermepass/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..2a195c6 --- /dev/null +++ b/plugins/WinVST/Hermepass/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Hermepass/Hermepass.cpp b/plugins/WinVST/Hermepass/Hermepass.cpp new file mode 100755 index 0000000..3bfb1aa --- /dev/null +++ b/plugins/WinVST/Hermepass/Hermepass.cpp @@ -0,0 +1,149 @@ +/* ======================================== + * Hermepass - Hermepass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Hermepass_H +#include "Hermepass.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Hermepass(audioMaster);} + +Hermepass::Hermepass(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + + iirAL = 0.0; + iirBL = 0.0; + iirCL = 0.0; + iirDL = 0.0; + iirEL = 0.0; + iirFL = 0.0; + iirGL = 0.0; + iirHL = 0.0; + + iirAR = 0.0; + iirBR = 0.0; + iirCR = 0.0; + iirDR = 0.0; + iirER = 0.0; + iirFR = 0.0; + iirGR = 0.0; + iirHR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Hermepass::~Hermepass() {} +VstInt32 Hermepass::getVendorVersion () {return 1000;} +void Hermepass::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Hermepass::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 Hermepass::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 Hermepass::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 Hermepass::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Hermepass::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 Hermepass::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Cutoff", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Slope", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Hermepass::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Hermepass::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Hermepass::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Hermepass::getEffectName(char* name) { + vst_strncpy(name, "Hermepass", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Hermepass::getPlugCategory() {return kPlugCategEffect;} + +bool Hermepass::getProductString(char* text) { + vst_strncpy (text, "airwindows Hermepass", kVstMaxProductStrLen); return true; +} + +bool Hermepass::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Hermepass/Hermepass.h b/plugins/WinVST/Hermepass/Hermepass.h new file mode 100755 index 0000000..4f29497 --- /dev/null +++ b/plugins/WinVST/Hermepass/Hermepass.h @@ -0,0 +1,86 @@ +/* ======================================== + * Hermepass - Hermepass.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Hermepass_H +#define __Hermepass_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'herm'; //Change this to what the AU identity is! + +class Hermepass : + public AudioEffectX +{ +public: + Hermepass(audioMasterCallback audioMaster); + ~Hermepass(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double iirAL; + double iirBL; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one + double iirCL; //we introduce the second pole at the same frequency, to become a pseudo-Capacitor behavior + double iirDL; + double iirEL; + double iirFL; //our slope control will have a pow() on it so that the high orders are way to the right side + double iirGL; + double iirHL; //seven poles max, and the final pole is always at 20hz directly. + + double iirAR; + double iirBR; //first stage is the flipping one, for lowest slope. It is always engaged, and is the highest one + double iirCR; //we introduce the second pole at the same frequency, to become a pseudo-Capacitor behavior + double iirDR; + double iirER; + double iirFR; //our slope control will have a pow() on it so that the high orders are way to the right side + double iirGR; + double iirHR; //seven poles max, and the final pole is always at 20hz directly. + + + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Hermepass/HermepassProc.cpp b/plugins/WinVST/Hermepass/HermepassProc.cpp new file mode 100755 index 0000000..01b35aa --- /dev/null +++ b/plugins/WinVST/Hermepass/HermepassProc.cpp @@ -0,0 +1,406 @@ +/* ======================================== + * Hermepass - Hermepass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Hermepass_H +#include "Hermepass.h" +#endif + +void Hermepass::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; + + double rangescale = 0.1 / overallscale; + + double cutoff = pow(A,3); + double slope = pow(B,3) * 6.0; + + double newA = cutoff * rangescale; + double newB = newA; //other part of interleaved IIR is the same + + double newC = cutoff * rangescale; //first extra pole is the same + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newD = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newE = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newF = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newG = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newH = cutoff * rangescale; + //converge toward the unvarying fixed cutoff value + + double oldA = 1.0 - newA; + double oldB = 1.0 - newB; + double oldC = 1.0 - newC; + double oldD = 1.0 - newD; + double oldE = 1.0 - newE; + double oldF = 1.0 - newF; + double oldG = 1.0 - newG; + double oldH = 1.0 - newH; + + double polesC; + double polesD; + double polesE; + double polesF; + double polesG; + double polesH; + + polesC = slope; if (slope > 1.0) polesC = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesD = slope; if (slope > 1.0) polesD = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesE = slope; if (slope > 1.0) polesE = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesF = slope; if (slope > 1.0) polesF = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesG = slope; if (slope > 1.0) polesG = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + //each one will either be 0.0, the fractional slope value, or 1 + + long double inputSampleL; + long double inputSampleR; + double tempSampleL; + double tempSampleR; + double correction; + + 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. + } + + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + //begin L channel + if (fpFlip) { + iirAL = (iirAL * oldA) + (tempSampleL * newA); tempSampleL -= iirAL; correction = iirAL; + } else { + iirBL = (iirBL * oldB) + (tempSampleL * newB); tempSampleL -= iirBL; correction = iirBL; + } + iirCL = (iirCL * oldC) + (tempSampleL * newC); tempSampleL -= iirCL; + iirDL = (iirDL * oldD) + (tempSampleL * newD); tempSampleL -= iirDL; + iirEL = (iirEL * oldE) + (tempSampleL * newE); tempSampleL -= iirEL; + iirFL = (iirFL * oldF) + (tempSampleL * newF); tempSampleL -= iirFL; + iirGL = (iirGL * oldG) + (tempSampleL * newG); tempSampleL -= iirGL; + iirHL = (iirHL * oldH) + (tempSampleL * newH); tempSampleL -= iirHL; + //set up all the iir filters in case they are used + + if (polesC == 1.0) correction += iirCL; if (polesC > 0.0 && polesC < 1.0) correction += (iirCL * polesC); + if (polesD == 1.0) correction += iirDL; if (polesD > 0.0 && polesD < 1.0) correction += (iirDL * polesD); + if (polesE == 1.0) correction += iirEL; if (polesE > 0.0 && polesE < 1.0) correction += (iirEL * polesE); + if (polesF == 1.0) correction += iirFL; if (polesF > 0.0 && polesF < 1.0) correction += (iirFL * polesF); + if (polesG == 1.0) correction += iirGL; if (polesG > 0.0 && polesG < 1.0) correction += (iirGL * polesG); + if (polesH == 1.0) correction += iirHL; if (polesH > 0.0 && polesH < 1.0) correction += (iirHL * polesH); + //each of these are added directly if they're fully engaged, + //multiplied by 0-1 if they are the interpolated one, or skipped if they are beyond the interpolated one. + //the purpose is to do all the math at the floating point exponent nearest to the tiny value in use. + //also, it's formatted that way to easily substitute the next variable: this could be written as a loop + //with everything an array value. However, this makes just as much sense for this few poles. + + inputSampleL -= correction; + //end L channel + + //begin R channel + if (fpFlip) { + iirAR = (iirAR * oldA) + (tempSampleR * newA); tempSampleR -= iirAR; correction = iirAR; + } else { + iirBR = (iirBR * oldB) + (tempSampleR * newB); tempSampleR -= iirBR; correction = iirBR; + } + iirCR = (iirCR * oldC) + (tempSampleR * newC); tempSampleR -= iirCR; + iirDR = (iirDR * oldD) + (tempSampleR * newD); tempSampleR -= iirDR; + iirER = (iirER * oldE) + (tempSampleR * newE); tempSampleR -= iirER; + iirFR = (iirFR * oldF) + (tempSampleR * newF); tempSampleR -= iirFR; + iirGR = (iirGR * oldG) + (tempSampleR * newG); tempSampleR -= iirGR; + iirHR = (iirHR * oldH) + (tempSampleR * newH); tempSampleR -= iirHR; + //set up all the iir filters in case they are used + + if (polesC == 1.0) correction += iirCR; if (polesC > 0.0 && polesC < 1.0) correction += (iirCR * polesC); + if (polesD == 1.0) correction += iirDR; if (polesD > 0.0 && polesD < 1.0) correction += (iirDR * polesD); + if (polesE == 1.0) correction += iirER; if (polesE > 0.0 && polesE < 1.0) correction += (iirER * polesE); + if (polesF == 1.0) correction += iirFR; if (polesF > 0.0 && polesF < 1.0) correction += (iirFR * polesF); + if (polesG == 1.0) correction += iirGR; if (polesG > 0.0 && polesG < 1.0) correction += (iirGR * polesG); + if (polesH == 1.0) correction += iirHR; if (polesH > 0.0 && polesH < 1.0) correction += (iirHR * polesH); + //each of these are added directly if they're fully engaged, + //multiplied by 0-1 if they are the interpolated one, or skipped if they are beyond the interpolated one. + //the purpose is to do all the math at the floating point exponent nearest to the tiny value in use. + //also, it's formatted that way to easily substitute the next variable: this could be written as a loop + //with everything an array value. However, this makes just as much sense for this few poles. + + inputSampleR -= correction; + //end R channel + + //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 Hermepass::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; + + double rangescale = 0.1 / overallscale; + + double cutoff = pow(A,3); + double slope = pow(B,3) * 6.0; + + double newA = cutoff * rangescale; + double newB = newA; //other part of interleaved IIR is the same + + double newC = cutoff * rangescale; //first extra pole is the same + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newD = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newE = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newF = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newG = cutoff * rangescale; + cutoff = (cutoff * fpOld) + (0.00001 * fpNew); + double newH = cutoff * rangescale; + //converge toward the unvarying fixed cutoff value + + double oldA = 1.0 - newA; + double oldB = 1.0 - newB; + double oldC = 1.0 - newC; + double oldD = 1.0 - newD; + double oldE = 1.0 - newE; + double oldF = 1.0 - newF; + double oldG = 1.0 - newG; + double oldH = 1.0 - newH; + + double polesC; + double polesD; + double polesE; + double polesF; + double polesG; + double polesH; + + polesC = slope; if (slope > 1.0) polesC = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesD = slope; if (slope > 1.0) polesD = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesE = slope; if (slope > 1.0) polesE = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesF = slope; if (slope > 1.0) polesF = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesG = slope; if (slope > 1.0) polesG = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + polesH = slope; if (slope > 1.0) polesH = 1.0; slope -= 1.0; if (slope < 0.0) slope = 0.0; + //each one will either be 0.0, the fractional slope value, or 1 + + long double inputSampleL; + long double inputSampleR; + double tempSampleL; + double tempSampleR; + double correction; + + 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. + } + + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + //begin L channel + if (fpFlip) { + iirAL = (iirAL * oldA) + (tempSampleL * newA); tempSampleL -= iirAL; correction = iirAL; + } else { + iirBL = (iirBL * oldB) + (tempSampleL * newB); tempSampleL -= iirBL; correction = iirBL; + } + iirCL = (iirCL * oldC) + (tempSampleL * newC); tempSampleL -= iirCL; + iirDL = (iirDL * oldD) + (tempSampleL * newD); tempSampleL -= iirDL; + iirEL = (iirEL * oldE) + (tempSampleL * newE); tempSampleL -= iirEL; + iirFL = (iirFL * oldF) + (tempSampleL * newF); tempSampleL -= iirFL; + iirGL = (iirGL * oldG) + (tempSampleL * newG); tempSampleL -= iirGL; + iirHL = (iirHL * oldH) + (tempSampleL * newH); tempSampleL -= iirHL; + //set up all the iir filters in case they are used + + if (polesC == 1.0) correction += iirCL; if (polesC > 0.0 && polesC < 1.0) correction += (iirCL * polesC); + if (polesD == 1.0) correction += iirDL; if (polesD > 0.0 && polesD < 1.0) correction += (iirDL * polesD); + if (polesE == 1.0) correction += iirEL; if (polesE > 0.0 && polesE < 1.0) correction += (iirEL * polesE); + if (polesF == 1.0) correction += iirFL; if (polesF > 0.0 && polesF < 1.0) correction += (iirFL * polesF); + if (polesG == 1.0) correction += iirGL; if (polesG > 0.0 && polesG < 1.0) correction += (iirGL * polesG); + if (polesH == 1.0) correction += iirHL; if (polesH > 0.0 && polesH < 1.0) correction += (iirHL * polesH); + //each of these are added directly if they're fully engaged, + //multiplied by 0-1 if they are the interpolated one, or skipped if they are beyond the interpolated one. + //the purpose is to do all the math at the floating point exponent nearest to the tiny value in use. + //also, it's formatted that way to easily substitute the next variable: this could be written as a loop + //with everything an array value. However, this makes just as much sense for this few poles. + + inputSampleL -= correction; + //end L channel + + //begin R channel + if (fpFlip) { + iirAR = (iirAR * oldA) + (tempSampleR * newA); tempSampleR -= iirAR; correction = iirAR; + } else { + iirBR = (iirBR * oldB) + (tempSampleR * newB); tempSampleR -= iirBR; correction = iirBR; + } + iirCR = (iirCR * oldC) + (tempSampleR * newC); tempSampleR -= iirCR; + iirDR = (iirDR * oldD) + (tempSampleR * newD); tempSampleR -= iirDR; + iirER = (iirER * oldE) + (tempSampleR * newE); tempSampleR -= iirER; + iirFR = (iirFR * oldF) + (tempSampleR * newF); tempSampleR -= iirFR; + iirGR = (iirGR * oldG) + (tempSampleR * newG); tempSampleR -= iirGR; + iirHR = (iirHR * oldH) + (tempSampleR * newH); tempSampleR -= iirHR; + //set up all the iir filters in case they are used + + if (polesC == 1.0) correction += iirCR; if (polesC > 0.0 && polesC < 1.0) correction += (iirCR * polesC); + if (polesD == 1.0) correction += iirDR; if (polesD > 0.0 && polesD < 1.0) correction += (iirDR * polesD); + if (polesE == 1.0) correction += iirER; if (polesE > 0.0 && polesE < 1.0) correction += (iirER * polesE); + if (polesF == 1.0) correction += iirFR; if (polesF > 0.0 && polesF < 1.0) correction += (iirFR * polesF); + if (polesG == 1.0) correction += iirGR; if (polesG > 0.0 && polesG < 1.0) correction += (iirGR * polesG); + if (polesH == 1.0) correction += iirHR; if (polesH > 0.0 && polesH < 1.0) correction += (iirHR * polesH); + //each of these are added directly if they're fully engaged, + //multiplied by 0-1 if they are the interpolated one, or skipped if they are beyond the interpolated one. + //the purpose is to do all the math at the floating point exponent nearest to the tiny value in use. + //also, it's formatted that way to easily substitute the next variable: this could be written as a loop + //with everything an array value. However, this makes just as much sense for this few poles. + + inputSampleR -= correction; + //end R channel + + //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/Hermepass/VSTProject.sln b/plugins/WinVST/Hermepass/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Hermepass/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/Hermepass/VSTProject.vcxproj b/plugins/WinVST/Hermepass/VSTProject.vcxproj new file mode 100755 index 0000000..ed9e8cf --- /dev/null +++ b/plugins/WinVST/Hermepass/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Hermepass.cpp" />
+ <ClCompile Include="HermepassProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Hermepass.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Hermepass64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hermepass/VSTProject.vcxproj.filters b/plugins/WinVST/Hermepass/VSTProject.vcxproj.filters new file mode 100755 index 0000000..21a9ec6 --- /dev/null +++ b/plugins/WinVST/Hermepass/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Hermepass.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HermepassProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Hermepass.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hermepass/VSTProject.vcxproj.user b/plugins/WinVST/Hermepass/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Hermepass/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hermepass/vstplug.def b/plugins/WinVST/Hermepass/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Hermepass/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/HighImpact/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/HighImpact/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/HighImpact/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/HighImpact/.vs/VSTProject/v14/.suo b/plugins/WinVST/HighImpact/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..56b69ec --- /dev/null +++ b/plugins/WinVST/HighImpact/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/HighImpact/HighImpact.cpp b/plugins/WinVST/HighImpact/HighImpact.cpp new file mode 100755 index 0000000..0944b18 --- /dev/null +++ b/plugins/WinVST/HighImpact/HighImpact.cpp @@ -0,0 +1,140 @@ +/* ======================================== + * HighImpact - HighImpact.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __HighImpact_H +#include "HighImpact.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new HighImpact(audioMaster);} + +HighImpact::HighImpact(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.0; + C = 0.0; + lastSampleL = 0.0; + lastSampleR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +HighImpact::~HighImpact() {} +VstInt32 HighImpact::getVendorVersion () {return 1000;} +void HighImpact::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void HighImpact::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 HighImpact::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 HighImpact::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 HighImpact::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 + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float HighImpact::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 HighImpact::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Impact", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Output Level", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void HighImpact::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void HighImpact::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 HighImpact::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool HighImpact::getEffectName(char* name) { + vst_strncpy(name, "HighImpact", kVstMaxProductStrLen); return true; +} + +VstPlugCategory HighImpact::getPlugCategory() {return kPlugCategEffect;} + +bool HighImpact::getProductString(char* text) { + vst_strncpy (text, "airwindows HighImpact", kVstMaxProductStrLen); return true; +} + +bool HighImpact::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/HighImpact/HighImpact.h b/plugins/WinVST/HighImpact/HighImpact.h new file mode 100755 index 0000000..9c7a4a0 --- /dev/null +++ b/plugins/WinVST/HighImpact/HighImpact.h @@ -0,0 +1,73 @@ +/* ======================================== + * HighImpact - HighImpact.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __HighImpact_H +#define __HighImpact_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'himp'; //Change this to what the AU identity is! + +class HighImpact : + public AudioEffectX +{ +public: + HighImpact(audioMasterCallback audioMaster); + ~HighImpact(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double lastSampleL; + double lastSampleR; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/HighImpact/HighImpactProc.cpp b/plugins/WinVST/HighImpact/HighImpactProc.cpp new file mode 100755 index 0000000..037bbe9 --- /dev/null +++ b/plugins/WinVST/HighImpact/HighImpactProc.cpp @@ -0,0 +1,379 @@ +/* ======================================== + * HighImpact - HighImpact.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __HighImpact_H +#include "HighImpact.h" +#endif + +void HighImpact::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + double density = A*5.0; + double out = density / 5.0; + double sustain = 1.0 - (1.0/(1.0 + (density*A))); + double bridgerectifier; + double count; + double output = B; + double wet = C; + double dry = 1.0-wet; + double clamp; + double threshold = (1.25 - out); + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + count = density; + while (count > 1.0) + { + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + count = count - 1.0; + } + //we have now accounted for any really high density settings. + + while (out > 1.0) out = out - 1.0; + + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + + + //done first density. Next, sustain-reducer + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + bridgerectifier = 1-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-sustain))+(bridgerectifier*sustain); + else inputSampleL = (inputSampleL*(1-sustain))-(bridgerectifier*sustain); + //done sustain removing, converted to Slew inputs + + //done first density. Next, sustain-reducer + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + bridgerectifier = 1-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-sustain))+(bridgerectifier*sustain); + else inputSampleR = (inputSampleR*(1-sustain))-(bridgerectifier*sustain); + //done sustain removing, converted to Slew inputs + + clamp = inputSampleL - lastSampleL; + if (clamp > threshold) + inputSampleL = lastSampleL + threshold; + if (-clamp > threshold) + inputSampleL = lastSampleL - threshold; + lastSampleL = inputSampleL; + + clamp = inputSampleR - lastSampleR; + if (clamp > threshold) + inputSampleR = lastSampleR + threshold; + if (-clamp > threshold) + inputSampleR = lastSampleR - threshold; + lastSampleR = inputSampleR; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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 HighImpact::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 drySampleL; + long double drySampleR; + + double density = A*5.0; + double out = density / 5.0; + double sustain = 1.0 - (1.0/(1.0 + (density*A))); + double bridgerectifier; + double count; + double output = B; + double wet = C; + double dry = 1.0-wet; + double clamp; + double threshold = (1.25 - out); + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + count = density; + while (count > 1.0) + { + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + count = count - 1.0; + } + //we have now accounted for any really high density settings. + + while (out > 1.0) out = out - 1.0; + + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (density > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + + + //done first density. Next, sustain-reducer + bridgerectifier = fabs(inputSampleL)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + bridgerectifier = 1-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-sustain))+(bridgerectifier*sustain); + else inputSampleL = (inputSampleL*(1-sustain))-(bridgerectifier*sustain); + //done sustain removing, converted to Slew inputs + + //done first density. Next, sustain-reducer + bridgerectifier = fabs(inputSampleR)*1.57079633; + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + bridgerectifier = 1-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-sustain))+(bridgerectifier*sustain); + else inputSampleR = (inputSampleR*(1-sustain))-(bridgerectifier*sustain); + //done sustain removing, converted to Slew inputs + + clamp = inputSampleL - lastSampleL; + if (clamp > threshold) + inputSampleL = lastSampleL + threshold; + if (-clamp > threshold) + inputSampleL = lastSampleL - threshold; + lastSampleL = inputSampleL; + + clamp = inputSampleR - lastSampleR; + if (clamp > threshold) + inputSampleR = lastSampleR + threshold; + if (-clamp > threshold) + inputSampleR = lastSampleR - threshold; + lastSampleR = inputSampleR; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/HighImpact/VSTProject.sln b/plugins/WinVST/HighImpact/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/HighImpact/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/HighImpact/VSTProject.vcxproj b/plugins/WinVST/HighImpact/VSTProject.vcxproj new file mode 100755 index 0000000..54f3aef --- /dev/null +++ b/plugins/WinVST/HighImpact/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="HighImpact.cpp" />
+ <ClCompile Include="HighImpactProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="HighImpact.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>HighImpact64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HighImpact/VSTProject.vcxproj.filters b/plugins/WinVST/HighImpact/VSTProject.vcxproj.filters new file mode 100755 index 0000000..0ff6215 --- /dev/null +++ b/plugins/WinVST/HighImpact/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HighImpact.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HighImpactProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="HighImpact.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HighImpact/VSTProject.vcxproj.user b/plugins/WinVST/HighImpact/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/HighImpact/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/HighImpact/vstplug.def b/plugins/WinVST/HighImpact/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/HighImpact/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Highpass/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Highpass/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Highpass/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Highpass/.vs/VSTProject/v14/.suo b/plugins/WinVST/Highpass/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..9f7300c --- /dev/null +++ b/plugins/WinVST/Highpass/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Highpass/Highpass.cpp b/plugins/WinVST/Highpass/Highpass.cpp new file mode 100755 index 0000000..ed43f9d --- /dev/null +++ b/plugins/WinVST/Highpass/Highpass.cpp @@ -0,0 +1,147 @@ +/* ======================================== + * Highpass - Highpass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Highpass_H +#include "Highpass.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Highpass(audioMaster);} + +Highpass::Highpass(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.5; + C = 1.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Highpass::~Highpass() {} +VstInt32 Highpass::getVendorVersion () {return 1000;} +void Highpass::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Highpass::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 Highpass::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Highpass::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Highpass::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 + case kParamC: C = value; break; + 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 Highpass.h file to do it. +} + +float Highpass::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Highpass::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Highpass", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Loose/Tight", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Highpass::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B * 2.0)-1.0, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Highpass::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Highpass::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Highpass::getEffectName(char* name) { + vst_strncpy(name, "Highpass", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Highpass::getPlugCategory() {return kPlugCategEffect;} + +bool Highpass::getProductString(char* text) { + vst_strncpy (text, "airwindows Highpass", kVstMaxProductStrLen); return true; +} + +bool Highpass::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Highpass/Highpass.h b/plugins/WinVST/Highpass/Highpass.h new file mode 100755 index 0000000..03d8609 --- /dev/null +++ b/plugins/WinVST/Highpass/Highpass.h @@ -0,0 +1,74 @@ +/* ======================================== + * Highpass - Highpass.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Highpass_H +#define __Highpass_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'hpas'; //Change this to what the AU identity is! + +class Highpass : + public AudioEffectX +{ +public: + Highpass(audioMasterCallback audioMaster); + ~Highpass(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + +}; + +#endif diff --git a/plugins/WinVST/Highpass/HighpassProc.cpp b/plugins/WinVST/Highpass/HighpassProc.cpp new file mode 100755 index 0000000..b1e7de9 --- /dev/null +++ b/plugins/WinVST/Highpass/HighpassProc.cpp @@ -0,0 +1,298 @@ +/* ======================================== + * Highpass - Highpass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Highpass_H +#include "Highpass.h" +#endif + +void Highpass::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 iirAmount = pow(A,3)/overallscale; + double tight = (B*2.0)-1.0; + double wet = C; + double dry = 1.0 - wet; + double offset; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + iirAmount += (iirAmount * tight * tight); + if (tight > 0) tight /= 1.5; + else tight /= 3.0; + //we are setting it up so that to either extreme we can get an audible sound, + //but sort of scaled so small adjustments don't shift the cutoff frequency yet. + if (iirAmount <= 0.0) iirAmount = 0.0; + if (iirAmount > 1.0) iirAmount = 1.0; + //handle the change in cutoff frequency + + 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. + } + outputSampleL = inputSampleL; + outputSampleR = inputSampleR; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = outputSampleL - iirSampleAL; + } + else + { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = outputSampleL - iirSampleBL; + } + + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = outputSampleR - iirSampleAR; + } + else + { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = outputSampleR - iirSampleBR; + } + + + + if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); + if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); + + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = outputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLA; + + fpTemp = outputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRA; + } + else { + fpTemp = outputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLB; + + fpTemp = outputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = outputSampleL; + *out2 = outputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void Highpass::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 iirAmount = pow(A,3)/overallscale; + double tight = (B*2.0)-1.0; + double wet = C; + double dry = 1.0 - wet; + double offset; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + iirAmount += (iirAmount * tight * tight); + if (tight > 0) tight /= 1.5; + else tight /= 3.0; + //we are setting it up so that to either extreme we can get an audible sound, + //but sort of scaled so small adjustments don't shift the cutoff frequency yet. + if (iirAmount <= 0.0) iirAmount = 0.0; + if (iirAmount > 1.0) iirAmount = 1.0; + //handle the change in cutoff frequency + + 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. + } + outputSampleL = inputSampleL; + outputSampleR = inputSampleR; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = outputSampleL - iirSampleAL; + } + else + { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = outputSampleL - iirSampleBL; + } + + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = outputSampleR - iirSampleAR; + } + else + { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = outputSampleR - iirSampleBR; + } + + + + if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); + if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); + + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = outputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLA; + + fpTemp = outputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRA; + } + else { + fpTemp = outputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLB; + + fpTemp = outputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = outputSampleL; + *out2 = outputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/Highpass/VSTProject.sln b/plugins/WinVST/Highpass/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Highpass/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/Highpass/VSTProject.vcxproj b/plugins/WinVST/Highpass/VSTProject.vcxproj new file mode 100755 index 0000000..c5c9996 --- /dev/null +++ b/plugins/WinVST/Highpass/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Highpass.cpp" />
+ <ClCompile Include="HighpassProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Highpass.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Highpass64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Highpass/VSTProject.vcxproj.filters b/plugins/WinVST/Highpass/VSTProject.vcxproj.filters new file mode 100755 index 0000000..1b4a930 --- /dev/null +++ b/plugins/WinVST/Highpass/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Highpass.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HighpassProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Highpass.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Highpass/VSTProject.vcxproj.user b/plugins/WinVST/Highpass/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Highpass/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Highpass/vstplug.def b/plugins/WinVST/Highpass/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Highpass/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Hombre/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Hombre/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Hombre/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Hombre/.vs/VSTProject/v14/.suo b/plugins/WinVST/Hombre/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..1c81394 --- /dev/null +++ b/plugins/WinVST/Hombre/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Hombre/Hombre.cpp b/plugins/WinVST/Hombre/Hombre.cpp new file mode 100755 index 0000000..9ef8844 --- /dev/null +++ b/plugins/WinVST/Hombre/Hombre.cpp @@ -0,0 +1,133 @@ +/* ======================================== + * Hombre - Hombre.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Hombre_H +#include "Hombre.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Hombre(audioMaster);} + +Hombre::Hombre(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.421; + B = 0.5; + for(int count = 0; count < 4000; count++) {pL[count] = 0.0; pR[count] = 0.0;} + gcount = 0; + slide = 0.421; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Hombre::~Hombre() {} +VstInt32 Hombre::getVendorVersion () {return 1000;} +void Hombre::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Hombre::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 Hombre::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 Hombre::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 Hombre::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Hombre::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 Hombre::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Voicing", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Intensity", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Hombre::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Hombre::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Hombre::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Hombre::getEffectName(char* name) { + vst_strncpy(name, "Hombre", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Hombre::getPlugCategory() {return kPlugCategEffect;} + +bool Hombre::getProductString(char* text) { + vst_strncpy (text, "airwindows Hombre", kVstMaxProductStrLen); return true; +} + +bool Hombre::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Hombre/Hombre.h b/plugins/WinVST/Hombre/Hombre.h new file mode 100755 index 0000000..94e29b1 --- /dev/null +++ b/plugins/WinVST/Hombre/Hombre.h @@ -0,0 +1,72 @@ +/* ======================================== + * Hombre - Hombre.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Hombre_H +#define __Hombre_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'hmbr'; //Change this to what the AU identity is! + +class Hombre : + public AudioEffectX +{ +public: + Hombre(audioMasterCallback audioMaster); + ~Hombre(); + 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 pL[4001]; + double pR[4001]; + double slide; + int gcount; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Hombre/HombreProc.cpp b/plugins/WinVST/Hombre/HombreProc.cpp new file mode 100755 index 0000000..01e08bd --- /dev/null +++ b/plugins/WinVST/Hombre/HombreProc.cpp @@ -0,0 +1,322 @@ +/* ======================================== + * Hombre - Hombre.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Hombre_H +#include "Hombre.h" +#endif + +void Hombre::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; + + double target = A; + double offsetA; + double offsetB; + int widthA = (int)(1.0*overallscale); + int widthB = (int)(7.0*overallscale); //max 364 at 44.1, 792 at 96K + double wet = B; + double dry = 1.0 - wet; + double totalL; + double totalR; + int count; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + slide = (slide * 0.9997)+(target*0.0003); + + offsetA = ((pow(slide,2)) * 77)+3.2; + offsetB = (3.85 * offsetA)+41; + offsetA *= overallscale; + offsetB *= overallscale; + //adjust for sample rate + + if (gcount < 1 || gcount > 2000) {gcount = 2000;} + count = gcount; + + pL[count+2000] = pL[count] = inputSampleL; + pR[count+2000] = pR[count] = inputSampleR; + //double buffer + + count = (int)(gcount+floor(offsetA)); + + totalL = pL[count] * 0.391; //less as value moves away from .0 + totalL += pL[count+widthA]; //we can assume always using this in one way or another? + totalL += pL[count+widthA+widthA] * 0.391; //greater as value moves away from .0 + + totalR = pR[count] * 0.391; //less as value moves away from .0 + totalR += pR[count+widthA]; //we can assume always using this in one way or another? + totalR += pR[count+widthA+widthA] * 0.391; //greater as value moves away from .0 + + inputSampleL += ((totalL * 0.274)); + inputSampleR += ((totalR * 0.274)); + + count = (int)(gcount+floor(offsetB)); + + totalL = pL[count] * 0.918; //less as value moves away from .0 + totalL += pL[count+widthB]; //we can assume always using this in one way or another? + totalL += pL[count+widthB+widthB] * 0.918; //greater as value moves away from .0 + + totalR = pR[count] * 0.918; //less as value moves away from .0 + totalR += pR[count+widthB]; //we can assume always using this in one way or another? + totalR += pR[count+widthB+widthB] * 0.918; //greater as value moves away from .0 + + inputSampleL -= ((totalL * 0.629)); + inputSampleR -= ((totalR * 0.629)); + + inputSampleL /= 4; + inputSampleR /= 4; + + gcount--; + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 Hombre::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; + + double target = A; + double offsetA; + double offsetB; + int widthA = (int)(1.0*overallscale); + int widthB = (int)(7.0*overallscale); //max 364 at 44.1, 792 at 96K + double wet = B; + double dry = 1.0 - wet; + double totalL; + double totalR; + int count; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + slide = (slide * 0.9997)+(target*0.0003); + + offsetA = ((pow(slide,2)) * 77)+3.2; + offsetB = (3.85 * offsetA)+41; + offsetA *= overallscale; + offsetB *= overallscale; + //adjust for sample rate + + if (gcount < 1 || gcount > 2000) {gcount = 2000;} + count = gcount; + + pL[count+2000] = pL[count] = inputSampleL; + pR[count+2000] = pR[count] = inputSampleR; + //double buffer + + count = (int)(gcount+floor(offsetA)); + + totalL = pL[count] * 0.391; //less as value moves away from .0 + totalL += pL[count+widthA]; //we can assume always using this in one way or another? + totalL += pL[count+widthA+widthA] * 0.391; //greater as value moves away from .0 + + totalR = pR[count] * 0.391; //less as value moves away from .0 + totalR += pR[count+widthA]; //we can assume always using this in one way or another? + totalR += pR[count+widthA+widthA] * 0.391; //greater as value moves away from .0 + + inputSampleL += ((totalL * 0.274)); + inputSampleR += ((totalR * 0.274)); + + count = (int)(gcount+floor(offsetB)); + + totalL = pL[count] * 0.918; //less as value moves away from .0 + totalL += pL[count+widthB]; //we can assume always using this in one way or another? + totalL += pL[count+widthB+widthB] * 0.918; //greater as value moves away from .0 + + totalR = pR[count] * 0.918; //less as value moves away from .0 + totalR += pR[count+widthB]; //we can assume always using this in one way or another? + totalR += pR[count+widthB+widthB] * 0.918; //greater as value moves away from .0 + + inputSampleL -= ((totalL * 0.629)); + inputSampleR -= ((totalR * 0.629)); + + inputSampleL /= 4; + inputSampleR /= 4; + + gcount--; + //still scrolling through the samples, remember + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/Hombre/VSTProject.sln b/plugins/WinVST/Hombre/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Hombre/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/Hombre/VSTProject.vcxproj b/plugins/WinVST/Hombre/VSTProject.vcxproj new file mode 100755 index 0000000..7056d59 --- /dev/null +++ b/plugins/WinVST/Hombre/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Hombre.cpp" />
+ <ClCompile Include="HombreProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Hombre.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Hombre64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hombre/VSTProject.vcxproj.filters b/plugins/WinVST/Hombre/VSTProject.vcxproj.filters new file mode 100755 index 0000000..06bc650 --- /dev/null +++ b/plugins/WinVST/Hombre/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Hombre.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="HombreProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Hombre.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hombre/VSTProject.vcxproj.user b/plugins/WinVST/Hombre/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Hombre/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Hombre/vstplug.def b/plugins/WinVST/Hombre/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Hombre/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/IronOxide5/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/IronOxide5/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/IronOxide5/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/IronOxide5/.vs/VSTProject/v14/.suo b/plugins/WinVST/IronOxide5/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..171a825 --- /dev/null +++ b/plugins/WinVST/IronOxide5/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/IronOxide5/IronOxide5.cpp b/plugins/WinVST/IronOxide5/IronOxide5.cpp new file mode 100755 index 0000000..2d7c84f --- /dev/null +++ b/plugins/WinVST/IronOxide5/IronOxide5.cpp @@ -0,0 +1,196 @@ +/* ======================================== + * IronOxide5 - IronOxide5.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __IronOxide5_H +#include "IronOxide5.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new IronOxide5(audioMaster);} + +IronOxide5::IronOxide5(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; //0.0 input trim in dB -18 to +18, default 0 ((A*36.0)-18.0) + B = 0.562341325190349; //15.0 ips 1.5 to 150.0 logarithmic. B*B + C = 0.562341325190349; // (C*C) * (C*C) * 150 gives 15 ips (clamp to 1.5 minimum) + //15.0 (0.316227766016838)squared * 150 gives 15 ips + D = 0.5; //0.5 flutter 0 to 1 + E = 0.5; //0.5 noise 0 to 1 + F = 0.5; //0.0 output trim in dB -18 to +18, default 0 ((E*36.0)-18.0) + G = 1.0; //1.0 inv/dry/wet -1 0 1 ((F*2.0)-1.0) + //needs very fussy defaults to comply with unusual defaults + + for (int temp = 0; temp < 263; temp++) {dL[temp] = 0.0; dR[temp] = 0.0;} + gcount = 0; + + fastIIRAL = fastIIRBL = slowIIRAL = slowIIRBL = 0.0; + fastIIHAL = fastIIHBL = slowIIHAL = slowIIHBL = 0.0; + iirSamplehAL = iirSamplehBL = 0.0; + iirSampleAL = iirSampleBL = 0.0; + prevInputSampleL = 0.0; + + fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; + fastIIHAR = fastIIHBR = slowIIHAR = slowIIHBR = 0.0; + iirSamplehAR = iirSamplehBR = 0.0; + iirSampleAR = iirSampleBR = 0.0; + prevInputSampleR = 0.0; + + flip = false; + for (int temp = 0; temp < 99; temp++) {flL[temp] = 0.0; flR[temp] = 0.0;} + + fstoredcount = 0; + sweep = 0.0; + rateof = 0.5; + nextmax = 0.5; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +IronOxide5::~IronOxide5() {} +VstInt32 IronOxide5::getVendorVersion () {return 1000;} +void IronOxide5::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void IronOxide5::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 IronOxide5::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + chunkData[6] = G; + /* 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 IronOxide5::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + G = pinParameter(chunkData[6]); + /* 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 IronOxide5::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + case kParamG: G = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float IronOxide5::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; break; + case kParamG: return G; 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 IronOxide5::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input Trim", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Tape High", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Tape Low", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Flutter", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Noise", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Output Trim", kVstMaxParamStrLen); break; + case kParamG: vst_strncpy (text, "Inv/Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void IronOxide5::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (((A*36.0)-18.0), text, kVstMaxParamStrLen); break; + case kParamB: float2string (((B*B)*(B*B)*148.5)+1.5, text, kVstMaxParamStrLen); break; + case kParamC: float2string (((C*C)*(C*C)*148.5)+1.5, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (((F*36.0)-18.0), text, kVstMaxParamStrLen); break; + case kParamG: float2string (((G*2.0)-1.0), text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void IronOxide5::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "ips", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "ips", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 IronOxide5::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool IronOxide5::getEffectName(char* name) { + vst_strncpy(name, "IronOxide5", kVstMaxProductStrLen); return true; +} + +VstPlugCategory IronOxide5::getPlugCategory() {return kPlugCategEffect;} + +bool IronOxide5::getProductString(char* text) { + vst_strncpy (text, "airwindows IronOxide5", kVstMaxProductStrLen); return true; +} + +bool IronOxide5::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/IronOxide5/IronOxide5.h b/plugins/WinVST/IronOxide5/IronOxide5.h new file mode 100755 index 0000000..a7cad5d --- /dev/null +++ b/plugins/WinVST/IronOxide5/IronOxide5.h @@ -0,0 +1,121 @@ +/* ======================================== + * IronOxide5 - IronOxide5.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __IronOxide5_H +#define __IronOxide5_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kParamG = 6, + kNumParameters = 7 + +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'feob'; //Change this to what the AU identity is! + +class IronOxide5 : + public AudioEffectX +{ +public: + IronOxide5(audioMasterCallback audioMaster); + ~IronOxide5(); + 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 iirSamplehAL; + double iirSamplehBL; + double iirSampleAL; + double iirSampleBL; + double dL[264]; + double fastIIRAL; + double fastIIRBL; + double slowIIRAL; + double slowIIRBL; + double fastIIHAL; + double fastIIHBL; + double slowIIHAL; + double slowIIHBL; + double prevInputSampleL; + + double iirSamplehAR; + double iirSamplehBR; + double iirSampleAR; + double iirSampleBR; + double dR[264]; + double fastIIRAR; + double fastIIRBR; + double slowIIRAR; + double slowIIRBR; + double fastIIHAR; + double fastIIHBR; + double slowIIHAR; + double slowIIHBR; + double prevInputSampleR; + + int gcount; + bool flip; + + double flL[100]; + double flR[100]; + + int fstoredcount; + double rateof; + double sweep; + double nextmax; + + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; + float G; + +}; + +#endif diff --git a/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp new file mode 100755 index 0000000..c0fbb35 --- /dev/null +++ b/plugins/WinVST/IronOxide5/IronOxide5Proc.cpp @@ -0,0 +1,898 @@ +/* ======================================== + * IronOxide5 - IronOxide5.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __IronOxide5_H +#include "IronOxide5.h" +#endif + +void IronOxide5::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; + + double inputgain = pow(10.0,((A*36.0)-18.0)/20.0); + double outputgain = pow(10.0,((F*36.0)-18.0)/20.0); + double ips = (((B*B)*(B*B)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (ips < 1 || ips > 200){ips=33.0;} + //sanity checks are always key + double tempRandy = 0.04+(0.11/sqrt(ips)); + double randy; + double lps = (((C*C)*(C*C)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (lps < 1 || lps > 200){lps=33.0;} + //sanity checks are always key + double iirAmount = lps/430.0; //for low leaning + double bridgerectifierL; + double bridgerectifierR; + double fastTaper = ips/15.0; + double slowTaper = 2.0/(lps*lps); + double lowspeedscale = (5.0/ips); + int count; + int flutcount; + double flutterrandy; + double temp; + double depth = pow(D,2)*overallscale; + double fluttertrim = 0.00581/overallscale; + double sweeptrim = (0.0005*depth)/overallscale; + double offset; + double flooroffset; + double tupi = 3.141592653589793238 * 2.0; + double newrate = 0.006/overallscale; + double oldrate = 1.0-newrate; + if (overallscale == 0) {fastTaper += 1.0; slowTaper += 1.0;} + else + { + iirAmount /= overallscale; + lowspeedscale *= overallscale; + fastTaper = 1.0 + (fastTaper / overallscale); + slowTaper = 1.0 + (slowTaper / overallscale); + } + + double noise = E * 0.5; + double invdrywet = ((G*2.0)-1.0); + double dry = 1.0; + if (invdrywet > 0.0) dry -= invdrywet; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + flutterrandy = (rand()/(double)RAND_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;} + flutcount = fstoredcount; + flL[flutcount+31] = flL[flutcount] = inputSampleL; + flR[flutcount+31] = flR[flutcount] = inputSampleR; + offset = (1.0 + sin(sweep)) * depth; + flooroffset = offset-floor(offset); + flutcount += (int)floor(offset); + bridgerectifierL = (flL[flutcount] * (1-flooroffset)); + bridgerectifierR = (flR[flutcount] * (1-flooroffset)); + bridgerectifierL += (flL[flutcount+1] * flooroffset); + bridgerectifierR += (flR[flutcount+1] * flooroffset); + rateof = (nextmax * newrate) + (rateof * oldrate); + sweep += rateof * fluttertrim; + sweep += sweep * sweeptrim; + if (sweep >= tupi){sweep = 0.0; nextmax = 0.02 + (flutterrandy*0.98);} + fstoredcount--; + inputSampleL = bridgerectifierL; + inputSampleR = bridgerectifierR; + //apply to input signal, interpolate samples + //all the funky renaming is just trying to fix how I never reassigned the control numbers + + if (flip) + { + iirSampleAL = (iirSampleAL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleAR = (iirSampleAR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleAL; + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleBR = (iirSampleBR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleBL; + inputSampleR -= iirSampleBR; + } + //do IIR highpass for leaning out + + inputSampleL *= inputgain; + inputSampleR *= inputgain; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //preliminary gain stage using antialiasing + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //preliminary gain stage using antialiasing + + //over to the Iron Oxide shaping code using inputsample + if (gcount < 0 || gcount > 131) {gcount = 131;} + count = gcount; + //increment the counter + + dL[count+131] = dL[count] = inputSampleL; + dR[count+131] = dR[count] = inputSampleR; + + if (flip) + { + fastIIRAL = fastIIRAL/fastTaper; + slowIIRAL = slowIIRAL/slowTaper; + fastIIRAL += dL[count]; + //scale stuff down + + fastIIRAR = fastIIRAR/fastTaper; + slowIIRAR = slowIIRAR/slowTaper; + fastIIRAR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; //end L + slowIIRAL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; //end R + slowIIRAR += (temp/128); + + inputSampleL = fastIIRAL - (slowIIRAL / slowTaper); + inputSampleR = fastIIRAR - (slowIIRAR / slowTaper); + } + else + { + fastIIRBL = fastIIRBL/fastTaper; + slowIIRBL = slowIIRBL/slowTaper; + fastIIRBL += dL[count]; + //scale stuff down + + fastIIRBR = fastIIRBR/fastTaper; + slowIIRBR = slowIIRBR/slowTaper; + fastIIRBR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; + slowIIRBL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; + slowIIRBR += (temp/128); + + inputSampleL = fastIIRBL - (slowIIRBL / slowTaper); + inputSampleR = fastIIRBR - (slowIIRBR / slowTaper); + } + + inputSampleL /= fastTaper; + inputSampleR /= fastTaper; + inputSampleL /= lowspeedscale; + inputSampleR /= lowspeedscale; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + //can use as an output limiter + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + //can use as an output limiter + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + randy = (0.55 + tempRandy + ((rand()/(double)RAND_MAX)*tempRandy))*noise; //0 to 2 + + inputSampleL *= (1.0 - randy); + inputSampleL += (prevInputSampleL*randy); + prevInputSampleL = drySampleL; + + inputSampleR *= (1.0 - randy); + inputSampleR += (prevInputSampleR*randy); + prevInputSampleR = drySampleR; + //a slew-based noise generator: noise is only relative to how much change between samples there is. + //This will cause high sample rates to be a little 'smoother' and clearer. I see this mechanic as something that + //interacts with the sample rate. The 'dust' is scaled to the size of the samples. + + flip = !flip; + + //begin invdrywet block with outputgain + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + if (invdrywet != 1.0) { + inputSampleL *= invdrywet; + inputSampleR *= invdrywet; + } + if (dry != 1.0) { + drySampleL *= dry; + drySampleR *= dry; + } + if (fabs(drySampleL) > 0.0) { + inputSampleL += drySampleL; + } + if (fabs(drySampleR) > 0.0) { + inputSampleR += drySampleR; + } + //end invdrywet block with outputgain + + //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 IronOxide5::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputgain = pow(10.0,((A*36.0)-18.0)/20.0); + double outputgain = pow(10.0,((F*36.0)-18.0)/20.0); + double ips = (((B*B)*(B*B)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (ips < 1 || ips > 200){ips=33.0;} + //sanity checks are always key + double tempRandy = 0.04+(0.11/sqrt(ips)); + double randy; + double lps = (((C*C)*(C*C)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (lps < 1 || lps > 200){lps=33.0;} + //sanity checks are always key + double iirAmount = lps/430.0; //for low leaning + double bridgerectifierL; + double bridgerectifierR; + double fastTaper = ips/15.0; + double slowTaper = 2.0/(lps*lps); + double lowspeedscale = (5.0/ips); + int count; + int flutcount; + double flutterrandy; + double temp; + double depth = pow(D,2)*overallscale; + double fluttertrim = 0.00581/overallscale; + double sweeptrim = (0.0005*depth)/overallscale; + double offset; + double flooroffset; + double tupi = 3.141592653589793238 * 2.0; + double newrate = 0.006/overallscale; + double oldrate = 1.0-newrate; + if (overallscale == 0) {fastTaper += 1.0; slowTaper += 1.0;} + else + { + iirAmount /= overallscale; + lowspeedscale *= overallscale; + fastTaper = 1.0 + (fastTaper / overallscale); + slowTaper = 1.0 + (slowTaper / overallscale); + } + + double noise = E * 0.5; + double invdrywet = ((G*2.0)-1.0); + double dry = 1.0; + if (invdrywet > 0.0) dry -= invdrywet; + + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + flutterrandy = (rand()/(double)RAND_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;} + flutcount = fstoredcount; + flL[flutcount+31] = flL[flutcount] = inputSampleL; + flR[flutcount+31] = flR[flutcount] = inputSampleR; + offset = (1.0 + sin(sweep)) * depth; + flooroffset = offset-floor(offset); + flutcount += (int)floor(offset); + bridgerectifierL = (flL[flutcount] * (1-flooroffset)); + bridgerectifierR = (flR[flutcount] * (1-flooroffset)); + bridgerectifierL += (flL[flutcount+1] * flooroffset); + bridgerectifierR += (flR[flutcount+1] * flooroffset); + rateof = (nextmax * newrate) + (rateof * oldrate); + sweep += rateof * fluttertrim; + sweep += sweep * sweeptrim; + if (sweep >= tupi){sweep = 0.0; nextmax = 0.02 + (flutterrandy*0.98);} + fstoredcount--; + inputSampleL = bridgerectifierL; + inputSampleR = bridgerectifierR; + //apply to input signal, interpolate samples + //all the funky renaming is just trying to fix how I never reassigned the control numbers + + if (flip) + { + iirSampleAL = (iirSampleAL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleAR = (iirSampleAR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleAL; + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleBR = (iirSampleBR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleBL; + inputSampleR -= iirSampleBR; + } + //do IIR highpass for leaning out + + inputSampleL *= inputgain; + inputSampleR *= inputgain; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //preliminary gain stage using antialiasing + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //preliminary gain stage using antialiasing + + //over to the Iron Oxide shaping code using inputsample + if (gcount < 0 || gcount > 131) {gcount = 131;} + count = gcount; + //increment the counter + + dL[count+131] = dL[count] = inputSampleL; + dR[count+131] = dR[count] = inputSampleR; + + if (flip) + { + fastIIRAL = fastIIRAL/fastTaper; + slowIIRAL = slowIIRAL/slowTaper; + fastIIRAL += dL[count]; + //scale stuff down + + fastIIRAR = fastIIRAR/fastTaper; + slowIIRAR = slowIIRAR/slowTaper; + fastIIRAR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; //end L + slowIIRAL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; //end R + slowIIRAR += (temp/128); + + inputSampleL = fastIIRAL - (slowIIRAL / slowTaper); + inputSampleR = fastIIRAR - (slowIIRAR / slowTaper); + } + else + { + fastIIRBL = fastIIRBL/fastTaper; + slowIIRBL = slowIIRBL/slowTaper; + fastIIRBL += dL[count]; + //scale stuff down + + fastIIRBR = fastIIRBR/fastTaper; + slowIIRBR = slowIIRBR/slowTaper; + fastIIRBR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; + slowIIRBL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; + slowIIRBR += (temp/128); + + inputSampleL = fastIIRBL - (slowIIRBL / slowTaper); + inputSampleR = fastIIRBR - (slowIIRBR / slowTaper); + } + + inputSampleL /= fastTaper; + inputSampleR /= fastTaper; + inputSampleL /= lowspeedscale; + inputSampleR /= lowspeedscale; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + //can use as an output limiter + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + //can use as an output limiter + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + randy = (0.55 + tempRandy + ((rand()/(double)RAND_MAX)*tempRandy))*noise; //0 to 2 + + inputSampleL *= (1.0 - randy); + inputSampleL += (prevInputSampleL*randy); + prevInputSampleL = drySampleL; + + inputSampleR *= (1.0 - randy); + inputSampleR += (prevInputSampleR*randy); + prevInputSampleR = drySampleR; + //a slew-based noise generator: noise is only relative to how much change between samples there is. + //This will cause high sample rates to be a little 'smoother' and clearer. I see this mechanic as something that + //interacts with the sample rate. The 'dust' is scaled to the size of the samples. + + flip = !flip; + + //begin invdrywet block with outputgain + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + if (invdrywet != 1.0) { + inputSampleL *= invdrywet; + inputSampleR *= invdrywet; + } + if (dry != 1.0) { + drySampleL *= dry; + drySampleR *= dry; + } + if (fabs(drySampleL) > 0.0) { + inputSampleL += drySampleL; + } + if (fabs(drySampleR) > 0.0) { + inputSampleR += drySampleR; + } + //end invdrywet block with outputgain + + //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/IronOxide5/VSTProject.sln b/plugins/WinVST/IronOxide5/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/IronOxide5/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/IronOxide5/VSTProject.vcxproj b/plugins/WinVST/IronOxide5/VSTProject.vcxproj new file mode 100755 index 0000000..350b7a9 --- /dev/null +++ b/plugins/WinVST/IronOxide5/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="IronOxide5.cpp" />
+ <ClCompile Include="IronOxide5Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="IronOxide5.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>IronOxide564</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxide5/VSTProject.vcxproj.filters b/plugins/WinVST/IronOxide5/VSTProject.vcxproj.filters new file mode 100755 index 0000000..382c515 --- /dev/null +++ b/plugins/WinVST/IronOxide5/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="IronOxide5.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="IronOxide5Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="IronOxide5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxide5/VSTProject.vcxproj.user b/plugins/WinVST/IronOxide5/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/IronOxide5/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxide5/vstplug.def b/plugins/WinVST/IronOxide5/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/IronOxide5/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/IronOxideClassic/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/IronOxideClassic/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/IronOxideClassic/.vs/VSTProject/v14/.suo b/plugins/WinVST/IronOxideClassic/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..b85b7c1 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp b/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp new file mode 100755 index 0000000..012d8a3 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassic.cpp @@ -0,0 +1,146 @@ +/* ======================================== + * IronOxideClassic - IronOxideClassic.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __IronOxideClassic_H +#include "IronOxideClassic.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new IronOxideClassic(audioMaster);} + +IronOxideClassic::IronOxideClassic(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.562341325190349; + C = 0.5; + + for (int temp = 0; temp < 263; temp++) {dL[temp] = 0.0;dR[temp] = 0.0;} + gcount = 0; + fastIIRAL = fastIIRBL = slowIIRAL = slowIIRBL = 0.0; + iirSampleAL = iirSampleBL = 0.0; + fastIIRAR = fastIIRBR = slowIIRAR = slowIIRBR = 0.0; + iirSampleAR = iirSampleBR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +IronOxideClassic::~IronOxideClassic() {} +VstInt32 IronOxideClassic::getVendorVersion () {return 1000;} +void IronOxideClassic::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void IronOxideClassic::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 IronOxideClassic::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 IronOxideClassic::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 IronOxideClassic::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float IronOxideClassic::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 IronOxideClassic::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input Trim", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Tape Speed", kVstMaxParamStrLen); break; + case kParamC: 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 IronOxideClassic::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (((A*36.0)-18.0), text, kVstMaxParamStrLen); break; + case kParamB: float2string (((B*B)*(B*B)*148.5)+1.5, text, kVstMaxParamStrLen); break; + case kParamC: float2string (((C*36.0)-18.0), text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void IronOxideClassic::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "ips", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 IronOxideClassic::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool IronOxideClassic::getEffectName(char* name) { + vst_strncpy(name, "IronOxideClassic", kVstMaxProductStrLen); return true; +} + +VstPlugCategory IronOxideClassic::getPlugCategory() {return kPlugCategEffect;} + +bool IronOxideClassic::getProductString(char* text) { + vst_strncpy (text, "airwindows IronOxideClassic", kVstMaxProductStrLen); return true; +} + +bool IronOxideClassic::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassic.h b/plugins/WinVST/IronOxideClassic/IronOxideClassic.h new file mode 100755 index 0000000..b7f8bfa --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassic.h @@ -0,0 +1,87 @@ +/* ======================================== + * IronOxideClassic - IronOxideClassic.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __IronOxideClassic_H +#define __IronOxideClassic_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'feoc'; //Change this to what the AU identity is! + +class IronOxideClassic : + public AudioEffectX +{ +public: + IronOxideClassic(audioMasterCallback audioMaster); + ~IronOxideClassic(); + 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 iirSampleAL; + double iirSampleBL; + double dL[264]; + double fastIIRAL; + double fastIIRBL; + double slowIIRAL; + double slowIIRBL; + + double iirSampleAR; + double iirSampleBR; + double dR[264]; + double fastIIRAR; + double fastIIRBR; + double slowIIRAR; + double slowIIRBR; + + int gcount; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp b/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp new file mode 100755 index 0000000..c245166 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/IronOxideClassicProc.cpp @@ -0,0 +1,742 @@ +/* ======================================== + * IronOxideClassic - IronOxideClassic.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __IronOxideClassic_H +#include "IronOxideClassic.h" +#endif + +void IronOxideClassic::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; + + double inputgain = pow(10.0,((A*36.0)-18.0)/20.0); + double outputgain = pow(10.0,((C*36.0)-18.0)/20.0); + double ips = (((B*B)*(B*B)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (ips < 1 || ips > 200){ips=33.0;} + //sanity checks are always key + double iirAmount = ips/430.0; //for low leaning + double bridgerectifierL; + double bridgerectifierR; + double fastTaper = ips/15.0; + double slowTaper = 2.0/(ips*ips); + double lowspeedscale = (5.0/ips); + int count; + double temp; + if (overallscale == 0) {fastTaper += 1.0; slowTaper += 1.0;} + else + { + iirAmount /= overallscale; + lowspeedscale *= overallscale; + fastTaper = 1.0 + (fastTaper / overallscale); + slowTaper = 1.0 + (slowTaper / overallscale); + } + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleAR = (iirSampleAR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleAL; + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleBR = (iirSampleBR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleBL; + inputSampleR -= iirSampleBR; + } + //do IIR highpass for leaning out + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //preliminary gain stage using antialiasing + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //preliminary gain stage using antialiasing + + //over to the Iron Oxide shaping code using inputsample + if (gcount < 0 || gcount > 131) {gcount = 131;} + count = gcount; + //increment the counter + + dL[count+131] = dL[count] = inputSampleL; + dR[count+131] = dR[count] = inputSampleR; + + if (fpFlip) + { + fastIIRAL = fastIIRAL/fastTaper; + slowIIRAL = slowIIRAL/slowTaper; + fastIIRAL += dL[count]; + //scale stuff down + + fastIIRAR = fastIIRAR/fastTaper; + slowIIRAR = slowIIRAR/slowTaper; + fastIIRAR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; //end L + slowIIRAL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; //end R + slowIIRAR += (temp/128); + + inputSampleL = fastIIRAL - (slowIIRAL / slowTaper); + inputSampleR = fastIIRAR - (slowIIRAR / slowTaper); + } + else + { + fastIIRBL = fastIIRBL/fastTaper; + slowIIRBL = slowIIRBL/slowTaper; + fastIIRBL += dL[count]; + //scale stuff down + + fastIIRBR = fastIIRBR/fastTaper; + slowIIRBR = slowIIRBR/slowTaper; + fastIIRBR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; + slowIIRBL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; + slowIIRBR += (temp/128); + + inputSampleL = fastIIRBL - (slowIIRBL / slowTaper); + inputSampleR = fastIIRBR - (slowIIRBR / slowTaper); + } + + inputSampleL /= fastTaper; + inputSampleR /= fastTaper; + inputSampleL /= lowspeedscale; + inputSampleR /= lowspeedscale; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + //can use as an output limiter + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + //can use as an output limiter + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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 IronOxideClassic::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; + + double inputgain = pow(10.0,((A*36.0)-18.0)/20.0); + double outputgain = pow(10.0,((C*36.0)-18.0)/20.0); + double ips = (((B*B)*(B*B)*148.5)+1.5) * 1.1; + //slight correction to dial in convincing ips settings + if (ips < 1 || ips > 200){ips=33.0;} + //sanity checks are always key + double iirAmount = ips/430.0; //for low leaning + double bridgerectifierL; + double bridgerectifierR; + double fastTaper = ips/15.0; + double slowTaper = 2.0/(ips*ips); + double lowspeedscale = (5.0/ips); + int count; + double temp; + if (overallscale == 0) {fastTaper += 1.0; slowTaper += 1.0;} + else + { + iirAmount /= overallscale; + lowspeedscale *= overallscale; + fastTaper = 1.0 + (fastTaper / overallscale); + slowTaper = 1.0 + (slowTaper / overallscale); + } + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleAR = (iirSampleAR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleAL; + inputSampleR -= iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * (1 - iirAmount)) + (inputSampleL * iirAmount); + iirSampleBR = (iirSampleBR * (1 - iirAmount)) + (inputSampleR * iirAmount); + inputSampleL -= iirSampleBL; + inputSampleR -= iirSampleBR; + } + //do IIR highpass for leaning out + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //preliminary gain stage using antialiasing + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //preliminary gain stage using antialiasing + + //over to the Iron Oxide shaping code using inputsample + if (gcount < 0 || gcount > 131) {gcount = 131;} + count = gcount; + //increment the counter + + dL[count+131] = dL[count] = inputSampleL; + dR[count+131] = dR[count] = inputSampleR; + + if (fpFlip) + { + fastIIRAL = fastIIRAL/fastTaper; + slowIIRAL = slowIIRAL/slowTaper; + fastIIRAL += dL[count]; + //scale stuff down + + fastIIRAR = fastIIRAR/fastTaper; + slowIIRAR = slowIIRAR/slowTaper; + fastIIRAR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; //end L + slowIIRAL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; //end R + slowIIRAR += (temp/128); + + inputSampleL = fastIIRAL - (slowIIRAL / slowTaper); + inputSampleR = fastIIRAR - (slowIIRAR / slowTaper); + } + else + { + fastIIRBL = fastIIRBL/fastTaper; + slowIIRBL = slowIIRBL/slowTaper; + fastIIRBL += dL[count]; + //scale stuff down + + fastIIRBR = fastIIRBR/fastTaper; + slowIIRBR = slowIIRBR/slowTaper; + fastIIRBR += dR[count]; + //scale stuff down + count += 3; + + temp = dL[count+127]; + temp += dL[count+113]; + temp += dL[count+109]; + temp += dL[count+107]; + temp += dL[count+103]; + temp += dL[count+101]; + temp += dL[count+97]; + temp += dL[count+89]; + temp += dL[count+83]; + temp /= 2; + temp += dL[count+79]; + temp += dL[count+73]; + temp += dL[count+71]; + temp += dL[count+67]; + temp += dL[count+61]; + temp += dL[count+59]; + temp += dL[count+53]; + temp += dL[count+47]; + temp += dL[count+43]; + temp += dL[count+41]; + temp += dL[count+37]; + temp += dL[count+31]; + temp += dL[count+29]; + temp /= 2; + temp += dL[count+23]; + temp += dL[count+19]; + temp += dL[count+17]; + temp += dL[count+13]; + temp += dL[count+11]; + temp /= 2; + temp += dL[count+7]; + temp += dL[count+5]; + temp += dL[count+3]; + temp /= 2; + temp += dL[count+2]; + temp += dL[count+1]; + slowIIRBL += (temp/128); + + temp = dR[count+127]; + temp += dR[count+113]; + temp += dR[count+109]; + temp += dR[count+107]; + temp += dR[count+103]; + temp += dR[count+101]; + temp += dR[count+97]; + temp += dR[count+89]; + temp += dR[count+83]; + temp /= 2; + temp += dR[count+79]; + temp += dR[count+73]; + temp += dR[count+71]; + temp += dR[count+67]; + temp += dR[count+61]; + temp += dR[count+59]; + temp += dR[count+53]; + temp += dR[count+47]; + temp += dR[count+43]; + temp += dR[count+41]; + temp += dR[count+37]; + temp += dR[count+31]; + temp += dR[count+29]; + temp /= 2; + temp += dR[count+23]; + temp += dR[count+19]; + temp += dR[count+17]; + temp += dR[count+13]; + temp += dR[count+11]; + temp /= 2; + temp += dR[count+7]; + temp += dR[count+5]; + temp += dR[count+3]; + temp /= 2; + temp += dR[count+2]; + temp += dR[count+1]; + slowIIRBR += (temp/128); + + inputSampleL = fastIIRBL - (slowIIRBL / slowTaper); + inputSampleR = fastIIRBR - (slowIIRBR / slowTaper); + } + + inputSampleL /= fastTaper; + inputSampleR /= fastTaper; + inputSampleL /= lowspeedscale; + inputSampleR /= lowspeedscale; + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + //can use as an output limiter + if (inputSampleL > 0.0) inputSampleL = bridgerectifierL; + else inputSampleL = -bridgerectifierL; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + //can use as an output limiter + if (inputSampleR > 0.0) inputSampleR = bridgerectifierR; + else inputSampleR = -bridgerectifierR; + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + //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/IronOxideClassic/VSTProject.sln b/plugins/WinVST/IronOxideClassic/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/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/IronOxideClassic/VSTProject.vcxproj b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj new file mode 100755 index 0000000..8ae3d3a --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="IronOxideClassic.cpp" />
+ <ClCompile Include="IronOxideClassicProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="IronOxideClassic.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>IronOxideClassic64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.filters b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.filters new file mode 100755 index 0000000..4f42ef2 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="IronOxideClassic.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="IronOxideClassicProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="IronOxideClassic.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.user b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/IronOxideClassic/vstplug.def b/plugins/WinVST/IronOxideClassic/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/IronOxideClassic/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo b/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..0a67ad3 --- /dev/null +++ b/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Logical4/Logical4.cpp b/plugins/WinVST/Logical4/Logical4.cpp new file mode 100755 index 0000000..b17cc55 --- /dev/null +++ b/plugins/WinVST/Logical4/Logical4.cpp @@ -0,0 +1,215 @@ +/* ======================================== + * Logical4 - Logical4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Logical4_H +#include "Logical4.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Logical4(audioMaster);} + +Logical4::Logical4(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.2; + C = 0.19202020202020202; + D = 0.5; + E = 1.0; + + //begin ButterComps + controlAposL = 1.0; + controlAnegL = 1.0; + controlBposL = 1.0; + controlBnegL = 1.0; + targetposL = 1.0; + targetnegL = 1.0; + + controlAposBL = 1.0; + controlAnegBL = 1.0; + controlBposBL = 1.0; + controlBnegBL = 1.0; + targetposBL = 1.0; + targetnegBL = 1.0; + + controlAposCL = 1.0; + controlAnegCL = 1.0; + controlBposCL = 1.0; + controlBnegCL = 1.0; + targetposCL = 1.0; + targetnegCL = 1.0; + + avgAL = avgBL = avgCL = avgDL = avgEL = avgFL = 0.0; + nvgAL = nvgBL = nvgCL = nvgDL = nvgEL = nvgFL = 0.0; + //end ButterComps + + //begin ButterComps + controlAposR = 1.0; + controlAnegR = 1.0; + controlBposR = 1.0; + controlBnegR = 1.0; + targetposR = 1.0; + targetnegR = 1.0; + + controlAposBR = 1.0; + controlAnegBR = 1.0; + controlBposBR = 1.0; + controlBnegBR = 1.0; + targetposBR = 1.0; + targetnegBR = 1.0; + + controlAposCR = 1.0; + controlAnegCR = 1.0; + controlBposCR = 1.0; + controlBnegCR = 1.0; + targetposCR = 1.0; + targetnegCR = 1.0; + + avgAR = avgBR = avgCR = avgDR = avgER = avgFR = 0.0; + nvgAR = nvgBR = nvgCR = nvgDR = nvgER = nvgFR = 0.0; + //end ButterComps + + //begin Power Sags + for(int count = 0; count < 999; count++) {dL[count] = 0; bL[count] = 0; cL[count] = 0; dR[count] = 0; bR[count] = 0; cR[count] = 0;} + controlL = 0; controlBL = 0; controlCL = 0; + controlR = 0; controlBR = 0; controlCR = 0; + + gcount = 0; + //end Power Sags + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Logical4::~Logical4() {} +VstInt32 Logical4::getVendorVersion () {return 1000;} +void Logical4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Logical4::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 Logical4::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + /* 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 Logical4::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + /* 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 Logical4::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Logical4::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; 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 Logical4::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Threshold", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Ratio", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "MakeupGn", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Logical4::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ( (A*40.0)-20.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string ( ((B*B)*15.0)+1.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string ( ((C*C)*99.0)+1.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string ( (D*40.0)-20.0, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Logical4::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "/1", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "ms", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Logical4::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Logical4::getEffectName(char* name) { + vst_strncpy(name, "Logical4", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Logical4::getPlugCategory() {return kPlugCategEffect;} + +bool Logical4::getProductString(char* text) { + vst_strncpy (text, "airwindows Logical4", kVstMaxProductStrLen); return true; +} + +bool Logical4::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Logical4/Logical4.h b/plugins/WinVST/Logical4/Logical4.h new file mode 100755 index 0000000..71e118e --- /dev/null +++ b/plugins/WinVST/Logical4/Logical4.h @@ -0,0 +1,160 @@ +/* ======================================== + * Logical4 - Logical4.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Logical4_H +#define __Logical4_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kNumParameters = 5 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'logv'; //Change this to what the AU identity is! + +class Logical4 : + public AudioEffectX +{ +public: + Logical4(audioMasterCallback audioMaster); + ~Logical4(); + 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; + + //begin ButterComp + double controlAposL; + double controlAnegL; + double controlBposL; + double controlBnegL; + double targetposL; + double targetnegL; + double controlAposBL; + double controlAnegBL; + double controlBposBL; + double controlBnegBL; + double targetposBL; + double targetnegBL; + double controlAposCL; + double controlAnegCL; + double controlBposCL; + double controlBnegCL; + double targetposCL; + double targetnegCL; + double avgAL; + double avgBL; + double avgCL; + double avgDL; + double avgEL; + double avgFL; + double nvgAL; + double nvgBL; + double nvgCL; + double nvgDL; + double nvgEL; + double nvgFL; + //end ButterComp + + //begin Power Sag + double dL[1000]; + double controlL; + double bL[1000]; + double controlBL; + double cL[1000]; + double controlCL; + //end Power Sag + + //begin ButterComp + double controlAposR; + double controlAnegR; + double controlBposR; + double controlBnegR; + double targetposR; + double targetnegR; + double controlAposBR; + double controlAnegBR; + double controlBposBR; + double controlBnegBR; + double targetposBR; + double targetnegBR; + double controlAposCR; + double controlAnegCR; + double controlBposCR; + double controlBnegCR; + double targetposCR; + double targetnegCR; + double avgAR; + double avgBR; + double avgCR; + double avgDR; + double avgER; + double avgFR; + double nvgAR; + double nvgBR; + double nvgCR; + double nvgDR; + double nvgER; + double nvgFR; + //end ButterComp + + //begin Power Sag + double dR[1000]; + double controlR; + double bR[1000]; + double controlBR; + double cR[1000]; + double controlCR; + //end Power Sag + + int gcount; + + + double fpNShapeLA; + double fpNShapeLB; + double fpNShapeRA; + double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; +}; + +#endif diff --git a/plugins/WinVST/Logical4/Logical4Proc.cpp b/plugins/WinVST/Logical4/Logical4Proc.cpp new file mode 100755 index 0000000..0d09fcf --- /dev/null +++ b/plugins/WinVST/Logical4/Logical4Proc.cpp @@ -0,0 +1,1794 @@ +/* ======================================== + * Logical4 - Logical4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Logical4_H +#include "Logical4.h" +#endif + +void Logical4::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; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + + float drySampleL; + float drySampleR; + double inputSampleL; + double inputSampleR; + + //begin ButterComp + double inputpos; + double inputneg; + double calcpos; + double calcneg; + double outputpos; + double outputneg; + double totalmultiplier; + double inputgain = pow(10.0,(-((A*40.0)-20.0))/20.0); + //fussing with the controls to make it hit the right threshold values + double compoutgain = inputgain; //let's try compensating for this + + double attackspeed = ((C*C)*99.0)+1.0; + //is in ms + attackspeed = 10.0 / sqrt(attackspeed); + //convert to a remainder for use in comp + double divisor = 0.000782*attackspeed; + //First Speed control + divisor /= overallscale; + double remainder = divisor; + divisor = 1.0 - divisor; + + double divisorB = 0.000819*attackspeed; + //Second Speed control + divisorB /= overallscale; + double remainderB = divisorB; + divisorB = 1.0 - divisorB; + + double divisorC = 0.000857; + //Third Speed control + divisorC /= overallscale; + double remainderC = divisorC*attackspeed; + divisorC = 1.0 - divisorC; + //end ButterComp + + double dynamicDivisor; + double dynamicRemainder; + //used for variable release + + //begin Desk Power Sag + double intensity = 0.0445556; + double depthA = 2.42; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 498) offsetA = 498; + + double depthB = 2.42; //was 3.38 + int offsetB = (int)(depthB * overallscale); + if (offsetB < 1) offsetB = 1; + if (offsetB > 498) offsetB = 498; + + double depthC = 2.42; //was 4.35 + int offsetC = (int)(depthC * overallscale); + if (offsetC < 1) offsetC = 1; + if (offsetC > 498) offsetC = 498; + + double clamp; + double thickness; + double out; + double bridgerectifier; + double powerSag = 0.003300223685324102874217; //was .00365 + //the Power Sag constant is how much the sag is cut back in high compressions. Increasing it + //increases the guts and gnarl of the music, decreasing it or making it negative causes the texture to go + //'ethereal' and unsolid under compression. Very subtle! + //end Desk Power Sag + + double ratio = sqrt(((B*B)*15.0)+1.0)-1.0; + if (ratio > 2.99999) ratio = 2.99999; + if (ratio < 0.0) ratio = 0.0; + //anything we do must adapt to our dry/a/b/c output stages + int ratioselector = floor( ratio ); + //zero to three, it'll become, always with 3 as the max + ratio -= ratioselector; + double invRatio = 1.0 - ratio; + //for all processing we've settled on the 'stage' and are just interpolating between top and bottom + //ratio is the more extreme case, invratio becomes our 'floor' case including drySample + + double outSampleAL = 0.0; + double outSampleBL = 0.0; + double outSampleCL = 0.0; + double outSampleAR = 0.0; + double outSampleBR = 0.0; + double outSampleCR = 0.0; + //what we interpolate between using ratio + + double outputgain = pow(10.0,((D*40.0)-20.0)/20.0); + double wet = E; + double dry = 1.0 - wet; + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + gcount--; + if (gcount < 0 || gcount > 499) {gcount = 499;} + + //begin first Power SagL + dL[gcount+499] = dL[gcount] = fabs(inputSampleL)*(intensity-((controlAposL+controlBposL+controlAnegL+controlBnegL)*powerSag)); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end first Power SagL + + //begin first Power SagR + dR[gcount+499] = dR[gcount] = fabs(inputSampleR)*(intensity-((controlAposR+controlBposR+controlAnegR+controlBnegR)*powerSag)); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end first Power SagR + + //begin first compressorL + if (inputgain != 1.0) inputSampleL *= inputgain; + inputpos = (inputSampleL * fpOld) + (avgAL * fpNew) + 1.0; + avgAL = inputSampleL; + //hovers around 1 when there's no signal + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposL *= dynamicDivisor; + targetposL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposL),2); + //extra tiny, quick, if the inputpos of this polarity is high + + inputneg = (-inputSampleL * fpOld) + (nvgAL * fpNew) + 1.0; + nvgAL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegL *= dynamicDivisor; + targetnegL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegL),2); + //now we have mirrored targets for comp + //each calc is a blowed up chased target from tiny (at high levels of that polarity) to 1 at no input + //calc is the one we want to react differently: go tiny quick, + //outputpos and outputneg go from 0 to 1 + + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposL *= divisor; + controlAposL += (calcpos*remainder); + if (controlAposR > controlAposL) controlAposR = (controlAposR + controlAposL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposL *= divisor; + controlBposL += (calcpos*remainder); + if (controlBposR > controlBposL) controlBposR = (controlBposR + controlBposL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegL *= divisor; + controlAnegL += (calcneg*remainder); + if (controlAnegR > controlAnegL) controlAnegR = (controlAnegR + controlAnegL) * 0.5; + } + else + { + controlBnegL *= divisor; + controlBnegL += (calcneg*remainder); + if (controlBnegR > controlBnegL) controlBnegR = (controlBnegR + controlBnegL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposL * outputpos) + (controlAnegL * outputneg);} + else + {totalmultiplier = (controlBposL * outputpos) + (controlBnegL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleAL = inputSampleL / compoutgain; + //end first compressorL + + //begin first compressorR + if (inputgain != 1.0) inputSampleR *= inputgain; + inputpos = (inputSampleR * fpOld) + (avgAR * fpNew) + 1.0; + avgAR = inputSampleR; + //hovers around 1 when there's no signal + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposR *= dynamicDivisor; + targetposR += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposR),2); + //extra tiny, quick, if the inputpos of this polarity is high + + inputneg = (-inputSampleR * fpOld) + (nvgAR * fpNew) + 1.0; + nvgAR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegR *= dynamicDivisor; + targetnegR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegR),2); + //now we have mirrored targets for comp + //each calc is a blowed up chased target from tiny (at high levels of that polarity) to 1 at no input + //calc is the one we want to react differently: go tiny quick, + //outputpos and outputneg go from 0 to 1 + + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposR *= divisor; + controlAposR += (calcpos*remainder); + if (controlAposL > controlAposR) controlAposL = (controlAposR + controlAposL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposR *= divisor; + controlBposR += (calcpos*remainder); + if (controlBposL > controlBposR) controlBposL = (controlBposR + controlBposL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegR *= divisor; + controlAnegR += (calcneg*remainder); + if (controlAnegL > controlAnegR) controlAnegL = (controlAnegR + controlAnegL) * 0.5; + } + else + { + controlBnegR *= divisor; + controlBnegR += (calcneg*remainder); + if (controlBnegL > controlBnegR) controlBnegL = (controlBnegR + controlBnegL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposR * outputpos) + (controlAnegR * outputneg);} + else + {totalmultiplier = (controlBposR * outputpos) + (controlBnegR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleAR = inputSampleR / compoutgain; + //end first compressorR + + if (ratioselector > 0) { + + //begin second Power SagL + bL[gcount+499] = bL[gcount] = fabs(inputSampleL)*(intensity-((controlAposBL+controlBposBL+controlAnegBL+controlBnegBL)*powerSag)); + controlBL += (bL[gcount] / offsetB); + controlBL -= (bL[gcount+offsetB] / offsetB); + controlBL -= 0.000001; + clamp = 1; + if (controlBL < 0) {controlBL = 0;} + if (controlBL > 1) {clamp -= (controlBL - 1); controlBL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlBL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end second Power SagL + + //begin second Power SagR + bR[gcount+499] = bR[gcount] = fabs(inputSampleR)*(intensity-((controlAposBR+controlBposBR+controlAnegBR+controlBnegBR)*powerSag)); + controlBR += (bR[gcount] / offsetB); + controlBR -= (bR[gcount+offsetB] / offsetB); + controlBR -= 0.000001; + clamp = 1; + if (controlBR < 0) {controlBR = 0;} + if (controlBR > 1) {clamp -= (controlBR - 1); controlBR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlBR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end second Power SagR + + + //begin second compressorL + inputpos = (inputSampleL * fpOld) + (avgBL * fpNew) + 1.0; + avgBL = inputSampleL; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposBL *= dynamicDivisor; + targetposBL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposBL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgBL * fpNew) + 1.0; + nvgBL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegBL *= dynamicDivisor; + targetnegBL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegBL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposBL *= divisorB; + controlAposBL += (calcpos*remainderB); + if (controlAposBR > controlAposBL) controlAposBR = (controlAposBR + controlAposBL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposBL *= divisorB; + controlBposBL += (calcpos*remainderB); + if (controlBposBR > controlBposBL) controlBposBR = (controlBposBR + controlBposBL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegBL *= divisorB; + controlAnegBL += (calcneg*remainderB); + if (controlAnegBR > controlAnegBL) controlAnegBR = (controlAnegBR + controlAnegBL) * 0.5; + } + else + { + controlBnegBL *= divisorB; + controlBnegBL += (calcneg*remainderB); + if (controlBnegBR > controlBnegBL) controlBnegBR = (controlBnegBR + controlBnegBL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposBL * outputpos) + (controlAnegBL * outputneg);} + else + {totalmultiplier = (controlBposBL * outputpos) + (controlBnegBL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleBL = inputSampleL / compoutgain; + //end second compressorL + + //begin second compressorR + inputpos = (inputSampleR * fpOld) + (avgBR * fpNew) + 1.0; + avgBR = inputSampleR; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposBR *= dynamicDivisor; + targetposBR += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposBR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgBR * fpNew) + 1.0; + nvgBR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegBR *= dynamicDivisor; + targetnegBR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegBR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposBR *= divisorB; + controlAposBR += (calcpos*remainderB); + if (controlAposBL > controlAposBR) controlAposBL = (controlAposBR + controlAposBL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposBR *= divisorB; + controlBposBR += (calcpos*remainderB); + if (controlBposBL > controlBposBR) controlBposBL = (controlBposBR + controlBposBL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegBR *= divisorB; + controlAnegBR += (calcneg*remainderB); + if (controlAnegBL > controlAnegBR) controlAnegBL = (controlAnegBR + controlAnegBL) * 0.5; + } + else + { + controlBnegBR *= divisorB; + controlBnegBR += (calcneg*remainderB); + if (controlBnegBL > controlBnegBR) controlBnegBL = (controlBnegBR + controlBnegBL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposBR * outputpos) + (controlAnegBR * outputneg);} + else + {totalmultiplier = (controlBposBR * outputpos) + (controlBnegBR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleBR = inputSampleR / compoutgain; + //end second compressorR + + if (ratioselector > 1) { + + //begin third Power SagL + cL[gcount+499] = cL[gcount] = fabs(inputSampleL)*(intensity-((controlAposCL+controlBposCL+controlAnegCL+controlBnegCL)*powerSag)); + controlCL += (cL[gcount] / offsetC); + controlCL -= (cL[gcount+offsetB] / offsetC); + controlCL -= 0.000001; + clamp = 1; + if (controlCL < 0) {controlCL = 0;} + if (controlCL > 1) {clamp -= (controlCL - 1); controlCL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlCL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end third Power SagL + + //begin third Power SagR + cR[gcount+499] = cR[gcount] = fabs(inputSampleR)*(intensity-((controlAposCR+controlBposCR+controlAnegCR+controlBnegCR)*powerSag)); + controlCR += (cR[gcount] / offsetC); + controlCR -= (cR[gcount+offsetB] / offsetC); + controlCR -= 0.000001; + clamp = 1; + if (controlCR < 0) {controlCR = 0;} + if (controlCR > 1) {clamp -= (controlCR - 1); controlCR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlCR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end third Power SagR + + //begin third compressorL + inputpos = (inputSampleL * fpOld) + (avgCL * fpNew) + 1.0; + avgCL = inputSampleL; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposCL *= dynamicDivisor; + targetposCL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposCL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgCL * fpNew) + 1.0; + nvgCL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegCL *= dynamicDivisor; + targetnegCL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegCL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposCL *= divisorC; + controlAposCL += (calcpos*remainderC); + if (controlAposCR > controlAposCL) controlAposCR = (controlAposCR + controlAposCL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposCL *= divisorC; + controlBposCL += (calcpos*remainderC); + if (controlBposCR > controlBposCL) controlBposCR = (controlBposCR + controlBposCL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegCL *= divisorC; + controlAnegCL += (calcneg*remainderC); + if (controlAnegCR > controlAnegCL) controlAnegCR = (controlAnegCR + controlAnegCL) * 0.5; + } + else + { + controlBnegCL *= divisorC; + controlBnegCL += (calcneg*remainderC); + if (controlBnegCR > controlBnegCL) controlBnegCR = (controlBnegCR + controlBnegCL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposCL * outputpos) + (controlAnegCL * outputneg);} + else + {totalmultiplier = (controlBposCL * outputpos) + (controlBnegCL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleCL = inputSampleL / compoutgain; + //if (compoutgain != 1.0) inputSample /= compoutgain; + //end third compressorL + + //begin third compressorR + inputpos = (inputSampleR * fpOld) + (avgCR * fpNew) + 1.0; + avgCR = inputSampleR; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposCL *= dynamicDivisor; + targetposCL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposCR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgCR * fpNew) + 1.0; + nvgCR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegCR *= dynamicDivisor; + targetnegCR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegCR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposCR *= divisorC; + controlAposCR += (calcpos*remainderC); + if (controlAposCL > controlAposCR) controlAposCL = (controlAposCR + controlAposCL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposCR *= divisorC; + controlBposCR += (calcpos*remainderC); + if (controlBposCL > controlBposCR) controlBposCL = (controlBposCR + controlBposCL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegCR *= divisorC; + controlAnegCR += (calcneg*remainderC); + if (controlAnegCL > controlAnegCR) controlAnegCL = (controlAnegCR + controlAnegCL) * 0.5; + } + else + { + controlBnegCR *= divisorC; + controlBnegCR += (calcneg*remainderC); + if (controlBnegCL > controlBnegCR) controlBnegCL = (controlBnegCR + controlBnegCL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposCR * outputpos) + (controlAnegCR * outputneg);} + else + {totalmultiplier = (controlBposCR * outputpos) + (controlBnegCR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleCR = inputSampleR / compoutgain; + //if (compoutgain != 1.0) inputSample /= compoutgain; + //end third compressorR + } + } //these nested if blocks are not indented because the old xCode doesn't support it + + //here we will interpolate between dry, and the three post-stages of processing + switch (ratioselector) { + case 0: + inputSampleL = (drySampleL * invRatio) + (outSampleAL * ratio); + inputSampleR = (drySampleR * invRatio) + (outSampleAR * ratio); + break; + case 1: + inputSampleL = (outSampleAL * invRatio) + (outSampleBL * ratio); + inputSampleR = (outSampleAR * invRatio) + (outSampleBR * ratio); + break; + default: + inputSampleL = (outSampleBL * invRatio) + (outSampleCL * ratio); + inputSampleR = (outSampleBR * invRatio) + (outSampleCR * ratio); + break; + } + //only then do we reconstruct the output, but our ratio is built here + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet != 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + + //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 Logical4::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 + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + + float drySampleL; + float drySampleR; + double inputSampleL; + double inputSampleR; + + //begin ButterComp + double inputpos; + double inputneg; + double calcpos; + double calcneg; + double outputpos; + double outputneg; + double totalmultiplier; + double inputgain = pow(10.0,(-((A*40.0)-20.0))/20.0); + //fussing with the controls to make it hit the right threshold values + double compoutgain = inputgain; //let's try compensating for this + + double attackspeed = ((C*C)*99.0)+1.0; + //is in ms + attackspeed = 10.0 / sqrt(attackspeed); + //convert to a remainder for use in comp + double divisor = 0.000782*attackspeed; + //First Speed control + divisor /= overallscale; + double remainder = divisor; + divisor = 1.0 - divisor; + + double divisorB = 0.000819*attackspeed; + //Second Speed control + divisorB /= overallscale; + double remainderB = divisorB; + divisorB = 1.0 - divisorB; + + double divisorC = 0.000857; + //Third Speed control + divisorC /= overallscale; + double remainderC = divisorC*attackspeed; + divisorC = 1.0 - divisorC; + //end ButterComp + + double dynamicDivisor; + double dynamicRemainder; + //used for variable release + + //begin Desk Power Sag + double intensity = 0.0445556; + double depthA = 2.42; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 498) offsetA = 498; + + double depthB = 2.42; //was 3.38 + int offsetB = (int)(depthB * overallscale); + if (offsetB < 1) offsetB = 1; + if (offsetB > 498) offsetB = 498; + + double depthC = 2.42; //was 4.35 + int offsetC = (int)(depthC * overallscale); + if (offsetC < 1) offsetC = 1; + if (offsetC > 498) offsetC = 498; + + double clamp; + double thickness; + double out; + double bridgerectifier; + double powerSag = 0.003300223685324102874217; //was .00365 + //the Power Sag constant is how much the sag is cut back in high compressions. Increasing it + //increases the guts and gnarl of the music, decreasing it or making it negative causes the texture to go + //'ethereal' and unsolid under compression. Very subtle! + //end Desk Power Sag + + double ratio = sqrt(((B*B)*15.0)+1.0)-1.0; + if (ratio > 2.99999) ratio = 2.99999; + if (ratio < 0.0) ratio = 0.0; + //anything we do must adapt to our dry/a/b/c output stages + int ratioselector = floor( ratio ); + //zero to three, it'll become, always with 3 as the max + ratio -= ratioselector; + double invRatio = 1.0 - ratio; + //for all processing we've settled on the 'stage' and are just interpolating between top and bottom + //ratio is the more extreme case, invratio becomes our 'floor' case including drySample + + double outSampleAL = 0.0; + double outSampleBL = 0.0; + double outSampleCL = 0.0; + double outSampleAR = 0.0; + double outSampleBR = 0.0; + double outSampleCR = 0.0; + //what we interpolate between using ratio + + double outputgain = pow(10.0,((D*40.0)-20.0)/20.0); + double wet = E; + double dry = 1.0 - wet; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + gcount--; + if (gcount < 0 || gcount > 499) {gcount = 499;} + + //begin first Power SagL + dL[gcount+499] = dL[gcount] = fabs(inputSampleL)*(intensity-((controlAposL+controlBposL+controlAnegL+controlBnegL)*powerSag)); + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end first Power SagL + + //begin first Power SagR + dR[gcount+499] = dR[gcount] = fabs(inputSampleR)*(intensity-((controlAposR+controlBposR+controlAnegR+controlBnegR)*powerSag)); + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end first Power SagR + + //begin first compressorL + if (inputgain != 1.0) inputSampleL *= inputgain; + inputpos = (inputSampleL * fpOld) + (avgAL * fpNew) + 1.0; + avgAL = inputSampleL; + //hovers around 1 when there's no signal + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposL *= dynamicDivisor; + targetposL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposL),2); + //extra tiny, quick, if the inputpos of this polarity is high + + inputneg = (-inputSampleL * fpOld) + (nvgAL * fpNew) + 1.0; + nvgAL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegL *= dynamicDivisor; + targetnegL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegL),2); + //now we have mirrored targets for comp + //each calc is a blowed up chased target from tiny (at high levels of that polarity) to 1 at no input + //calc is the one we want to react differently: go tiny quick, + //outputpos and outputneg go from 0 to 1 + + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposL *= divisor; + controlAposL += (calcpos*remainder); + if (controlAposR > controlAposL) controlAposR = (controlAposR + controlAposL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposL *= divisor; + controlBposL += (calcpos*remainder); + if (controlBposR > controlBposL) controlBposR = (controlBposR + controlBposL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegL *= divisor; + controlAnegL += (calcneg*remainder); + if (controlAnegR > controlAnegL) controlAnegR = (controlAnegR + controlAnegL) * 0.5; + } + else + { + controlBnegL *= divisor; + controlBnegL += (calcneg*remainder); + if (controlBnegR > controlBnegL) controlBnegR = (controlBnegR + controlBnegL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposL * outputpos) + (controlAnegL * outputneg);} + else + {totalmultiplier = (controlBposL * outputpos) + (controlBnegL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleAL = inputSampleL / compoutgain; + //end first compressorL + + //begin first compressorR + if (inputgain != 1.0) inputSampleR *= inputgain; + inputpos = (inputSampleR * fpOld) + (avgAR * fpNew) + 1.0; + avgAR = inputSampleR; + //hovers around 1 when there's no signal + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposR *= dynamicDivisor; + targetposR += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposR),2); + //extra tiny, quick, if the inputpos of this polarity is high + + inputneg = (-inputSampleR * fpOld) + (nvgAR * fpNew) + 1.0; + nvgAR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainder * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegR *= dynamicDivisor; + targetnegR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegR),2); + //now we have mirrored targets for comp + //each calc is a blowed up chased target from tiny (at high levels of that polarity) to 1 at no input + //calc is the one we want to react differently: go tiny quick, + //outputpos and outputneg go from 0 to 1 + + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposR *= divisor; + controlAposR += (calcpos*remainder); + if (controlAposL > controlAposR) controlAposL = (controlAposR + controlAposL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposR *= divisor; + controlBposR += (calcpos*remainder); + if (controlBposL > controlBposR) controlBposL = (controlBposR + controlBposL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegR *= divisor; + controlAnegR += (calcneg*remainder); + if (controlAnegL > controlAnegR) controlAnegL = (controlAnegR + controlAnegL) * 0.5; + } + else + { + controlBnegR *= divisor; + controlBnegR += (calcneg*remainder); + if (controlBnegL > controlBnegR) controlBnegL = (controlBnegR + controlBnegL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposR * outputpos) + (controlAnegR * outputneg);} + else + {totalmultiplier = (controlBposR * outputpos) + (controlBnegR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleAR = inputSampleR / compoutgain; + //end first compressorR + + if (ratioselector > 0) { + + //begin second Power SagL + bL[gcount+499] = bL[gcount] = fabs(inputSampleL)*(intensity-((controlAposBL+controlBposBL+controlAnegBL+controlBnegBL)*powerSag)); + controlBL += (bL[gcount] / offsetB); + controlBL -= (bL[gcount+offsetB] / offsetB); + controlBL -= 0.000001; + clamp = 1; + if (controlBL < 0) {controlBL = 0;} + if (controlBL > 1) {clamp -= (controlBL - 1); controlBL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlBL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end second Power SagL + + //begin second Power SagR + bR[gcount+499] = bR[gcount] = fabs(inputSampleR)*(intensity-((controlAposBR+controlBposBR+controlAnegBR+controlBnegBR)*powerSag)); + controlBR += (bR[gcount] / offsetB); + controlBR -= (bR[gcount+offsetB] / offsetB); + controlBR -= 0.000001; + clamp = 1; + if (controlBR < 0) {controlBR = 0;} + if (controlBR > 1) {clamp -= (controlBR - 1); controlBR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlBR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end second Power SagR + + + //begin second compressorL + inputpos = (inputSampleL * fpOld) + (avgBL * fpNew) + 1.0; + avgBL = inputSampleL; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposBL *= dynamicDivisor; + targetposBL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposBL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgBL * fpNew) + 1.0; + nvgBL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegBL *= dynamicDivisor; + targetnegBL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegBL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposBL *= divisorB; + controlAposBL += (calcpos*remainderB); + if (controlAposBR > controlAposBL) controlAposBR = (controlAposBR + controlAposBL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposBL *= divisorB; + controlBposBL += (calcpos*remainderB); + if (controlBposBR > controlBposBL) controlBposBR = (controlBposBR + controlBposBL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegBL *= divisorB; + controlAnegBL += (calcneg*remainderB); + if (controlAnegBR > controlAnegBL) controlAnegBR = (controlAnegBR + controlAnegBL) * 0.5; + } + else + { + controlBnegBL *= divisorB; + controlBnegBL += (calcneg*remainderB); + if (controlBnegBR > controlBnegBL) controlBnegBR = (controlBnegBR + controlBnegBL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposBL * outputpos) + (controlAnegBL * outputneg);} + else + {totalmultiplier = (controlBposBL * outputpos) + (controlBnegBL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleBL = inputSampleL / compoutgain; + //end second compressorL + + //begin second compressorR + inputpos = (inputSampleR * fpOld) + (avgBR * fpNew) + 1.0; + avgBR = inputSampleR; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposBR *= dynamicDivisor; + targetposBR += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposBR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgBR * fpNew) + 1.0; + nvgBR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderB * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegBR *= dynamicDivisor; + targetnegBR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegBR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposBR *= divisorB; + controlAposBR += (calcpos*remainderB); + if (controlAposBL > controlAposBR) controlAposBL = (controlAposBR + controlAposBL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposBR *= divisorB; + controlBposBR += (calcpos*remainderB); + if (controlBposBL > controlBposBR) controlBposBL = (controlBposBR + controlBposBL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegBR *= divisorB; + controlAnegBR += (calcneg*remainderB); + if (controlAnegBL > controlAnegBR) controlAnegBL = (controlAnegBR + controlAnegBL) * 0.5; + } + else + { + controlBnegBR *= divisorB; + controlBnegBR += (calcneg*remainderB); + if (controlBnegBL > controlBnegBR) controlBnegBL = (controlBnegBR + controlBnegBL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposBR * outputpos) + (controlAnegBR * outputneg);} + else + {totalmultiplier = (controlBposBR * outputpos) + (controlBnegBR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + //if (compoutgain != 1.0) inputSample /= compoutgain; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleBR = inputSampleR / compoutgain; + //end second compressorR + + if (ratioselector > 1) { + + //begin third Power SagL + cL[gcount+499] = cL[gcount] = fabs(inputSampleL)*(intensity-((controlAposCL+controlBposCL+controlAnegCL+controlBnegCL)*powerSag)); + controlCL += (cL[gcount] / offsetC); + controlCL -= (cL[gcount+offsetB] / offsetC); + controlCL -= 0.000001; + clamp = 1; + if (controlCL < 0) {controlCL = 0;} + if (controlCL > 1) {clamp -= (controlCL - 1); controlCL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlCL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleL *= clamp; + //end third Power SagL + + //begin third Power SagR + cR[gcount+499] = cR[gcount] = fabs(inputSampleR)*(intensity-((controlAposCR+controlBposCR+controlAnegCR+controlBnegCR)*powerSag)); + controlCR += (cR[gcount] / offsetC); + controlCR -= (cR[gcount+offsetB] / offsetC); + controlCR -= 0.000001; + clamp = 1; + if (controlCR < 0) {controlCR = 0;} + if (controlCR > 1) {clamp -= (controlCR - 1); controlCR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlCR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + if (clamp != 1.0) inputSampleR *= clamp; + //end third Power SagR + + //begin third compressorL + inputpos = (inputSampleL * fpOld) + (avgCL * fpNew) + 1.0; + avgCL = inputSampleL; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposCL *= dynamicDivisor; + targetposCL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposCL),2); + + inputneg = (-inputSampleL * fpOld) + (nvgCL * fpNew) + 1.0; + nvgCL = -inputSampleL; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegCL *= dynamicDivisor; + targetnegCL += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegCL),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleL > 0) + { //working on pos + if (true == fpFlip) + { + controlAposCL *= divisorC; + controlAposCL += (calcpos*remainderC); + if (controlAposCR > controlAposCL) controlAposCR = (controlAposCR + controlAposCL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposCL *= divisorC; + controlBposCL += (calcpos*remainderC); + if (controlBposCR > controlBposCL) controlBposCR = (controlBposCR + controlBposCL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegCL *= divisorC; + controlAnegCL += (calcneg*remainderC); + if (controlAnegCR > controlAnegCL) controlAnegCR = (controlAnegCR + controlAnegCL) * 0.5; + } + else + { + controlBnegCL *= divisorC; + controlBnegCL += (calcneg*remainderC); + if (controlBnegCR > controlBnegCL) controlBnegCR = (controlBnegCR + controlBnegCL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposCL * outputpos) + (controlAnegCL * outputneg);} + else + {totalmultiplier = (controlBposCL * outputpos) + (controlBnegCL * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleL *= totalmultiplier; + if (inputSampleL > 36.0) inputSampleL = 36.0; + if (inputSampleL < -36.0) inputSampleL = -36.0; + //build in +18db hard clip on insano inputs + outSampleCL = inputSampleL / compoutgain; + //if (compoutgain != 1.0) inputSample /= compoutgain; + //end third compressorL + + //begin third compressorR + inputpos = (inputSampleR * fpOld) + (avgCR * fpNew) + 1.0; + avgCR = inputSampleR; + + if (inputpos < 0.001) inputpos = 0.001; + outputpos = inputpos / 2.0; + if (outputpos > 1.0) outputpos = 1.0; + inputpos *= inputpos; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputpos + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetposCL *= dynamicDivisor; + targetposCL += (inputpos * dynamicRemainder); + calcpos = pow((1.0/targetposCR),2); + + inputneg = (-inputSampleR * fpOld) + (nvgCR * fpNew) + 1.0; + nvgCR = -inputSampleR; + + if (inputneg < 0.001) inputneg = 0.001; + outputneg = inputneg / 2.0; + if (outputneg > 1.0) outputneg = 1.0; + inputneg *= inputneg; + //will be very high for hot input, can be 0.00001-1 for other-polarity + + dynamicRemainder = remainderC * (inputneg + 1.0); + if (dynamicRemainder > 1.0) dynamicRemainder = 1.0; + dynamicDivisor = 1.0 - dynamicRemainder; + //calc chases much faster if input swing is high + + targetnegCR *= dynamicDivisor; + targetnegCR += (inputneg * dynamicRemainder); + calcneg = pow((1.0/targetnegCR),2); + //now we have mirrored targets for comp + //outputpos and outputneg go from 0 to 1 + if (inputSampleR > 0) + { //working on pos + if (true == fpFlip) + { + controlAposCR *= divisorC; + controlAposCR += (calcpos*remainderC); + if (controlAposCL > controlAposCR) controlAposCL = (controlAposCR + controlAposCL) * 0.5; + //this part makes the compressor linked: both channels will converge towards whichever + //is the most compressed at the time. + } + else + { + controlBposCR *= divisorC; + controlBposCR += (calcpos*remainderC); + if (controlBposCL > controlBposCR) controlBposCL = (controlBposCR + controlBposCL) * 0.5; + } + } + else + { //working on neg + if (true == fpFlip) + { + controlAnegCR *= divisorC; + controlAnegCR += (calcneg*remainderC); + if (controlAnegCL > controlAnegCR) controlAnegCL = (controlAnegCR + controlAnegCL) * 0.5; + } + else + { + controlBnegCR *= divisorC; + controlBnegCR += (calcneg*remainderC); + if (controlBnegCL > controlBnegCR) controlBnegCL = (controlBnegCR + controlBnegCL) * 0.5; + } + } + //this causes each of the four to update only when active and in the correct 'fpFlip' + + if (true == fpFlip) + {totalmultiplier = (controlAposCR * outputpos) + (controlAnegCR * outputneg);} + else + {totalmultiplier = (controlBposCR * outputpos) + (controlBnegCR * outputneg);} + //this combines the sides according to fpFlip, blending relative to the input value + + if (totalmultiplier != 1.0) inputSampleR *= totalmultiplier; + if (inputSampleR > 36.0) inputSampleR = 36.0; + if (inputSampleR < -36.0) inputSampleR = -36.0; + //build in +18db hard clip on insano inputs + outSampleCR = inputSampleR / compoutgain; + //if (compoutgain != 1.0) inputSample /= compoutgain; + //end third compressorR + } + } //these nested if blocks are not indented because the old xCode doesn't support it + + //here we will interpolate between dry, and the three post-stages of processing + switch (ratioselector) { + case 0: + inputSampleL = (drySampleL * invRatio) + (outSampleAL * ratio); + inputSampleR = (drySampleR * invRatio) + (outSampleAR * ratio); + break; + case 1: + inputSampleL = (outSampleAL * invRatio) + (outSampleBL * ratio); + inputSampleR = (outSampleAR * invRatio) + (outSampleBR * ratio); + break; + default: + inputSampleL = (outSampleBL * invRatio) + (outSampleCL * ratio); + inputSampleR = (outSampleBR * invRatio) + (outSampleCR * ratio); + break; + } + //only then do we reconstruct the output, but our ratio is built here + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet != 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/Logical4/VSTProject.sln b/plugins/WinVST/Logical4/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Logical4/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/Logical4/VSTProject.vcxproj b/plugins/WinVST/Logical4/VSTProject.vcxproj new file mode 100755 index 0000000..217d863 --- /dev/null +++ b/plugins/WinVST/Logical4/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Logical4.cpp" />
+ <ClCompile Include="Logical4Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Logical4.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Logical464</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Logical4/VSTProject.vcxproj.filters b/plugins/WinVST/Logical4/VSTProject.vcxproj.filters new file mode 100755 index 0000000..7d7cccf --- /dev/null +++ b/plugins/WinVST/Logical4/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Logical4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Logical4Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Logical4.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Logical4/VSTProject.vcxproj.user b/plugins/WinVST/Logical4/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Logical4/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Logical4/vstplug.def b/plugins/WinVST/Logical4/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Logical4/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Loud/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Loud/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Loud/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Loud/.vs/VSTProject/v14/.suo b/plugins/WinVST/Loud/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..abcac37 --- /dev/null +++ b/plugins/WinVST/Loud/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Loud/Loud.cpp b/plugins/WinVST/Loud/Loud.cpp new file mode 100755 index 0000000..43f7ffc --- /dev/null +++ b/plugins/WinVST/Loud/Loud.cpp @@ -0,0 +1,138 @@ +/* ======================================== + * Loud - Loud.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Loud_H +#include "Loud.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Loud(audioMaster);} + +Loud::Loud(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + C = 1.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Loud::~Loud() {} +VstInt32 Loud::getVendorVersion () {return 1000;} +void Loud::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Loud::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 Loud::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Loud::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Loud::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 + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Loud::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Loud::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Boost", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Output Level", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Loud::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Loud::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Loud::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Loud::getEffectName(char* name) { + vst_strncpy(name, "Loud", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Loud::getPlugCategory() {return kPlugCategEffect;} + +bool Loud::getProductString(char* text) { + vst_strncpy (text, "airwindows Loud", kVstMaxProductStrLen); return true; +} + +bool Loud::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Loud/Loud.h b/plugins/WinVST/Loud/Loud.h new file mode 100755 index 0000000..85b66a2 --- /dev/null +++ b/plugins/WinVST/Loud/Loud.h @@ -0,0 +1,71 @@ +/* ======================================== + * Loud - Loud.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Loud_H +#define __Loud_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'loud'; //Change this to what the AU identity is! + +class Loud : + public AudioEffectX +{ +public: + Loud(audioMasterCallback audioMaster); + ~Loud(); + 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 lastSampleL; + double lastSampleR; + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/Loud/LoudProc.cpp b/plugins/WinVST/Loud/LoudProc.cpp new file mode 100755 index 0000000..8aedede --- /dev/null +++ b/plugins/WinVST/Loud/LoudProc.cpp @@ -0,0 +1,339 @@ +/* ======================================== + * Loud - Loud.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Loud_H +#include "Loud.h" +#endif + +void Loud::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 boost = pow(A+1.0,5); + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + double output = B; + double wet = C; + double dry = 1.0-wet; + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + double clamp; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + //begin L + inputSampleL *= boost; + clamp = inputSampleL - lastSampleL; + + if (clamp > 0) + { + inputSampleL = -(inputSampleL - 1.0); + inputSampleL *= 1.2566108; + if (inputSampleL < 0.0) inputSampleL = 0.0; + if (inputSampleL > 3.141527) inputSampleL = 3.141527; + inputSampleL = sin(inputSampleL) * overallscale; + if (clamp > inputSampleL) clamp = inputSampleL; + } + + if (clamp < 0) + { + inputSampleL += 1.0; + inputSampleL *= 1.2566108; + if (inputSampleL < 0.0) inputSampleL = 0.0; + if (inputSampleL > 3.141527) inputSampleL = 3.141527; + inputSampleL = -sin(inputSampleL) * overallscale; + if (clamp < inputSampleL) clamp = inputSampleL; + } + + inputSampleL = lastSampleL + clamp; + lastSampleL = inputSampleL; + //finished L + + //begin R + inputSampleR *= boost; + clamp = inputSampleR - lastSampleR; + + if (clamp > 0) + { + inputSampleR = -(inputSampleR - 1.0); + inputSampleR *= 1.2566108; + if (inputSampleR < 0.0) inputSampleR = 0.0; + if (inputSampleR > 3.141527) inputSampleR = 3.141527; + inputSampleR = sin(inputSampleR) * overallscale; + if (clamp > inputSampleR) clamp = inputSampleR; + } + + if (clamp < 0) + { + inputSampleR += 1.0; + inputSampleR *= 1.2566108; + if (inputSampleR < 0.0) inputSampleR = 0.0; + if (inputSampleR > 3.141527) inputSampleR = 3.141527; + inputSampleR = -sin(inputSampleR) * overallscale; + if (clamp < inputSampleR) clamp = inputSampleR; + } + + inputSampleR = lastSampleR + clamp; + lastSampleR = inputSampleR; + //finished R + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL*dry)+(inputSampleL*wet); + inputSampleR = (drySampleR*dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + + //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 Loud::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 boost = pow(A+1.0,5); + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + double output = B; + double wet = C; + double dry = 1.0-wet; + long double inputSampleL; + long double inputSampleR; + double drySampleL; + double drySampleR; + double clamp; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + //begin L + inputSampleL *= boost; + clamp = inputSampleL - lastSampleL; + + if (clamp > 0) + { + inputSampleL = -(inputSampleL - 1.0); + inputSampleL *= 1.2566108; + if (inputSampleL < 0.0) inputSampleL = 0.0; + if (inputSampleL > 3.141527) inputSampleL = 3.141527; + inputSampleL = sin(inputSampleL) * overallscale; + if (clamp > inputSampleL) clamp = inputSampleL; + } + + if (clamp < 0) + { + inputSampleL += 1.0; + inputSampleL *= 1.2566108; + if (inputSampleL < 0.0) inputSampleL = 0.0; + if (inputSampleL > 3.141527) inputSampleL = 3.141527; + inputSampleL = -sin(inputSampleL) * overallscale; + if (clamp < inputSampleL) clamp = inputSampleL; + } + + inputSampleL = lastSampleL + clamp; + lastSampleL = inputSampleL; + //finished L + + //begin R + inputSampleR *= boost; + clamp = inputSampleR - lastSampleR; + + if (clamp > 0) + { + inputSampleR = -(inputSampleR - 1.0); + inputSampleR *= 1.2566108; + if (inputSampleR < 0.0) inputSampleR = 0.0; + if (inputSampleR > 3.141527) inputSampleR = 3.141527; + inputSampleR = sin(inputSampleR) * overallscale; + if (clamp > inputSampleR) clamp = inputSampleR; + } + + if (clamp < 0) + { + inputSampleR += 1.0; + inputSampleR *= 1.2566108; + if (inputSampleR < 0.0) inputSampleR = 0.0; + if (inputSampleR > 3.141527) inputSampleR = 3.141527; + inputSampleR = -sin(inputSampleR) * overallscale; + if (clamp < inputSampleR) clamp = inputSampleR; + } + + inputSampleR = lastSampleR + clamp; + lastSampleR = inputSampleR; + //finished R + + if (output < 1.0) { + inputSampleL *= output; + inputSampleR *= output; + } + if (wet < 1.0) { + inputSampleL = (drySampleL*dry)+(inputSampleL*wet); + inputSampleR = (drySampleR*dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/Loud/VSTProject.sln b/plugins/WinVST/Loud/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Loud/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/Loud/VSTProject.vcxproj b/plugins/WinVST/Loud/VSTProject.vcxproj new file mode 100755 index 0000000..067bc55 --- /dev/null +++ b/plugins/WinVST/Loud/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Loud.cpp" />
+ <ClCompile Include="LoudProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Loud.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Loud64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Loud/VSTProject.vcxproj.filters b/plugins/WinVST/Loud/VSTProject.vcxproj.filters new file mode 100755 index 0000000..2b32a01 --- /dev/null +++ b/plugins/WinVST/Loud/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Loud.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="LoudProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Loud.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Loud/VSTProject.vcxproj.user b/plugins/WinVST/Loud/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Loud/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Loud/vstplug.def b/plugins/WinVST/Loud/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Loud/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Lowpass/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Lowpass/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Lowpass/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Lowpass/.vs/VSTProject/v14/.suo b/plugins/WinVST/Lowpass/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..f5cbb3f --- /dev/null +++ b/plugins/WinVST/Lowpass/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Lowpass/Lowpass.cpp b/plugins/WinVST/Lowpass/Lowpass.cpp new file mode 100755 index 0000000..8178799 --- /dev/null +++ b/plugins/WinVST/Lowpass/Lowpass.cpp @@ -0,0 +1,142 @@ +/* ======================================== + * Lowpass - Lowpass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Lowpass_H +#include "Lowpass.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Lowpass(audioMaster);} + +Lowpass::Lowpass(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 0.5; + C = 1.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Lowpass::~Lowpass() {} +VstInt32 Lowpass::getVendorVersion () {return 1000;} +void Lowpass::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Lowpass::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 Lowpass::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Lowpass::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Lowpass::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 + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Lowpass::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Lowpass::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Soft/Hard", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Lowpass::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B * 2.0)-1.0, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Lowpass::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Lowpass::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Lowpass::getEffectName(char* name) { + vst_strncpy(name, "Lowpass", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Lowpass::getPlugCategory() {return kPlugCategEffect;} + +bool Lowpass::getProductString(char* text) { + vst_strncpy (text, "airwindows Lowpass", kVstMaxProductStrLen); return true; +} + +bool Lowpass::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Lowpass/Lowpass.h b/plugins/WinVST/Lowpass/Lowpass.h new file mode 100755 index 0000000..1b99c55 --- /dev/null +++ b/plugins/WinVST/Lowpass/Lowpass.h @@ -0,0 +1,74 @@ +/* ======================================== + * Lowpass - Lowpass.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Lowpass_H +#define __Lowpass_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'lops'; //Change this to what the AU identity is! + +class Lowpass : + public AudioEffectX +{ +public: + Lowpass(audioMasterCallback audioMaster); + ~Lowpass(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + double iirSampleAL; + double iirSampleBL; + double iirSampleAR; + double iirSampleBR; + +}; + +#endif diff --git a/plugins/WinVST/Lowpass/LowpassProc.cpp b/plugins/WinVST/Lowpass/LowpassProc.cpp new file mode 100755 index 0000000..bcce714 --- /dev/null +++ b/plugins/WinVST/Lowpass/LowpassProc.cpp @@ -0,0 +1,302 @@ +/* ======================================== + * Lowpass - Lowpass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Lowpass_H +#include "Lowpass.h" +#endif + +void Lowpass::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 iirAmount = (pow(A,2)+A)/2.0; + iirAmount /= overallscale; + double tight = (B*2.0)-1.0; + double wet = C; + double dry = 1.0 - wet; + double offset; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + iirAmount += (iirAmount * tight * tight); + if (tight > 0) tight /= 1.5; + else tight /= 3.0; + //we are setting it up so that to either extreme we can get an audible sound, + //but sort of scaled so small adjustments don't shift the cutoff frequency yet. + if (iirAmount <= 0.0) iirAmount = 0.0; + if (iirAmount > 1.0) iirAmount = 1.0; + //handle the change in cutoff frequency + + 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. + } + + outputSampleL = inputSampleL; + outputSampleR = inputSampleR; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = iirSampleAL; + } + else + { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = iirSampleBL; + } + + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = iirSampleAR; + } + else + { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = iirSampleBR; + } + + + + if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); + if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); + + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = outputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLA; + + fpTemp = outputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRA; + } + else { + fpTemp = outputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLB; + + fpTemp = outputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = outputSampleL; + *out2 = outputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void Lowpass::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 iirAmount = (pow(A,2)+A)/2.0; + iirAmount /= overallscale; + double tight = (B*2.0)-1.0; + double wet = C; + double dry = 1.0 - wet; + double offset; + double inputSampleL; + double inputSampleR; + double outputSampleL; + double outputSampleR; + double fpTemp; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + + iirAmount += (iirAmount * tight * tight); + if (tight > 0) tight /= 1.5; + else tight /= 3.0; + //we are setting it up so that to either extreme we can get an audible sound, + //but sort of scaled so small adjustments don't shift the cutoff frequency yet. + if (iirAmount <= 0.0) iirAmount = 0.0; + if (iirAmount > 1.0) iirAmount = 1.0; + //handle the change in cutoff frequency + + 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. + } + + outputSampleL = inputSampleL; + outputSampleR = inputSampleR; + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleL)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleL))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAL = (iirSampleAL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = iirSampleAL; + } + else + { + iirSampleBL = (iirSampleBL * (1 - (offset * iirAmount))) + (inputSampleL * (offset * iirAmount)); + outputSampleL = iirSampleBL; + } + + + if (tight > 0) offset = (1 - tight) + (fabs(inputSampleR)*tight); + else offset = (1 + tight) + ((1-fabs(inputSampleR))*tight); + if (offset < 0) offset = 0; + if (offset > 1) offset = 1; + if (fpFlip) + { + iirSampleAR = (iirSampleAR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = iirSampleAR; + } + else + { + iirSampleBR = (iirSampleBR * (1 - (offset * iirAmount))) + (inputSampleR * (offset * iirAmount)); + outputSampleR = iirSampleBR; + } + + + + if (wet < 1.0) outputSampleL = (outputSampleL * wet) + (inputSampleL * dry); + if (wet < 1.0) outputSampleR = (outputSampleR * wet) + (inputSampleR * dry); + + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = outputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLA; + + fpTemp = outputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRA; + } + else { + fpTemp = outputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((outputSampleL-fpTemp)*fpNew); + outputSampleL += fpNShapeLB; + + fpTemp = outputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((outputSampleR-fpTemp)*fpNew); + outputSampleR += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = outputSampleL; + *out2 = outputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/Lowpass/VSTProject.sln b/plugins/WinVST/Lowpass/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Lowpass/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/Lowpass/VSTProject.vcxproj b/plugins/WinVST/Lowpass/VSTProject.vcxproj new file mode 100755 index 0000000..67cce2c --- /dev/null +++ b/plugins/WinVST/Lowpass/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Lowpass.cpp" />
+ <ClCompile Include="LowpassProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Lowpass.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Lowpass64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Lowpass/VSTProject.vcxproj.filters b/plugins/WinVST/Lowpass/VSTProject.vcxproj.filters new file mode 100755 index 0000000..0ea94b8 --- /dev/null +++ b/plugins/WinVST/Lowpass/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Lowpass.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="LowpassProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Lowpass.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Lowpass/VSTProject.vcxproj.user b/plugins/WinVST/Lowpass/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Lowpass/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Lowpass/vstplug.def b/plugins/WinVST/Lowpass/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Lowpass/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Melt/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Melt/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Melt/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Melt/.vs/VSTProject/v14/.suo b/plugins/WinVST/Melt/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..ee90f48 --- /dev/null +++ b/plugins/WinVST/Melt/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Melt/Melt.cpp b/plugins/WinVST/Melt/Melt.cpp new file mode 100755 index 0000000..9722e1f --- /dev/null +++ b/plugins/WinVST/Melt/Melt.cpp @@ -0,0 +1,156 @@ +/* ======================================== + * Melt - Melt.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Melt_H +#include "Melt.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Melt(audioMaster);} + +Melt::Melt(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.25; + B = 0.75; + C = 1.0; + D = 1.0; + + for(int count = 0; count < 32001; count++) {dL[count] = 0;dR[count] = 0;} + combineL = 0; combineR = 0; + scalefactorL = 0.999; scalefactorR = 0.999; + + for(int count = 0; count < 31; count++) {minTap[count] = 0; maxTap[count] = 0; position[count] = 1; stepTap[count] = 1;} + stepCount = 0; + slowCount = 0; + gcount = 0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Melt::~Melt() {} +VstInt32 Melt::getVendorVersion () {return 1000;} +void Melt::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Melt::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 Melt::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Melt::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Melt::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Melt::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Melt::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Depth", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Range", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Melt::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Melt::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the popup + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Melt::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Melt::getEffectName(char* name) { + vst_strncpy(name, "Melt", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Melt::getPlugCategory() {return kPlugCategEffect;} + +bool Melt::getProductString(char* text) { + vst_strncpy (text, "airwindows Melt", kVstMaxProductStrLen); return true; +} + +bool Melt::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Melt/Melt.h b/plugins/WinVST/Melt/Melt.h new file mode 100755 index 0000000..a8e0f38 --- /dev/null +++ b/plugins/WinVST/Melt/Melt.h @@ -0,0 +1,87 @@ +/* ======================================== + * Melt - Melt.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Melt_H +#define __Melt_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'melt'; //Change this to what the AU identity is! + +class Melt : + public AudioEffectX +{ +public: + Melt(audioMasterCallback audioMaster); + ~Melt(); + 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; + + float dL[32002]; + float dR[32002]; + float combineL; + float combineR; + float scalefactorL; + float scalefactorR; + + int minTap[32]; + int maxTap[32]; + int position[32]; + int stepTap[32]; + int stepCount; + int slowCount; + int gcount; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/Melt/MeltProc.cpp b/plugins/WinVST/Melt/MeltProc.cpp new file mode 100755 index 0000000..48a1c11 --- /dev/null +++ b/plugins/WinVST/Melt/MeltProc.cpp @@ -0,0 +1,596 @@ +/* ======================================== + * Melt - Melt.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Melt_H +#include "Melt.h" +#endif + +void Melt::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double rate = 1 / (pow(A,2) + 0.001); + double depthB = (B * 139.5)+2; + double depthA = depthB * (1.0 - A); + double output = C * 0.05; + double wet = D; + double dry = 1.0-wet; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); + minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); + minTap[2] = floor(5 * depthA); maxTap[2] = floor(5 * depthB); + minTap[3] = floor(7 * depthA); maxTap[3] = floor(7 * depthB); + minTap[4] = floor(11 * depthA); maxTap[4] = floor(11 * depthB); + minTap[5] = floor(13 * depthA); maxTap[5] = floor(13 * depthB); + minTap[6] = floor(17 * depthA); maxTap[6] = floor(17 * depthB); + minTap[7] = floor(19 * depthA); maxTap[7] = floor(19 * depthB); + minTap[8] = floor(23 * depthA); maxTap[8] = floor(23 * depthB); + minTap[9] = floor(29 * depthA); maxTap[9] = floor(29 * depthB); + minTap[10] = floor(31 * depthA); maxTap[10] = floor(31 * depthB); + minTap[11] = floor(37 * depthA); maxTap[11] = floor(37 * depthB); + minTap[12] = floor(41 * depthA); maxTap[12] = floor(41 * depthB); + minTap[13] = floor(43 * depthA); maxTap[13] = floor(43 * depthB); + minTap[14] = floor(47 * depthA); maxTap[14] = floor(47 * depthB); + minTap[15] = floor(53 * depthA); maxTap[15] = floor(53 * depthB); + minTap[16] = floor(59 * depthA); maxTap[16] = floor(59 * depthB); + minTap[17] = floor(61 * depthA); maxTap[17] = floor(61 * depthB); + minTap[18] = floor(67 * depthA); maxTap[18] = floor(67 * depthB); + minTap[19] = floor(71 * depthA); maxTap[19] = floor(71 * depthB); + minTap[20] = floor(73 * depthA); maxTap[20] = floor(73 * depthB); + minTap[21] = floor(79 * depthA); maxTap[21] = floor(79 * depthB); + minTap[22] = floor(83 * depthA); maxTap[22] = floor(83 * depthB); + minTap[23] = floor(89 * depthA); maxTap[23] = floor(89 * depthB); + minTap[24] = floor(97 * depthA); maxTap[24] = floor(97 * depthB); + minTap[25] = floor(101 * depthA); maxTap[25] = floor(101 * depthB); + minTap[26] = floor(103 * depthA); maxTap[26] = floor(103 * depthB); + minTap[27] = floor(107 * depthA); maxTap[27] = floor(107 * depthB); + minTap[28] = floor(109 * depthA); maxTap[28] = floor(109 * depthB); + minTap[29] = floor(113 * depthA); maxTap[29] = floor(113 * depthB); + minTap[30] = floor(117 * depthA); maxTap[30] = floor(117 * depthB); + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gcount < 0 || gcount > 16000) {gcount = 16000;} + dL[gcount+16000] = dL[gcount] = inputSampleL; + dR[gcount+16000] = dR[gcount] = inputSampleR; + + if (slowCount > rate || slowCount < 0) { + slowCount = 0; + stepCount++; + if (stepCount > 29 || stepCount < 0) {stepCount = 0;} + position[stepCount] += stepTap[stepCount]; + if (position[stepCount] < minTap[stepCount]) { + position[stepCount] = minTap[stepCount]; + stepTap[stepCount] = 1; + } + if (position[stepCount] > maxTap[stepCount]) { + position[stepCount] = maxTap[stepCount]; + stepTap[stepCount] = -1; + } + } + + //begin L + scalefactorL *= 0.9999; + scalefactorL += (100.0 - fabs(combineL)) * 0.000001; + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[29]]); + combineL += (dL[gcount+position[28]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[27]]); + combineL += (dL[gcount+position[26]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[25]]); + combineL += (dL[gcount+position[24]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[23]]); + combineL += (dL[gcount+position[22]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[21]]); + combineL += (dL[gcount+position[20]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[19]]); + combineL += (dL[gcount+position[18]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[17]]); + combineL += (dL[gcount+position[16]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[15]]); + combineL += (dL[gcount+position[14]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[13]]); + combineL += (dL[gcount+position[12]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[11]]); + combineL += (dL[gcount+position[10]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[9]]); + combineL += (dL[gcount+position[8]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[7]]); + combineL += (dL[gcount+position[6]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[5]]); + combineL += (dL[gcount+position[4]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[3]]); + combineL += (dL[gcount+position[2]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[1]]); + combineL += (dL[gcount+position[0]]); + + inputSampleL = combineL; + //done with L + + //begin R + scalefactorR *= 0.9999; + scalefactorR += (100.0 - fabs(combineR)) * 0.000001; + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[29]]); + combineR += (dR[gcount+position[28]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[27]]); + combineR += (dR[gcount+position[26]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[25]]); + combineR += (dR[gcount+position[24]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[23]]); + combineR += (dR[gcount+position[22]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[21]]); + combineR += (dR[gcount+position[20]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[19]]); + combineR += (dR[gcount+position[18]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[17]]); + combineR += (dR[gcount+position[16]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[15]]); + combineR += (dR[gcount+position[14]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[13]]); + combineR += (dR[gcount+position[12]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[11]]); + combineR += (dR[gcount+position[10]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[9]]); + combineR += (dR[gcount+position[8]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[7]]); + combineR += (dR[gcount+position[6]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[5]]); + combineR += (dR[gcount+position[4]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[3]]); + combineR += (dR[gcount+position[2]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[1]]); + combineR += (dR[gcount+position[0]]); + + inputSampleR = combineR; + //done with R + + gcount--; + slowCount++; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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 Melt::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double rate = 1 / (pow(A,2) + 0.001); + double depthB = (B * 139.5)+2; + double depthA = depthB * (1.0 - A); + double output = C * 0.05; + double wet = D; + double dry = 1.0-wet; + + 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 drySampleL; + long double drySampleR; + + minTap[0] = floor(2 * depthA); maxTap[0] = floor(2 * depthB); + minTap[1] = floor(3 * depthA); maxTap[1] = floor(3 * depthB); + minTap[2] = floor(5 * depthA); maxTap[2] = floor(5 * depthB); + minTap[3] = floor(7 * depthA); maxTap[3] = floor(7 * depthB); + minTap[4] = floor(11 * depthA); maxTap[4] = floor(11 * depthB); + minTap[5] = floor(13 * depthA); maxTap[5] = floor(13 * depthB); + minTap[6] = floor(17 * depthA); maxTap[6] = floor(17 * depthB); + minTap[7] = floor(19 * depthA); maxTap[7] = floor(19 * depthB); + minTap[8] = floor(23 * depthA); maxTap[8] = floor(23 * depthB); + minTap[9] = floor(29 * depthA); maxTap[9] = floor(29 * depthB); + minTap[10] = floor(31 * depthA); maxTap[10] = floor(31 * depthB); + minTap[11] = floor(37 * depthA); maxTap[11] = floor(37 * depthB); + minTap[12] = floor(41 * depthA); maxTap[12] = floor(41 * depthB); + minTap[13] = floor(43 * depthA); maxTap[13] = floor(43 * depthB); + minTap[14] = floor(47 * depthA); maxTap[14] = floor(47 * depthB); + minTap[15] = floor(53 * depthA); maxTap[15] = floor(53 * depthB); + minTap[16] = floor(59 * depthA); maxTap[16] = floor(59 * depthB); + minTap[17] = floor(61 * depthA); maxTap[17] = floor(61 * depthB); + minTap[18] = floor(67 * depthA); maxTap[18] = floor(67 * depthB); + minTap[19] = floor(71 * depthA); maxTap[19] = floor(71 * depthB); + minTap[20] = floor(73 * depthA); maxTap[20] = floor(73 * depthB); + minTap[21] = floor(79 * depthA); maxTap[21] = floor(79 * depthB); + minTap[22] = floor(83 * depthA); maxTap[22] = floor(83 * depthB); + minTap[23] = floor(89 * depthA); maxTap[23] = floor(89 * depthB); + minTap[24] = floor(97 * depthA); maxTap[24] = floor(97 * depthB); + minTap[25] = floor(101 * depthA); maxTap[25] = floor(101 * depthB); + minTap[26] = floor(103 * depthA); maxTap[26] = floor(103 * depthB); + minTap[27] = floor(107 * depthA); maxTap[27] = floor(107 * depthB); + minTap[28] = floor(109 * depthA); maxTap[28] = floor(109 * depthB); + minTap[29] = floor(113 * depthA); maxTap[29] = floor(113 * depthB); + minTap[30] = floor(117 * depthA); maxTap[30] = floor(117 * depthB); + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (gcount < 0 || gcount > 16000) {gcount = 16000;} + dL[gcount+16000] = dL[gcount] = inputSampleL; + dR[gcount+16000] = dR[gcount] = inputSampleR; + + if (slowCount > rate || slowCount < 0) { + slowCount = 0; + stepCount++; + if (stepCount > 29 || stepCount < 0) {stepCount = 0;} + position[stepCount] += stepTap[stepCount]; + if (position[stepCount] < minTap[stepCount]) { + position[stepCount] = minTap[stepCount]; + stepTap[stepCount] = 1; + } + if (position[stepCount] > maxTap[stepCount]) { + position[stepCount] = maxTap[stepCount]; + stepTap[stepCount] = -1; + } + } + + //begin L + scalefactorL *= 0.9999; + scalefactorL += (100.0 - fabs(combineL)) * 0.000001; + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[29]]); + combineL += (dL[gcount+position[28]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[27]]); + combineL += (dL[gcount+position[26]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[25]]); + combineL += (dL[gcount+position[24]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[23]]); + combineL += (dL[gcount+position[22]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[21]]); + combineL += (dL[gcount+position[20]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[19]]); + combineL += (dL[gcount+position[18]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[17]]); + combineL += (dL[gcount+position[16]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[15]]); + combineL += (dL[gcount+position[14]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[13]]); + combineL += (dL[gcount+position[12]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[11]]); + combineL += (dL[gcount+position[10]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[9]]); + combineL += (dL[gcount+position[8]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[7]]); + combineL += (dL[gcount+position[6]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[5]]); + combineL += (dL[gcount+position[4]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[3]]); + combineL += (dL[gcount+position[2]]); + + combineL *= scalefactorL; + combineL -= (dL[gcount+position[1]]); + combineL += (dL[gcount+position[0]]); + + inputSampleL = combineL; + //done with L + + //begin R + scalefactorR *= 0.9999; + scalefactorR += (100.0 - fabs(combineR)) * 0.000001; + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[29]]); + combineR += (dR[gcount+position[28]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[27]]); + combineR += (dR[gcount+position[26]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[25]]); + combineR += (dR[gcount+position[24]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[23]]); + combineR += (dR[gcount+position[22]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[21]]); + combineR += (dR[gcount+position[20]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[19]]); + combineR += (dR[gcount+position[18]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[17]]); + combineR += (dR[gcount+position[16]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[15]]); + combineR += (dR[gcount+position[14]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[13]]); + combineR += (dR[gcount+position[12]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[11]]); + combineR += (dR[gcount+position[10]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[9]]); + combineR += (dR[gcount+position[8]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[7]]); + combineR += (dR[gcount+position[6]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[5]]); + combineR += (dR[gcount+position[4]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[3]]); + combineR += (dR[gcount+position[2]]); + + combineR *= scalefactorR; + combineR -= (dR[gcount+position[1]]); + combineR += (dR[gcount+position[0]]); + + inputSampleR = combineR; + //done with R + + gcount--; + slowCount++; + + if (output < 1.0) {inputSampleL *= output; inputSampleR *= output;} + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL*wet); + inputSampleR = (drySampleR * dry)+(inputSampleR*wet); + } + //nice little output stage template: if we have another scale of floating point + //number, we really don't want to meaninglessly multiply that by 1.0. + + //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/Melt/VSTProject.sln b/plugins/WinVST/Melt/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Melt/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/Melt/VSTProject.vcxproj b/plugins/WinVST/Melt/VSTProject.vcxproj new file mode 100755 index 0000000..6c33d53 --- /dev/null +++ b/plugins/WinVST/Melt/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Melt.cpp" />
+ <ClCompile Include="MeltProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Melt.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Melt64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Melt/VSTProject.vcxproj.filters b/plugins/WinVST/Melt/VSTProject.vcxproj.filters new file mode 100755 index 0000000..d3e73f4 --- /dev/null +++ b/plugins/WinVST/Melt/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Melt.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MeltProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Melt.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Melt/VSTProject.vcxproj.user b/plugins/WinVST/Melt/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Melt/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Melt/vstplug.def b/plugins/WinVST/Melt/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Melt/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/MidSide/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/MidSide/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/MidSide/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/MidSide/.vs/VSTProject/v14/.suo b/plugins/WinVST/MidSide/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..652923f --- /dev/null +++ b/plugins/WinVST/MidSide/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/MidSide/MidSide.cpp b/plugins/WinVST/MidSide/MidSide.cpp new file mode 100755 index 0000000..bc37393 --- /dev/null +++ b/plugins/WinVST/MidSide/MidSide.cpp @@ -0,0 +1,122 @@ +/* ======================================== + * MidSide - MidSide.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __MidSide_H +#include "MidSide.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new MidSide(audioMaster);} + +MidSide::MidSide(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +MidSide::~MidSide() {} +VstInt32 MidSide::getVendorVersion () {return 1000;} +void MidSide::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void MidSide::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 MidSide::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 MidSide::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 MidSide::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float MidSide::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 MidSide::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Mid/Side", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void MidSide::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void MidSide::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 MidSide::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool MidSide::getEffectName(char* name) { + vst_strncpy(name, "MidSide", kVstMaxProductStrLen); return true; +} + +VstPlugCategory MidSide::getPlugCategory() {return kPlugCategEffect;} + +bool MidSide::getProductString(char* text) { + vst_strncpy (text, "airwindows MidSide", kVstMaxProductStrLen); return true; +} + +bool MidSide::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/MidSide/MidSide.h b/plugins/WinVST/MidSide/MidSide.h new file mode 100755 index 0000000..28b2ae7 --- /dev/null +++ b/plugins/WinVST/MidSide/MidSide.h @@ -0,0 +1,66 @@ +/* ======================================== + * MidSide - MidSide.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __MidSide_H +#define __MidSide_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'mdsd'; //Change this to what the AU identity is! + +class MidSide : + public AudioEffectX +{ +public: + MidSide(audioMasterCallback audioMaster); + ~MidSide(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + +}; + +#endif diff --git a/plugins/WinVST/MidSide/MidSideProc.cpp b/plugins/WinVST/MidSide/MidSideProc.cpp new file mode 100755 index 0000000..2df14f4 --- /dev/null +++ b/plugins/WinVST/MidSide/MidSideProc.cpp @@ -0,0 +1,206 @@ +/* ======================================== + * MidSide - MidSide.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __MidSide_H +#include "MidSide.h" +#endif + +void MidSide::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + long double mid; + long double side; + + double sidegain = A * 2.0; + double midgain = 2.0 - sidegain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + mid *= midgain; + side *= sidegain; + + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = mid; + fpNShapeLA = (fpNShapeLA*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLA; + fpTemp = side; + fpNShapeRA = (fpNShapeRA*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRA; + } + else { + fpTemp = mid; + fpNShapeLB = (fpNShapeLB*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLB; + fpTemp = side; + fpNShapeRB = (fpNShapeRB*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = mid; + *out2 = side; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void MidSide::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + 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 mid; + long double side; + + double sidegain = A * 2.0; + double midgain = 2.0 - sidegain; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + mid *= midgain; + side *= sidegain; + + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = mid; + fpNShapeLA = (fpNShapeLA*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLA; + fpTemp = side; + fpNShapeRA = (fpNShapeRA*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRA; + } + else { + fpTemp = mid; + fpNShapeLB = (fpNShapeLB*fpOld)+((mid-fpTemp)*fpNew); + mid += fpNShapeLB; + fpTemp = side; + fpNShapeRB = (fpNShapeRB*fpOld)+((side-fpTemp)*fpNew); + side += fpNShapeRB; + } + fpFlip = !fpFlip; + //end noise shaping on 64 bit output + + *out1 = mid; + *out2 = side; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/MidSide/VSTProject.sln b/plugins/WinVST/MidSide/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/MidSide/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/MidSide/VSTProject.vcxproj b/plugins/WinVST/MidSide/VSTProject.vcxproj new file mode 100755 index 0000000..33ae85d --- /dev/null +++ b/plugins/WinVST/MidSide/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="MidSide.cpp" />
+ <ClCompile Include="MidSideProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="MidSide.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>MidSide64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/MidSide/VSTProject.vcxproj.filters b/plugins/WinVST/MidSide/VSTProject.vcxproj.filters new file mode 100755 index 0000000..b342e57 --- /dev/null +++ b/plugins/WinVST/MidSide/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MidSide.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="MidSideProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="MidSide.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/MidSide/VSTProject.vcxproj.user b/plugins/WinVST/MidSide/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/MidSide/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/MidSide/vstplug.def b/plugins/WinVST/MidSide/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/MidSide/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/NCSeventeen/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/NCSeventeen/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/NCSeventeen/.vs/VSTProject/v14/.suo b/plugins/WinVST/NCSeventeen/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..0832384 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/NCSeventeen/NCSeventeen.cpp b/plugins/WinVST/NCSeventeen/NCSeventeen.cpp new file mode 100755 index 0000000..9bc129a --- /dev/null +++ b/plugins/WinVST/NCSeventeen/NCSeventeen.cpp @@ -0,0 +1,147 @@ +/* ======================================== + * NCSeventeen - NCSeventeen.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __NCSeventeen_H +#include "NCSeventeen.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new NCSeventeen(audioMaster);} + +NCSeventeen::NCSeventeen(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + + lastSampleL = 0.0; + iirSampleAL = 0.0; + iirSampleBL = 0.0; + basslevL = 0.0; + treblevL = 0.0; + cheblevL = 0.0; + + lastSampleR = 0.0; + iirSampleAR = 0.0; + iirSampleBR = 0.0; + basslevR = 0.0; + treblevR = 0.0; + cheblevR = 0.0; + + flip = false; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +NCSeventeen::~NCSeventeen() {} +VstInt32 NCSeventeen::getVendorVersion () {return 1000;} +void NCSeventeen::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void NCSeventeen::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 NCSeventeen::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 NCSeventeen::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 NCSeventeen::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float NCSeventeen::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 NCSeventeen::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "LOUDER", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void NCSeventeen::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A*24.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void NCSeventeen::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 NCSeventeen::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool NCSeventeen::getEffectName(char* name) { + vst_strncpy(name, "NC-17", kVstMaxProductStrLen); return true; +} + +VstPlugCategory NCSeventeen::getPlugCategory() {return kPlugCategEffect;} + +bool NCSeventeen::getProductString(char* text) { + vst_strncpy (text, "airwindows NC-17", kVstMaxProductStrLen); return true; +} + +bool NCSeventeen::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/NCSeventeen/NCSeventeen.h b/plugins/WinVST/NCSeventeen/NCSeventeen.h new file mode 100755 index 0000000..01179e9 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/NCSeventeen.h @@ -0,0 +1,84 @@ +/* ======================================== + * NCSeventeen - NCSeventeen.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __NCSeventeen_H +#define __NCSeventeen_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'ncse'; //Change this to what the AU identity is! + +class NCSeventeen : + public AudioEffectX +{ +public: + NCSeventeen(audioMasterCallback audioMaster); + ~NCSeventeen(); + 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; + +private: + double lastSampleL; + double iirSampleAL; + double iirSampleBL; + double basslevL; + double treblevL; + double cheblevL; + + double lastSampleR; + double iirSampleAR; + double iirSampleBR; + double basslevR; + double treblevR; + double cheblevR; + + bool flip; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp new file mode 100755 index 0000000..b2f2aa1 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/NCSeventeenProc.cpp @@ -0,0 +1,747 @@ +/* ======================================== + * NCSeventeen - NCSeventeen.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __NCSeventeen_H +#include "NCSeventeen.h" +#endif + +void NCSeventeen::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double inP2; + double chebyshev; + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double IIRscaleback = 0.0004716; + double bassScaleback = 0.0002364; + double trebleScaleback = 0.0005484; + double addBassBuss = 0.000243; + double addTrebBuss = 0.000407; + double addShortBuss = 0.000326; + IIRscaleback /= overallscale; + bassScaleback /= overallscale; + trebleScaleback /= overallscale; + addBassBuss /= overallscale; + addTrebBuss /= overallscale; + addShortBuss /= overallscale; + double limitingBass = 0.39; + double limitingTreb = 0.6; + double limiting = 0.36; + double maxfeedBass = 0.972; + double maxfeedTreb = 0.972; + double maxfeed = 0.975; + double bridgerectifier; + long double inputSampleL; + double lowSampleL = 0.0; + double highSampleL; + double distSampleL; + double minusSampleL; + double plusSampleL; + long double inputSampleR; + double lowSampleR = 0.0; + double highSampleR; + double distSampleR; + double minusSampleR; + double plusSampleR; + double gain = pow(10.0,(A*24.0)/20); + double outlevel = B; + + + 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. + } + + inputSampleL *= gain; + inputSampleR *= gain; + + if (flip) + { + iirSampleAL = (iirSampleAL * 0.9) + (inputSampleL * 0.1); + lowSampleL = iirSampleAL; + iirSampleAR = (iirSampleAR * 0.9) + (inputSampleR * 0.1); + lowSampleR = iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * 0.9) + (inputSampleL * 0.1); + lowSampleL = iirSampleBL; + iirSampleBR = (iirSampleBR * 0.9) + (inputSampleR * 0.1); + lowSampleR = iirSampleBR; + } + highSampleL = inputSampleL - lowSampleL; + highSampleR = inputSampleR - lowSampleR; + flip = !flip; + //we now have two bands and the original source + + inP2 = lowSampleL * lowSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= basslevL; + //second harmonic max +1 + if (basslevL > 0) basslevL -= bassScaleback; + if (basslevL < 0) basslevL += bassScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(lowSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = lowSampleL - distSampleL; + plusSampleL = lowSampleL + distSampleL; + if (minusSampleL > maxfeedBass) minusSampleL = maxfeedBass; + if (plusSampleL > maxfeedBass) plusSampleL = maxfeedBass; + if (plusSampleL < -maxfeedBass) plusSampleL = -maxfeedBass; + if (minusSampleL < -maxfeedBass) minusSampleL = -maxfeedBass; + if (lowSampleL > distSampleL) basslevL += (minusSampleL*addBassBuss); + if (lowSampleL < -distSampleL) basslevL -= (plusSampleL*addBassBuss); + if (basslevL > 1.0) basslevL = 1.0; + if (basslevL < -1.0) basslevL = -1.0; + bridgerectifier = fabs(lowSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleL > 0.0) lowSampleL = bridgerectifier; + else lowSampleL = -bridgerectifier; + //apply the distortion transform for reals + lowSampleL /= (1.0+fabs(basslevL*limitingBass)); + lowSampleL += chebyshev; + //apply the correction measuresL + + inP2 = lowSampleR * lowSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= basslevR; + //second harmonic max +1 + if (basslevR > 0) basslevR -= bassScaleback; + if (basslevR < 0) basslevR += bassScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(lowSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = lowSampleR - distSampleR; + plusSampleR = lowSampleR + distSampleR; + if (minusSampleR > maxfeedBass) minusSampleR = maxfeedBass; + if (plusSampleR > maxfeedBass) plusSampleR = maxfeedBass; + if (plusSampleR < -maxfeedBass) plusSampleR = -maxfeedBass; + if (minusSampleR < -maxfeedBass) minusSampleR = -maxfeedBass; + if (lowSampleR > distSampleR) basslevR += (minusSampleR*addBassBuss); + if (lowSampleR < -distSampleR) basslevR -= (plusSampleR*addBassBuss); + if (basslevR > 1.0) basslevR = 1.0; + if (basslevR < -1.0) basslevR = -1.0; + bridgerectifier = fabs(lowSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleR > 0.0) lowSampleR = bridgerectifier; + else lowSampleR = -bridgerectifier; + //apply the distortion transform for reals + lowSampleR /= (1.0+fabs(basslevR*limitingBass)); + lowSampleR += chebyshev; + //apply the correction measuresR + + inP2 = highSampleL * highSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= treblevL; + //second harmonic max +1 + if (treblevL > 0) treblevL -= trebleScaleback; + if (treblevL < 0) treblevL += trebleScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(highSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = highSampleL - distSampleL; + plusSampleL = highSampleL + distSampleL; + if (minusSampleL > maxfeedTreb) minusSampleL = maxfeedTreb; + if (plusSampleL > maxfeedTreb) plusSampleL = maxfeedTreb; + if (plusSampleL < -maxfeedTreb) plusSampleL = -maxfeedTreb; + if (minusSampleL < -maxfeedTreb) minusSampleL = -maxfeedTreb; + if (highSampleL > distSampleL) treblevL += (minusSampleL*addTrebBuss); + if (highSampleL < -distSampleL) treblevL -= (plusSampleL*addTrebBuss); + if (treblevL > 1.0) treblevL = 1.0; + if (treblevL < -1.0) treblevL = -1.0; + bridgerectifier = fabs(highSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleL > 0.0) highSampleL = bridgerectifier; + else highSampleL = -bridgerectifier; + //apply the distortion transform for reals + highSampleL /= (1.0+fabs(treblevL*limitingTreb)); + highSampleL += chebyshev; + //apply the correction measuresL + + inP2 = highSampleR * highSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= treblevR; + //second harmonic max +1 + if (treblevR > 0) treblevR -= trebleScaleback; + if (treblevR < 0) treblevR += trebleScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(highSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = highSampleR - distSampleR; + plusSampleR = highSampleR + distSampleR; + if (minusSampleR > maxfeedTreb) minusSampleR = maxfeedTreb; + if (plusSampleR > maxfeedTreb) plusSampleR = maxfeedTreb; + if (plusSampleR < -maxfeedTreb) plusSampleR = -maxfeedTreb; + if (minusSampleR < -maxfeedTreb) minusSampleR = -maxfeedTreb; + if (highSampleR > distSampleR) treblevR += (minusSampleR*addTrebBuss); + if (highSampleR < -distSampleR) treblevR -= (plusSampleR*addTrebBuss); + if (treblevR > 1.0) treblevR = 1.0; + if (treblevR < -1.0) treblevR = -1.0; + bridgerectifier = fabs(highSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleR > 0.0) highSampleR = bridgerectifier; + else highSampleR = -bridgerectifier; + //apply the distortion transform for reals + highSampleR /= (1.0+fabs(treblevR*limitingTreb)); + highSampleR += chebyshev; + //apply the correction measuresR + + inputSampleL = lowSampleL + highSampleL; + inputSampleR = lowSampleR + highSampleR; + + inP2 = inputSampleL * inputSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= cheblevL; + //third harmonic max -1 + if (cheblevL > 0) cheblevL -= (IIRscaleback); + if (cheblevL < 0) cheblevL += (IIRscaleback); + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = inputSampleL - distSampleL; + plusSampleL = inputSampleL + distSampleL; + if (minusSampleL > maxfeed) minusSampleL = maxfeed; + if (plusSampleL > maxfeed) plusSampleL = maxfeed; + if (plusSampleL < -maxfeed) plusSampleL = -maxfeed; + if (minusSampleL < -maxfeed) minusSampleL = -maxfeed; + if (inputSampleL > distSampleL) cheblevL += (minusSampleL*addShortBuss); + if (inputSampleL < -distSampleL) cheblevL -= (plusSampleL*addShortBuss); + if (cheblevL > 1.0) cheblevL = 1.0; + if (cheblevL < -1.0) cheblevL = -1.0; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //apply the distortion transform for reals + inputSampleL /= (1.0+fabs(cheblevL*limiting)); + inputSampleL += chebyshev; + //apply the correction measuresL + + inP2 = inputSampleR * inputSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= cheblevR; + //third harmonic max -1 + if (cheblevR > 0) cheblevR -= IIRscaleback; + if (cheblevR < 0) cheblevR += IIRscaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = inputSampleR - distSampleR; + plusSampleR = inputSampleR + distSampleR; + if (minusSampleR > maxfeed) minusSampleR = maxfeed; + if (plusSampleR > maxfeed) plusSampleR = maxfeed; + if (plusSampleR < -maxfeed) plusSampleR = -maxfeed; + if (minusSampleR < -maxfeed) minusSampleR = -maxfeed; + if (inputSampleR > distSampleR) cheblevR += (minusSampleR*addShortBuss); + if (inputSampleR < -distSampleR) cheblevR -= (plusSampleR*addShortBuss); + if (cheblevR > 1.0) cheblevR = 1.0; + if (cheblevR < -1.0) cheblevR = -1.0; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //apply the distortion transform for reals + inputSampleR /= (1.0+fabs(cheblevR*limiting)); + inputSampleR += chebyshev; + //apply the correction measuresR + + if (outlevel < 1.0) { + inputSampleL *= outlevel; + inputSampleR *= outlevel; + } + + if (inputSampleL > 0.95) inputSampleL = 0.95; + if (inputSampleL < -0.95) inputSampleL = -0.95; + if (inputSampleR > 0.95) inputSampleR = 0.95; + 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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void NCSeventeen::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double inP2; + double chebyshev; + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double IIRscaleback = 0.0004716; + double bassScaleback = 0.0002364; + double trebleScaleback = 0.0005484; + double addBassBuss = 0.000243; + double addTrebBuss = 0.000407; + double addShortBuss = 0.000326; + IIRscaleback /= overallscale; + bassScaleback /= overallscale; + trebleScaleback /= overallscale; + addBassBuss /= overallscale; + addTrebBuss /= overallscale; + addShortBuss /= overallscale; + double limitingBass = 0.39; + double limitingTreb = 0.6; + double limiting = 0.36; + double maxfeedBass = 0.972; + double maxfeedTreb = 0.972; + double maxfeed = 0.975; + double bridgerectifier; + long double inputSampleL; + double lowSampleL = 0.0; + double highSampleL; + double distSampleL; + double minusSampleL; + double plusSampleL; + long double inputSampleR; + double lowSampleR = 0.0; + double highSampleR; + double distSampleR; + double minusSampleR; + double plusSampleR; + double gain = pow(10.0,(A*24.0)/20); + double outlevel = B; + + 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. + } + + inputSampleL *= gain; + inputSampleR *= gain; + + if (flip) + { + iirSampleAL = (iirSampleAL * 0.9) + (inputSampleL * 0.1); + lowSampleL = iirSampleAL; + iirSampleAR = (iirSampleAR * 0.9) + (inputSampleR * 0.1); + lowSampleR = iirSampleAR; + } + else + { + iirSampleBL = (iirSampleBL * 0.9) + (inputSampleL * 0.1); + lowSampleL = iirSampleBL; + iirSampleBR = (iirSampleBR * 0.9) + (inputSampleR * 0.1); + lowSampleR = iirSampleBR; + } + highSampleL = inputSampleL - lowSampleL; + highSampleR = inputSampleR - lowSampleR; + flip = !flip; + //we now have two bands and the original source + + inP2 = lowSampleL * lowSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= basslevL; + //second harmonic max +1 + if (basslevL > 0) basslevL -= bassScaleback; + if (basslevL < 0) basslevL += bassScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(lowSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = lowSampleL - distSampleL; + plusSampleL = lowSampleL + distSampleL; + if (minusSampleL > maxfeedBass) minusSampleL = maxfeedBass; + if (plusSampleL > maxfeedBass) plusSampleL = maxfeedBass; + if (plusSampleL < -maxfeedBass) plusSampleL = -maxfeedBass; + if (minusSampleL < -maxfeedBass) minusSampleL = -maxfeedBass; + if (lowSampleL > distSampleL) basslevL += (minusSampleL*addBassBuss); + if (lowSampleL < -distSampleL) basslevL -= (plusSampleL*addBassBuss); + if (basslevL > 1.0) basslevL = 1.0; + if (basslevL < -1.0) basslevL = -1.0; + bridgerectifier = fabs(lowSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleL > 0.0) lowSampleL = bridgerectifier; + else lowSampleL = -bridgerectifier; + //apply the distortion transform for reals + lowSampleL /= (1.0+fabs(basslevL*limitingBass)); + lowSampleL += chebyshev; + //apply the correction measuresL + + inP2 = lowSampleR * lowSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= basslevR; + //second harmonic max +1 + if (basslevR > 0) basslevR -= bassScaleback; + if (basslevR < 0) basslevR += bassScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(lowSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = lowSampleR - distSampleR; + plusSampleR = lowSampleR + distSampleR; + if (minusSampleR > maxfeedBass) minusSampleR = maxfeedBass; + if (plusSampleR > maxfeedBass) plusSampleR = maxfeedBass; + if (plusSampleR < -maxfeedBass) plusSampleR = -maxfeedBass; + if (minusSampleR < -maxfeedBass) minusSampleR = -maxfeedBass; + if (lowSampleR > distSampleR) basslevR += (minusSampleR*addBassBuss); + if (lowSampleR < -distSampleR) basslevR -= (plusSampleR*addBassBuss); + if (basslevR > 1.0) basslevR = 1.0; + if (basslevR < -1.0) basslevR = -1.0; + bridgerectifier = fabs(lowSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (lowSampleR > 0.0) lowSampleR = bridgerectifier; + else lowSampleR = -bridgerectifier; + //apply the distortion transform for reals + lowSampleR /= (1.0+fabs(basslevR*limitingBass)); + lowSampleR += chebyshev; + //apply the correction measuresR + + inP2 = highSampleL * highSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= treblevL; + //second harmonic max +1 + if (treblevL > 0) treblevL -= trebleScaleback; + if (treblevL < 0) treblevL += trebleScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(highSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = highSampleL - distSampleL; + plusSampleL = highSampleL + distSampleL; + if (minusSampleL > maxfeedTreb) minusSampleL = maxfeedTreb; + if (plusSampleL > maxfeedTreb) plusSampleL = maxfeedTreb; + if (plusSampleL < -maxfeedTreb) plusSampleL = -maxfeedTreb; + if (minusSampleL < -maxfeedTreb) minusSampleL = -maxfeedTreb; + if (highSampleL > distSampleL) treblevL += (minusSampleL*addTrebBuss); + if (highSampleL < -distSampleL) treblevL -= (plusSampleL*addTrebBuss); + if (treblevL > 1.0) treblevL = 1.0; + if (treblevL < -1.0) treblevL = -1.0; + bridgerectifier = fabs(highSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleL > 0.0) highSampleL = bridgerectifier; + else highSampleL = -bridgerectifier; + //apply the distortion transform for reals + highSampleL /= (1.0+fabs(treblevL*limitingTreb)); + highSampleL += chebyshev; + //apply the correction measuresL + + inP2 = highSampleR * highSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= treblevR; + //second harmonic max +1 + if (treblevR > 0) treblevR -= trebleScaleback; + if (treblevR < 0) treblevR += trebleScaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(highSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = highSampleR - distSampleR; + plusSampleR = highSampleR + distSampleR; + if (minusSampleR > maxfeedTreb) minusSampleR = maxfeedTreb; + if (plusSampleR > maxfeedTreb) plusSampleR = maxfeedTreb; + if (plusSampleR < -maxfeedTreb) plusSampleR = -maxfeedTreb; + if (minusSampleR < -maxfeedTreb) minusSampleR = -maxfeedTreb; + if (highSampleR > distSampleR) treblevR += (minusSampleR*addTrebBuss); + if (highSampleR < -distSampleR) treblevR -= (plusSampleR*addTrebBuss); + if (treblevR > 1.0) treblevR = 1.0; + if (treblevR < -1.0) treblevR = -1.0; + bridgerectifier = fabs(highSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (highSampleR > 0.0) highSampleR = bridgerectifier; + else highSampleR = -bridgerectifier; + //apply the distortion transform for reals + highSampleR /= (1.0+fabs(treblevR*limitingTreb)); + highSampleR += chebyshev; + //apply the correction measuresR + + inputSampleL = lowSampleL + highSampleL; + inputSampleR = lowSampleR + highSampleR; + + inP2 = inputSampleL * inputSampleL; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= cheblevL; + //third harmonic max -1 + if (cheblevL > 0) cheblevL -= (IIRscaleback); + if (cheblevL < 0) cheblevL += (IIRscaleback); + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) distSampleL = bridgerectifier; + else distSampleL = -bridgerectifier; + minusSampleL = inputSampleL - distSampleL; + plusSampleL = inputSampleL + distSampleL; + if (minusSampleL > maxfeed) minusSampleL = maxfeed; + if (plusSampleL > maxfeed) plusSampleL = maxfeed; + if (plusSampleL < -maxfeed) plusSampleL = -maxfeed; + if (minusSampleL < -maxfeed) minusSampleL = -maxfeed; + if (inputSampleL > distSampleL) cheblevL += (minusSampleL*addShortBuss); + if (inputSampleL < -distSampleL) cheblevL -= (plusSampleL*addShortBuss); + if (cheblevL > 1.0) cheblevL = 1.0; + if (cheblevL < -1.0) cheblevL = -1.0; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0.0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //apply the distortion transform for reals + inputSampleL /= (1.0+fabs(cheblevL*limiting)); + inputSampleL += chebyshev; + //apply the correction measuresL + + inP2 = inputSampleR * inputSampleR; + if (inP2 > 1.0) inP2 = 1.0; if (inP2 < -1.0) inP2 = -1.0; + chebyshev = (2 * inP2); + chebyshev *= cheblevR; + //third harmonic max -1 + if (cheblevR > 0) cheblevR -= IIRscaleback; + if (cheblevR < 0) cheblevR += IIRscaleback; + //this is ShortBuss, IIRscaleback is the decay speed. *2 for second harmonic, and so on + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) distSampleR = bridgerectifier; + else distSampleR = -bridgerectifier; + minusSampleR = inputSampleR - distSampleR; + plusSampleR = inputSampleR + distSampleR; + if (minusSampleR > maxfeed) minusSampleR = maxfeed; + if (plusSampleR > maxfeed) plusSampleR = maxfeed; + if (plusSampleR < -maxfeed) plusSampleR = -maxfeed; + if (minusSampleR < -maxfeed) minusSampleR = -maxfeed; + if (inputSampleR > distSampleR) cheblevR += (minusSampleR*addShortBuss); + if (inputSampleR < -distSampleR) cheblevR -= (plusSampleR*addShortBuss); + if (cheblevR > 1.0) cheblevR = 1.0; + if (cheblevR < -1.0) cheblevR = -1.0; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0.0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //apply the distortion transform for reals + inputSampleR /= (1.0+fabs(cheblevR*limiting)); + inputSampleR += chebyshev; + //apply the correction measuresR + + if (outlevel < 1.0) { + inputSampleL *= outlevel; + inputSampleR *= outlevel; + } + + if (inputSampleL > 0.95) inputSampleL = 0.95; + if (inputSampleL < -0.95) inputSampleL = -0.95; + if (inputSampleR > 0.95) inputSampleR = 0.95; + 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 + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/NCSeventeen/VSTProject.sln b/plugins/WinVST/NCSeventeen/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/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/NCSeventeen/VSTProject.vcxproj b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj new file mode 100755 index 0000000..06ea4cd --- /dev/null +++ b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="NCSeventeen.cpp" />
+ <ClCompile Include="NCSeventeenProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="NCSeventeen.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>NC-1764</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.filters b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.filters new file mode 100755 index 0000000..266110e --- /dev/null +++ b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="NCSeventeen.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="NCSeventeenProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="NCSeventeen.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.user b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/NCSeventeen/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/NCSeventeen/vstplug.def b/plugins/WinVST/NCSeventeen/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/NCSeventeen/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Noise/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Noise/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Noise/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Noise/.vs/VSTProject/v14/.suo b/plugins/WinVST/Noise/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..78a0fe9 --- /dev/null +++ b/plugins/WinVST/Noise/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Noise/Noise.cpp b/plugins/WinVST/Noise/Noise.cpp new file mode 100755 index 0000000..76d00c8 --- /dev/null +++ b/plugins/WinVST/Noise/Noise.cpp @@ -0,0 +1,180 @@ +/* ======================================== + * Noise - Noise.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Noise_H +#include "Noise.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Noise(audioMaster);} + +Noise::Noise(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + D = 1.0; + E = 0.0; + F = 1.0; + position = 99999999; + quadratic = 0; + noiseAL = 0.0; + noiseBL = 0.0; + noiseCL = 0.0; + rumbleAL = 0.0; + rumbleBL = 0.0; + surgeL = 0.0; + noiseAR = 0.0; + noiseBR = 0.0; + noiseCR = 0.0; + rumbleAR = 0.0; + rumbleBR = 0.0; + surgeR = 0.0; + flipL = false; + flipR = false; + filterflip = false; + for(int count = 0; count < 11; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Noise::~Noise() {} +VstInt32 Noise::getVendorVersion () {return 1000;} +void Noise::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Noise::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 Noise::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* 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 Noise::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* 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 Noise::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Noise::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; 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 Noise::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "HighCut", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "LowCut", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "LShape", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Decay", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Distnc", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Noise::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Noise::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Noise::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Noise::getEffectName(char* name) { + vst_strncpy(name, "Noise", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Noise::getPlugCategory() {return kPlugCategEffect;} + +bool Noise::getProductString(char* text) { + vst_strncpy (text, "airwindows Noise", kVstMaxProductStrLen); return true; +} + +bool Noise::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Noise/Noise.h b/plugins/WinVST/Noise/Noise.h new file mode 100755 index 0000000..0ee4d76 --- /dev/null +++ b/plugins/WinVST/Noise/Noise.h @@ -0,0 +1,100 @@ +/* ======================================== + * Noise - Noise.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Noise_H +#define __Noise_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'nois'; //Change this to what the AU identity is! + +class Noise : + public AudioEffectX +{ +public: + Noise(audioMasterCallback audioMaster); + ~Noise(); + 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 noiseAL; + double noiseBL; + double noiseCL; + double rumbleAL; + double rumbleBL; + double surgeL; + double noiseAR; + double noiseBR; + double noiseCR; + double rumbleAR; + double rumbleBR; + double surgeR; + + int position; + int quadratic; + bool flipL; + bool flipR; + bool filterflip; + + double bL[11]; + double bR[11]; + + double f[11]; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/Noise/NoiseProc.cpp b/plugins/WinVST/Noise/NoiseProc.cpp new file mode 100755 index 0000000..e185120 --- /dev/null +++ b/plugins/WinVST/Noise/NoiseProc.cpp @@ -0,0 +1,650 @@ +/* ======================================== + * Noise - Noise.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Noise_H +#include "Noise.h" +#endif + +void Noise::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double cutoffL; + double cutoffR; + double cutofftarget = (A*3.5); + double rumblecutoff = cutofftarget * 0.005; + double invcutoffL; + double invcutoffR; + double drySampleL; + double drySampleR; + long double inputSampleL; + long double inputSampleR; + double highpass = C*38.0; + int lowcut = floor(highpass); + int dcut; + if (lowcut > 37) {dcut= 1151;} + if (lowcut == 37) {dcut= 1091;} + if (lowcut == 36) {dcut= 1087;} + if (lowcut == 35) {dcut= 1031;} + if (lowcut == 34) {dcut= 1013;} + if (lowcut == 33) {dcut= 971;} + if (lowcut == 32) {dcut= 907;} + if (lowcut == 31) {dcut= 839;} + if (lowcut == 30) {dcut= 797;} + if (lowcut == 29) {dcut= 733;} + if (lowcut == 28) {dcut= 719;} + if (lowcut == 27) {dcut= 673;} + if (lowcut == 26) {dcut= 613;} + if (lowcut == 25) {dcut= 593;} + if (lowcut == 24) {dcut= 541;} + if (lowcut == 23) {dcut= 479;} + if (lowcut == 22) {dcut= 431;} + if (lowcut == 21) {dcut= 419;} + if (lowcut == 20) {dcut= 373;} + if (lowcut == 19) {dcut= 311;} + if (lowcut == 18) {dcut= 293;} + if (lowcut == 17) {dcut= 233;} + if (lowcut == 16) {dcut= 191;} + if (lowcut == 15) {dcut= 173;} + if (lowcut == 14) {dcut= 131;} + if (lowcut == 13) {dcut= 113;} + if (lowcut == 12) {dcut= 71;} + if (lowcut == 11) {dcut= 53;} + if (lowcut == 10) {dcut= 31;} + if (lowcut == 9) {dcut= 27;} + if (lowcut == 8) {dcut= 23;} + if (lowcut == 7) {dcut= 19;} + if (lowcut == 6) {dcut= 17;} + if (lowcut == 5) {dcut= 13;} + if (lowcut == 4) {dcut= 11;} + if (lowcut == 3) {dcut= 7;} + if (lowcut == 2) {dcut= 5;} + if (lowcut < 2) {dcut= 3;} + highpass = B * 22.0; + lowcut = floor(highpass)+1; + + double decay = 0.001 - ((1.0-pow(1.0-D,3))*0.001); + if (decay == 0.001) decay = 0.1; + double wet = F; + double dry = 1.0 - wet; + wet *= 0.01; //correct large gain issue + double correctionSample; + double accumulatorSampleL; + double accumulatorSampleR; + double overallscale = (E*9.0)+1.0; + double gain = overallscale; + + if (gain > 1.0) {f[0] = 1.0; gain -= 1.0;} else {f[0] = gain; gain = 0.0;} + if (gain > 1.0) {f[1] = 1.0; gain -= 1.0;} else {f[1] = gain; gain = 0.0;} + if (gain > 1.0) {f[2] = 1.0; gain -= 1.0;} else {f[2] = gain; gain = 0.0;} + if (gain > 1.0) {f[3] = 1.0; gain -= 1.0;} else {f[3] = gain; gain = 0.0;} + if (gain > 1.0) {f[4] = 1.0; gain -= 1.0;} else {f[4] = gain; gain = 0.0;} + if (gain > 1.0) {f[5] = 1.0; gain -= 1.0;} else {f[5] = gain; gain = 0.0;} + if (gain > 1.0) {f[6] = 1.0; gain -= 1.0;} else {f[6] = gain; gain = 0.0;} + if (gain > 1.0) {f[7] = 1.0; gain -= 1.0;} else {f[7] = gain; gain = 0.0;} + if (gain > 1.0) {f[8] = 1.0; gain -= 1.0;} else {f[8] = gain; gain = 0.0;} + if (gain > 1.0) {f[9] = 1.0; gain -= 1.0;} else {f[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + f[0] /= overallscale; + f[1] /= overallscale; + f[2] /= overallscale; + f[3] /= overallscale; + f[4] /= overallscale; + f[5] /= overallscale; + f[6] /= overallscale; + f[7] /= overallscale; + f[8] /= overallscale; + f[9] /= overallscale; + //and now it's neatly scaled, too + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (surgeL<fabs(inputSampleL)) + { + surgeL += (rand()/(double)RAND_MAX)*(fabs(inputSampleL)-surgeL); + if (surgeL > 1.0) surgeL = 1.0; + } + else + { + surgeL -= ((rand()/(double)RAND_MAX)*(surgeL-fabs(inputSampleL))*decay); + if (surgeL < 0.0) surgeL = 0.0; + } + + cutoffL = pow((cutofftarget*surgeL),5); + if (cutoffL > 1.0) cutoffL = 1.0; + invcutoffL = 1.0 - cutoffL; + //set up modified cutoff L + + if (surgeR<fabs(inputSampleR)) + { + surgeR += (rand()/(double)RAND_MAX)*(fabs(inputSampleR)-surgeR); + if (surgeR > 1.0) surgeR = 1.0; + } + else + { + surgeR -= ((rand()/(double)RAND_MAX)*(surgeR-fabs(inputSampleR))*decay); + if (surgeR < 0.0) surgeR = 0.0; + } + + cutoffR = pow((cutofftarget*surgeR),5); + if (cutoffR > 1.0) cutoffR = 1.0; + invcutoffR = 1.0 - cutoffR; + //set up modified cutoff R + + flipL = !flipL; + flipR = !flipR; + filterflip = !filterflip; + quadratic -= 1; + if (quadratic < 0) + { + position += 1; + quadratic = position * position; + quadratic = quadratic % 170003; //% is C++ mod operator + quadratic *= quadratic; + quadratic = quadratic % 17011; //% is C++ mod operator + quadratic *= quadratic; + //quadratic = quadratic % 1709; //% is C++ mod operator + //quadratic *= quadratic; + quadratic = quadratic % dcut; //% is C++ mod operator + quadratic *= quadratic; + quadratic = quadratic % lowcut; + //sets density of the centering force + if (noiseAL < 0) {flipL = true;} + else {flipL = false;} + if (noiseAR < 0) {flipR = true;} + else {flipR = false;} + } + + + if (flipL) noiseAL += (rand()/(double)RAND_MAX); + else noiseAL -= (rand()/(double)RAND_MAX); + if (flipR) noiseAR += (rand()/(double)RAND_MAX); + else noiseAR -= (rand()/(double)RAND_MAX); + + if (filterflip) + { + noiseBL *= invcutoffL; noiseBL += (noiseAL*cutoffL); + inputSampleL = noiseBL+noiseCL; + rumbleAL *= (1.0-rumblecutoff); + rumbleAL += (inputSampleL*rumblecutoff); + + noiseBR *= invcutoffR; noiseBR += (noiseAR*cutoffR); + inputSampleR = noiseBR+noiseCR; + rumbleAR *= (1.0-rumblecutoff); + rumbleAR += (inputSampleR*rumblecutoff); + } + else + { + noiseCL *= invcutoffL; noiseCL += (noiseAL*cutoffL); + inputSampleL = noiseBL+noiseCL; + rumbleBL *= (1.0-rumblecutoff); + rumbleBL += (inputSampleL*rumblecutoff); + + noiseCR *= invcutoffR; noiseCR += (noiseAR*cutoffR); + inputSampleR = noiseBR+noiseCR; + rumbleBR *= (1.0-rumblecutoff); + rumbleBR += (inputSampleR*rumblecutoff); + } + + inputSampleL -= (rumbleAL+rumbleBL); + inputSampleL *= (1.0-rumblecutoff); + + inputSampleR -= (rumbleAR+rumbleBR); + inputSampleR *= (1.0-rumblecutoff); + + inputSampleL *= wet; + inputSampleL += (drySampleL * dry); + + inputSampleR *= wet; + inputSampleR += (drySampleR * dry); + //apply the dry to the noise + + 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] = accumulatorSampleL = inputSampleL; + + 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] = accumulatorSampleR = inputSampleR; + + accumulatorSampleL *= f[0]; + accumulatorSampleL += (bL[1] * f[1]); + accumulatorSampleL += (bL[2] * f[2]); + accumulatorSampleL += (bL[3] * f[3]); + accumulatorSampleL += (bL[4] * f[4]); + accumulatorSampleL += (bL[5] * f[5]); + accumulatorSampleL += (bL[6] * f[6]); + accumulatorSampleL += (bL[7] * f[7]); + accumulatorSampleL += (bL[8] * f[8]); + accumulatorSampleL += (bL[9] * f[9]); + //we are doing our repetitive calculations on a separate value + accumulatorSampleR *= f[0]; + accumulatorSampleR += (bR[1] * f[1]); + accumulatorSampleR += (bR[2] * f[2]); + accumulatorSampleR += (bR[3] * f[3]); + accumulatorSampleR += (bR[4] * f[4]); + accumulatorSampleR += (bR[5] * f[5]); + accumulatorSampleR += (bR[6] * f[6]); + accumulatorSampleR += (bR[7] * f[7]); + accumulatorSampleR += (bR[8] * f[8]); + accumulatorSampleR += (bR[9] * f[9]); + //we are doing our repetitive calculations on a separate value + + correctionSample = inputSampleL - accumulatorSampleL; + //we're gonna apply the total effect of all these calculations as a single subtract + //(formerly a more complicated algorithm) + inputSampleL -= correctionSample; + //applying the distance calculation to both the dry AND the noise output to blend them + correctionSample = inputSampleR - accumulatorSampleR; + //we're gonna apply the total effect of all these calculations as a single subtract + //(formerly a more complicated algorithm) + inputSampleR -= correctionSample; + //applying the distance calculation to both the dry AND the noise output to blend them + //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this + //and breaking it somehow. So, there ya go, strange obtuse code. + + //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 Noise::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double cutoffL; + double cutoffR; + double cutofftarget = (A*3.5); + double rumblecutoff = cutofftarget * 0.005; + double invcutoffL; + double invcutoffR; + double drySampleL; + double drySampleR; + long double inputSampleL; + long double inputSampleR; + double highpass = C*38.0; + int lowcut = floor(highpass); + int dcut; + if (lowcut > 37) {dcut= 1151;} + if (lowcut == 37) {dcut= 1091;} + if (lowcut == 36) {dcut= 1087;} + if (lowcut == 35) {dcut= 1031;} + if (lowcut == 34) {dcut= 1013;} + if (lowcut == 33) {dcut= 971;} + if (lowcut == 32) {dcut= 907;} + if (lowcut == 31) {dcut= 839;} + if (lowcut == 30) {dcut= 797;} + if (lowcut == 29) {dcut= 733;} + if (lowcut == 28) {dcut= 719;} + if (lowcut == 27) {dcut= 673;} + if (lowcut == 26) {dcut= 613;} + if (lowcut == 25) {dcut= 593;} + if (lowcut == 24) {dcut= 541;} + if (lowcut == 23) {dcut= 479;} + if (lowcut == 22) {dcut= 431;} + if (lowcut == 21) {dcut= 419;} + if (lowcut == 20) {dcut= 373;} + if (lowcut == 19) {dcut= 311;} + if (lowcut == 18) {dcut= 293;} + if (lowcut == 17) {dcut= 233;} + if (lowcut == 16) {dcut= 191;} + if (lowcut == 15) {dcut= 173;} + if (lowcut == 14) {dcut= 131;} + if (lowcut == 13) {dcut= 113;} + if (lowcut == 12) {dcut= 71;} + if (lowcut == 11) {dcut= 53;} + if (lowcut == 10) {dcut= 31;} + if (lowcut == 9) {dcut= 27;} + if (lowcut == 8) {dcut= 23;} + if (lowcut == 7) {dcut= 19;} + if (lowcut == 6) {dcut= 17;} + if (lowcut == 5) {dcut= 13;} + if (lowcut == 4) {dcut= 11;} + if (lowcut == 3) {dcut= 7;} + if (lowcut == 2) {dcut= 5;} + if (lowcut < 2) {dcut= 3;} + highpass = B * 22.0; + lowcut = floor(highpass)+1; + + double decay = 0.001 - ((1.0-pow(1.0-D,3))*0.001); + if (decay == 0.001) decay = 0.1; + double wet = F; + double dry = 1.0 - wet; + wet *= 0.01; //correct large gain issue + double correctionSample; + double accumulatorSampleL; + double accumulatorSampleR; + double overallscale = (E*9.0)+1.0; + double gain = overallscale; + + if (gain > 1.0) {f[0] = 1.0; gain -= 1.0;} else {f[0] = gain; gain = 0.0;} + if (gain > 1.0) {f[1] = 1.0; gain -= 1.0;} else {f[1] = gain; gain = 0.0;} + if (gain > 1.0) {f[2] = 1.0; gain -= 1.0;} else {f[2] = gain; gain = 0.0;} + if (gain > 1.0) {f[3] = 1.0; gain -= 1.0;} else {f[3] = gain; gain = 0.0;} + if (gain > 1.0) {f[4] = 1.0; gain -= 1.0;} else {f[4] = gain; gain = 0.0;} + if (gain > 1.0) {f[5] = 1.0; gain -= 1.0;} else {f[5] = gain; gain = 0.0;} + if (gain > 1.0) {f[6] = 1.0; gain -= 1.0;} else {f[6] = gain; gain = 0.0;} + if (gain > 1.0) {f[7] = 1.0; gain -= 1.0;} else {f[7] = gain; gain = 0.0;} + if (gain > 1.0) {f[8] = 1.0; gain -= 1.0;} else {f[8] = gain; gain = 0.0;} + if (gain > 1.0) {f[9] = 1.0; gain -= 1.0;} else {f[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + f[0] /= overallscale; + f[1] /= overallscale; + f[2] /= overallscale; + f[3] /= overallscale; + f[4] /= overallscale; + f[5] /= overallscale; + f[6] /= overallscale; + f[7] /= overallscale; + f[8] /= overallscale; + f[9] /= overallscale; + //and now it's neatly scaled, too + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (surgeL<fabs(inputSampleL)) + { + surgeL += (rand()/(double)RAND_MAX)*(fabs(inputSampleL)-surgeL); + if (surgeL > 1.0) surgeL = 1.0; + } + else + { + surgeL -= ((rand()/(double)RAND_MAX)*(surgeL-fabs(inputSampleL))*decay); + if (surgeL < 0.0) surgeL = 0.0; + } + + cutoffL = pow((cutofftarget*surgeL),5); + if (cutoffL > 1.0) cutoffL = 1.0; + invcutoffL = 1.0 - cutoffL; + //set up modified cutoff L + + if (surgeR<fabs(inputSampleR)) + { + surgeR += (rand()/(double)RAND_MAX)*(fabs(inputSampleR)-surgeR); + if (surgeR > 1.0) surgeR = 1.0; + } + else + { + surgeR -= ((rand()/(double)RAND_MAX)*(surgeR-fabs(inputSampleR))*decay); + if (surgeR < 0.0) surgeR = 0.0; + } + + cutoffR = pow((cutofftarget*surgeR),5); + if (cutoffR > 1.0) cutoffR = 1.0; + invcutoffR = 1.0 - cutoffR; + //set up modified cutoff R + + flipL = !flipL; + flipR = !flipR; + filterflip = !filterflip; + quadratic -= 1; + if (quadratic < 0) + { + position += 1; + quadratic = position * position; + quadratic = quadratic % 170003; //% is C++ mod operator + quadratic *= quadratic; + quadratic = quadratic % 17011; //% is C++ mod operator + quadratic *= quadratic; + //quadratic = quadratic % 1709; //% is C++ mod operator + //quadratic *= quadratic; + quadratic = quadratic % dcut; //% is C++ mod operator + quadratic *= quadratic; + quadratic = quadratic % lowcut; + //sets density of the centering force + if (noiseAL < 0) {flipL = true;} + else {flipL = false;} + if (noiseAR < 0) {flipR = true;} + else {flipR = false;} + } + + + if (flipL) noiseAL += (rand()/(double)RAND_MAX); + else noiseAL -= (rand()/(double)RAND_MAX); + if (flipR) noiseAR += (rand()/(double)RAND_MAX); + else noiseAR -= (rand()/(double)RAND_MAX); + + if (filterflip) + { + noiseBL *= invcutoffL; noiseBL += (noiseAL*cutoffL); + inputSampleL = noiseBL+noiseCL; + rumbleAL *= (1.0-rumblecutoff); + rumbleAL += (inputSampleL*rumblecutoff); + + noiseBR *= invcutoffR; noiseBR += (noiseAR*cutoffR); + inputSampleR = noiseBR+noiseCR; + rumbleAR *= (1.0-rumblecutoff); + rumbleAR += (inputSampleR*rumblecutoff); + } + else + { + noiseCL *= invcutoffL; noiseCL += (noiseAL*cutoffL); + inputSampleL = noiseBL+noiseCL; + rumbleBL *= (1.0-rumblecutoff); + rumbleBL += (inputSampleL*rumblecutoff); + + noiseCR *= invcutoffR; noiseCR += (noiseAR*cutoffR); + inputSampleR = noiseBR+noiseCR; + rumbleBR *= (1.0-rumblecutoff); + rumbleBR += (inputSampleR*rumblecutoff); + } + + inputSampleL -= (rumbleAL+rumbleBL); + inputSampleL *= (1.0-rumblecutoff); + + inputSampleR -= (rumbleAR+rumbleBR); + inputSampleR *= (1.0-rumblecutoff); + + inputSampleL *= wet; + inputSampleL += (drySampleL * dry); + + inputSampleR *= wet; + inputSampleR += (drySampleR * dry); + //apply the dry to the noise + + 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] = accumulatorSampleL = inputSampleL; + + 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] = accumulatorSampleR = inputSampleR; + + accumulatorSampleL *= f[0]; + accumulatorSampleL += (bL[1] * f[1]); + accumulatorSampleL += (bL[2] * f[2]); + accumulatorSampleL += (bL[3] * f[3]); + accumulatorSampleL += (bL[4] * f[4]); + accumulatorSampleL += (bL[5] * f[5]); + accumulatorSampleL += (bL[6] * f[6]); + accumulatorSampleL += (bL[7] * f[7]); + accumulatorSampleL += (bL[8] * f[8]); + accumulatorSampleL += (bL[9] * f[9]); + //we are doing our repetitive calculations on a separate value + accumulatorSampleR *= f[0]; + accumulatorSampleR += (bR[1] * f[1]); + accumulatorSampleR += (bR[2] * f[2]); + accumulatorSampleR += (bR[3] * f[3]); + accumulatorSampleR += (bR[4] * f[4]); + accumulatorSampleR += (bR[5] * f[5]); + accumulatorSampleR += (bR[6] * f[6]); + accumulatorSampleR += (bR[7] * f[7]); + accumulatorSampleR += (bR[8] * f[8]); + accumulatorSampleR += (bR[9] * f[9]); + //we are doing our repetitive calculations on a separate value + + correctionSample = inputSampleL - accumulatorSampleL; + //we're gonna apply the total effect of all these calculations as a single subtract + //(formerly a more complicated algorithm) + inputSampleL -= correctionSample; + //applying the distance calculation to both the dry AND the noise output to blend them + correctionSample = inputSampleR - accumulatorSampleR; + //we're gonna apply the total effect of all these calculations as a single subtract + //(formerly a more complicated algorithm) + inputSampleR -= correctionSample; + //applying the distance calculation to both the dry AND the noise output to blend them + //sometimes I'm really tired and can't do stuff, and I remember trying to simplify this + //and breaking it somehow. So, there ya go, strange obtuse code. + + //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/Noise/VSTProject.sln b/plugins/WinVST/Noise/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Noise/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/Noise/VSTProject.vcxproj b/plugins/WinVST/Noise/VSTProject.vcxproj new file mode 100755 index 0000000..db8cfac --- /dev/null +++ b/plugins/WinVST/Noise/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Noise.cpp" />
+ <ClCompile Include="NoiseProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Noise.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Noise64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Noise/VSTProject.vcxproj.filters b/plugins/WinVST/Noise/VSTProject.vcxproj.filters new file mode 100755 index 0000000..dd52cc3 --- /dev/null +++ b/plugins/WinVST/Noise/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Noise.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="NoiseProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Noise.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Noise/VSTProject.vcxproj.user b/plugins/WinVST/Noise/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Noise/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Noise/vstplug.def b/plugins/WinVST/Noise/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Noise/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/PhaseNudge/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/PhaseNudge/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/PhaseNudge/.vs/VSTProject/v14/.suo b/plugins/WinVST/PhaseNudge/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..11ae01b --- /dev/null +++ b/plugins/WinVST/PhaseNudge/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/PhaseNudge/PhaseNudge.cpp b/plugins/WinVST/PhaseNudge/PhaseNudge.cpp new file mode 100755 index 0000000..8a77175 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/PhaseNudge.cpp @@ -0,0 +1,132 @@ +/* ======================================== + * PhaseNudge - PhaseNudge.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PhaseNudge_H +#include "PhaseNudge.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new PhaseNudge(audioMaster);} + +PhaseNudge::PhaseNudge(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + for(int count = 0; count < 1502; count++) {dL[count] = 0.0; dR[count] = 0.0;} + one = 1; maxdelay = 9001; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +PhaseNudge::~PhaseNudge() {} +VstInt32 PhaseNudge::getVendorVersion () {return 1000;} +void PhaseNudge::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void PhaseNudge::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 PhaseNudge::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 PhaseNudge::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 PhaseNudge::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 PhaseNudge::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 PhaseNudge::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Phase Nudge", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void PhaseNudge::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void PhaseNudge::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 PhaseNudge::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool PhaseNudge::getEffectName(char* name) { + vst_strncpy(name, "PhaseNudge", kVstMaxProductStrLen); return true; +} + +VstPlugCategory PhaseNudge::getPlugCategory() {return kPlugCategEffect;} + +bool PhaseNudge::getProductString(char* text) { + vst_strncpy (text, "airwindows PhaseNudge", kVstMaxProductStrLen); return true; +} + +bool PhaseNudge::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/PhaseNudge/PhaseNudge.h b/plugins/WinVST/PhaseNudge/PhaseNudge.h new file mode 100755 index 0000000..cba0ac8 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/PhaseNudge.h @@ -0,0 +1,72 @@ +/* ======================================== + * PhaseNudge - PhaseNudge.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __PhaseNudge_H +#define __PhaseNudge_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'psng'; //Change this to what the AU identity is! + +class PhaseNudge : + public AudioEffectX +{ +public: + PhaseNudge(audioMasterCallback audioMaster); + ~PhaseNudge(); + 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 dL[1503]; + double dR[1503]; + int one, maxdelay; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + +}; + +#endif diff --git a/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp new file mode 100755 index 0000000..494c841 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/PhaseNudgeProc.cpp @@ -0,0 +1,325 @@ +/* ======================================== + * PhaseNudge - PhaseNudge.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PhaseNudge_H +#include "PhaseNudge.h" +#endif + +void PhaseNudge::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + int allpasstemp; + double outallpass = 0.618033988749894848204586; //golden ratio! + //if you see 0.6180 it's not a wild stretch to wonder whether you are working with a constant + int maxdelayTarget = (int)(pow(A,3)*1501.0); + double wet = B; + double dry = 1.0 - wet; + double bridgerectifier; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL /= 4.0; + inputSampleR /= 4.0; + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + if (fabs(maxdelay - maxdelayTarget) > 1500) maxdelay = maxdelayTarget; + + if (maxdelay < maxdelayTarget) { + maxdelay++; + dL[maxdelay] = (dL[0]+dL[maxdelay-1]) / 2.0; + dR[maxdelay] = (dR[0]+dR[maxdelay-1]) / 2.0; + } + + if (maxdelay > maxdelayTarget) { + maxdelay--; + dL[maxdelay] = (dL[0]+dL[maxdelay]) / 2.0; + dR[maxdelay] = (dR[0]+dR[maxdelay]) / 2.0; + } + + allpasstemp = one - 1; + + if (allpasstemp < 0 || allpasstemp > maxdelay) allpasstemp = maxdelay; + + inputSampleL -= dL[allpasstemp]*outallpass; + inputSampleR -= dR[allpasstemp]*outallpass; + dL[one] = inputSampleL; + dR[one] = inputSampleR; + inputSampleL *= outallpass; + inputSampleR *= outallpass; + one--; if (one < 0 || one > maxdelay) {one = maxdelay;} + inputSampleL += (dL[one]); + inputSampleR += (dR[one]); + + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL -= bridgerectifier; + else inputSampleL += bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR -= bridgerectifier; + else inputSampleR += bridgerectifier; + + inputSampleL *= 4.0; + inputSampleR *= 4.0; + + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + + //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 PhaseNudge::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + int allpasstemp; + double outallpass = 0.618033988749894848204586; //golden ratio! + //if you see 0.6180 it's not a wild stretch to wonder whether you are working with a constant + int maxdelayTarget = (int)(pow(A,3)*1501.0); + double wet = B; + double dry = 1.0 - wet; + double bridgerectifier; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL /= 4.0; + inputSampleR /= 4.0; + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + + if (fabs(maxdelay - maxdelayTarget) > 1500) maxdelay = maxdelayTarget; + + if (maxdelay < maxdelayTarget) { + maxdelay++; + dL[maxdelay] = (dL[0]+dL[maxdelay-1]) / 2.0; + dR[maxdelay] = (dR[0]+dR[maxdelay-1]) / 2.0; + } + + if (maxdelay > maxdelayTarget) { + maxdelay--; + dL[maxdelay] = (dL[0]+dL[maxdelay]) / 2.0; + dR[maxdelay] = (dR[0]+dR[maxdelay]) / 2.0; + } + + allpasstemp = one - 1; + + if (allpasstemp < 0 || allpasstemp > maxdelay) allpasstemp = maxdelay; + + inputSampleL -= dL[allpasstemp]*outallpass; + inputSampleR -= dR[allpasstemp]*outallpass; + dL[one] = inputSampleL; + dR[one] = inputSampleR; + inputSampleL *= outallpass; + inputSampleR *= outallpass; + one--; if (one < 0 || one > maxdelay) {one = maxdelay;} + inputSampleL += (dL[one]); + inputSampleR += (dR[one]); + + bridgerectifier = fabs(inputSampleL); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleL > 0) inputSampleL -= bridgerectifier; + else inputSampleL += bridgerectifier; + + bridgerectifier = fabs(inputSampleR); + bridgerectifier = 1.0-cos(bridgerectifier); + if (inputSampleR > 0) inputSampleR -= bridgerectifier; + else inputSampleR += bridgerectifier; + + inputSampleL *= 4.0; + inputSampleR *= 4.0; + + if (wet < 1.0) { + inputSampleL = (drySampleL * dry)+(inputSampleL * wet); + inputSampleR = (drySampleR * dry)+(inputSampleR * wet); + } + + //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/PhaseNudge/VSTProject.sln b/plugins/WinVST/PhaseNudge/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/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/PhaseNudge/VSTProject.vcxproj b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj new file mode 100755 index 0000000..1866fa3 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="PhaseNudge.cpp" />
+ <ClCompile Include="PhaseNudgeProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="PhaseNudge.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>PhaseNudge64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.filters b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.filters new file mode 100755 index 0000000..465cccb --- /dev/null +++ b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PhaseNudge.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PhaseNudgeProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PhaseNudge.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.user b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/PhaseNudge/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PhaseNudge/vstplug.def b/plugins/WinVST/PhaseNudge/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/PhaseNudge/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Point/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Point/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Point/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Point/.vs/VSTProject/v14/.suo b/plugins/WinVST/Point/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..8ad608b --- /dev/null +++ b/plugins/WinVST/Point/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Point/Point.cpp b/plugins/WinVST/Point/Point.cpp new file mode 100755 index 0000000..22885b5 --- /dev/null +++ b/plugins/WinVST/Point/Point.cpp @@ -0,0 +1,147 @@ +/* ======================================== + * Point - Point.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Point_H +#include "Point.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Point(audioMaster);} + +Point::Point(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + nibAL = 0.0; + nobAL = 0.0; + nibBL = 0.0; + nobBL = 0.0; + nibAR = 0.0; + nobAR = 0.0; + nibBR = 0.0; + nobBR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Point::~Point() {} +VstInt32 Point::getVendorVersion () {return 1000;} +void Point::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Point::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 Point::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Point::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Point::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 + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Point::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Point::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input Trim", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Point", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Reaction Speed", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Point::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Point::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Point::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Point::getEffectName(char* name) { + vst_strncpy(name, "Point", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Point::getPlugCategory() {return kPlugCategEffect;} + +bool Point::getProductString(char* text) { + vst_strncpy (text, "airwindows Point", kVstMaxProductStrLen); return true; +} + +bool Point::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Point/Point.h b/plugins/WinVST/Point/Point.h new file mode 100755 index 0000000..12c8001 --- /dev/null +++ b/plugins/WinVST/Point/Point.h @@ -0,0 +1,77 @@ +/* ======================================== + * Point - Point.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Point_H +#define __Point_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'poit'; //Change this to what the AU identity is! + +class Point : + public AudioEffectX +{ +public: + Point(audioMasterCallback audioMaster); + ~Point(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double nibAL; + double nobAL; + double nibBL; + double nobBL; + double nibAR; + double nobAR; + double nibBR; + double nobBR; + + float A; + float B; + float C; +}; + +#endif diff --git a/plugins/WinVST/Point/PointProc.cpp b/plugins/WinVST/Point/PointProc.cpp new file mode 100755 index 0000000..a00263d --- /dev/null +++ b/plugins/WinVST/Point/PointProc.cpp @@ -0,0 +1,312 @@ +/* ======================================== + * Point - Point.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Point_H +#include "Point.h" +#endif + +void Point::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 gaintrim = pow(10.0,((A*24.0)-12.0)/20); + double nibDiv = 1 / pow(C+0.2,7); + nibDiv /= overallscale; + double nobDiv; + if (((B*2.0)-1.0) > 0) nobDiv = nibDiv / (1.001-((B*2.0)-1.0)); + else nobDiv = nibDiv * (1.001-pow(((B*2.0)-1.0)*0.75,2)); + double nibnobFactor = 0.0; //start with the fallthrough value, why not + double absolute; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + 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. + } + + inputSampleL *= gaintrim; + absolute = fabs(inputSampleL); + if (fpFlip) + { + nibAL = nibAL + (absolute / nibDiv); + nibAL = nibAL / (1 + (1/nibDiv)); + nobAL = nobAL + (absolute / nobDiv); + nobAL = nobAL / (1 + (1/nobDiv)); + if (nobAL > 0) + { + nibnobFactor = nibAL / nobAL; + } + } + else + { + nibBL = nibBL + (absolute / nibDiv); + nibBL = nibBL / (1 + (1/nibDiv)); + nobBL = nobBL + (absolute / nobDiv); + nobBL = nobBL / (1 + (1/nobDiv)); + if (nobBL > 0) + { + nibnobFactor = nibBL / nobBL; + } + } + inputSampleL *= nibnobFactor; + + + inputSampleR *= gaintrim; + absolute = fabs(inputSampleR); + if (fpFlip) + { + nibAR = nibAR + (absolute / nibDiv); + nibAR = nibAR / (1 + (1/nibDiv)); + nobAR = nobAR + (absolute / nobDiv); + nobAR = nobAR / (1 + (1/nobDiv)); + if (nobAR > 0) + { + nibnobFactor = nibAR / nobAR; + } + } + else + { + nibBR = nibBR + (absolute / nibDiv); + nibBR = nibBR / (1 + (1/nibDiv)); + nobBR = nobBR + (absolute / nobDiv); + nobBR = nobBR / (1 + (1/nobDiv)); + if (nobBR > 0) + { + nibnobFactor = nibBR / nobBR; + } + } + inputSampleR *= nibnobFactor; + + //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 Point::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 gaintrim = pow(10.0,((A*24.0)-12.0)/20); + double nibDiv = 1 / pow(C+0.2,7); + nibDiv /= overallscale; + double nobDiv; + if (((B*2.0)-1.0) > 0) nobDiv = nibDiv / (1.001-((B*2.0)-1.0)); + else nobDiv = nibDiv * (1.001-pow(((B*2.0)-1.0)*0.75,2)); + double nibnobFactor = 0.0; //start with the fallthrough value, why not + double absolute; + + 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; + + 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. + } + + inputSampleL *= gaintrim; + absolute = fabs(inputSampleL); + if (fpFlip) + { + nibAL = nibAL + (absolute / nibDiv); + nibAL = nibAL / (1 + (1/nibDiv)); + nobAL = nobAL + (absolute / nobDiv); + nobAL = nobAL / (1 + (1/nobDiv)); + if (nobAL > 0) + { + nibnobFactor = nibAL / nobAL; + } + } + else + { + nibBL = nibBL + (absolute / nibDiv); + nibBL = nibBL / (1 + (1/nibDiv)); + nobBL = nobBL + (absolute / nobDiv); + nobBL = nobBL / (1 + (1/nobDiv)); + if (nobBL > 0) + { + nibnobFactor = nibBL / nobBL; + } + } + inputSampleL *= nibnobFactor; + + + inputSampleR *= gaintrim; + absolute = fabs(inputSampleR); + if (fpFlip) + { + nibAR = nibAR + (absolute / nibDiv); + nibAR = nibAR / (1 + (1/nibDiv)); + nobAR = nobAR + (absolute / nobDiv); + nobAR = nobAR / (1 + (1/nobDiv)); + if (nobAR > 0) + { + nibnobFactor = nibAR / nobAR; + } + } + else + { + nibBR = nibBR + (absolute / nibDiv); + nibBR = nibBR / (1 + (1/nibDiv)); + nobBR = nobBR + (absolute / nobDiv); + nobBR = nobBR / (1 + (1/nobDiv)); + if (nobBR > 0) + { + nibnobFactor = nibBR / nobBR; + } + } + inputSampleR *= nibnobFactor; + + //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/Point/VSTProject.sln b/plugins/WinVST/Point/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Point/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/Point/VSTProject.vcxproj b/plugins/WinVST/Point/VSTProject.vcxproj new file mode 100755 index 0000000..d1bb298 --- /dev/null +++ b/plugins/WinVST/Point/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Point.cpp" />
+ <ClCompile Include="PointProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Point.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Point64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Point/VSTProject.vcxproj.filters b/plugins/WinVST/Point/VSTProject.vcxproj.filters new file mode 100755 index 0000000..a452dba --- /dev/null +++ b/plugins/WinVST/Point/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Point.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PointProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Point.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Point/VSTProject.vcxproj.user b/plugins/WinVST/Point/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Point/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Point/vstplug.def b/plugins/WinVST/Point/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Point/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/PowerSag/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/PowerSag/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/PowerSag/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/PowerSag/.vs/VSTProject/v14/.suo b/plugins/WinVST/PowerSag/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..b1569f1 --- /dev/null +++ b/plugins/WinVST/PowerSag/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/PowerSag/PowerSag.cpp b/plugins/WinVST/PowerSag/PowerSag.cpp new file mode 100755 index 0000000..0218186 --- /dev/null +++ b/plugins/WinVST/PowerSag/PowerSag.cpp @@ -0,0 +1,134 @@ +/* ======================================== + * PowerSag - PowerSag.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PowerSag_H +#include "PowerSag.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new PowerSag(audioMaster);} + +PowerSag::PowerSag(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + for(int count = 0; count < 8999; count++) {dL[count] = 0; dR[count] = 0;} + controlL = 0; + controlR = 0; + gcount = 0; + A = 0.0; + B = 0.3; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +PowerSag::~PowerSag() {} +VstInt32 PowerSag::getVendorVersion () {return 1000;} +void PowerSag::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void PowerSag::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 PowerSag::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 PowerSag::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 PowerSag::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float PowerSag::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 PowerSag::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Depth", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void PowerSag::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void PowerSag::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 PowerSag::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool PowerSag::getEffectName(char* name) { + vst_strncpy(name, "PowerSag", kVstMaxProductStrLen); return true; +} + +VstPlugCategory PowerSag::getPlugCategory() {return kPlugCategEffect;} + +bool PowerSag::getProductString(char* text) { + vst_strncpy (text, "airwindows PowerSag", kVstMaxProductStrLen); return true; +} + +bool PowerSag::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/PowerSag/PowerSag.h b/plugins/WinVST/PowerSag/PowerSag.h new file mode 100755 index 0000000..930f05b --- /dev/null +++ b/plugins/WinVST/PowerSag/PowerSag.h @@ -0,0 +1,73 @@ +/* ======================================== + * PowerSag - PowerSag.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __PowerSag_H +#define __PowerSag_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'psag'; //Change this to what the AU identity is! + +class PowerSag : + public AudioEffectX +{ +public: + PowerSag(audioMasterCallback audioMaster); + ~PowerSag(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double dL[9000]; + double dR[9000]; + double controlL; + double controlR; + int gcount; + + float A; + float B; + +}; + +#endif diff --git a/plugins/WinVST/PowerSag/PowerSagProc.cpp b/plugins/WinVST/PowerSag/PowerSagProc.cpp new file mode 100755 index 0000000..d1afa31 --- /dev/null +++ b/plugins/WinVST/PowerSag/PowerSagProc.cpp @@ -0,0 +1,300 @@ +/* ======================================== + * PowerSag - PowerSag.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PowerSag_H +#include "PowerSag.h" +#endif + +void PowerSag::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + double intensity = pow(A,5)*80.0; + double depthA = pow(B,2); + int offsetA = (int)(depthA * 3900) + 1; + double clamp; + double thickness; + double out; + double bridgerectifier; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (gcount < 0 || gcount > 4000) {gcount = 4000;} + + //doing L + dL[gcount+4000] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + //end L + + //doing R + dR[gcount+4000] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + //end R + + gcount--; + + + //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 PowerSag::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double intensity = pow(A,5)*80.0; + double depthA = pow(B,2); + int offsetA = (int)(depthA * 3900) + 1; + double clamp; + double thickness; + double out; + double bridgerectifier; + + 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; + + 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. + } + + if (gcount < 0 || gcount > 4000) {gcount = 4000;} + + //doing L + dL[gcount+4000] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + //end L + + //doing R + dR[gcount+4000] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + //end R + + gcount--; + + + //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/PowerSag/VSTProject.sln b/plugins/WinVST/PowerSag/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/PowerSag/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/PowerSag/VSTProject.vcxproj b/plugins/WinVST/PowerSag/VSTProject.vcxproj new file mode 100755 index 0000000..e2ca976 --- /dev/null +++ b/plugins/WinVST/PowerSag/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="PowerSag.cpp" />
+ <ClCompile Include="PowerSagProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="PowerSag.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>PowerSag64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PowerSag/VSTProject.vcxproj.filters b/plugins/WinVST/PowerSag/VSTProject.vcxproj.filters new file mode 100755 index 0000000..f161cfc --- /dev/null +++ b/plugins/WinVST/PowerSag/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PowerSag.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PowerSagProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PowerSag.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PowerSag/VSTProject.vcxproj.user b/plugins/WinVST/PowerSag/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/PowerSag/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PowerSag/vstplug.def b/plugins/WinVST/PowerSag/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/PowerSag/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Pressure4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Pressure4/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Pressure4/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Pressure4/.vs/VSTProject/v14/.suo b/plugins/WinVST/Pressure4/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..a911044 --- /dev/null +++ b/plugins/WinVST/Pressure4/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Pressure4/Pressure4.cpp b/plugins/WinVST/Pressure4/Pressure4.cpp new file mode 100755 index 0000000..8ae2adc --- /dev/null +++ b/plugins/WinVST/Pressure4/Pressure4.cpp @@ -0,0 +1,156 @@ +/* ======================================== + * Pressure4 - Pressure4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Pressure4_H +#include "Pressure4.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Pressure4(audioMaster);} + +Pressure4::Pressure4(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.2; + C = 1.0; + D = 1.0; + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + muSpeedA = 10000; + muSpeedB = 10000; + muCoefficientA = 1; + muCoefficientB = 1; + muVary = 1; + 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 +} + +Pressure4::~Pressure4() {} +VstInt32 Pressure4::getVendorVersion () {return 1000;} +void Pressure4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Pressure4::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 Pressure4::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 Pressure4::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 Pressure4::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 + case kParamC: C = value; break; //this is the popup, stored as a float + case kParamD: D = value; break; //this is the popup, stored as a float + 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 Pressure4.h file to do it. +} + +float Pressure4::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 Pressure4::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Pressure", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Mewiness", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Output Gain", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Pressure4::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + case kParamC: float2string ((C*2.0)-1.0, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Pressure4::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Pressure4::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Pressure4::getEffectName(char* name) { + vst_strncpy(name, "Pressure4", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Pressure4::getPlugCategory() {return kPlugCategEffect;} + +bool Pressure4::getProductString(char* text) { + vst_strncpy (text, "airwindows Pressure4", kVstMaxProductStrLen); return true; +} + +bool Pressure4::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Pressure4/Pressure4.h b/plugins/WinVST/Pressure4/Pressure4.h new file mode 100755 index 0000000..29d20eb --- /dev/null +++ b/plugins/WinVST/Pressure4/Pressure4.h @@ -0,0 +1,78 @@ +/* ======================================== + * Pressure4 - Pressure4.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Pressure4_H +#define __Pressure4_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'prs4'; //Change this to what the AU identity is! + +class Pressure4 : + public AudioEffectX +{ +public: + Pressure4(audioMasterCallback audioMaster); + ~Pressure4(); + 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; + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + bool flip; + + float A; + float B; + float C; //parameters. Always 0-1, and we scale/alter them elsewhere. + float D; + +}; + +#endif diff --git a/plugins/WinVST/Pressure4/Pressure4Proc.cpp b/plugins/WinVST/Pressure4/Pressure4Proc.cpp new file mode 100755 index 0000000..02b8a78 --- /dev/null +++ b/plugins/WinVST/Pressure4/Pressure4Proc.cpp @@ -0,0 +1,449 @@ +/* ======================================== + * Pressure4 - Pressure4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Pressure4_H +#include "Pressure4.h" +#endif + +void Pressure4::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* inputL = inputs[0]; + float* inputR = inputs[1]; + float* outputL = outputs[0]; + float* outputR = outputs[1]; + + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + double threshold = 1.0 - (A * 0.95); + double muMakeupGain = 1.0 / threshold; + //gain settings around threshold + double release = pow((1.28-B),5)*32768.0; + release /= overallscale; + double fastest = sqrt(release); + //speed settings around release + long double bridgerectifier; + double coefficient; + double inputSense; + double mewiness = (C*2.0)-1.0; + double unmewiness; + double outputGain = D; + bool positivemu; + if (mewiness >= 0) + { + positivemu = true; + unmewiness = 1.0-mewiness; + } + else + { + positivemu = false; + mewiness = -mewiness; + unmewiness = 1.0-mewiness; + } + // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + while (--sampleFrames >= 0) + { + inputSampleL = *inputL; + inputSampleR = *inputR; + 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. + } + + inputSampleL = inputSampleL * muMakeupGain; + inputSampleR = inputSampleR * muMakeupGain; + + 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) + { + if (positivemu) coefficient = pow(muCoefficientA,2); + else coefficient = sqrt(muCoefficientA); + coefficient = (coefficient*mewiness)+(muCoefficientA*unmewiness); + inputSampleL *= coefficient; + inputSampleR *= coefficient; + } + else + { + if (positivemu) coefficient = pow(muCoefficientB,2); + else coefficient = sqrt(muCoefficientB); + coefficient = (coefficient*mewiness)+(muCoefficientB*unmewiness); + 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 + + if (outputGain != 1.0) { + inputSampleL *= outputGain; + inputSampleR *= outputGain; + } + + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0){inputSampleL = bridgerectifier;} + else {inputSampleL = -bridgerectifier;} + //second stage of overdrive to prevent overs and allow bloody loud extremeness + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0){inputSampleR = bridgerectifier;} + else {inputSampleR = -bridgerectifier;} + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *outputL = inputSampleL; + *outputR = inputSampleR; + + *inputL++; + *inputR++; + *outputL++; + *outputR++; + } +} + +void Pressure4::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* inputL = inputs[0]; + double* inputR = inputs[1]; + double* outputL = outputs[0]; + double* outputR = outputs[1]; + + double overallscale = 1.0; + overallscale /= 44100.0; + overallscale *= getSampleRate(); + double threshold = 1.0 - (A * 0.95); + double muMakeupGain = 1.0 / threshold; + //gain settings around threshold + double release = pow((1.28-B),5)*32768.0; + release /= overallscale; + double fastest = sqrt(release); + //speed settings around release + long double bridgerectifier; + double coefficient; + double inputSense; + double mewiness = (C*2.0)-1.0; + double unmewiness; + double outputGain = D; + bool positivemu; + if (mewiness >= 0) + { + positivemu = true; + unmewiness = 1.0-mewiness; + } + else + { + positivemu = false; + mewiness = -mewiness; + unmewiness = 1.0-mewiness; + } + // µ µ µ µ µ µ µ µ µ µ µ µ is the kitten song o/~ + 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; + + + while (--sampleFrames >= 0) + { + inputSampleL = *inputL; + inputSampleR = *inputR; + 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. + } + + inputSampleL = inputSampleL * muMakeupGain; + inputSampleR = inputSampleR * muMakeupGain; + + 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) + { + if (positivemu) coefficient = pow(muCoefficientA,2); + else coefficient = sqrt(muCoefficientA); + coefficient = (coefficient*mewiness)+(muCoefficientA*unmewiness); + inputSampleL *= coefficient; + inputSampleR *= coefficient; + } + else + { + if (positivemu) coefficient = pow(muCoefficientB,2); + else coefficient = sqrt(muCoefficientB); + coefficient = (coefficient*mewiness)+(muCoefficientB*unmewiness); + 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 + + if (outputGain != 1.0) { + inputSampleL *= outputGain; + inputSampleR *= outputGain; + } + + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0){inputSampleL = bridgerectifier;} + else {inputSampleL = -bridgerectifier;} + //second stage of overdrive to prevent overs and allow bloody loud extremeness + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0){inputSampleR = bridgerectifier;} + else {inputSampleR = -bridgerectifier;} + //second stage of overdrive to prevent overs and allow bloody loud extremeness + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *outputL = inputSampleL; + *outputR = inputSampleR; + + *inputL++; + *inputR++; + *outputL++; + *outputR++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/Pressure4/VSTProject.sln b/plugins/WinVST/Pressure4/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Pressure4/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/Pressure4/VSTProject.vcxproj b/plugins/WinVST/Pressure4/VSTProject.vcxproj new file mode 100755 index 0000000..81d68fd --- /dev/null +++ b/plugins/WinVST/Pressure4/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Pressure4.cpp" />
+ <ClCompile Include="Pressure4Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Pressure4.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Pressure464</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pressure4/VSTProject.vcxproj.filters b/plugins/WinVST/Pressure4/VSTProject.vcxproj.filters new file mode 100755 index 0000000..036b9a9 --- /dev/null +++ b/plugins/WinVST/Pressure4/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Pressure4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Pressure4Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Pressure4.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pressure4/VSTProject.vcxproj.user b/plugins/WinVST/Pressure4/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Pressure4/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pressure4/vstplug.def b/plugins/WinVST/Pressure4/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Pressure4/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/PurestEcho/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/PurestEcho/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/PurestEcho/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/PurestEcho/.vs/VSTProject/v14/.suo b/plugins/WinVST/PurestEcho/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..1ddbf82 --- /dev/null +++ b/plugins/WinVST/PurestEcho/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/PurestEcho/PurestEcho.cpp b/plugins/WinVST/PurestEcho/PurestEcho.cpp new file mode 100755 index 0000000..6b8c302 --- /dev/null +++ b/plugins/WinVST/PurestEcho/PurestEcho.cpp @@ -0,0 +1,157 @@ +/* ======================================== + * PurestEcho - PurestEcho.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PurestEcho_H +#include "PurestEcho.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new PurestEcho(audioMaster);} + +PurestEcho::PurestEcho(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 1.0; + C = 0.0; + D = 0.0; + E = 0.0; + for(int count = 0; count < totalsamples-1; count++) {dL[count] = 0;dR[count] = 0;} + gcount = 0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +PurestEcho::~PurestEcho() {} +VstInt32 PurestEcho::getVendorVersion () {return 1000;} +void PurestEcho::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void PurestEcho::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 PurestEcho::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + /* 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 PurestEcho::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + /* 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 PurestEcho::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float PurestEcho::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; 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 PurestEcho::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Time", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Tap 1", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Tap 2", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Tap 3", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Tap 4", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void PurestEcho::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void PurestEcho::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 PurestEcho::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool PurestEcho::getEffectName(char* name) { + vst_strncpy(name, "PurestEcho", kVstMaxProductStrLen); return true; +} + +VstPlugCategory PurestEcho::getPlugCategory() {return kPlugCategEffect;} + +bool PurestEcho::getProductString(char* text) { + vst_strncpy (text, "airwindows PurestEcho", kVstMaxProductStrLen); return true; +} + +bool PurestEcho::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/PurestEcho/PurestEcho.h b/plugins/WinVST/PurestEcho/PurestEcho.h new file mode 100755 index 0000000..a298dd2 --- /dev/null +++ b/plugins/WinVST/PurestEcho/PurestEcho.h @@ -0,0 +1,80 @@ +/* ======================================== + * PurestEcho - PurestEcho.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __PurestEcho_H +#define __PurestEcho_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kNumParameters = 5 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'pech'; //Change this to what the AU identity is! + +class PurestEcho : + public AudioEffectX +{ +public: + PurestEcho(audioMasterCallback audioMaster); + ~PurestEcho(); + 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; + + const static int totalsamples = 65535; + double dL[totalsamples]; + double dR[totalsamples]; + int gcount; + + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/WinVST/PurestEcho/PurestEchoProc.cpp b/plugins/WinVST/PurestEcho/PurestEchoProc.cpp new file mode 100755 index 0000000..77e4b2f --- /dev/null +++ b/plugins/WinVST/PurestEcho/PurestEchoProc.cpp @@ -0,0 +1,408 @@ +/* ======================================== + * PurestEcho - PurestEcho.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PurestEcho_H +#include "PurestEcho.h" +#endif + +void PurestEcho::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + int loopLimit = (int)(totalsamples * 0.499); + //this is a double buffer so we will be splitting it in two + + double time = pow(A,2) * 0.999; + double tap1 = B; + double tap2 = C; + double tap3 = D; + double tap4 = E; + + double gainTrim = 1.0 / (1.0 + tap1 + tap2 + tap3 + tap4); + //this becomes our equal-loudness mechanic. 0.2 to 1.0 gain on all things. + double tapsTrim = gainTrim * 0.5; + //the taps interpolate and require half that gain: 0.1 to 0.5 on all taps. + + int position1 = (int)(loopLimit * time * 0.25); + int position2 = (int)(loopLimit * time * 0.5); + int position3 = (int)(loopLimit * time * 0.75); + int position4 = (int)(loopLimit * time); + //basic echo information: we're taking four equally spaced echoes and setting their levels as desired. + //position4 is what you'd have for 'just set a delay time' + + double volAfter1 = (loopLimit * time * 0.25) - position1; + double volAfter2 = (loopLimit * time * 0.5) - position2; + double volAfter3 = (loopLimit * time * 0.75) - position3; + double volAfter4 = (loopLimit * time) - position4; + //these are 0-1: casting to an (int) truncates fractional numbers towards zero (and is faster than floor() ) + //so, when we take the integer number (all above zero) and subtract it from the real value, we get 0-1 + double volBefore1 = (1.0 - volAfter1) * tap1; + double volBefore2 = (1.0 - volAfter2) * tap2; + double volBefore3 = (1.0 - volAfter3) * tap3; + double volBefore4 = (1.0 - volAfter4) * tap4; + //and if we are including a bit of the previous/next sample to interpolate, then if the sample position is 1.0001 + //we'll be leaning most heavily on the 'before' sample which is nearer to us, and the 'after' sample is almost not used. + //if the sample position is 1.9999, the 'after' sample is strong and 'before' is almost not used. + + volAfter1 *= tap1; + volAfter2 *= tap2; + volAfter3 *= tap3; + volAfter4 *= tap4; + //and like with volBefore, we also want to scale this 'interpolate' to the loudness of this tap. + //We do it here because we can do it only once per audio buffer, not on every sample. This assumes we're + //not moving the tap every sample: if so we'd have to do this every sample as well. + + int oneBefore1 = position1 - 1; + int oneBefore2 = position2 - 1; + int oneBefore3 = position3 - 1; + int oneBefore4 = position4 - 1; + if (oneBefore1 < 0) oneBefore1 = 0; + if (oneBefore2 < 0) oneBefore2 = 0; + if (oneBefore3 < 0) oneBefore3 = 0; + if (oneBefore4 < 0) oneBefore4 = 0; + int oneAfter1 = position1 + 1; + int oneAfter2 = position2 + 1; + int oneAfter3 = position3 + 1; + int oneAfter4 = position4 + 1; + //this is setting up the way we interpolate samples: we're doing an echo-darkening thing + //to make it sound better. Pretty much no acoustic delay in human-breathable air will give + //you zero attenuation at 22 kilohertz: forget this at your peril ;) + + double delaysBufferL; + double delaysBufferR; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; + dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; + dR[gcount+loopLimit] = dR[gcount] = inputSampleR * tapsTrim; //this is how the double buffer works: + //we can look for delay taps without ever having to 'wrap around' within our calculation. + //As long as the delay tap is less than our loop limit we can always just add it to where we're + //at, and get a valid sample back right away, no matter where we are in the buffer. + //The 0.5 is taking into account the interpolation, by padding down the whole buffer. + + delaysBufferL = (dL[gcount+oneBefore4]*volBefore4); + delaysBufferL += (dL[gcount+oneAfter4]*volAfter4); + delaysBufferL += (dL[gcount+oneBefore3]*volBefore3); + delaysBufferL += (dL[gcount+oneAfter3]*volAfter3); + delaysBufferL += (dL[gcount+oneBefore2]*volBefore2); + delaysBufferL += (dL[gcount+oneAfter2]*volAfter2); + delaysBufferL += (dL[gcount+oneBefore1]*volBefore1); + delaysBufferL += (dL[gcount+oneAfter1]*volAfter1); + + delaysBufferR = (dR[gcount+oneBefore4]*volBefore4); + delaysBufferR += (dR[gcount+oneAfter4]*volAfter4); + delaysBufferR += (dR[gcount+oneBefore3]*volBefore3); + delaysBufferR += (dR[gcount+oneAfter3]*volAfter3); + delaysBufferR += (dR[gcount+oneBefore2]*volBefore2); + delaysBufferR += (dR[gcount+oneAfter2]*volAfter2); + delaysBufferR += (dR[gcount+oneBefore1]*volBefore1); + delaysBufferR += (dR[gcount+oneAfter1]*volAfter1); + //These are the interpolated samples. We're adding them first, because we know they're smaller + //and while the value of delaysBuffer is small we'll add similarly small values to it. Note the order. + + delaysBufferL += (dL[gcount+position4]*tap4); + delaysBufferL += (dL[gcount+position3]*tap3); + delaysBufferL += (dL[gcount+position2]*tap2); + delaysBufferL += (dL[gcount+position1]*tap1); + + delaysBufferR += (dR[gcount+position4]*tap4); + delaysBufferR += (dR[gcount+position3]*tap3); + delaysBufferR += (dR[gcount+position2]*tap2); + delaysBufferR += (dR[gcount+position1]*tap1); + //These are the primary samples for the echo, and we're adding them last. As before we're starting with the + //most delayed echoes, and ending with what we think might be the loudest echo. We're building this delaybuffer + //from the faintest noises to the loudest, to avoid adding a bunch of teeny values at the end. + //You can of course put the last echo as loudest, but with diminishing echo volumes this is optimal. + //This technique is also present in other plugins such as Iron Oxide. + + inputSampleL = (inputSampleL * gainTrim) + delaysBufferL; + inputSampleR = (inputSampleR * gainTrim) + delaysBufferR; + //this could be just inputSample += d[gcount+position1]; + //for literally a single, full volume echo combined with dry. + //What I'm doing is making the echoes more interesting. + + gcount--; + + //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 PurestEcho::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + int loopLimit = (int)(totalsamples * 0.499); + //this is a double buffer so we will be splitting it in two + + double time = pow(A,2) * 0.999; + double tap1 = B; + double tap2 = C; + double tap3 = D; + double tap4 = E; + + double gainTrim = 1.0 / (1.0 + tap1 + tap2 + tap3 + tap4); + //this becomes our equal-loudness mechanic. 0.2 to 1.0 gain on all things. + double tapsTrim = gainTrim * 0.5; + //the taps interpolate and require half that gain: 0.1 to 0.5 on all taps. + + int position1 = (int)(loopLimit * time * 0.25); + int position2 = (int)(loopLimit * time * 0.5); + int position3 = (int)(loopLimit * time * 0.75); + int position4 = (int)(loopLimit * time); + //basic echo information: we're taking four equally spaced echoes and setting their levels as desired. + //position4 is what you'd have for 'just set a delay time' + + double volAfter1 = (loopLimit * time * 0.25) - position1; + double volAfter2 = (loopLimit * time * 0.5) - position2; + double volAfter3 = (loopLimit * time * 0.75) - position3; + double volAfter4 = (loopLimit * time) - position4; + //these are 0-1: casting to an (int) truncates fractional numbers towards zero (and is faster than floor() ) + //so, when we take the integer number (all above zero) and subtract it from the real value, we get 0-1 + double volBefore1 = (1.0 - volAfter1) * tap1; + double volBefore2 = (1.0 - volAfter2) * tap2; + double volBefore3 = (1.0 - volAfter3) * tap3; + double volBefore4 = (1.0 - volAfter4) * tap4; + //and if we are including a bit of the previous/next sample to interpolate, then if the sample position is 1.0001 + //we'll be leaning most heavily on the 'before' sample which is nearer to us, and the 'after' sample is almost not used. + //if the sample position is 1.9999, the 'after' sample is strong and 'before' is almost not used. + + volAfter1 *= tap1; + volAfter2 *= tap2; + volAfter3 *= tap3; + volAfter4 *= tap4; + //and like with volBefore, we also want to scale this 'interpolate' to the loudness of this tap. + //We do it here because we can do it only once per audio buffer, not on every sample. This assumes we're + //not moving the tap every sample: if so we'd have to do this every sample as well. + + int oneBefore1 = position1 - 1; + int oneBefore2 = position2 - 1; + int oneBefore3 = position3 - 1; + int oneBefore4 = position4 - 1; + if (oneBefore1 < 0) oneBefore1 = 0; + if (oneBefore2 < 0) oneBefore2 = 0; + if (oneBefore3 < 0) oneBefore3 = 0; + if (oneBefore4 < 0) oneBefore4 = 0; + int oneAfter1 = position1 + 1; + int oneAfter2 = position2 + 1; + int oneAfter3 = position3 + 1; + int oneAfter4 = position4 + 1; + //this is setting up the way we interpolate samples: we're doing an echo-darkening thing + //to make it sound better. Pretty much no acoustic delay in human-breathable air will give + //you zero attenuation at 22 kilohertz: forget this at your peril ;) + + double delaysBufferL; + double delaysBufferR; + + 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; + + 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. + } + + if (gcount < 0 || gcount > loopLimit) gcount = loopLimit; + dL[gcount+loopLimit] = dL[gcount] = inputSampleL * tapsTrim; + dR[gcount+loopLimit] = dR[gcount] = inputSampleR * tapsTrim; //this is how the double buffer works: + //we can look for delay taps without ever having to 'wrap around' within our calculation. + //As long as the delay tap is less than our loop limit we can always just add it to where we're + //at, and get a valid sample back right away, no matter where we are in the buffer. + //The 0.5 is taking into account the interpolation, by padding down the whole buffer. + + delaysBufferL = (dL[gcount+oneBefore4]*volBefore4); + delaysBufferL += (dL[gcount+oneAfter4]*volAfter4); + delaysBufferL += (dL[gcount+oneBefore3]*volBefore3); + delaysBufferL += (dL[gcount+oneAfter3]*volAfter3); + delaysBufferL += (dL[gcount+oneBefore2]*volBefore2); + delaysBufferL += (dL[gcount+oneAfter2]*volAfter2); + delaysBufferL += (dL[gcount+oneBefore1]*volBefore1); + delaysBufferL += (dL[gcount+oneAfter1]*volAfter1); + + delaysBufferR = (dR[gcount+oneBefore4]*volBefore4); + delaysBufferR += (dR[gcount+oneAfter4]*volAfter4); + delaysBufferR += (dR[gcount+oneBefore3]*volBefore3); + delaysBufferR += (dR[gcount+oneAfter3]*volAfter3); + delaysBufferR += (dR[gcount+oneBefore2]*volBefore2); + delaysBufferR += (dR[gcount+oneAfter2]*volAfter2); + delaysBufferR += (dR[gcount+oneBefore1]*volBefore1); + delaysBufferR += (dR[gcount+oneAfter1]*volAfter1); + //These are the interpolated samples. We're adding them first, because we know they're smaller + //and while the value of delaysBuffer is small we'll add similarly small values to it. Note the order. + + delaysBufferL += (dL[gcount+position4]*tap4); + delaysBufferL += (dL[gcount+position3]*tap3); + delaysBufferL += (dL[gcount+position2]*tap2); + delaysBufferL += (dL[gcount+position1]*tap1); + + delaysBufferR += (dR[gcount+position4]*tap4); + delaysBufferR += (dR[gcount+position3]*tap3); + delaysBufferR += (dR[gcount+position2]*tap2); + delaysBufferR += (dR[gcount+position1]*tap1); + //These are the primary samples for the echo, and we're adding them last. As before we're starting with the + //most delayed echoes, and ending with what we think might be the loudest echo. We're building this delaybuffer + //from the faintest noises to the loudest, to avoid adding a bunch of teeny values at the end. + //You can of course put the last echo as loudest, but with diminishing echo volumes this is optimal. + //This technique is also present in other plugins such as Iron Oxide. + + inputSampleL = (inputSampleL * gainTrim) + delaysBufferL; + inputSampleR = (inputSampleR * gainTrim) + delaysBufferR; + //this could be just inputSample += d[gcount+position1]; + //for literally a single, full volume echo combined with dry. + //What I'm doing is making the echoes more interesting. + + gcount--; + + //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/PurestEcho/VSTProject.sln b/plugins/WinVST/PurestEcho/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/PurestEcho/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/PurestEcho/VSTProject.vcxproj b/plugins/WinVST/PurestEcho/VSTProject.vcxproj new file mode 100755 index 0000000..73426c1 --- /dev/null +++ b/plugins/WinVST/PurestEcho/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="PurestEcho.cpp" />
+ <ClCompile Include="PurestEchoProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="PurestEcho.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>PurestEcho64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestEcho/VSTProject.vcxproj.filters b/plugins/WinVST/PurestEcho/VSTProject.vcxproj.filters new file mode 100755 index 0000000..dbb5d22 --- /dev/null +++ b/plugins/WinVST/PurestEcho/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PurestEcho.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PurestEchoProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PurestEcho.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestEcho/VSTProject.vcxproj.user b/plugins/WinVST/PurestEcho/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/PurestEcho/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestEcho/vstplug.def b/plugins/WinVST/PurestEcho/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/PurestEcho/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/PurestWarm/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/PurestWarm/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/PurestWarm/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/PurestWarm/.vs/VSTProject/v14/.suo b/plugins/WinVST/PurestWarm/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..91f4254 --- /dev/null +++ b/plugins/WinVST/PurestWarm/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/PurestWarm/PurestWarm.cpp b/plugins/WinVST/PurestWarm/PurestWarm.cpp new file mode 100755 index 0000000..475e845 --- /dev/null +++ b/plugins/WinVST/PurestWarm/PurestWarm.cpp @@ -0,0 +1,127 @@ +/* ======================================== + * PurestWarm - PurestWarm.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PurestWarm_H +#include "PurestWarm.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new PurestWarm(audioMaster);} + +PurestWarm::PurestWarm(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +PurestWarm::~PurestWarm() {} +VstInt32 PurestWarm::getVendorVersion () {return 1000;} +void PurestWarm::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void PurestWarm::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 PurestWarm::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 PurestWarm::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 PurestWarm::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float PurestWarm::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 PurestWarm::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Polarity", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void PurestWarm::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: switch((VstInt32)( A * 1.999 )) //0 to almost edge of # of params + { + case 0: vst_strncpy (text, "Normal", kVstMaxParamStrLen); break; + case 1: vst_strncpy (text, "Inverse", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void PurestWarm::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 PurestWarm::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool PurestWarm::getEffectName(char* name) { + vst_strncpy(name, "PurestWarm", kVstMaxProductStrLen); return true; +} + +VstPlugCategory PurestWarm::getPlugCategory() {return kPlugCategEffect;} + +bool PurestWarm::getProductString(char* text) { + vst_strncpy (text, "airwindows PurestWarm", kVstMaxProductStrLen); return true; +} + +bool PurestWarm::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/PurestWarm/PurestWarm.h b/plugins/WinVST/PurestWarm/PurestWarm.h new file mode 100755 index 0000000..c67a91e --- /dev/null +++ b/plugins/WinVST/PurestWarm/PurestWarm.h @@ -0,0 +1,66 @@ +/* ======================================== + * PurestWarm - PurestWarm.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __PurestWarm_H +#define __PurestWarm_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'puwm'; //Change this to what the AU identity is! + +class PurestWarm : + public AudioEffectX +{ +public: + PurestWarm(audioMasterCallback audioMaster); + ~PurestWarm(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + +}; + +#endif diff --git a/plugins/WinVST/PurestWarm/PurestWarmProc.cpp b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp new file mode 100755 index 0000000..b5a5070 --- /dev/null +++ b/plugins/WinVST/PurestWarm/PurestWarmProc.cpp @@ -0,0 +1,352 @@ +/* ======================================== + * PurestWarm - PurestWarm.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __PurestWarm_H +#include "PurestWarm.h" +#endif + +void PurestWarm::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + int polarity = (int) ( A * 1.999 ); + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (polarity == 1) + { + if (inputSampleL < 0) + { + inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLA; + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + } + } + + if (inputSampleR < 0) + { + inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRA; + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + } + } + + } else { + + if (inputSampleL > 0) + { + inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLA; + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + } + } + + if (inputSampleR > 0) + { + inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; + //noise shaping to 32-bit floating point + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRA; + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + } + } + + } + //that's it. Only applies on one half of the waveform, other half is passthrough untouched. + //even the floating point noise shaping to the 32 bit buss is only applied as needed. + + fpFlip = !fpFlip; + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void PurestWarm::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + int polarity = (int) ( A * 1.999 ); + + long double inputSampleL; + long double inputSampleR; + + 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. + } + + if (polarity == 1) + { + if (inputSampleL < 0) + { + inputSampleL = -(sin(-inputSampleL*1.57079634)/1.57079634); + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLA; + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + } + } + + if (inputSampleR < 0) + { + inputSampleR = -(sin(-inputSampleR*1.57079634)/1.57079634); + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRA; + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + } + } + + } else { + + if (inputSampleL > 0) + { + inputSampleL = sin(inputSampleL*1.57079634)/1.57079634; + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLA; + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeLB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleL; + fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew); + } else { + fpTemp = inputSampleL; + fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew); + } + } + + if (inputSampleR > 0) + { + inputSampleR = sin(inputSampleR*1.57079634)/1.57079634; + //noise shaping to 64-bit floating point + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRA; + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeRB; + } + } else { + if (fpFlip) { + fpTemp = inputSampleR; + fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew); + } else { + fpTemp = inputSampleR; + fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew); + } + } + + } + //that's it. Only applies on one half of the waveform, other half is passthrough untouched. + //even the floating point noise shaping to the 32 bit buss is only applied as needed. + + 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/PurestWarm/VSTProject.sln b/plugins/WinVST/PurestWarm/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/PurestWarm/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/PurestWarm/VSTProject.vcxproj b/plugins/WinVST/PurestWarm/VSTProject.vcxproj new file mode 100755 index 0000000..7ee946a --- /dev/null +++ b/plugins/WinVST/PurestWarm/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="PurestWarm.cpp" />
+ <ClCompile Include="PurestWarmProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="PurestWarm.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>PurestWarm64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestWarm/VSTProject.vcxproj.filters b/plugins/WinVST/PurestWarm/VSTProject.vcxproj.filters new file mode 100755 index 0000000..a25f8ad --- /dev/null +++ b/plugins/WinVST/PurestWarm/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PurestWarm.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PurestWarmProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PurestWarm.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestWarm/VSTProject.vcxproj.user b/plugins/WinVST/PurestWarm/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/PurestWarm/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/PurestWarm/vstplug.def b/plugins/WinVST/PurestWarm/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/PurestWarm/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Pyewacket/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Pyewacket/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Pyewacket/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Pyewacket/.vs/VSTProject/v14/.suo b/plugins/WinVST/Pyewacket/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..be9ac10 --- /dev/null +++ b/plugins/WinVST/Pyewacket/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Pyewacket/Pyewacket.cpp b/plugins/WinVST/Pyewacket/Pyewacket.cpp new file mode 100755 index 0000000..ee2db40 --- /dev/null +++ b/plugins/WinVST/Pyewacket/Pyewacket.cpp @@ -0,0 +1,141 @@ +/* ======================================== + * Pyewacket - Pyewacket.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Pyewacket_H +#include "Pyewacket.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Pyewacket(audioMaster);} + +Pyewacket::Pyewacket(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.5; + C = 0.5; + chase = 1.0; + lastrectifierL = 0.0; + lastrectifierR = 0.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Pyewacket::~Pyewacket() {} +VstInt32 Pyewacket::getVendorVersion () {return 1000;} +void Pyewacket::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Pyewacket::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 Pyewacket::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Pyewacket::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Pyewacket::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Pyewacket::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Pyewacket::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Input Gain", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Release", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Output Gain", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Pyewacket::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*24.0)-12.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string ((C*24.0)-12.0, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Pyewacket::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Pyewacket::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Pyewacket::getEffectName(char* name) { + vst_strncpy(name, "Pyewacket", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Pyewacket::getPlugCategory() {return kPlugCategEffect;} + +bool Pyewacket::getProductString(char* text) { + vst_strncpy (text, "airwindows Pyewacket", kVstMaxProductStrLen); return true; +} + +bool Pyewacket::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Pyewacket/Pyewacket.h b/plugins/WinVST/Pyewacket/Pyewacket.h new file mode 100755 index 0000000..593001f --- /dev/null +++ b/plugins/WinVST/Pyewacket/Pyewacket.h @@ -0,0 +1,73 @@ +/* ======================================== + * Pyewacket - Pyewacket.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Pyewacket_H +#define __Pyewacket_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'pyew'; //Change this to what the AU identity is! + +class Pyewacket : + public AudioEffectX +{ +public: + Pyewacket(audioMasterCallback audioMaster); + ~Pyewacket(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + double chase; + double lastrectifierL; + double lastrectifierR; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/Pyewacket/PyewacketProc.cpp b/plugins/WinVST/Pyewacket/PyewacketProc.cpp new file mode 100755 index 0000000..83112a2 --- /dev/null +++ b/plugins/WinVST/Pyewacket/PyewacketProc.cpp @@ -0,0 +1,322 @@ +/* ======================================== + * Pyewacket - Pyewacket.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Pyewacket_H +#include "Pyewacket.h" +#endif + +void Pyewacket::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 drySampleL; + long double drySampleR; + double bridgerectifier; + double temprectifier; + double inputSense; + + double inputGain = pow(10.0,((A*24.0)-12.0)/20.0); + double attack = ((B+0.5)*0.006)/overallscale; + double decay = ((B+0.01)*0.0004)/overallscale; + double outputGain = pow(10.0,((C*24.0)-12.0)/20.0); + double wet; + double maxblur; + double blurdry; + double out; + double dry; + + 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. + } + + if (inputGain != 1.0) { + inputSampleL *= inputGain; + inputSampleR *= inputGain; + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + 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 (chase < inputSense) chase += attack; + if (chase > 1.0) chase = 1.0; + if (chase > inputSense) chase -= decay; + if (chase < 0.0) chase = 0.0; + //chase will be between 0 and ? (if input is super hot) + out = wet = chase; + if (wet > 1.0) wet = 1.0; + maxblur = wet * fpNew; + blurdry = 1.0 - maxblur; + //scaled back so that blur remains balance of both + if (out > fpOld) out = fpOld - (out - fpOld); + if (out < 0.0) out = 0.0; + dry = 1.0 - wet; + + if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + temprectifier = 1-cos(bridgerectifier); + bridgerectifier = ((lastrectifierL*maxblur) + (temprectifier*blurdry)); + lastrectifierL = temprectifier; + //starved version is also blurred by one sample + if (inputSampleL > 0) inputSampleL = (inputSampleL*dry)+(bridgerectifier*out); + else inputSampleL = (inputSampleL*dry)-(bridgerectifier*out); + + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + temprectifier = 1-cos(bridgerectifier); + bridgerectifier = ((lastrectifierR*maxblur) + (temprectifier*blurdry)); + lastrectifierR = temprectifier; + //starved version is also blurred by one sample + if (inputSampleR > 0) inputSampleR = (inputSampleR*dry)+(bridgerectifier*out); + else inputSampleR = (inputSampleR*dry)-(bridgerectifier*out); + + if (outputGain != 1.0) { + inputSampleL *= outputGain; + inputSampleR *= outputGain; + } + + //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 Pyewacket::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 drySampleL; + long double drySampleR; + double bridgerectifier; + double temprectifier; + double inputSense; + + double inputGain = pow(10.0,((A*24.0)-12.0)/20.0); + double attack = ((B+0.5)*0.006)/overallscale; + double decay = ((B+0.01)*0.0004)/overallscale; + double outputGain = pow(10.0,((C*24.0)-12.0)/20.0); + double wet; + double maxblur; + double blurdry; + double out; + double dry; + + 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. + } + + if (inputGain != 1.0) { + inputSampleL *= inputGain; + inputSampleR *= inputGain; + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + 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 (chase < inputSense) chase += attack; + if (chase > 1.0) chase = 1.0; + if (chase > inputSense) chase -= decay; + if (chase < 0.0) chase = 0.0; + //chase will be between 0 and ? (if input is super hot) + out = wet = chase; + if (wet > 1.0) wet = 1.0; + maxblur = wet * fpNew; + blurdry = 1.0 - maxblur; + //scaled back so that blur remains balance of both + if (out > fpOld) out = fpOld - (out - fpOld); + if (out < 0.0) out = 0.0; + dry = 1.0 - wet; + + if (inputSampleL > 1.57079633) inputSampleL = 1.57079633; + if (inputSampleL < -1.57079633) inputSampleL = -1.57079633; + if (inputSampleR > 1.57079633) inputSampleR = 1.57079633; + if (inputSampleR < -1.57079633) inputSampleR = -1.57079633; + + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + temprectifier = 1-cos(bridgerectifier); + bridgerectifier = ((lastrectifierL*maxblur) + (temprectifier*blurdry)); + lastrectifierL = temprectifier; + //starved version is also blurred by one sample + if (inputSampleL > 0) inputSampleL = (inputSampleL*dry)+(bridgerectifier*out); + else inputSampleL = (inputSampleL*dry)-(bridgerectifier*out); + + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + temprectifier = 1-cos(bridgerectifier); + bridgerectifier = ((lastrectifierR*maxblur) + (temprectifier*blurdry)); + lastrectifierR = temprectifier; + //starved version is also blurred by one sample + if (inputSampleR > 0) inputSampleR = (inputSampleR*dry)+(bridgerectifier*out); + else inputSampleR = (inputSampleR*dry)-(bridgerectifier*out); + + if (outputGain != 1.0) { + inputSampleL *= outputGain; + inputSampleR *= outputGain; + } + + //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/Pyewacket/VSTProject.sln b/plugins/WinVST/Pyewacket/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Pyewacket/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/Pyewacket/VSTProject.vcxproj b/plugins/WinVST/Pyewacket/VSTProject.vcxproj new file mode 100755 index 0000000..ae7f0b1 --- /dev/null +++ b/plugins/WinVST/Pyewacket/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Pyewacket.cpp" />
+ <ClCompile Include="PyewacketProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Pyewacket.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Pyewacket64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pyewacket/VSTProject.vcxproj.filters b/plugins/WinVST/Pyewacket/VSTProject.vcxproj.filters new file mode 100755 index 0000000..f443179 --- /dev/null +++ b/plugins/WinVST/Pyewacket/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Pyewacket.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PyewacketProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Pyewacket.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pyewacket/VSTProject.vcxproj.user b/plugins/WinVST/Pyewacket/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Pyewacket/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Pyewacket/vstplug.def b/plugins/WinVST/Pyewacket/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Pyewacket/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/SideDull/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/SideDull/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/SideDull/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/SideDull/.vs/VSTProject/v14/.suo b/plugins/WinVST/SideDull/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..68a45bd --- /dev/null +++ b/plugins/WinVST/SideDull/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/SideDull/SideDull.cpp b/plugins/WinVST/SideDull/SideDull.cpp new file mode 100755 index 0000000..547f1fd --- /dev/null +++ b/plugins/WinVST/SideDull/SideDull.cpp @@ -0,0 +1,124 @@ +/* ======================================== + * SideDull - SideDull.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __SideDull_H +#include "SideDull.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new SideDull(audioMaster);} + +SideDull::SideDull(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + iirSampleA = 0.0; + iirSampleB = 0.0; + flip = true; + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + //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 +} + +SideDull::~SideDull() {} +VstInt32 SideDull::getVendorVersion () {return 1000;} +void SideDull::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void SideDull::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 SideDull::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 SideDull::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 SideDull::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float SideDull::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 SideDull::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Cutoff", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void SideDull::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void SideDull::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 SideDull::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool SideDull::getEffectName(char* name) { + vst_strncpy(name, "SideDull", kVstMaxProductStrLen); return true; +} + +VstPlugCategory SideDull::getPlugCategory() {return kPlugCategEffect;} + +bool SideDull::getProductString(char* text) { + vst_strncpy (text, "airwindows SideDull", kVstMaxProductStrLen); return true; +} + +bool SideDull::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/SideDull/SideDull.h b/plugins/WinVST/SideDull/SideDull.h new file mode 100755 index 0000000..6f431ac --- /dev/null +++ b/plugins/WinVST/SideDull/SideDull.h @@ -0,0 +1,66 @@ +/* ======================================== + * SideDull - SideDull.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __SideDull_H +#define __SideDull_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'sidd'; //Change this to what the AU identity is! + +class SideDull : + public AudioEffectX +{ +public: + SideDull(audioMasterCallback audioMaster); + ~SideDull(); + 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 iirSampleA; + double iirSampleB; + bool flip; + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + + float A; +}; + +#endif diff --git a/plugins/WinVST/SideDull/SideDullProc.cpp b/plugins/WinVST/SideDull/SideDullProc.cpp new file mode 100755 index 0000000..347e5e8 --- /dev/null +++ b/plugins/WinVST/SideDull/SideDullProc.cpp @@ -0,0 +1,234 @@ +/* ======================================== + * SideDull - SideDull.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __SideDull_H +#include "SideDull.h" +#endif + +void SideDull::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 mid; + double side; + double iirAmount = pow(A,3)/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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + if (flip) + { + iirSampleA = (iirSampleA * (1 - iirAmount)) + (side * iirAmount); + side = iirSampleA; + } + else + { + iirSampleB = (iirSampleB * (1 - iirAmount)) + (side * iirAmount); + side = iirSampleB; + } + //highpass section + + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void SideDull::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 mid; + double side; + double iirAmount = pow(A,3)/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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + if (flip) + { + iirSampleA = (iirSampleA * (1 - iirAmount)) + (side * iirAmount); + side = iirSampleA; + } + else + { + iirSampleB = (iirSampleB * (1 - iirAmount)) + (side * iirAmount); + side = iirSampleB; + } + //highpass section + + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + //noise shaping to 64-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //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/SideDull/VSTProject.sln b/plugins/WinVST/SideDull/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/SideDull/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/SideDull/VSTProject.vcxproj b/plugins/WinVST/SideDull/VSTProject.vcxproj new file mode 100755 index 0000000..392d553 --- /dev/null +++ b/plugins/WinVST/SideDull/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="SideDull.cpp" />
+ <ClCompile Include="SideDullProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="SideDull.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>SideDull64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SideDull/VSTProject.vcxproj.filters b/plugins/WinVST/SideDull/VSTProject.vcxproj.filters new file mode 100755 index 0000000..f839adb --- /dev/null +++ b/plugins/WinVST/SideDull/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SideDull.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SideDullProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SideDull.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SideDull/VSTProject.vcxproj.user b/plugins/WinVST/SideDull/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/SideDull/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SideDull/vstplug.def b/plugins/WinVST/SideDull/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/SideDull/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Sidepass/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Sidepass/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Sidepass/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Sidepass/.vs/VSTProject/v14/.suo b/plugins/WinVST/Sidepass/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..5aee656 --- /dev/null +++ b/plugins/WinVST/Sidepass/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Sidepass/Sidepass.cpp b/plugins/WinVST/Sidepass/Sidepass.cpp new file mode 100755 index 0000000..98f6f3a --- /dev/null +++ b/plugins/WinVST/Sidepass/Sidepass.cpp @@ -0,0 +1,124 @@ +/* ======================================== + * Sidepass - Sidepass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Sidepass_H +#include "Sidepass.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Sidepass(audioMaster);} + +Sidepass::Sidepass(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + iirSampleA = 0.0; + iirSampleB = 0.0; + flip = true; + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + //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 +} + +Sidepass::~Sidepass() {} +VstInt32 Sidepass::getVendorVersion () {return 1000;} +void Sidepass::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Sidepass::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 Sidepass::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + /* 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 Sidepass::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + /* 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 Sidepass::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Sidepass::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; 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 Sidepass::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Cutoff", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Sidepass::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Sidepass::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Sidepass::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Sidepass::getEffectName(char* name) { + vst_strncpy(name, "Sidepass", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Sidepass::getPlugCategory() {return kPlugCategEffect;} + +bool Sidepass::getProductString(char* text) { + vst_strncpy (text, "airwindows Sidepass", kVstMaxProductStrLen); return true; +} + +bool Sidepass::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Sidepass/Sidepass.h b/plugins/WinVST/Sidepass/Sidepass.h new file mode 100755 index 0000000..0e496f5 --- /dev/null +++ b/plugins/WinVST/Sidepass/Sidepass.h @@ -0,0 +1,68 @@ +/* ======================================== + * Sidepass - Sidepass.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Sidepass_H +#define __Sidepass_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kNumParameters = 1 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'sidp'; //Change this to what the AU identity is! + +class Sidepass : + public AudioEffectX +{ +public: + Sidepass(audioMasterCallback audioMaster); + ~Sidepass(); + 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 iirSampleA; + double iirSampleB; + bool flip; + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + //default stuff + + float A; + +}; + +#endif diff --git a/plugins/WinVST/Sidepass/SidepassProc.cpp b/plugins/WinVST/Sidepass/SidepassProc.cpp new file mode 100755 index 0000000..d022df3 --- /dev/null +++ b/plugins/WinVST/Sidepass/SidepassProc.cpp @@ -0,0 +1,228 @@ +/* ======================================== + * Sidepass - Sidepass.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Sidepass_H +#include "Sidepass.h" +#endif + +void Sidepass::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; + double iirAmount = pow(A,3)/overallscale; + long double inputSampleL; + long double inputSampleR; + long double mid; + double side; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + if (flip) + { + iirSampleA = (iirSampleA * (1 - iirAmount)) + (side * iirAmount); + side -= iirSampleA; + } + else + { + iirSampleB = (iirSampleB * (1 - iirAmount)) + (side * iirAmount); + side -= iirSampleB; + } + //highpass section + + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void Sidepass::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + double iirAmount = pow(A,3)/overallscale; + long double inputSampleL; + long double inputSampleR; + long double mid; + double side; + + 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. + } + + mid = inputSampleL + inputSampleR; + side = inputSampleL - inputSampleR; + + if (flip) + { + iirSampleA = (iirSampleA * (1 - iirAmount)) + (side * iirAmount); + side -= iirSampleA; + } + else + { + iirSampleB = (iirSampleB * (1 - iirAmount)) + (side * iirAmount); + side -= iirSampleB; + } + //highpass section + + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + //noise shaping to 64-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //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/Sidepass/VSTProject.sln b/plugins/WinVST/Sidepass/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Sidepass/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/Sidepass/VSTProject.vcxproj b/plugins/WinVST/Sidepass/VSTProject.vcxproj new file mode 100755 index 0000000..47d1a35 --- /dev/null +++ b/plugins/WinVST/Sidepass/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Sidepass.cpp" />
+ <ClCompile Include="SidepassProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Sidepass.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Sidepass64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Sidepass/VSTProject.vcxproj.filters b/plugins/WinVST/Sidepass/VSTProject.vcxproj.filters new file mode 100755 index 0000000..a317c62 --- /dev/null +++ b/plugins/WinVST/Sidepass/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Sidepass.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SidepassProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Sidepass.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Sidepass/VSTProject.vcxproj.user b/plugins/WinVST/Sidepass/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Sidepass/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Sidepass/vstplug.def b/plugins/WinVST/Sidepass/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Sidepass/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/StarChild/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/StarChild/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/StarChild/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/StarChild/.vs/VSTProject/v14/.suo b/plugins/WinVST/StarChild/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..1c72906 --- /dev/null +++ b/plugins/WinVST/StarChild/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/StarChild/StarChild.cpp b/plugins/WinVST/StarChild/StarChild.cpp new file mode 100755 index 0000000..84becbc --- /dev/null +++ b/plugins/WinVST/StarChild/StarChild.cpp @@ -0,0 +1,188 @@ +/* ======================================== + * StarChild - StarChild.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __StarChild_H +#include "StarChild.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new StarChild(audioMaster);} + +StarChild::StarChild(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 1.0; + B = 0.7; + C = 0.2; + + int count; + + for(count = 0; count < 44101; count++) {d[count] = 0.0;} + + for(count = 0; count < 11; count++) {wearL[count] = 0.0; wearR[count] = 0.0; factor[count] = 0.0;} + + wearLPrev = 0.0; wearRPrev = 0.0; + + p[1] = 11; p[2] = 13; p[3] = 17; p[4] = 19; p[5] = 23; p[6] = 29; p[7] = 31; p[8] = 37; p[9] = 41; + p[10] = 43; p[11] = 47; p[12] = 53; p[13] = 59; p[14] = 61; p[15] = 67; p[16] = 71; p[17] = 73; p[18] = 79; p[19] = 83; p[20] = 89; + p[21] = 97; p[22] = 101; p[23] = 103; p[24] = 107; p[25] = 109; p[26] = 113; p[27] = 127; p[28] = 131; p[29] = 137; p[30] = 139; + p[31] = 149; p[32] = 151; p[33] = 157; p[34] = 163; p[35] = 167; p[36] = 173; p[37] = 179; p[38] = 181; p[39] = 191; p[40] = 193; + p[41] = 197; p[42] = 199; p[43] = 211; p[44] = 223; p[45] = 227; p[46] = 229; p[47] = 233; p[48] = 239; p[49] = 241; p[50] = 251; + p[51] = 257; p[52] = 263; p[53] = 269; p[54] = 271; p[55] = 277; p[56] = 281; p[57] = 283; p[58] = 293; p[59] = 307; p[60] = 311; + p[61] = 313; p[62] = 317; p[63] = 331; p[64] = 337; p[65] = 347; p[66] = 349; p[67] = 353; p[68] = 359; p[69] = 367; p[70] = 373; + p[71] = 379; p[72] = 383; p[73] = 389; p[74] = 397; p[75] = 401; p[76] = 409; p[77] = 419; p[78] = 421; p[79] = 431; p[80] = 433; + p[81] = 439; p[82] = 443; p[83] = 449; p[84] = 457; p[85] = 461; p[86] = 463; p[87] = 467; p[88] = 479; p[89] = 487; p[90] = 491; + p[91] = 499; p[92] = 503; p[93] = 509; p[94] = 521; p[95] = 523; p[96] = 541; p[97] = 547; p[98] = 557; p[99] = 563; p[100] = 569; + p[101] = 571; p[102] = 577; p[103] = 587; p[104] = 593; p[105] = 599; p[106] = 601; p[107] = 607; p[108] = 613; p[109] = 617; p[110] = 619; + p[111] = 631; p[112] = 641; p[113] = 643; p[114] = 647; p[115] = 653; p[116] = 659; p[117] = 661; p[118] = 673; p[119] = 677; p[120] = 683; + p[121] = 691; p[122] = 701; p[123] = 709; p[124] = 719; p[125] = 727; p[126] = 733; p[127] = 739; p[128] = 743; p[129] = 751; p[130] = 757; + p[131] = 761; p[132] = 769; p[133] = 773; p[134] = 787; p[135] = 797; p[136] = 809; p[137] = 811; p[138] = 821; p[139] = 823; p[140] = 827; + p[141] = 829; p[142] = 839; p[143] = 853; p[144] = 857; p[145] = 859; p[146] = 863; p[147] = 877; p[148] = 881; p[149] = 883; p[150] = 887; + p[151] = 907; p[152] = 911; p[153] = 919; p[154] = 929; p[155] = 937; p[156] = 941; p[157] = 947; p[158] = 953; p[159] = 967; p[160] = 971; + p[161] = 977; p[162] = 983; p[163] = 991; p[164] = 997; p[165] = 998; p[166] = 999; + + int assign; + for(count = 0; count < 165; count++) + { + t[count] = p[count]; + //these get assigned again but we'll give them real values in case of trouble. They are 32 bit unsigned ints + assign = p[count] % 10; + //give us the 1, 3, 7 or 9 on the end + + switch (assign){ + case 1: outL[count] = 0.0; outR[count] = p[count]; break; + case 3: outL[count] = p[count] * 0.25; outR[count] = p[count] * 0.75; break; + case 7: outL[count] = p[count] * 0.75; outR[count] = p[count] * 0.25; break; + case 9: outL[count] = p[count]; outR[count] = 0.0; break; + } + //this gives us a set of stereo offsets that are always the same. When building our delay outputs, + //we multiply our -1 to 1 float values by this and add the result to a simple signed int. + //The result gives us a coarser and coarser output the fewer taps we have, + //and we divide the result by count*count to drop the volume down again. + } + pitchCounter = 2; + increment = 1; + dutyCycle = 1; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +StarChild::~StarChild() {} +VstInt32 StarChild::getVendorVersion () {return 1000;} +void StarChild::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void StarChild::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 StarChild::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 StarChild::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 StarChild::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float StarChild::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 StarChild::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Sustain", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Grain", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void StarChild::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void StarChild::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 StarChild::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool StarChild::getEffectName(char* name) { + vst_strncpy(name, "StarChild", kVstMaxProductStrLen); return true; +} + +VstPlugCategory StarChild::getPlugCategory() {return kPlugCategEffect;} + +bool StarChild::getProductString(char* text) { + vst_strncpy (text, "airwindows StarChild", kVstMaxProductStrLen); return true; +} + +bool StarChild::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/StarChild/StarChild.h b/plugins/WinVST/StarChild/StarChild.h new file mode 100755 index 0000000..7ae986a --- /dev/null +++ b/plugins/WinVST/StarChild/StarChild.h @@ -0,0 +1,87 @@ +/* ======================================== + * StarChild - StarChild.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __StarChild_H +#define __StarChild_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'star'; //Change this to what the AU identity is! + +class StarChild : + public AudioEffectX +{ +public: + StarChild(audioMasterCallback audioMaster); + ~StarChild(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double d[45102]; + int dCount; + + int p[171]; + int t[171]; + double outL[171]; + double outR[171]; + int pitchCounter; + int increment; + int dutyCycle; + + double wearL[11]; + double wearR[11]; + double factor[11]; + double wearLPrev; + double wearRPrev; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/StarChild/StarChildProc.cpp b/plugins/WinVST/StarChild/StarChildProc.cpp new file mode 100755 index 0000000..03c8e31 --- /dev/null +++ b/plugins/WinVST/StarChild/StarChildProc.cpp @@ -0,0 +1,838 @@ +/* ======================================== + * StarChild - StarChild.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __StarChild_H +#include "StarChild.h" +#endif + +void StarChild::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + + int bufferL = 0; + int bufferR = 0; + //these are to build up the reverb tank outs + + int rangeDirect = (pow(B,2) * 156.0) + 7.0; + //maximum safe delay is 259 * the prime tap, not including room for the pitch shift offset + + float scaleDirect = (pow(A,2) * (3280.0/rangeDirect)) + 2.0; + //let's try making it always be the max delay: smaller range forces scale to be longer + + float outputPad = 4 * rangeDirect * sqrt(rangeDirect); + + float overallscale = ((1.0-B)*9.0)+1.0; + //apply the singlestage groove wear strongest when bits are heavily crushed + float gain = overallscale; + if (gain > 1.0) {factor[0] = 1.0; gain -= 1.0;} else {factor[0] = gain; gain = 0.0;} + if (gain > 1.0) {factor[1] = 1.0; gain -= 1.0;} else {factor[1] = gain; gain = 0.0;} + if (gain > 1.0) {factor[2] = 1.0; gain -= 1.0;} else {factor[2] = gain; gain = 0.0;} + if (gain > 1.0) {factor[3] = 1.0; gain -= 1.0;} else {factor[3] = gain; gain = 0.0;} + if (gain > 1.0) {factor[4] = 1.0; gain -= 1.0;} else {factor[4] = gain; gain = 0.0;} + if (gain > 1.0) {factor[5] = 1.0; gain -= 1.0;} else {factor[5] = gain; gain = 0.0;} + if (gain > 1.0) {factor[6] = 1.0; gain -= 1.0;} else {factor[6] = gain; gain = 0.0;} + if (gain > 1.0) {factor[7] = 1.0; gain -= 1.0;} else {factor[7] = gain; gain = 0.0;} + if (gain > 1.0) {factor[8] = 1.0; gain -= 1.0;} else {factor[8] = gain; gain = 0.0;} + if (gain > 1.0) {factor[9] = 1.0; gain -= 1.0;} else {factor[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + factor[0] /= overallscale; + factor[1] /= overallscale; + factor[2] /= overallscale; + factor[3] /= overallscale; + factor[4] /= overallscale; + factor[5] /= overallscale; + factor[6] /= overallscale; + factor[7] /= overallscale; + factor[8] /= overallscale; + factor[9] /= overallscale; + //and now it's neatly scaled, too + float accumulatorSample; + float correction; + float wetness = C; + float dryness = 1.0 - wetness; //reverb setup + + int count; + for(count = 1; count < 165; count++) + { + t[count] = p[count] * scaleDirect; + //this is the scaled tap for direct out, in number of samples delay + } + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + //assign working variables like the dry + + if (dCount < 0 || dCount > 22050) {dCount = 22050;} + d[dCount + 22050] = d[dCount] = inputSampleL + inputSampleR; + dCount--; + //feed the delay line with summed channels. The stuff we're reading back + //will always be plus dCount, because we're counting back to 0. + + //now we're going to start pitch shifting. + dutyCycle += 1; + if (dutyCycle > scaleDirect) { + dutyCycle = 1; + //this whole routine doesn't run every sample, it's making a wacky hypervibrato + t[pitchCounter] += increment; pitchCounter += 1; + //pitchCounter always goes up, t[] goes up and down + //possibly do that not every sample? Let's see what we get + if (pitchCounter > rangeDirect) { + if (increment == 1) { + pitchCounter = 1; + if (t[1] > ((11 * scaleDirect) + 1000)) increment = -1; + //let's try hardcoding a big 1000 sample buffer + } + else { + //increment is -1 so we have been counting down! + pitchCounter = 1; + + if (t[1] < (11 * scaleDirect)) { + //we've scaled everything back so we're going up again + increment = 1; + //and we're gonna reset the lot in case of screw-ups (control manipulations) + for(count = 1; count < 165; count++) + { + t[count] = p[count] * scaleDirect; + } + //which means we're back to normal and counting up again. + } + } + //wrap around to begin again, and if our first tap is greater than + //its base value plus scaleDirect, start going down. + } + } + //always wrap around to the first tap + + //Now we do a select case where we jump into the middle of some repetitive math, unrolled. + bufferL = 0; bufferR = 0; + //clear before making our delay sound + switch (rangeDirect) { + case 164: bufferL += (int)(d[dCount+t[164]]*outL[164]); bufferR += (int)(d[dCount+t[164]]*outR[164]); + case 163: bufferL += (int)(d[dCount+t[163]]*outL[163]); bufferR += (int)(d[dCount+t[163]]*outR[163]); + case 162: bufferL += (int)(d[dCount+t[162]]*outL[162]); bufferR += (int)(d[dCount+t[162]]*outR[162]); + case 161: bufferL += (int)(d[dCount+t[161]]*outL[161]); bufferR += (int)(d[dCount+t[161]]*outR[161]); + case 160: bufferL += (int)(d[dCount+t[160]]*outL[160]); bufferR += (int)(d[dCount+t[160]]*outR[160]); + case 159: bufferL += (int)(d[dCount+t[159]]*outL[159]); bufferR += (int)(d[dCount+t[159]]*outR[159]); + case 158: bufferL += (int)(d[dCount+t[158]]*outL[158]); bufferR += (int)(d[dCount+t[158]]*outR[158]); + case 157: bufferL += (int)(d[dCount+t[157]]*outL[157]); bufferR += (int)(d[dCount+t[157]]*outR[157]); + case 156: bufferL += (int)(d[dCount+t[156]]*outL[156]); bufferR += (int)(d[dCount+t[156]]*outR[156]); + case 155: bufferL += (int)(d[dCount+t[155]]*outL[155]); bufferR += (int)(d[dCount+t[155]]*outR[155]); + case 154: bufferL += (int)(d[dCount+t[154]]*outL[154]); bufferR += (int)(d[dCount+t[154]]*outR[154]); + case 153: bufferL += (int)(d[dCount+t[153]]*outL[153]); bufferR += (int)(d[dCount+t[153]]*outR[153]); + case 152: bufferL += (int)(d[dCount+t[152]]*outL[152]); bufferR += (int)(d[dCount+t[152]]*outR[152]); + case 151: bufferL += (int)(d[dCount+t[151]]*outL[151]); bufferR += (int)(d[dCount+t[151]]*outR[151]); + case 150: bufferL += (int)(d[dCount+t[150]]*outL[150]); bufferR += (int)(d[dCount+t[150]]*outR[150]); + case 149: bufferL += (int)(d[dCount+t[149]]*outL[149]); bufferR += (int)(d[dCount+t[149]]*outR[149]); + case 148: bufferL += (int)(d[dCount+t[148]]*outL[148]); bufferR += (int)(d[dCount+t[148]]*outR[148]); + case 147: bufferL += (int)(d[dCount+t[147]]*outL[147]); bufferR += (int)(d[dCount+t[147]]*outR[147]); + case 146: bufferL += (int)(d[dCount+t[146]]*outL[146]); bufferR += (int)(d[dCount+t[146]]*outR[146]); + case 145: bufferL += (int)(d[dCount+t[145]]*outL[145]); bufferR += (int)(d[dCount+t[145]]*outR[145]); + case 144: bufferL += (int)(d[dCount+t[144]]*outL[144]); bufferR += (int)(d[dCount+t[144]]*outR[144]); + case 143: bufferL += (int)(d[dCount+t[143]]*outL[143]); bufferR += (int)(d[dCount+t[143]]*outR[143]); + case 142: bufferL += (int)(d[dCount+t[142]]*outL[142]); bufferR += (int)(d[dCount+t[142]]*outR[142]); + case 141: bufferL += (int)(d[dCount+t[141]]*outL[141]); bufferR += (int)(d[dCount+t[141]]*outR[141]); + case 140: bufferL += (int)(d[dCount+t[140]]*outL[140]); bufferR += (int)(d[dCount+t[140]]*outR[140]); + case 139: bufferL += (int)(d[dCount+t[139]]*outL[139]); bufferR += (int)(d[dCount+t[139]]*outR[139]); + case 138: bufferL += (int)(d[dCount+t[138]]*outL[138]); bufferR += (int)(d[dCount+t[138]]*outR[138]); + case 137: bufferL += (int)(d[dCount+t[137]]*outL[137]); bufferR += (int)(d[dCount+t[137]]*outR[137]); + case 136: bufferL += (int)(d[dCount+t[136]]*outL[136]); bufferR += (int)(d[dCount+t[136]]*outR[136]); + case 135: bufferL += (int)(d[dCount+t[135]]*outL[135]); bufferR += (int)(d[dCount+t[135]]*outR[135]); + case 134: bufferL += (int)(d[dCount+t[134]]*outL[134]); bufferR += (int)(d[dCount+t[134]]*outR[134]); + case 133: bufferL += (int)(d[dCount+t[133]]*outL[133]); bufferR += (int)(d[dCount+t[133]]*outR[133]); + case 132: bufferL += (int)(d[dCount+t[132]]*outL[132]); bufferR += (int)(d[dCount+t[132]]*outR[132]); + case 131: bufferL += (int)(d[dCount+t[131]]*outL[131]); bufferR += (int)(d[dCount+t[131]]*outR[131]); + case 130: bufferL += (int)(d[dCount+t[130]]*outL[130]); bufferR += (int)(d[dCount+t[130]]*outR[130]); + case 129: bufferL += (int)(d[dCount+t[129]]*outL[129]); bufferR += (int)(d[dCount+t[129]]*outR[129]); + case 128: bufferL += (int)(d[dCount+t[128]]*outL[128]); bufferR += (int)(d[dCount+t[128]]*outR[128]); + case 127: bufferL += (int)(d[dCount+t[127]]*outL[127]); bufferR += (int)(d[dCount+t[127]]*outR[127]); + case 126: bufferL += (int)(d[dCount+t[126]]*outL[126]); bufferR += (int)(d[dCount+t[126]]*outR[126]); + case 125: bufferL += (int)(d[dCount+t[125]]*outL[125]); bufferR += (int)(d[dCount+t[125]]*outR[125]); + case 124: bufferL += (int)(d[dCount+t[124]]*outL[124]); bufferR += (int)(d[dCount+t[124]]*outR[124]); + case 123: bufferL += (int)(d[dCount+t[123]]*outL[123]); bufferR += (int)(d[dCount+t[123]]*outR[123]); + case 122: bufferL += (int)(d[dCount+t[122]]*outL[122]); bufferR += (int)(d[dCount+t[122]]*outR[122]); + case 121: bufferL += (int)(d[dCount+t[121]]*outL[121]); bufferR += (int)(d[dCount+t[121]]*outR[121]); + case 120: bufferL += (int)(d[dCount+t[120]]*outL[120]); bufferR += (int)(d[dCount+t[120]]*outR[120]); + case 119: bufferL += (int)(d[dCount+t[119]]*outL[119]); bufferR += (int)(d[dCount+t[119]]*outR[119]); + case 118: bufferL += (int)(d[dCount+t[118]]*outL[118]); bufferR += (int)(d[dCount+t[118]]*outR[118]); + case 117: bufferL += (int)(d[dCount+t[117]]*outL[117]); bufferR += (int)(d[dCount+t[117]]*outR[117]); + case 116: bufferL += (int)(d[dCount+t[116]]*outL[116]); bufferR += (int)(d[dCount+t[116]]*outR[116]); + case 115: bufferL += (int)(d[dCount+t[115]]*outL[115]); bufferR += (int)(d[dCount+t[115]]*outR[115]); + case 114: bufferL += (int)(d[dCount+t[114]]*outL[114]); bufferR += (int)(d[dCount+t[114]]*outR[114]); + case 113: bufferL += (int)(d[dCount+t[113]]*outL[113]); bufferR += (int)(d[dCount+t[113]]*outR[113]); + case 112: bufferL += (int)(d[dCount+t[112]]*outL[112]); bufferR += (int)(d[dCount+t[112]]*outR[112]); + case 111: bufferL += (int)(d[dCount+t[111]]*outL[111]); bufferR += (int)(d[dCount+t[111]]*outR[111]); + case 110: bufferL += (int)(d[dCount+t[110]]*outL[110]); bufferR += (int)(d[dCount+t[110]]*outR[110]); + case 109: bufferL += (int)(d[dCount+t[109]]*outL[109]); bufferR += (int)(d[dCount+t[109]]*outR[109]); + case 108: bufferL += (int)(d[dCount+t[108]]*outL[108]); bufferR += (int)(d[dCount+t[108]]*outR[108]); + case 107: bufferL += (int)(d[dCount+t[107]]*outL[107]); bufferR += (int)(d[dCount+t[107]]*outR[107]); + case 106: bufferL += (int)(d[dCount+t[106]]*outL[106]); bufferR += (int)(d[dCount+t[106]]*outR[106]); + case 105: bufferL += (int)(d[dCount+t[105]]*outL[105]); bufferR += (int)(d[dCount+t[105]]*outR[105]); + case 104: bufferL += (int)(d[dCount+t[104]]*outL[104]); bufferR += (int)(d[dCount+t[104]]*outR[104]); + case 103: bufferL += (int)(d[dCount+t[103]]*outL[103]); bufferR += (int)(d[dCount+t[103]]*outR[103]); + case 102: bufferL += (int)(d[dCount+t[102]]*outL[102]); bufferR += (int)(d[dCount+t[102]]*outR[102]); + case 101: bufferL += (int)(d[dCount+t[101]]*outL[101]); bufferR += (int)(d[dCount+t[101]]*outR[101]); + case 100: bufferL += (int)(d[dCount+t[100]]*outL[100]); bufferR += (int)(d[dCount+t[100]]*outR[100]); + case 99: bufferL += (int)(d[dCount+t[ 99]]*outL[ 99]); bufferR += (int)(d[dCount+t[ 99]]*outR[ 99]); + case 98: bufferL += (int)(d[dCount+t[ 98]]*outL[ 98]); bufferR += (int)(d[dCount+t[ 98]]*outR[ 98]); + case 97: bufferL += (int)(d[dCount+t[ 97]]*outL[ 97]); bufferR += (int)(d[dCount+t[ 97]]*outR[ 97]); + case 96: bufferL += (int)(d[dCount+t[ 96]]*outL[ 96]); bufferR += (int)(d[dCount+t[ 96]]*outR[ 96]); + case 95: bufferL += (int)(d[dCount+t[ 95]]*outL[ 95]); bufferR += (int)(d[dCount+t[ 95]]*outR[ 95]); + case 94: bufferL += (int)(d[dCount+t[ 94]]*outL[ 94]); bufferR += (int)(d[dCount+t[ 94]]*outR[ 94]); + case 93: bufferL += (int)(d[dCount+t[ 93]]*outL[ 93]); bufferR += (int)(d[dCount+t[ 93]]*outR[ 93]); + case 92: bufferL += (int)(d[dCount+t[ 92]]*outL[ 92]); bufferR += (int)(d[dCount+t[ 92]]*outR[ 92]); + case 91: bufferL += (int)(d[dCount+t[ 91]]*outL[ 91]); bufferR += (int)(d[dCount+t[ 91]]*outR[ 91]); + case 90: bufferL += (int)(d[dCount+t[ 90]]*outL[ 90]); bufferR += (int)(d[dCount+t[ 90]]*outR[ 90]); + case 89: bufferL += (int)(d[dCount+t[ 89]]*outL[ 89]); bufferR += (int)(d[dCount+t[ 89]]*outR[ 89]); + case 88: bufferL += (int)(d[dCount+t[ 88]]*outL[ 88]); bufferR += (int)(d[dCount+t[ 88]]*outR[ 88]); + case 87: bufferL += (int)(d[dCount+t[ 87]]*outL[ 87]); bufferR += (int)(d[dCount+t[ 87]]*outR[ 87]); + case 86: bufferL += (int)(d[dCount+t[ 86]]*outL[ 86]); bufferR += (int)(d[dCount+t[ 86]]*outR[ 86]); + case 85: bufferL += (int)(d[dCount+t[ 85]]*outL[ 85]); bufferR += (int)(d[dCount+t[ 85]]*outR[ 85]); + case 84: bufferL += (int)(d[dCount+t[ 84]]*outL[ 84]); bufferR += (int)(d[dCount+t[ 84]]*outR[ 84]); + case 83: bufferL += (int)(d[dCount+t[ 83]]*outL[ 83]); bufferR += (int)(d[dCount+t[ 83]]*outR[ 83]); + case 82: bufferL += (int)(d[dCount+t[ 82]]*outL[ 82]); bufferR += (int)(d[dCount+t[ 82]]*outR[ 82]); + case 81: bufferL += (int)(d[dCount+t[ 81]]*outL[ 81]); bufferR += (int)(d[dCount+t[ 81]]*outR[ 81]); + case 80: bufferL += (int)(d[dCount+t[ 80]]*outL[ 80]); bufferR += (int)(d[dCount+t[ 80]]*outR[ 80]); + case 79: bufferL += (int)(d[dCount+t[ 79]]*outL[ 79]); bufferR += (int)(d[dCount+t[ 79]]*outR[ 79]); + case 78: bufferL += (int)(d[dCount+t[ 78]]*outL[ 78]); bufferR += (int)(d[dCount+t[ 78]]*outR[ 78]); + case 77: bufferL += (int)(d[dCount+t[ 77]]*outL[ 77]); bufferR += (int)(d[dCount+t[ 77]]*outR[ 77]); + case 76: bufferL += (int)(d[dCount+t[ 76]]*outL[ 76]); bufferR += (int)(d[dCount+t[ 76]]*outR[ 76]); + case 75: bufferL += (int)(d[dCount+t[ 75]]*outL[ 75]); bufferR += (int)(d[dCount+t[ 75]]*outR[ 75]); + case 74: bufferL += (int)(d[dCount+t[ 74]]*outL[ 74]); bufferR += (int)(d[dCount+t[ 74]]*outR[ 74]); + case 73: bufferL += (int)(d[dCount+t[ 73]]*outL[ 73]); bufferR += (int)(d[dCount+t[ 73]]*outR[ 73]); + case 72: bufferL += (int)(d[dCount+t[ 72]]*outL[ 72]); bufferR += (int)(d[dCount+t[ 72]]*outR[ 72]); + case 71: bufferL += (int)(d[dCount+t[ 71]]*outL[ 71]); bufferR += (int)(d[dCount+t[ 71]]*outR[ 71]); + case 70: bufferL += (int)(d[dCount+t[ 70]]*outL[ 70]); bufferR += (int)(d[dCount+t[ 70]]*outR[ 70]); + case 69: bufferL += (int)(d[dCount+t[ 69]]*outL[ 69]); bufferR += (int)(d[dCount+t[ 69]]*outR[ 69]); + case 68: bufferL += (int)(d[dCount+t[ 68]]*outL[ 68]); bufferR += (int)(d[dCount+t[ 68]]*outR[ 68]); + case 67: bufferL += (int)(d[dCount+t[ 67]]*outL[ 67]); bufferR += (int)(d[dCount+t[ 67]]*outR[ 67]); + case 66: bufferL += (int)(d[dCount+t[ 66]]*outL[ 66]); bufferR += (int)(d[dCount+t[ 66]]*outR[ 66]); + case 65: bufferL += (int)(d[dCount+t[ 65]]*outL[ 65]); bufferR += (int)(d[dCount+t[ 65]]*outR[ 65]); + case 64: bufferL += (int)(d[dCount+t[ 64]]*outL[ 64]); bufferR += (int)(d[dCount+t[ 64]]*outR[ 64]); + case 63: bufferL += (int)(d[dCount+t[ 63]]*outL[ 63]); bufferR += (int)(d[dCount+t[ 63]]*outR[ 63]); + case 62: bufferL += (int)(d[dCount+t[ 62]]*outL[ 62]); bufferR += (int)(d[dCount+t[ 62]]*outR[ 62]); + case 61: bufferL += (int)(d[dCount+t[ 61]]*outL[ 61]); bufferR += (int)(d[dCount+t[ 61]]*outR[ 61]); + case 60: bufferL += (int)(d[dCount+t[ 60]]*outL[ 60]); bufferR += (int)(d[dCount+t[ 60]]*outR[ 60]); + case 59: bufferL += (int)(d[dCount+t[ 59]]*outL[ 59]); bufferR += (int)(d[dCount+t[ 59]]*outR[ 59]); + case 58: bufferL += (int)(d[dCount+t[ 58]]*outL[ 58]); bufferR += (int)(d[dCount+t[ 58]]*outR[ 58]); + case 57: bufferL += (int)(d[dCount+t[ 57]]*outL[ 57]); bufferR += (int)(d[dCount+t[ 57]]*outR[ 57]); + case 56: bufferL += (int)(d[dCount+t[ 56]]*outL[ 56]); bufferR += (int)(d[dCount+t[ 56]]*outR[ 56]); + case 55: bufferL += (int)(d[dCount+t[ 55]]*outL[ 55]); bufferR += (int)(d[dCount+t[ 55]]*outR[ 55]); + case 54: bufferL += (int)(d[dCount+t[ 54]]*outL[ 54]); bufferR += (int)(d[dCount+t[ 54]]*outR[ 54]); + case 53: bufferL += (int)(d[dCount+t[ 53]]*outL[ 53]); bufferR += (int)(d[dCount+t[ 53]]*outR[ 53]); + case 52: bufferL += (int)(d[dCount+t[ 52]]*outL[ 52]); bufferR += (int)(d[dCount+t[ 52]]*outR[ 52]); + case 51: bufferL += (int)(d[dCount+t[ 51]]*outL[ 51]); bufferR += (int)(d[dCount+t[ 51]]*outR[ 51]); + case 50: bufferL += (int)(d[dCount+t[ 50]]*outL[ 50]); bufferR += (int)(d[dCount+t[ 50]]*outR[ 50]); + case 49: bufferL += (int)(d[dCount+t[ 49]]*outL[ 49]); bufferR += (int)(d[dCount+t[ 49]]*outR[ 49]); + case 48: bufferL += (int)(d[dCount+t[ 48]]*outL[ 48]); bufferR += (int)(d[dCount+t[ 48]]*outR[ 48]); + case 47: bufferL += (int)(d[dCount+t[ 47]]*outL[ 47]); bufferR += (int)(d[dCount+t[ 47]]*outR[ 47]); + case 46: bufferL += (int)(d[dCount+t[ 46]]*outL[ 46]); bufferR += (int)(d[dCount+t[ 46]]*outR[ 46]); + case 45: bufferL += (int)(d[dCount+t[ 45]]*outL[ 45]); bufferR += (int)(d[dCount+t[ 45]]*outR[ 45]); + case 44: bufferL += (int)(d[dCount+t[ 44]]*outL[ 44]); bufferR += (int)(d[dCount+t[ 44]]*outR[ 44]); + case 43: bufferL += (int)(d[dCount+t[ 43]]*outL[ 43]); bufferR += (int)(d[dCount+t[ 43]]*outR[ 43]); + case 42: bufferL += (int)(d[dCount+t[ 42]]*outL[ 42]); bufferR += (int)(d[dCount+t[ 42]]*outR[ 42]); + case 41: bufferL += (int)(d[dCount+t[ 41]]*outL[ 41]); bufferR += (int)(d[dCount+t[ 41]]*outR[ 41]); + case 40: bufferL += (int)(d[dCount+t[ 40]]*outL[ 40]); bufferR += (int)(d[dCount+t[ 40]]*outR[ 40]); + case 39: bufferL += (int)(d[dCount+t[ 39]]*outL[ 39]); bufferR += (int)(d[dCount+t[ 39]]*outR[ 39]); + case 38: bufferL += (int)(d[dCount+t[ 38]]*outL[ 38]); bufferR += (int)(d[dCount+t[ 38]]*outR[ 38]); + case 37: bufferL += (int)(d[dCount+t[ 37]]*outL[ 37]); bufferR += (int)(d[dCount+t[ 37]]*outR[ 37]); + case 36: bufferL += (int)(d[dCount+t[ 36]]*outL[ 36]); bufferR += (int)(d[dCount+t[ 36]]*outR[ 36]); + case 35: bufferL += (int)(d[dCount+t[ 35]]*outL[ 35]); bufferR += (int)(d[dCount+t[ 35]]*outR[ 35]); + case 34: bufferL += (int)(d[dCount+t[ 34]]*outL[ 34]); bufferR += (int)(d[dCount+t[ 34]]*outR[ 34]); + case 33: bufferL += (int)(d[dCount+t[ 33]]*outL[ 33]); bufferR += (int)(d[dCount+t[ 33]]*outR[ 33]); + case 32: bufferL += (int)(d[dCount+t[ 32]]*outL[ 32]); bufferR += (int)(d[dCount+t[ 32]]*outR[ 32]); + case 31: bufferL += (int)(d[dCount+t[ 31]]*outL[ 31]); bufferR += (int)(d[dCount+t[ 31]]*outR[ 31]); + case 30: bufferL += (int)(d[dCount+t[ 30]]*outL[ 30]); bufferR += (int)(d[dCount+t[ 30]]*outR[ 30]); + case 29: bufferL += (int)(d[dCount+t[ 29]]*outL[ 29]); bufferR += (int)(d[dCount+t[ 29]]*outR[ 29]); + case 28: bufferL += (int)(d[dCount+t[ 28]]*outL[ 28]); bufferR += (int)(d[dCount+t[ 28]]*outR[ 28]); + case 27: bufferL += (int)(d[dCount+t[ 27]]*outL[ 27]); bufferR += (int)(d[dCount+t[ 27]]*outR[ 27]); + case 26: bufferL += (int)(d[dCount+t[ 26]]*outL[ 26]); bufferR += (int)(d[dCount+t[ 26]]*outR[ 26]); + case 25: bufferL += (int)(d[dCount+t[ 25]]*outL[ 25]); bufferR += (int)(d[dCount+t[ 25]]*outR[ 25]); + case 24: bufferL += (int)(d[dCount+t[ 24]]*outL[ 24]); bufferR += (int)(d[dCount+t[ 24]]*outR[ 24]); + case 23: bufferL += (int)(d[dCount+t[ 23]]*outL[ 23]); bufferR += (int)(d[dCount+t[ 23]]*outR[ 23]); + case 22: bufferL += (int)(d[dCount+t[ 22]]*outL[ 22]); bufferR += (int)(d[dCount+t[ 22]]*outR[ 22]); + case 21: bufferL += (int)(d[dCount+t[ 21]]*outL[ 21]); bufferR += (int)(d[dCount+t[ 21]]*outR[ 21]); + case 20: bufferL += (int)(d[dCount+t[ 20]]*outL[ 20]); bufferR += (int)(d[dCount+t[ 20]]*outR[ 20]); + case 19: bufferL += (int)(d[dCount+t[ 19]]*outL[ 19]); bufferR += (int)(d[dCount+t[ 19]]*outR[ 19]); + case 18: bufferL += (int)(d[dCount+t[ 18]]*outL[ 18]); bufferR += (int)(d[dCount+t[ 18]]*outR[ 18]); + case 17: bufferL += (int)(d[dCount+t[ 17]]*outL[ 17]); bufferR += (int)(d[dCount+t[ 17]]*outR[ 17]); + case 16: bufferL += (int)(d[dCount+t[ 16]]*outL[ 16]); bufferR += (int)(d[dCount+t[ 16]]*outR[ 16]); + case 15: bufferL += (int)(d[dCount+t[ 15]]*outL[ 15]); bufferR += (int)(d[dCount+t[ 15]]*outR[ 15]); + case 14: bufferL += (int)(d[dCount+t[ 14]]*outL[ 14]); bufferR += (int)(d[dCount+t[ 14]]*outR[ 14]); + case 13: bufferL += (int)(d[dCount+t[ 13]]*outL[ 13]); bufferR += (int)(d[dCount+t[ 13]]*outR[ 13]); + case 12: bufferL += (int)(d[dCount+t[ 12]]*outL[ 12]); bufferR += (int)(d[dCount+t[ 12]]*outR[ 12]); + case 11: bufferL += (int)(d[dCount+t[ 11]]*outL[ 11]); bufferR += (int)(d[dCount+t[ 11]]*outR[ 11]); + case 10: bufferL += (int)(d[dCount+t[ 10]]*outL[ 10]); bufferR += (int)(d[dCount+t[ 10]]*outR[ 10]); + case 9: bufferL += (int)(d[dCount+t[ 9]]*outL[ 9]); bufferR += (int)(d[dCount+t[ 9]]*outR[ 9]); + case 8: bufferL += (int)(d[dCount+t[ 8]]*outL[ 8]); bufferR += (int)(d[dCount+t[ 8]]*outR[ 8]); + case 7: bufferL += (int)(d[dCount+t[ 7]]*outL[ 7]); bufferR += (int)(d[dCount+t[ 7]]*outR[ 7]); + case 6: bufferL += (int)(d[dCount+t[ 6]]*outL[ 6]); bufferR += (int)(d[dCount+t[ 6]]*outR[ 6]); + case 5: bufferL += (int)(d[dCount+t[ 5]]*outL[ 5]); bufferR += (int)(d[dCount+t[ 5]]*outR[ 5]); + case 4: bufferL += (int)(d[dCount+t[ 4]]*outL[ 4]); bufferR += (int)(d[dCount+t[ 4]]*outR[ 4]); + case 3: bufferL += (int)(d[dCount+t[ 3]]*outL[ 3]); bufferR += (int)(d[dCount+t[ 3]]*outR[ 3]); + case 2: bufferL += (int)(d[dCount+t[ 2]]*outL[ 2]); bufferR += (int)(d[dCount+t[ 2]]*outR[ 2]); + case 1: bufferL += (int)(d[dCount+t[ 1]]*outL[ 1]); bufferR += (int)(d[dCount+t[ 1]]*outR[ 1]); + } + //test to see that delay is working at all: it will be a big stack of case with no break + + inputSampleL = bufferL; + inputSampleR = bufferR; + //scale back the reverb buffers based on how big of a range we used + + + wearR[9] = wearR[8]; wearR[8] = wearR[7]; wearR[7] = wearR[6]; wearR[6] = wearR[5]; + wearR[5] = wearR[4]; wearR[4] = wearR[3]; wearR[3] = wearR[2]; wearR[2] = wearR[1]; + wearR[1] = wearR[0]; wearR[0] = accumulatorSample = (inputSampleR-wearRPrev); + + accumulatorSample *= factor[0]; + accumulatorSample += (wearR[1] * factor[1]); + accumulatorSample += (wearR[2] * factor[2]); + accumulatorSample += (wearR[3] * factor[3]); + accumulatorSample += (wearR[4] * factor[4]); + accumulatorSample += (wearR[5] * factor[5]); + accumulatorSample += (wearR[6] * factor[6]); + accumulatorSample += (wearR[7] * factor[7]); + accumulatorSample += (wearR[8] * factor[8]); + accumulatorSample += (wearR[9] * factor[9]); + //we are doing our repetitive calculations on a separate value + correction = (inputSampleR-wearRPrev) + accumulatorSample; + wearRPrev = inputSampleR; + inputSampleR += correction; + + wearL[9] = wearL[8]; wearL[8] = wearL[7]; wearL[7] = wearL[6]; wearL[6] = wearL[5]; + wearL[5] = wearL[4]; wearL[4] = wearL[3]; wearL[3] = wearL[2]; wearL[2] = wearL[1]; + wearL[1] = wearL[0]; wearL[0] = accumulatorSample = (inputSampleL-wearLPrev); + + accumulatorSample *= factor[0]; + accumulatorSample += (wearL[1] * factor[1]); + accumulatorSample += (wearL[2] * factor[2]); + accumulatorSample += (wearL[3] * factor[3]); + accumulatorSample += (wearL[4] * factor[4]); + accumulatorSample += (wearL[5] * factor[5]); + accumulatorSample += (wearL[6] * factor[6]); + accumulatorSample += (wearL[7] * factor[7]); + accumulatorSample += (wearL[8] * factor[8]); + accumulatorSample += (wearL[9] * factor[9]); + //we are doing our repetitive calculations on a separate value + correction = (inputSampleL-wearLPrev) + accumulatorSample; + wearLPrev = inputSampleL; + inputSampleL += correction; + //completed Groove Wear section + + inputSampleL /= outputPad; + inputSampleR /= outputPad; + + //back to previous plugin + drySampleL *= dryness; + drySampleR *= dryness; + + inputSampleL *= wetness; + inputSampleR *= wetness; + + inputSampleL += drySampleL; + inputSampleR += drySampleR; + //here we combine the tanks with the dry signal + + //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 StarChild::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; //this is different from singlereplacing + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double drySampleL; + double drySampleR; + double inputSampleL; + double inputSampleR; + + int bufferL = 0; + int bufferR = 0; + //these are to build up the reverb tank outs + + int rangeDirect = (pow(B,2) * 156.0) + 7.0; + //maximum safe delay is 259 * the prime tap, not including room for the pitch shift offset + + float scaleDirect = (pow(A,2) * (3280.0/rangeDirect)) + 2.0; + //let's try making it always be the max delay: smaller range forces scale to be longer + + float outputPad = 4 * rangeDirect * sqrt(rangeDirect); + + float overallscale = ((1.0-B)*9.0)+1.0; + //apply the singlestage groove wear strongest when bits are heavily crushed + float gain = overallscale; + if (gain > 1.0) {factor[0] = 1.0; gain -= 1.0;} else {factor[0] = gain; gain = 0.0;} + if (gain > 1.0) {factor[1] = 1.0; gain -= 1.0;} else {factor[1] = gain; gain = 0.0;} + if (gain > 1.0) {factor[2] = 1.0; gain -= 1.0;} else {factor[2] = gain; gain = 0.0;} + if (gain > 1.0) {factor[3] = 1.0; gain -= 1.0;} else {factor[3] = gain; gain = 0.0;} + if (gain > 1.0) {factor[4] = 1.0; gain -= 1.0;} else {factor[4] = gain; gain = 0.0;} + if (gain > 1.0) {factor[5] = 1.0; gain -= 1.0;} else {factor[5] = gain; gain = 0.0;} + if (gain > 1.0) {factor[6] = 1.0; gain -= 1.0;} else {factor[6] = gain; gain = 0.0;} + if (gain > 1.0) {factor[7] = 1.0; gain -= 1.0;} else {factor[7] = gain; gain = 0.0;} + if (gain > 1.0) {factor[8] = 1.0; gain -= 1.0;} else {factor[8] = gain; gain = 0.0;} + if (gain > 1.0) {factor[9] = 1.0; gain -= 1.0;} else {factor[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + factor[0] /= overallscale; + factor[1] /= overallscale; + factor[2] /= overallscale; + factor[3] /= overallscale; + factor[4] /= overallscale; + factor[5] /= overallscale; + factor[6] /= overallscale; + factor[7] /= overallscale; + factor[8] /= overallscale; + factor[9] /= overallscale; + //and now it's neatly scaled, too + float accumulatorSample; + float correction; + float wetness = C; + float dryness = 1.0 - wetness; //reverb setup + + int count; + for(count = 1; count < 165; count++) + { + t[count] = p[count] * scaleDirect; + //this is the scaled tap for direct out, in number of samples delay + } + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + //assign working variables like the dry + + if (dCount < 0 || dCount > 22050) {dCount = 22050;} + d[dCount + 22050] = d[dCount] = inputSampleL + inputSampleR; + dCount--; + //feed the delay line with summed channels. The stuff we're reading back + //will always be plus dCount, because we're counting back to 0. + + //now we're going to start pitch shifting. + dutyCycle += 1; + if (dutyCycle > scaleDirect) { + dutyCycle = 1; + //this whole routine doesn't run every sample, it's making a wacky hypervibrato + t[pitchCounter] += increment; pitchCounter += 1; + //pitchCounter always goes up, t[] goes up and down + //possibly do that not every sample? Let's see what we get + if (pitchCounter > rangeDirect) { + if (increment == 1) { + pitchCounter = 1; + if (t[1] > ((11 * scaleDirect) + 1000)) increment = -1; + //let's try hardcoding a big 1000 sample buffer + } + else { + //increment is -1 so we have been counting down! + pitchCounter = 1; + + if (t[1] < (11 * scaleDirect)) { + //we've scaled everything back so we're going up again + increment = 1; + //and we're gonna reset the lot in case of screw-ups (control manipulations) + for(count = 1; count < 165; count++) + { + t[count] = p[count] * scaleDirect; + } + //which means we're back to normal and counting up again. + } + } + //wrap around to begin again, and if our first tap is greater than + //its base value plus scaleDirect, start going down. + } + } + //always wrap around to the first tap + + //Now we do a select case where we jump into the middle of some repetitive math, unrolled. + bufferL = 0; bufferR = 0; + //clear before making our delay sound + switch (rangeDirect) { + case 164: bufferL += (int)(d[dCount+t[164]]*outL[164]); bufferR += (int)(d[dCount+t[164]]*outR[164]); + case 163: bufferL += (int)(d[dCount+t[163]]*outL[163]); bufferR += (int)(d[dCount+t[163]]*outR[163]); + case 162: bufferL += (int)(d[dCount+t[162]]*outL[162]); bufferR += (int)(d[dCount+t[162]]*outR[162]); + case 161: bufferL += (int)(d[dCount+t[161]]*outL[161]); bufferR += (int)(d[dCount+t[161]]*outR[161]); + case 160: bufferL += (int)(d[dCount+t[160]]*outL[160]); bufferR += (int)(d[dCount+t[160]]*outR[160]); + case 159: bufferL += (int)(d[dCount+t[159]]*outL[159]); bufferR += (int)(d[dCount+t[159]]*outR[159]); + case 158: bufferL += (int)(d[dCount+t[158]]*outL[158]); bufferR += (int)(d[dCount+t[158]]*outR[158]); + case 157: bufferL += (int)(d[dCount+t[157]]*outL[157]); bufferR += (int)(d[dCount+t[157]]*outR[157]); + case 156: bufferL += (int)(d[dCount+t[156]]*outL[156]); bufferR += (int)(d[dCount+t[156]]*outR[156]); + case 155: bufferL += (int)(d[dCount+t[155]]*outL[155]); bufferR += (int)(d[dCount+t[155]]*outR[155]); + case 154: bufferL += (int)(d[dCount+t[154]]*outL[154]); bufferR += (int)(d[dCount+t[154]]*outR[154]); + case 153: bufferL += (int)(d[dCount+t[153]]*outL[153]); bufferR += (int)(d[dCount+t[153]]*outR[153]); + case 152: bufferL += (int)(d[dCount+t[152]]*outL[152]); bufferR += (int)(d[dCount+t[152]]*outR[152]); + case 151: bufferL += (int)(d[dCount+t[151]]*outL[151]); bufferR += (int)(d[dCount+t[151]]*outR[151]); + case 150: bufferL += (int)(d[dCount+t[150]]*outL[150]); bufferR += (int)(d[dCount+t[150]]*outR[150]); + case 149: bufferL += (int)(d[dCount+t[149]]*outL[149]); bufferR += (int)(d[dCount+t[149]]*outR[149]); + case 148: bufferL += (int)(d[dCount+t[148]]*outL[148]); bufferR += (int)(d[dCount+t[148]]*outR[148]); + case 147: bufferL += (int)(d[dCount+t[147]]*outL[147]); bufferR += (int)(d[dCount+t[147]]*outR[147]); + case 146: bufferL += (int)(d[dCount+t[146]]*outL[146]); bufferR += (int)(d[dCount+t[146]]*outR[146]); + case 145: bufferL += (int)(d[dCount+t[145]]*outL[145]); bufferR += (int)(d[dCount+t[145]]*outR[145]); + case 144: bufferL += (int)(d[dCount+t[144]]*outL[144]); bufferR += (int)(d[dCount+t[144]]*outR[144]); + case 143: bufferL += (int)(d[dCount+t[143]]*outL[143]); bufferR += (int)(d[dCount+t[143]]*outR[143]); + case 142: bufferL += (int)(d[dCount+t[142]]*outL[142]); bufferR += (int)(d[dCount+t[142]]*outR[142]); + case 141: bufferL += (int)(d[dCount+t[141]]*outL[141]); bufferR += (int)(d[dCount+t[141]]*outR[141]); + case 140: bufferL += (int)(d[dCount+t[140]]*outL[140]); bufferR += (int)(d[dCount+t[140]]*outR[140]); + case 139: bufferL += (int)(d[dCount+t[139]]*outL[139]); bufferR += (int)(d[dCount+t[139]]*outR[139]); + case 138: bufferL += (int)(d[dCount+t[138]]*outL[138]); bufferR += (int)(d[dCount+t[138]]*outR[138]); + case 137: bufferL += (int)(d[dCount+t[137]]*outL[137]); bufferR += (int)(d[dCount+t[137]]*outR[137]); + case 136: bufferL += (int)(d[dCount+t[136]]*outL[136]); bufferR += (int)(d[dCount+t[136]]*outR[136]); + case 135: bufferL += (int)(d[dCount+t[135]]*outL[135]); bufferR += (int)(d[dCount+t[135]]*outR[135]); + case 134: bufferL += (int)(d[dCount+t[134]]*outL[134]); bufferR += (int)(d[dCount+t[134]]*outR[134]); + case 133: bufferL += (int)(d[dCount+t[133]]*outL[133]); bufferR += (int)(d[dCount+t[133]]*outR[133]); + case 132: bufferL += (int)(d[dCount+t[132]]*outL[132]); bufferR += (int)(d[dCount+t[132]]*outR[132]); + case 131: bufferL += (int)(d[dCount+t[131]]*outL[131]); bufferR += (int)(d[dCount+t[131]]*outR[131]); + case 130: bufferL += (int)(d[dCount+t[130]]*outL[130]); bufferR += (int)(d[dCount+t[130]]*outR[130]); + case 129: bufferL += (int)(d[dCount+t[129]]*outL[129]); bufferR += (int)(d[dCount+t[129]]*outR[129]); + case 128: bufferL += (int)(d[dCount+t[128]]*outL[128]); bufferR += (int)(d[dCount+t[128]]*outR[128]); + case 127: bufferL += (int)(d[dCount+t[127]]*outL[127]); bufferR += (int)(d[dCount+t[127]]*outR[127]); + case 126: bufferL += (int)(d[dCount+t[126]]*outL[126]); bufferR += (int)(d[dCount+t[126]]*outR[126]); + case 125: bufferL += (int)(d[dCount+t[125]]*outL[125]); bufferR += (int)(d[dCount+t[125]]*outR[125]); + case 124: bufferL += (int)(d[dCount+t[124]]*outL[124]); bufferR += (int)(d[dCount+t[124]]*outR[124]); + case 123: bufferL += (int)(d[dCount+t[123]]*outL[123]); bufferR += (int)(d[dCount+t[123]]*outR[123]); + case 122: bufferL += (int)(d[dCount+t[122]]*outL[122]); bufferR += (int)(d[dCount+t[122]]*outR[122]); + case 121: bufferL += (int)(d[dCount+t[121]]*outL[121]); bufferR += (int)(d[dCount+t[121]]*outR[121]); + case 120: bufferL += (int)(d[dCount+t[120]]*outL[120]); bufferR += (int)(d[dCount+t[120]]*outR[120]); + case 119: bufferL += (int)(d[dCount+t[119]]*outL[119]); bufferR += (int)(d[dCount+t[119]]*outR[119]); + case 118: bufferL += (int)(d[dCount+t[118]]*outL[118]); bufferR += (int)(d[dCount+t[118]]*outR[118]); + case 117: bufferL += (int)(d[dCount+t[117]]*outL[117]); bufferR += (int)(d[dCount+t[117]]*outR[117]); + case 116: bufferL += (int)(d[dCount+t[116]]*outL[116]); bufferR += (int)(d[dCount+t[116]]*outR[116]); + case 115: bufferL += (int)(d[dCount+t[115]]*outL[115]); bufferR += (int)(d[dCount+t[115]]*outR[115]); + case 114: bufferL += (int)(d[dCount+t[114]]*outL[114]); bufferR += (int)(d[dCount+t[114]]*outR[114]); + case 113: bufferL += (int)(d[dCount+t[113]]*outL[113]); bufferR += (int)(d[dCount+t[113]]*outR[113]); + case 112: bufferL += (int)(d[dCount+t[112]]*outL[112]); bufferR += (int)(d[dCount+t[112]]*outR[112]); + case 111: bufferL += (int)(d[dCount+t[111]]*outL[111]); bufferR += (int)(d[dCount+t[111]]*outR[111]); + case 110: bufferL += (int)(d[dCount+t[110]]*outL[110]); bufferR += (int)(d[dCount+t[110]]*outR[110]); + case 109: bufferL += (int)(d[dCount+t[109]]*outL[109]); bufferR += (int)(d[dCount+t[109]]*outR[109]); + case 108: bufferL += (int)(d[dCount+t[108]]*outL[108]); bufferR += (int)(d[dCount+t[108]]*outR[108]); + case 107: bufferL += (int)(d[dCount+t[107]]*outL[107]); bufferR += (int)(d[dCount+t[107]]*outR[107]); + case 106: bufferL += (int)(d[dCount+t[106]]*outL[106]); bufferR += (int)(d[dCount+t[106]]*outR[106]); + case 105: bufferL += (int)(d[dCount+t[105]]*outL[105]); bufferR += (int)(d[dCount+t[105]]*outR[105]); + case 104: bufferL += (int)(d[dCount+t[104]]*outL[104]); bufferR += (int)(d[dCount+t[104]]*outR[104]); + case 103: bufferL += (int)(d[dCount+t[103]]*outL[103]); bufferR += (int)(d[dCount+t[103]]*outR[103]); + case 102: bufferL += (int)(d[dCount+t[102]]*outL[102]); bufferR += (int)(d[dCount+t[102]]*outR[102]); + case 101: bufferL += (int)(d[dCount+t[101]]*outL[101]); bufferR += (int)(d[dCount+t[101]]*outR[101]); + case 100: bufferL += (int)(d[dCount+t[100]]*outL[100]); bufferR += (int)(d[dCount+t[100]]*outR[100]); + case 99: bufferL += (int)(d[dCount+t[ 99]]*outL[ 99]); bufferR += (int)(d[dCount+t[ 99]]*outR[ 99]); + case 98: bufferL += (int)(d[dCount+t[ 98]]*outL[ 98]); bufferR += (int)(d[dCount+t[ 98]]*outR[ 98]); + case 97: bufferL += (int)(d[dCount+t[ 97]]*outL[ 97]); bufferR += (int)(d[dCount+t[ 97]]*outR[ 97]); + case 96: bufferL += (int)(d[dCount+t[ 96]]*outL[ 96]); bufferR += (int)(d[dCount+t[ 96]]*outR[ 96]); + case 95: bufferL += (int)(d[dCount+t[ 95]]*outL[ 95]); bufferR += (int)(d[dCount+t[ 95]]*outR[ 95]); + case 94: bufferL += (int)(d[dCount+t[ 94]]*outL[ 94]); bufferR += (int)(d[dCount+t[ 94]]*outR[ 94]); + case 93: bufferL += (int)(d[dCount+t[ 93]]*outL[ 93]); bufferR += (int)(d[dCount+t[ 93]]*outR[ 93]); + case 92: bufferL += (int)(d[dCount+t[ 92]]*outL[ 92]); bufferR += (int)(d[dCount+t[ 92]]*outR[ 92]); + case 91: bufferL += (int)(d[dCount+t[ 91]]*outL[ 91]); bufferR += (int)(d[dCount+t[ 91]]*outR[ 91]); + case 90: bufferL += (int)(d[dCount+t[ 90]]*outL[ 90]); bufferR += (int)(d[dCount+t[ 90]]*outR[ 90]); + case 89: bufferL += (int)(d[dCount+t[ 89]]*outL[ 89]); bufferR += (int)(d[dCount+t[ 89]]*outR[ 89]); + case 88: bufferL += (int)(d[dCount+t[ 88]]*outL[ 88]); bufferR += (int)(d[dCount+t[ 88]]*outR[ 88]); + case 87: bufferL += (int)(d[dCount+t[ 87]]*outL[ 87]); bufferR += (int)(d[dCount+t[ 87]]*outR[ 87]); + case 86: bufferL += (int)(d[dCount+t[ 86]]*outL[ 86]); bufferR += (int)(d[dCount+t[ 86]]*outR[ 86]); + case 85: bufferL += (int)(d[dCount+t[ 85]]*outL[ 85]); bufferR += (int)(d[dCount+t[ 85]]*outR[ 85]); + case 84: bufferL += (int)(d[dCount+t[ 84]]*outL[ 84]); bufferR += (int)(d[dCount+t[ 84]]*outR[ 84]); + case 83: bufferL += (int)(d[dCount+t[ 83]]*outL[ 83]); bufferR += (int)(d[dCount+t[ 83]]*outR[ 83]); + case 82: bufferL += (int)(d[dCount+t[ 82]]*outL[ 82]); bufferR += (int)(d[dCount+t[ 82]]*outR[ 82]); + case 81: bufferL += (int)(d[dCount+t[ 81]]*outL[ 81]); bufferR += (int)(d[dCount+t[ 81]]*outR[ 81]); + case 80: bufferL += (int)(d[dCount+t[ 80]]*outL[ 80]); bufferR += (int)(d[dCount+t[ 80]]*outR[ 80]); + case 79: bufferL += (int)(d[dCount+t[ 79]]*outL[ 79]); bufferR += (int)(d[dCount+t[ 79]]*outR[ 79]); + case 78: bufferL += (int)(d[dCount+t[ 78]]*outL[ 78]); bufferR += (int)(d[dCount+t[ 78]]*outR[ 78]); + case 77: bufferL += (int)(d[dCount+t[ 77]]*outL[ 77]); bufferR += (int)(d[dCount+t[ 77]]*outR[ 77]); + case 76: bufferL += (int)(d[dCount+t[ 76]]*outL[ 76]); bufferR += (int)(d[dCount+t[ 76]]*outR[ 76]); + case 75: bufferL += (int)(d[dCount+t[ 75]]*outL[ 75]); bufferR += (int)(d[dCount+t[ 75]]*outR[ 75]); + case 74: bufferL += (int)(d[dCount+t[ 74]]*outL[ 74]); bufferR += (int)(d[dCount+t[ 74]]*outR[ 74]); + case 73: bufferL += (int)(d[dCount+t[ 73]]*outL[ 73]); bufferR += (int)(d[dCount+t[ 73]]*outR[ 73]); + case 72: bufferL += (int)(d[dCount+t[ 72]]*outL[ 72]); bufferR += (int)(d[dCount+t[ 72]]*outR[ 72]); + case 71: bufferL += (int)(d[dCount+t[ 71]]*outL[ 71]); bufferR += (int)(d[dCount+t[ 71]]*outR[ 71]); + case 70: bufferL += (int)(d[dCount+t[ 70]]*outL[ 70]); bufferR += (int)(d[dCount+t[ 70]]*outR[ 70]); + case 69: bufferL += (int)(d[dCount+t[ 69]]*outL[ 69]); bufferR += (int)(d[dCount+t[ 69]]*outR[ 69]); + case 68: bufferL += (int)(d[dCount+t[ 68]]*outL[ 68]); bufferR += (int)(d[dCount+t[ 68]]*outR[ 68]); + case 67: bufferL += (int)(d[dCount+t[ 67]]*outL[ 67]); bufferR += (int)(d[dCount+t[ 67]]*outR[ 67]); + case 66: bufferL += (int)(d[dCount+t[ 66]]*outL[ 66]); bufferR += (int)(d[dCount+t[ 66]]*outR[ 66]); + case 65: bufferL += (int)(d[dCount+t[ 65]]*outL[ 65]); bufferR += (int)(d[dCount+t[ 65]]*outR[ 65]); + case 64: bufferL += (int)(d[dCount+t[ 64]]*outL[ 64]); bufferR += (int)(d[dCount+t[ 64]]*outR[ 64]); + case 63: bufferL += (int)(d[dCount+t[ 63]]*outL[ 63]); bufferR += (int)(d[dCount+t[ 63]]*outR[ 63]); + case 62: bufferL += (int)(d[dCount+t[ 62]]*outL[ 62]); bufferR += (int)(d[dCount+t[ 62]]*outR[ 62]); + case 61: bufferL += (int)(d[dCount+t[ 61]]*outL[ 61]); bufferR += (int)(d[dCount+t[ 61]]*outR[ 61]); + case 60: bufferL += (int)(d[dCount+t[ 60]]*outL[ 60]); bufferR += (int)(d[dCount+t[ 60]]*outR[ 60]); + case 59: bufferL += (int)(d[dCount+t[ 59]]*outL[ 59]); bufferR += (int)(d[dCount+t[ 59]]*outR[ 59]); + case 58: bufferL += (int)(d[dCount+t[ 58]]*outL[ 58]); bufferR += (int)(d[dCount+t[ 58]]*outR[ 58]); + case 57: bufferL += (int)(d[dCount+t[ 57]]*outL[ 57]); bufferR += (int)(d[dCount+t[ 57]]*outR[ 57]); + case 56: bufferL += (int)(d[dCount+t[ 56]]*outL[ 56]); bufferR += (int)(d[dCount+t[ 56]]*outR[ 56]); + case 55: bufferL += (int)(d[dCount+t[ 55]]*outL[ 55]); bufferR += (int)(d[dCount+t[ 55]]*outR[ 55]); + case 54: bufferL += (int)(d[dCount+t[ 54]]*outL[ 54]); bufferR += (int)(d[dCount+t[ 54]]*outR[ 54]); + case 53: bufferL += (int)(d[dCount+t[ 53]]*outL[ 53]); bufferR += (int)(d[dCount+t[ 53]]*outR[ 53]); + case 52: bufferL += (int)(d[dCount+t[ 52]]*outL[ 52]); bufferR += (int)(d[dCount+t[ 52]]*outR[ 52]); + case 51: bufferL += (int)(d[dCount+t[ 51]]*outL[ 51]); bufferR += (int)(d[dCount+t[ 51]]*outR[ 51]); + case 50: bufferL += (int)(d[dCount+t[ 50]]*outL[ 50]); bufferR += (int)(d[dCount+t[ 50]]*outR[ 50]); + case 49: bufferL += (int)(d[dCount+t[ 49]]*outL[ 49]); bufferR += (int)(d[dCount+t[ 49]]*outR[ 49]); + case 48: bufferL += (int)(d[dCount+t[ 48]]*outL[ 48]); bufferR += (int)(d[dCount+t[ 48]]*outR[ 48]); + case 47: bufferL += (int)(d[dCount+t[ 47]]*outL[ 47]); bufferR += (int)(d[dCount+t[ 47]]*outR[ 47]); + case 46: bufferL += (int)(d[dCount+t[ 46]]*outL[ 46]); bufferR += (int)(d[dCount+t[ 46]]*outR[ 46]); + case 45: bufferL += (int)(d[dCount+t[ 45]]*outL[ 45]); bufferR += (int)(d[dCount+t[ 45]]*outR[ 45]); + case 44: bufferL += (int)(d[dCount+t[ 44]]*outL[ 44]); bufferR += (int)(d[dCount+t[ 44]]*outR[ 44]); + case 43: bufferL += (int)(d[dCount+t[ 43]]*outL[ 43]); bufferR += (int)(d[dCount+t[ 43]]*outR[ 43]); + case 42: bufferL += (int)(d[dCount+t[ 42]]*outL[ 42]); bufferR += (int)(d[dCount+t[ 42]]*outR[ 42]); + case 41: bufferL += (int)(d[dCount+t[ 41]]*outL[ 41]); bufferR += (int)(d[dCount+t[ 41]]*outR[ 41]); + case 40: bufferL += (int)(d[dCount+t[ 40]]*outL[ 40]); bufferR += (int)(d[dCount+t[ 40]]*outR[ 40]); + case 39: bufferL += (int)(d[dCount+t[ 39]]*outL[ 39]); bufferR += (int)(d[dCount+t[ 39]]*outR[ 39]); + case 38: bufferL += (int)(d[dCount+t[ 38]]*outL[ 38]); bufferR += (int)(d[dCount+t[ 38]]*outR[ 38]); + case 37: bufferL += (int)(d[dCount+t[ 37]]*outL[ 37]); bufferR += (int)(d[dCount+t[ 37]]*outR[ 37]); + case 36: bufferL += (int)(d[dCount+t[ 36]]*outL[ 36]); bufferR += (int)(d[dCount+t[ 36]]*outR[ 36]); + case 35: bufferL += (int)(d[dCount+t[ 35]]*outL[ 35]); bufferR += (int)(d[dCount+t[ 35]]*outR[ 35]); + case 34: bufferL += (int)(d[dCount+t[ 34]]*outL[ 34]); bufferR += (int)(d[dCount+t[ 34]]*outR[ 34]); + case 33: bufferL += (int)(d[dCount+t[ 33]]*outL[ 33]); bufferR += (int)(d[dCount+t[ 33]]*outR[ 33]); + case 32: bufferL += (int)(d[dCount+t[ 32]]*outL[ 32]); bufferR += (int)(d[dCount+t[ 32]]*outR[ 32]); + case 31: bufferL += (int)(d[dCount+t[ 31]]*outL[ 31]); bufferR += (int)(d[dCount+t[ 31]]*outR[ 31]); + case 30: bufferL += (int)(d[dCount+t[ 30]]*outL[ 30]); bufferR += (int)(d[dCount+t[ 30]]*outR[ 30]); + case 29: bufferL += (int)(d[dCount+t[ 29]]*outL[ 29]); bufferR += (int)(d[dCount+t[ 29]]*outR[ 29]); + case 28: bufferL += (int)(d[dCount+t[ 28]]*outL[ 28]); bufferR += (int)(d[dCount+t[ 28]]*outR[ 28]); + case 27: bufferL += (int)(d[dCount+t[ 27]]*outL[ 27]); bufferR += (int)(d[dCount+t[ 27]]*outR[ 27]); + case 26: bufferL += (int)(d[dCount+t[ 26]]*outL[ 26]); bufferR += (int)(d[dCount+t[ 26]]*outR[ 26]); + case 25: bufferL += (int)(d[dCount+t[ 25]]*outL[ 25]); bufferR += (int)(d[dCount+t[ 25]]*outR[ 25]); + case 24: bufferL += (int)(d[dCount+t[ 24]]*outL[ 24]); bufferR += (int)(d[dCount+t[ 24]]*outR[ 24]); + case 23: bufferL += (int)(d[dCount+t[ 23]]*outL[ 23]); bufferR += (int)(d[dCount+t[ 23]]*outR[ 23]); + case 22: bufferL += (int)(d[dCount+t[ 22]]*outL[ 22]); bufferR += (int)(d[dCount+t[ 22]]*outR[ 22]); + case 21: bufferL += (int)(d[dCount+t[ 21]]*outL[ 21]); bufferR += (int)(d[dCount+t[ 21]]*outR[ 21]); + case 20: bufferL += (int)(d[dCount+t[ 20]]*outL[ 20]); bufferR += (int)(d[dCount+t[ 20]]*outR[ 20]); + case 19: bufferL += (int)(d[dCount+t[ 19]]*outL[ 19]); bufferR += (int)(d[dCount+t[ 19]]*outR[ 19]); + case 18: bufferL += (int)(d[dCount+t[ 18]]*outL[ 18]); bufferR += (int)(d[dCount+t[ 18]]*outR[ 18]); + case 17: bufferL += (int)(d[dCount+t[ 17]]*outL[ 17]); bufferR += (int)(d[dCount+t[ 17]]*outR[ 17]); + case 16: bufferL += (int)(d[dCount+t[ 16]]*outL[ 16]); bufferR += (int)(d[dCount+t[ 16]]*outR[ 16]); + case 15: bufferL += (int)(d[dCount+t[ 15]]*outL[ 15]); bufferR += (int)(d[dCount+t[ 15]]*outR[ 15]); + case 14: bufferL += (int)(d[dCount+t[ 14]]*outL[ 14]); bufferR += (int)(d[dCount+t[ 14]]*outR[ 14]); + case 13: bufferL += (int)(d[dCount+t[ 13]]*outL[ 13]); bufferR += (int)(d[dCount+t[ 13]]*outR[ 13]); + case 12: bufferL += (int)(d[dCount+t[ 12]]*outL[ 12]); bufferR += (int)(d[dCount+t[ 12]]*outR[ 12]); + case 11: bufferL += (int)(d[dCount+t[ 11]]*outL[ 11]); bufferR += (int)(d[dCount+t[ 11]]*outR[ 11]); + case 10: bufferL += (int)(d[dCount+t[ 10]]*outL[ 10]); bufferR += (int)(d[dCount+t[ 10]]*outR[ 10]); + case 9: bufferL += (int)(d[dCount+t[ 9]]*outL[ 9]); bufferR += (int)(d[dCount+t[ 9]]*outR[ 9]); + case 8: bufferL += (int)(d[dCount+t[ 8]]*outL[ 8]); bufferR += (int)(d[dCount+t[ 8]]*outR[ 8]); + case 7: bufferL += (int)(d[dCount+t[ 7]]*outL[ 7]); bufferR += (int)(d[dCount+t[ 7]]*outR[ 7]); + case 6: bufferL += (int)(d[dCount+t[ 6]]*outL[ 6]); bufferR += (int)(d[dCount+t[ 6]]*outR[ 6]); + case 5: bufferL += (int)(d[dCount+t[ 5]]*outL[ 5]); bufferR += (int)(d[dCount+t[ 5]]*outR[ 5]); + case 4: bufferL += (int)(d[dCount+t[ 4]]*outL[ 4]); bufferR += (int)(d[dCount+t[ 4]]*outR[ 4]); + case 3: bufferL += (int)(d[dCount+t[ 3]]*outL[ 3]); bufferR += (int)(d[dCount+t[ 3]]*outR[ 3]); + case 2: bufferL += (int)(d[dCount+t[ 2]]*outL[ 2]); bufferR += (int)(d[dCount+t[ 2]]*outR[ 2]); + case 1: bufferL += (int)(d[dCount+t[ 1]]*outL[ 1]); bufferR += (int)(d[dCount+t[ 1]]*outR[ 1]); + } + //test to see that delay is working at all: it will be a big stack of case with no break + + inputSampleL = bufferL; + inputSampleR = bufferR; + //scale back the reverb buffers based on how big of a range we used + + + wearR[9] = wearR[8]; wearR[8] = wearR[7]; wearR[7] = wearR[6]; wearR[6] = wearR[5]; + wearR[5] = wearR[4]; wearR[4] = wearR[3]; wearR[3] = wearR[2]; wearR[2] = wearR[1]; + wearR[1] = wearR[0]; wearR[0] = accumulatorSample = (inputSampleR-wearRPrev); + + accumulatorSample *= factor[0]; + accumulatorSample += (wearR[1] * factor[1]); + accumulatorSample += (wearR[2] * factor[2]); + accumulatorSample += (wearR[3] * factor[3]); + accumulatorSample += (wearR[4] * factor[4]); + accumulatorSample += (wearR[5] * factor[5]); + accumulatorSample += (wearR[6] * factor[6]); + accumulatorSample += (wearR[7] * factor[7]); + accumulatorSample += (wearR[8] * factor[8]); + accumulatorSample += (wearR[9] * factor[9]); + //we are doing our repetitive calculations on a separate value + correction = (inputSampleR-wearRPrev) + accumulatorSample; + wearRPrev = inputSampleR; + inputSampleR += correction; + + wearL[9] = wearL[8]; wearL[8] = wearL[7]; wearL[7] = wearL[6]; wearL[6] = wearL[5]; + wearL[5] = wearL[4]; wearL[4] = wearL[3]; wearL[3] = wearL[2]; wearL[2] = wearL[1]; + wearL[1] = wearL[0]; wearL[0] = accumulatorSample = (inputSampleL-wearLPrev); + + accumulatorSample *= factor[0]; + accumulatorSample += (wearL[1] * factor[1]); + accumulatorSample += (wearL[2] * factor[2]); + accumulatorSample += (wearL[3] * factor[3]); + accumulatorSample += (wearL[4] * factor[4]); + accumulatorSample += (wearL[5] * factor[5]); + accumulatorSample += (wearL[6] * factor[6]); + accumulatorSample += (wearL[7] * factor[7]); + accumulatorSample += (wearL[8] * factor[8]); + accumulatorSample += (wearL[9] * factor[9]); + //we are doing our repetitive calculations on a separate value + correction = (inputSampleL-wearLPrev) + accumulatorSample; + wearLPrev = inputSampleL; + inputSampleL += correction; + //completed Groove Wear section + + inputSampleL /= outputPad; + inputSampleR /= outputPad; + + //back to previous plugin + drySampleL *= dryness; + drySampleR *= dryness; + + inputSampleL *= wetness; + inputSampleR *= wetness; + + inputSampleL += drySampleL; + inputSampleR += drySampleR; + //here we combine the tanks with the dry signal + + //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/StarChild/VSTProject.sln b/plugins/WinVST/StarChild/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/StarChild/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/StarChild/VSTProject.vcxproj b/plugins/WinVST/StarChild/VSTProject.vcxproj new file mode 100755 index 0000000..e7acdbf --- /dev/null +++ b/plugins/WinVST/StarChild/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="StarChild.cpp" />
+ <ClCompile Include="StarChildProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="StarChild.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>StarChild64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/StarChild/VSTProject.vcxproj.filters b/plugins/WinVST/StarChild/VSTProject.vcxproj.filters new file mode 100755 index 0000000..3089a5e --- /dev/null +++ b/plugins/WinVST/StarChild/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="StarChild.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="StarChildProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="StarChild.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/StarChild/VSTProject.vcxproj.user b/plugins/WinVST/StarChild/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/StarChild/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/StarChild/vstplug.def b/plugins/WinVST/StarChild/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/StarChild/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Surge/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Surge/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Surge/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Surge/.vs/VSTProject/v14/.suo b/plugins/WinVST/Surge/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..03e6045 --- /dev/null +++ b/plugins/WinVST/Surge/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Surge/Surge.cpp b/plugins/WinVST/Surge/Surge.cpp new file mode 100755 index 0000000..711c0df --- /dev/null +++ b/plugins/WinVST/Surge/Surge.cpp @@ -0,0 +1,135 @@ +/* ======================================== + * Surge - Surge.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Surge_H +#include "Surge.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Surge(audioMaster);} + +Surge::Surge(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + flip = true; + chaseA = 0.0; + chaseB = 0.0; + chaseC = 0.0; + chaseD = 0.0; + chaseMax = 0.0; + A = 0.0; + B = 1.0; + //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 +} + +Surge::~Surge() {} +VstInt32 Surge::getVendorVersion () {return 1000;} +void Surge::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Surge::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 Surge::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 Surge::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 Surge::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 Surge::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 Surge::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Surge", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Surge::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; //also display 0-1 as percent + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Surge::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Surge::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Surge::getEffectName(char* name) { + vst_strncpy(name, "Surge", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Surge::getPlugCategory() {return kPlugCategEffect;} + +bool Surge::getProductString(char* text) { + vst_strncpy (text, "airwindows Surge", kVstMaxProductStrLen); return true; +} + +bool Surge::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Surge/Surge.h b/plugins/WinVST/Surge/Surge.h new file mode 100755 index 0000000..0e485c3 --- /dev/null +++ b/plugins/WinVST/Surge/Surge.h @@ -0,0 +1,71 @@ +/* ======================================== + * Surge - Surge.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Surge_H +#define __Surge_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'srge'; //Change this to what the AU identity is! + +class Surge : + public AudioEffectX +{ +public: + Surge(audioMasterCallback audioMaster); + ~Surge(); + 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; + + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + bool flip; + long double chaseA; + long double chaseB; + long double chaseC; + long double chaseD; + long double chaseMax; + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Surge/SurgeProc.cpp b/plugins/WinVST/Surge/SurgeProc.cpp new file mode 100755 index 0000000..7a72b2f --- /dev/null +++ b/plugins/WinVST/Surge/SurgeProc.cpp @@ -0,0 +1,297 @@ +/* ======================================== + * Surge - Surge.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Surge_H +#include "Surge.h" +#endif + +void Surge::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 drySampleL; + long double drySampleR; + + double chaseMax = 0.0; + double intensity = (1.0-(pow((1.0-A),2)))*0.7; + double attack = ((intensity+0.1)*0.0005)/overallscale; + double decay = ((intensity+0.001)*0.00005)/overallscale; + double wet = B; + double dry = 1.0 - wet; + double inputSense; + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= 8.0; + inputSampleR *= 8.0; + inputSampleL *= intensity; + inputSampleR *= intensity; + + inputSense = fabs(inputSampleL); + if (fabs(inputSampleR) > inputSense) + inputSense = fabs(inputSampleR); + + if (chaseMax < inputSense) chaseA += attack; + if (chaseMax > inputSense) chaseA -= decay; + + if (chaseA > decay) chaseA = decay; + if (chaseA < -attack) chaseA = -attack; + + chaseB += (chaseA/overallscale); + if (chaseB > decay) chaseB = decay; + if (chaseB < -attack) chaseB = -attack; + + chaseC += (chaseB/overallscale); + if (chaseC > decay) chaseC = decay; + if (chaseC < -attack) chaseC = -attack; + + chaseD += (chaseC/overallscale); + if (chaseD > 1.0) chaseD = 1.0; + if (chaseD < 0.0) chaseD = 0.0; + + chaseMax = chaseA; + if (chaseMax < chaseB) chaseMax = chaseB; + if (chaseMax < chaseC) chaseMax = chaseC; + if (chaseMax < chaseD) chaseMax = chaseD; + + inputSampleL *= chaseMax; + inputSampleL = drySampleL - (inputSampleL * intensity); + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + + inputSampleR *= chaseMax; + inputSampleR = drySampleR - (inputSampleR * intensity); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void Surge::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 drySampleL; + long double drySampleR; + + double chaseMax = 0.0; + double intensity = (1.0-(pow((1.0-A),2)))*0.7; + double attack = ((intensity+0.1)*0.0005)/overallscale; + double decay = ((intensity+0.001)*0.00005)/overallscale; + double wet = B; + double dry = 1.0 - wet; + double inputSense; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= 8.0; + inputSampleR *= 8.0; + inputSampleL *= intensity; + inputSampleR *= intensity; + + inputSense = fabs(inputSampleL); + if (fabs(inputSampleR) > inputSense) + inputSense = fabs(inputSampleR); + + if (chaseMax < inputSense) chaseA += attack; + if (chaseMax > inputSense) chaseA -= decay; + + if (chaseA > decay) chaseA = decay; + if (chaseA < -attack) chaseA = -attack; + + chaseB += (chaseA/overallscale); + if (chaseB > decay) chaseB = decay; + if (chaseB < -attack) chaseB = -attack; + + chaseC += (chaseB/overallscale); + if (chaseC > decay) chaseC = decay; + if (chaseC < -attack) chaseC = -attack; + + chaseD += (chaseC/overallscale); + if (chaseD > 1.0) chaseD = 1.0; + if (chaseD < 0.0) chaseD = 0.0; + + chaseMax = chaseA; + if (chaseMax < chaseB) chaseMax = chaseB; + if (chaseMax < chaseC) chaseMax = chaseC; + if (chaseMax < chaseD) chaseMax = chaseD; + + inputSampleL *= chaseMax; + inputSampleL = drySampleL - (inputSampleL * intensity); + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + + inputSampleR *= chaseMax; + inputSampleR = drySampleR - (inputSampleR * intensity); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //noise shaping to 64-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //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/Surge/VSTProject.sln b/plugins/WinVST/Surge/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Surge/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/Surge/VSTProject.vcxproj b/plugins/WinVST/Surge/VSTProject.vcxproj new file mode 100755 index 0000000..656b566 --- /dev/null +++ b/plugins/WinVST/Surge/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Surge.cpp" />
+ <ClCompile Include="SurgeProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Surge.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Surge64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Surge/VSTProject.vcxproj.filters b/plugins/WinVST/Surge/VSTProject.vcxproj.filters new file mode 100755 index 0000000..8caec6f --- /dev/null +++ b/plugins/WinVST/Surge/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Surge.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SurgeProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Surge.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Surge/VSTProject.vcxproj.user b/plugins/WinVST/Surge/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Surge/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Surge/vstplug.def b/plugins/WinVST/Surge/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Surge/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/SurgeTide/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/SurgeTide/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/SurgeTide/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/SurgeTide/.vs/VSTProject/v14/.suo b/plugins/WinVST/SurgeTide/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..17702f9 --- /dev/null +++ b/plugins/WinVST/SurgeTide/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/SurgeTide/SurgeTide.cpp b/plugins/WinVST/SurgeTide/SurgeTide.cpp new file mode 100755 index 0000000..8df46c0 --- /dev/null +++ b/plugins/WinVST/SurgeTide/SurgeTide.cpp @@ -0,0 +1,141 @@ +/* ======================================== + * SurgeTide - SurgeTide.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __SurgeTide_H +#include "SurgeTide.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new SurgeTide(audioMaster);} + +SurgeTide::SurgeTide(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 0.3; + C = 1.0; + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + flip = true; + chaseA = 0.0; + chaseB = 0.0; + chaseC = 0.0; + //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 +} + +SurgeTide::~SurgeTide() {} +VstInt32 SurgeTide::getVendorVersion () {return 1000;} +void SurgeTide::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void SurgeTide::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 SurgeTide::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 SurgeTide::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 SurgeTide::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 + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float SurgeTide::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 SurgeTide::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "SurgeNode", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "SurgeRate", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void SurgeTide::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void SurgeTide::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + case kParamC: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 SurgeTide::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool SurgeTide::getEffectName(char* name) { + vst_strncpy(name, "SurgeTide", kVstMaxProductStrLen); return true; +} + +VstPlugCategory SurgeTide::getPlugCategory() {return kPlugCategEffect;} + +bool SurgeTide::getProductString(char* text) { + vst_strncpy (text, "airwindows SurgeTide", kVstMaxProductStrLen); return true; +} + +bool SurgeTide::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/SurgeTide/SurgeTide.h b/plugins/WinVST/SurgeTide/SurgeTide.h new file mode 100755 index 0000000..27495d7 --- /dev/null +++ b/plugins/WinVST/SurgeTide/SurgeTide.h @@ -0,0 +1,72 @@ +/* ======================================== + * SurgeTide - SurgeTide.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __SurgeTide_H +#define __SurgeTide_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'surg'; //Change this to what the AU identity is! + +class SurgeTide : + public AudioEffectX +{ +public: + SurgeTide(audioMasterCallback audioMaster); + ~SurgeTide(); + 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; + + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + bool flip; + long double chaseA; + long double chaseB; + long double chaseC; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/SurgeTide/SurgeTideProc.cpp b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp new file mode 100755 index 0000000..2fc6a1a --- /dev/null +++ b/plugins/WinVST/SurgeTide/SurgeTideProc.cpp @@ -0,0 +1,278 @@ +/* ======================================== + * SurgeTide - SurgeTide.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __SurgeTide_H +#include "SurgeTide.h" +#endif + +void SurgeTide::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 drySampleL; + long double drySampleR; + + double intensity = A; + double attack = ((B+0.1)*0.0005)/overallscale; + double decay = ((B+0.001)*0.00005)/overallscale; + double wet = C; + double dry = 1.0 - wet; + double inputSense; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= 8.0; + inputSampleR *= 8.0; + inputSampleL *= intensity; + inputSampleR *= intensity; + + inputSense = fabs(inputSampleL); + if (fabs(inputSampleR) > inputSense) + inputSense = fabs(inputSampleR); + + if (chaseC < inputSense) chaseA += attack; + if (chaseC > inputSense) chaseA -= decay; + + if (chaseA > decay) chaseA = decay; + if (chaseA < -attack) chaseA = -attack; + + chaseB += (chaseA/overallscale); + + if (chaseB > decay) chaseB = decay; + if (chaseB < -attack) chaseB = -attack; + + chaseC += (chaseB/overallscale); + if (chaseC > 1.0) chaseC = 1.0; + if (chaseC < 0.0) chaseC = 0.0; + + inputSampleL *= chaseC; + inputSampleL = drySampleL - (inputSampleL * intensity); + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + + inputSampleR *= chaseC; + inputSampleR = drySampleR - (inputSampleR * intensity); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void SurgeTide::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 drySampleL; + long double drySampleR; + + double intensity = A; + double attack = ((B+0.1)*0.0005)/overallscale; + double decay = ((B+0.001)*0.00005)/overallscale; + double wet = C; + double dry = 1.0 - wet; + double inputSense; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + inputSampleL *= 8.0; + inputSampleR *= 8.0; + inputSampleL *= intensity; + inputSampleR *= intensity; + + inputSense = fabs(inputSampleL); + if (fabs(inputSampleR) > inputSense) + inputSense = fabs(inputSampleR); + + if (chaseC < inputSense) chaseA += attack; + if (chaseC > inputSense) chaseA -= decay; + + if (chaseA > decay) chaseA = decay; + if (chaseA < -attack) chaseA = -attack; + + chaseB += (chaseA/overallscale); + + if (chaseB > decay) chaseB = decay; + if (chaseB < -attack) chaseB = -attack; + + chaseC += (chaseB/overallscale); + if (chaseC > 1.0) chaseC = 1.0; + if (chaseC < 0.0) chaseC = 0.0; + + inputSampleL *= chaseC; + inputSampleL = drySampleL - (inputSampleL * intensity); + inputSampleL = (drySampleL * dry) + (inputSampleL * wet); + + inputSampleR *= chaseC; + inputSampleR = drySampleR - (inputSampleR * intensity); + inputSampleR = (drySampleR * dry) + (inputSampleR * wet); + + //noise shaping to 64-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //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/SurgeTide/VSTProject.sln b/plugins/WinVST/SurgeTide/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/SurgeTide/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/SurgeTide/VSTProject.vcxproj b/plugins/WinVST/SurgeTide/VSTProject.vcxproj new file mode 100755 index 0000000..36f5b4d --- /dev/null +++ b/plugins/WinVST/SurgeTide/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="SurgeTide.cpp" />
+ <ClCompile Include="SurgeTideProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="SurgeTide.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>SurgeTide64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SurgeTide/VSTProject.vcxproj.filters b/plugins/WinVST/SurgeTide/VSTProject.vcxproj.filters new file mode 100755 index 0000000..38d043e --- /dev/null +++ b/plugins/WinVST/SurgeTide/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SurgeTide.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SurgeTideProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SurgeTide.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SurgeTide/VSTProject.vcxproj.user b/plugins/WinVST/SurgeTide/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/SurgeTide/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/SurgeTide/vstplug.def b/plugins/WinVST/SurgeTide/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/SurgeTide/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Swell/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Swell/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Swell/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Swell/.vs/VSTProject/v14/.suo b/plugins/WinVST/Swell/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..f1f16de --- /dev/null +++ b/plugins/WinVST/Swell/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Swell/Swell.cpp b/plugins/WinVST/Swell/Swell.cpp new file mode 100755 index 0000000..30518d8 --- /dev/null +++ b/plugins/WinVST/Swell/Swell.cpp @@ -0,0 +1,144 @@ +/* ======================================== + * Swell - Swell.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Swell_H +#include "Swell.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Swell(audioMaster);} + +Swell::Swell(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.9; + B = 0.5; + C = 1.0; + + swellL = 0.0; + swellR = 0.0; + louderL = false; + louderR = false; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Swell::~Swell() {} +VstInt32 Swell::getVendorVersion () {return 1000;} +void Swell::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Swell::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 Swell::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + /* 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 Swell::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + /* 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 Swell::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Swell::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; 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 Swell::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Thresh", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Swell", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Swell::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Swell::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Swell::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Swell::getEffectName(char* name) { + vst_strncpy(name, "Swell", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Swell::getPlugCategory() {return kPlugCategEffect;} + +bool Swell::getProductString(char* text) { + vst_strncpy (text, "airwindows Swell", kVstMaxProductStrLen); return true; +} + +bool Swell::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Swell/Swell.h b/plugins/WinVST/Swell/Swell.h new file mode 100755 index 0000000..c383df2 --- /dev/null +++ b/plugins/WinVST/Swell/Swell.h @@ -0,0 +1,76 @@ +/* ======================================== + * Swell - Swell.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Swell_H +#define __Swell_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kNumParameters = 3 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'swel'; //Change this to what the AU identity is! + +class Swell : + public AudioEffectX +{ +public: + Swell(audioMasterCallback audioMaster); + ~Swell(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + + long double swellL; + long double swellR; + bool louderL; + bool louderR; + + float A; + float B; + float C; + +}; + +#endif diff --git a/plugins/WinVST/Swell/SwellProc.cpp b/plugins/WinVST/Swell/SwellProc.cpp new file mode 100755 index 0000000..28c0aba --- /dev/null +++ b/plugins/WinVST/Swell/SwellProc.cpp @@ -0,0 +1,248 @@ +/* ======================================== + * Swell - Swell.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Swell_H +#include "Swell.h" +#endif + +void Swell::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; + + double thresholdOn = pow(A,2) * B; + double speedOn = (pow(B,2)*0.001)/overallscale; + double thresholdOff = thresholdOn * B; + double speedOff = (sin(B)*0.01)/overallscale; + double wet = C; + double dry = 1.0 - wet; + + long double drySampleL; + long double drySampleR; + long double inputSampleL; + long double inputSampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fabs(inputSampleL) > thresholdOn && louderL == false) louderL = true; + if (fabs(inputSampleL) < thresholdOff && louderL == true) louderL = false; + if (louderL == true) swellL = (swellL * (1.0 - speedOn)) + speedOn; + else swellL *= (1.0 - speedOff); + //both poles are a Zeno's arrow: approach but never get to either 1.0 or 0.0 + inputSampleL *= swellL; + + if (fabs(inputSampleR) > thresholdOn && louderR == false) louderR = true; + if (fabs(inputSampleR) < thresholdOff && louderR == true) louderR = false; + if (louderR == true) swellR = (swellR * (1.0 - speedOn)) + speedOn; + else swellR *= (1.0 - speedOff); + //both poles are a Zeno's arrow: approach but never get to either 1.0 or 0.0 + inputSampleR *= swellR; + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 Swell::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double thresholdOn = pow(A,2) * B; + double speedOn = (pow(B,2)*0.001)/overallscale; + double thresholdOff = thresholdOn * B; + double speedOff = (sin(B)*0.01)/overallscale; + double wet = C; + double dry = 1.0 - wet; + + long double drySampleL; + long double drySampleR; + long double inputSampleL; + long double inputSampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + if (fabs(inputSampleL) > thresholdOn && louderL == false) louderL = true; + if (fabs(inputSampleL) < thresholdOff && louderL == true) louderL = false; + if (louderL == true) swellL = (swellL * (1.0 - speedOn)) + speedOn; + else swellL *= (1.0 - speedOff); + //both poles are a Zeno's arrow: approach but never get to either 1.0 or 0.0 + inputSampleL *= swellL; + + if (fabs(inputSampleR) > thresholdOn && louderR == false) louderR = true; + if (fabs(inputSampleR) < thresholdOff && louderR == true) louderR = false; + if (louderR == true) swellR = (swellR * (1.0 - speedOn)) + speedOn; + else swellR *= (1.0 - speedOff); + //both poles are a Zeno's arrow: approach but never get to either 1.0 or 0.0 + inputSampleR *= swellR; + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/Swell/VSTProject.sln b/plugins/WinVST/Swell/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Swell/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/Swell/VSTProject.vcxproj b/plugins/WinVST/Swell/VSTProject.vcxproj new file mode 100755 index 0000000..6903903 --- /dev/null +++ b/plugins/WinVST/Swell/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Swell.cpp" />
+ <ClCompile Include="SwellProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Swell.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Swell64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Swell/VSTProject.vcxproj.filters b/plugins/WinVST/Swell/VSTProject.vcxproj.filters new file mode 100755 index 0000000..9b550dc --- /dev/null +++ b/plugins/WinVST/Swell/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Swell.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SwellProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Swell.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Swell/VSTProject.vcxproj.user b/plugins/WinVST/Swell/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Swell/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Swell/vstplug.def b/plugins/WinVST/Swell/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Swell/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/TapeDust/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/TapeDust/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/TapeDust/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/TapeDust/.vs/VSTProject/v14/.suo b/plugins/WinVST/TapeDust/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..df95641 --- /dev/null +++ b/plugins/WinVST/TapeDust/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/TapeDust/TapeDust.cpp b/plugins/WinVST/TapeDust/TapeDust.cpp new file mode 100755 index 0000000..9638c14 --- /dev/null +++ b/plugins/WinVST/TapeDust/TapeDust.cpp @@ -0,0 +1,138 @@ +/* ======================================== + * TapeDust - TapeDust.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TapeDust_H +#include "TapeDust.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new TapeDust(audioMaster);} + +TapeDust::TapeDust(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 1.0; + + for(int count = 0; count < 11; count++) { + bL[count] = 0.0; + fL[count] = 0.0; + bR[count] = 0.0; + fR[count] = 0.0; + } + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +TapeDust::~TapeDust() {} +VstInt32 TapeDust::getVendorVersion () {return 1000;} +void TapeDust::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void TapeDust::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 TapeDust::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 TapeDust::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 TapeDust::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float TapeDust::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 TapeDust::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Dust", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void TapeDust::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +void TapeDust::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 TapeDust::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool TapeDust::getEffectName(char* name) { + vst_strncpy(name, "TapeDust", kVstMaxProductStrLen); return true; +} + +VstPlugCategory TapeDust::getPlugCategory() {return kPlugCategEffect;} + +bool TapeDust::getProductString(char* text) { + vst_strncpy (text, "airwindows TapeDust", kVstMaxProductStrLen); return true; +} + +bool TapeDust::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/TapeDust/TapeDust.h b/plugins/WinVST/TapeDust/TapeDust.h new file mode 100755 index 0000000..7b3a7fd --- /dev/null +++ b/plugins/WinVST/TapeDust/TapeDust.h @@ -0,0 +1,73 @@ +/* ======================================== + * TapeDust - TapeDust.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __TapeDust_H +#define __TapeDust_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'tdus'; //Change this to what the AU identity is! + +class TapeDust : + public AudioEffectX +{ +public: + TapeDust(audioMasterCallback audioMaster); + ~TapeDust(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double bL[11]; + double fL[11]; + double bR[11]; + double fR[11]; + + float A; + float B; + +}; + +#endif diff --git a/plugins/WinVST/TapeDust/TapeDustProc.cpp b/plugins/WinVST/TapeDust/TapeDustProc.cpp new file mode 100755 index 0000000..3d6588d --- /dev/null +++ b/plugins/WinVST/TapeDust/TapeDustProc.cpp @@ -0,0 +1,294 @@ +/* ======================================== + * TapeDust - TapeDust.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TapeDust_H +#include "TapeDust.h" +#endif + +void TapeDust::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + double drySampleL; + double drySampleR; + double rRange = pow(A,2)*5.0; + double xfuzz = rRange * 0.002; + double rOffset = (rRange*0.4) + 1.0; + double rDepthL; //the randomly fluctuating value + double rDepthR; //the randomly fluctuating value + double gainL; + double gainR; + double wet = B; + double dry = 1.0 - wet; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + for(int count = 9; count < 0; count--) { + bL[count+1] = bL[count]; + bR[count+1] = bR[count]; + } + + bL[0] = inputSampleL; + bR[0] = inputSampleR; + inputSampleL = rand() / (double)RAND_MAX; + inputSampleR = rand() / (double)RAND_MAX; + gainL = rDepthL = (inputSampleL * rRange) + rOffset; + gainR = rDepthR = (inputSampleR * rRange) + rOffset; + inputSampleL *= ((1.0-fabs(bL[0]-bL[1]))*xfuzz); + inputSampleR *= ((1.0-fabs(bR[0]-bR[1]))*xfuzz); + if (fpFlip) { + inputSampleL = -inputSampleL; + inputSampleR = -inputSampleR; + } + + for(int count = 0; count < 9; count++) { + if (gainL > 1.0) { + fL[count] = 1.0; + gainL -= 1.0; + } else { + fL[count] = gainL; + gainL = 0.0; + } + if (gainR > 1.0) { + fR[count] = 1.0; + gainR -= 1.0; + } else { + fR[count] = gainR; + gainR = 0.0; + } + fL[count] /= rDepthL; + fR[count] /= rDepthR; + inputSampleL += (bL[count] * fL[count]); + inputSampleR += (bR[count] * fR[count]); + } + + if (wet < 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 TapeDust::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + 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; + + double drySampleL; + double drySampleR; + double rRange = pow(A,2)*5.0; + double xfuzz = rRange * 0.002; + double rOffset = (rRange*0.4) + 1.0; + double rDepthL; //the randomly fluctuating value + double rDepthR; //the randomly fluctuating value + double gainL; + double gainR; + double wet = B; + double dry = 1.0 - wet; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + for(int count = 9; count < 0; count--) { + bL[count+1] = bL[count]; + bR[count+1] = bR[count]; + } + + bL[0] = inputSampleL; + bR[0] = inputSampleR; + inputSampleL = rand() / (double)RAND_MAX; + inputSampleR = rand() / (double)RAND_MAX; + gainL = rDepthL = (inputSampleL * rRange) + rOffset; + gainR = rDepthR = (inputSampleR * rRange) + rOffset; + inputSampleL *= ((1.0-fabs(bL[0]-bL[1]))*xfuzz); + inputSampleR *= ((1.0-fabs(bR[0]-bR[1]))*xfuzz); + if (fpFlip) { + inputSampleL = -inputSampleL; + inputSampleR = -inputSampleR; + } + + for(int count = 0; count < 9; count++) { + if (gainL > 1.0) { + fL[count] = 1.0; + gainL -= 1.0; + } else { + fL[count] = gainL; + gainL = 0.0; + } + if (gainR > 1.0) { + fR[count] = 1.0; + gainR -= 1.0; + } else { + fR[count] = gainR; + gainR = 0.0; + } + fL[count] /= rDepthL; + fR[count] /= rDepthR; + inputSampleL += (bL[count] * fL[count]); + inputSampleR += (bR[count] * fR[count]); + } + + if (wet < 1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/TapeDust/VSTProject.sln b/plugins/WinVST/TapeDust/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/TapeDust/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/TapeDust/VSTProject.vcxproj b/plugins/WinVST/TapeDust/VSTProject.vcxproj new file mode 100755 index 0000000..7a05a85 --- /dev/null +++ b/plugins/WinVST/TapeDust/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="TapeDust.cpp" />
+ <ClCompile Include="TapeDustProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="TapeDust.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>TapeDust64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TapeDust/VSTProject.vcxproj.filters b/plugins/WinVST/TapeDust/VSTProject.vcxproj.filters new file mode 100755 index 0000000..71df380 --- /dev/null +++ b/plugins/WinVST/TapeDust/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TapeDust.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TapeDustProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="TapeDust.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TapeDust/VSTProject.vcxproj.user b/plugins/WinVST/TapeDust/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/TapeDust/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TapeDust/vstplug.def b/plugins/WinVST/TapeDust/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/TapeDust/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Thunder/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Thunder/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Thunder/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Thunder/.vs/VSTProject/v14/.suo b/plugins/WinVST/Thunder/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..b01488d --- /dev/null +++ b/plugins/WinVST/Thunder/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Thunder/Thunder.cpp b/plugins/WinVST/Thunder/Thunder.cpp new file mode 100755 index 0000000..015eabd --- /dev/null +++ b/plugins/WinVST/Thunder/Thunder.cpp @@ -0,0 +1,145 @@ +/* ======================================== + * 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; + + fpNShapeAL = 0.0; + fpNShapeBL = 0.0; + fpNShapeAR = 0.0; + fpNShapeBR = 0.0; + 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/WinVST/Thunder/Thunder.h b/plugins/WinVST/Thunder/Thunder.h new file mode 100755 index 0000000..1ef1d03 --- /dev/null +++ b/plugins/WinVST/Thunder/Thunder.h @@ -0,0 +1,83 @@ +/* ======================================== + * 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 <set> +#include <string> +#include <math.h> + +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; + long double fpNShapeAL; + long double fpNShapeBL; + long double fpNShapeAR; + long double fpNShapeBR; + bool flip; + + float A; + float B; + +}; + +#endif diff --git a/plugins/WinVST/Thunder/ThunderProc.cpp b/plugins/WinVST/Thunder/ThunderProc.cpp new file mode 100755 index 0000000..bd401d4 --- /dev/null +++ b/plugins/WinVST/Thunder/ThunderProc.cpp @@ -0,0 +1,510 @@ +/* ======================================== + * 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; + + float fpTemp; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + 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. + } + + 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; + } + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + + *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 fpTemp; + double fpOld = 0.618033988749894848204586; //golden ratio! + double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + 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. + } + + 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; + } + + //noise shaping to 32-bit floating point + if (flip) { + fpTemp = inputSampleL; + fpNShapeAL = (fpNShapeAL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeAL; + + fpTemp = inputSampleR; + fpNShapeAR = (fpNShapeAR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeAR; + } + else { + fpTemp = inputSampleL; + fpNShapeBL = (fpNShapeBL*fpOld)+((inputSampleL-fpTemp)*fpNew); + inputSampleL += fpNShapeBL; + + fpTemp = inputSampleR; + fpNShapeBR = (fpNShapeBR*fpOld)+((inputSampleR-fpTemp)*fpNew); + inputSampleR += fpNShapeBR; + } + flip = !flip; + //end noise shaping on 32 bit output + + + *out1 = inputSampleL; + *out2 = inputSampleR; + + *in1++; + *in2++; + *out1++; + *out2++; + } +}
\ No newline at end of file diff --git a/plugins/WinVST/Thunder/VSTProject.sln b/plugins/WinVST/Thunder/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Thunder/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/Thunder/VSTProject.vcxproj b/plugins/WinVST/Thunder/VSTProject.vcxproj new file mode 100755 index 0000000..6c14ced --- /dev/null +++ b/plugins/WinVST/Thunder/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Thunder.cpp" />
+ <ClCompile Include="ThunderProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Thunder.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Thunder64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Thunder/VSTProject.vcxproj.filters b/plugins/WinVST/Thunder/VSTProject.vcxproj.filters new file mode 100755 index 0000000..92c5c77 --- /dev/null +++ b/plugins/WinVST/Thunder/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Thunder.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ThunderProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Thunder.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Thunder/VSTProject.vcxproj.user b/plugins/WinVST/Thunder/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Thunder/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Thunder/vstplug.def b/plugins/WinVST/Thunder/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Thunder/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ToTape5/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ToTape5/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ToTape5/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ToTape5/.vs/VSTProject/v14/.suo b/plugins/WinVST/ToTape5/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..b0c4487 --- /dev/null +++ b/plugins/WinVST/ToTape5/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ToTape5/ToTape5.cpp b/plugins/WinVST/ToTape5/ToTape5.cpp new file mode 100755 index 0000000..01f61cb --- /dev/null +++ b/plugins/WinVST/ToTape5/ToTape5.cpp @@ -0,0 +1,242 @@ +/* ======================================== + * ToTape5 - ToTape5.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToTape5_H +#include "ToTape5.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ToTape5(audioMaster);} + +ToTape5::ToTape5(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.25; + B = 0.0; + C = 0.0; + D = 0.0; + E = 1.0; + F = 1.0; + + iirMidRollerAL = 0.0; + iirMidRollerBL = 0.0; + iirMidRollerCL = 0.0; + iirHeadBumpAL = 0.0; + iirHeadBumpBL = 0.0; + iirHeadBumpCL = 0.0; + iirMinHeadBumpL = 0.0; + + iirMidRollerAR = 0.0; + iirMidRollerBR = 0.0; + iirMidRollerCR = 0.0; + iirHeadBumpAR = 0.0; + iirHeadBumpBR = 0.0; + iirHeadBumpCR = 0.0; + iirMinHeadBumpR = 0.0; + + iirSampleAL = 0.0; + iirSampleBL = 0.0; + iirSampleCL = 0.0; + iirSampleDL = 0.0; + iirSampleEL = 0.0; + iirSampleFL = 0.0; + iirSampleGL = 0.0; + iirSampleHL = 0.0; + iirSampleIL = 0.0; + iirSampleJL = 0.0; + iirSampleKL = 0.0; + iirSampleLL = 0.0; + iirSampleML = 0.0; + iirSampleNL = 0.0; + iirSampleOL = 0.0; + iirSamplePL = 0.0; + iirSampleQL = 0.0; + iirSampleRL = 0.0; + iirSampleSL = 0.0; + iirSampleTL = 0.0; + iirSampleUL = 0.0; + iirSampleVL = 0.0; + iirSampleWL = 0.0; + iirSampleXL = 0.0; + iirSampleYL = 0.0; + iirSampleZL = 0.0; + + iirSampleAR = 0.0; + iirSampleBR = 0.0; + iirSampleCR = 0.0; + iirSampleDR = 0.0; + iirSampleER = 0.0; + iirSampleFR = 0.0; + iirSampleGR = 0.0; + iirSampleHR = 0.0; + iirSampleIR = 0.0; + iirSampleJR = 0.0; + iirSampleKR = 0.0; + iirSampleLR = 0.0; + iirSampleMR = 0.0; + iirSampleNR = 0.0; + iirSampleOR = 0.0; + iirSamplePR = 0.0; + iirSampleQR = 0.0; + iirSampleRR = 0.0; + iirSampleSR = 0.0; + iirSampleTR = 0.0; + iirSampleUR = 0.0; + iirSampleVR = 0.0; + iirSampleWR = 0.0; + iirSampleXR = 0.0; + iirSampleYR = 0.0; + iirSampleZR = 0.0; + + for (int temp = 0; temp < 999; temp++) {dL[temp] = 0.0; eL[temp] = 0.0; dR[temp] = 0.0; eR[temp] = 0.0;} + + gcount = 0; + rateof = 0.5; + sweep = 0.0; + nextmax = 0.5; + hcount = 0; + flip = 0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +ToTape5::~ToTape5() {} +VstInt32 ToTape5::getVendorVersion () {return 1000;} +void ToTape5::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ToTape5::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 ToTape5::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + chunkData[4] = E; + chunkData[5] = F; + /* 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 ToTape5::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + E = pinParameter(chunkData[4]); + F = pinParameter(chunkData[5]); + /* 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 ToTape5::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + case kParamE: E = value; break; + case kParamF: F = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ToTape5::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; break; + case kParamE: return E; break; + case kParamF: return F; 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 ToTape5::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Louder", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Softer", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "Fatter", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Flutter", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "Output", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ToTape5::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + case kParamE: float2string (E, text, kVstMaxParamStrLen); break; + case kParamF: float2string (F, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +void ToTape5::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ToTape5::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ToTape5::getEffectName(char* name) { + vst_strncpy(name, "ToTape5", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ToTape5::getPlugCategory() {return kPlugCategEffect;} + +bool ToTape5::getProductString(char* text) { + vst_strncpy (text, "airwindows ToTape5", kVstMaxProductStrLen); return true; +} + +bool ToTape5::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ToTape5/ToTape5.h b/plugins/WinVST/ToTape5/ToTape5.h new file mode 100755 index 0000000..ac26df5 --- /dev/null +++ b/plugins/WinVST/ToTape5/ToTape5.h @@ -0,0 +1,158 @@ +/* ======================================== + * ToTape5 - ToTape5.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ToTape5_H +#define __ToTape5_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kParamE = 4, + kParamF = 5, + kNumParameters = 6 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'tott'; //Change this to what the AU identity is! + +class ToTape5 : + public AudioEffectX +{ +public: + ToTape5(audioMasterCallback audioMaster); + ~ToTape5(); + 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; + + int gcount; + double rateof; + double sweep; + double nextmax; + int hcount; + int flip; + + double dL[1000]; + double eL[1000]; + double dR[1000]; + double eR[1000]; + + double iirMidRollerAL; + double iirMidRollerBL; + double iirMidRollerCL; + double iirHeadBumpAL; + double iirHeadBumpBL; + double iirHeadBumpCL; + double iirMinHeadBumpL; + + double iirMidRollerAR; + double iirMidRollerBR; + double iirMidRollerCR; + double iirHeadBumpAR; + double iirHeadBumpBR; + double iirHeadBumpCR; + double iirMinHeadBumpR; + + double iirSampleAL; + double iirSampleBL; + double iirSampleCL; + double iirSampleDL; + double iirSampleEL; + double iirSampleFL; + double iirSampleGL; + double iirSampleHL; + double iirSampleIL; + double iirSampleJL; + double iirSampleKL; + double iirSampleLL; + double iirSampleML; + double iirSampleNL; + double iirSampleOL; + double iirSamplePL; + double iirSampleQL; + double iirSampleRL; + double iirSampleSL; + double iirSampleTL; + double iirSampleUL; + double iirSampleVL; + double iirSampleWL; + double iirSampleXL; + double iirSampleYL; + double iirSampleZL; + + double iirSampleAR; + double iirSampleBR; + double iirSampleCR; + double iirSampleDR; + double iirSampleER; + double iirSampleFR; + double iirSampleGR; + double iirSampleHR; + double iirSampleIR; + double iirSampleJR; + double iirSampleKR; + double iirSampleLR; + double iirSampleMR; + double iirSampleNR; + double iirSampleOR; + double iirSamplePR; + double iirSampleQR; + double iirSampleRR; + double iirSampleSR; + double iirSampleTR; + double iirSampleUR; + double iirSampleVR; + double iirSampleWR; + double iirSampleXR; + double iirSampleYR; + double iirSampleZR; + + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; + float E; + float F; +}; + +#endif diff --git a/plugins/WinVST/ToTape5/ToTape5Proc.cpp b/plugins/WinVST/ToTape5/ToTape5Proc.cpp new file mode 100755 index 0000000..4d2d5c7 --- /dev/null +++ b/plugins/WinVST/ToTape5/ToTape5Proc.cpp @@ -0,0 +1,769 @@ +/* ======================================== + * ToTape5 - ToTape5.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToTape5_H +#include "ToTape5.h" +#endif + +void ToTape5::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 inputgain = pow(A+1.0,3); + double outputgain = E; + double wet = F; + double dry = 1.0 - wet; + double trim = 0.211324865405187117745425; + double SoftenControl = pow(B,2); + double tempRandy = 0.06 + (SoftenControl/10.0); + double RollAmount = (1.0-(SoftenControl * 0.45))/overallscale; + double HeadBumpControl = pow(C,2); + int allpasstemp; + int maxdelay = (int)(floor(((HeadBumpControl+0.3)*2.2)*overallscale)); + HeadBumpControl *= fabs(HeadBumpControl); + double HeadBumpFreq = 0.044/overallscale; + double iirAmount = 0.000001/overallscale; + double altAmount = 1.0 - iirAmount; + double iirHBoostAmount = 0.0001/overallscale; + double altHBoostAmount = 1.0 - iirAmount; + double depth = pow(D,2)*overallscale; + double fluttertrim = 0.005/overallscale; + double sweeptrim = (0.0006*depth)/overallscale; + double offset; + double tupi = 3.141592653589793238 * 2.0; + double newrate = 0.005/overallscale; + double oldrate = 1.0-newrate; + double flutterrandy; + double randy; + double invrandy; + int count; + + double HighsSampleL = 0.0; + double NonHighsSampleL = 0.0; + double HeadBumpL = 0.0; + double SubtractL; + double bridgerectifierL; + double tempSampleL; + double drySampleL; + + double HighsSampleR = 0.0; + double NonHighsSampleR = 0.0; + double HeadBumpR = 0.0; + double SubtractR; + double bridgerectifierR; + double tempSampleR; + double drySampleR; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + long double inputSampleL; + long double inputSampleR; + + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + flutterrandy = (rand()/(double)RAND_MAX); + randy = flutterrandy * tempRandy; //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 + + //now we've got a random flutter, so we're messing with the pitch before tape effects go on + if (gcount < 0 || gcount > 300) {gcount = 300;} + count = gcount; + dL[count+301] = dL[count] = inputSampleL; + dR[count+301] = dR[count] = inputSampleR; + gcount--; + //we will also keep the buffer going, even when not in use + + if (depth != 0.0) { + offset = (1.0 + sin(sweep)) * depth; + count += (int)floor(offset); + + bridgerectifierL = (dL[count] * (1-(offset-floor(offset)))); + bridgerectifierL += (dL[count+1] * (offset-floor(offset))); + bridgerectifierL -= ((dL[count+2] * (offset-floor(offset)))*trim); + + bridgerectifierR = (dR[count] * (1-(offset-floor(offset)))); + bridgerectifierR += (dR[count+1] * (offset-floor(offset))); + bridgerectifierR -= ((dR[count+2] * (offset-floor(offset)))*trim); + + rateof = (nextmax * newrate) + (rateof * oldrate); + sweep += rateof * fluttertrim; + sweep += sweep * sweeptrim; + if (sweep >= tupi){sweep = 0.0; nextmax = 0.02 + (flutterrandy*0.98);} + inputSampleL = bridgerectifierL; + inputSampleR = bridgerectifierR; + //apply to input signal only when flutter is present, interpolate samples + } + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + if (flip < 1 || flip > 3) flip = 1; + switch (flip) + { + case 1: + iirMidRollerAL = (iirMidRollerAL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerAL = (invrandy * iirMidRollerAL) + (randy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerAL; + NonHighsSampleL = iirMidRollerAL; + + iirHeadBumpAL += (inputSampleL * 0.05); + iirHeadBumpAL -= (iirHeadBumpAL * iirHeadBumpAL * iirHeadBumpAL * HeadBumpFreq); + iirHeadBumpAL = (invrandy * iirHeadBumpAL) + (randy * iirHeadBumpBL) + (randy * iirHeadBumpCL); + + iirMidRollerAR = (iirMidRollerAR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerAR = (invrandy * iirMidRollerAR) + (randy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerAR; + NonHighsSampleR = iirMidRollerAR; + + iirHeadBumpAR += (inputSampleR * 0.05); + iirHeadBumpAR -= (iirHeadBumpAR * iirHeadBumpAR * iirHeadBumpAR * HeadBumpFreq); + iirHeadBumpAR = (invrandy * iirHeadBumpAR) + (randy * iirHeadBumpBR) + (randy * iirHeadBumpCR); + break; + case 2: + iirMidRollerBL = (iirMidRollerBL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerBL = (randy * iirMidRollerAL) + (invrandy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerBL; + NonHighsSampleL = iirMidRollerBL; + + iirHeadBumpBL += (inputSampleL * 0.05); + iirHeadBumpBL -= (iirHeadBumpBL * iirHeadBumpBL * iirHeadBumpBL * HeadBumpFreq); + iirHeadBumpBL = (randy * iirHeadBumpAL) + (invrandy * iirHeadBumpBL) + (randy * iirHeadBumpCL); + + iirMidRollerBR = (iirMidRollerBR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerBR = (randy * iirMidRollerAR) + (invrandy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerBR; + NonHighsSampleR = iirMidRollerBR; + + iirHeadBumpBR += (inputSampleR * 0.05); + iirHeadBumpBR -= (iirHeadBumpBR * iirHeadBumpBR * iirHeadBumpBR * HeadBumpFreq); + iirHeadBumpBR = (randy * iirHeadBumpAR) + (invrandy * iirHeadBumpBR) + (randy * iirHeadBumpCR); + break; + case 3: + iirMidRollerCL = (iirMidRollerCL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerCL = (randy * iirMidRollerAL) + (randy * iirMidRollerBL) + (invrandy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerCL; + NonHighsSampleL = iirMidRollerCL; + + iirHeadBumpCL += (inputSampleL * 0.05); + iirHeadBumpCL -= (iirHeadBumpCL * iirHeadBumpCL * iirHeadBumpCL * HeadBumpFreq); + iirHeadBumpCL = (randy * iirHeadBumpAL) + (randy * iirHeadBumpBL) + (invrandy * iirHeadBumpCL); + + iirMidRollerCR = (iirMidRollerCR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerCR = (randy * iirMidRollerAR) + (randy * iirMidRollerBR) + (invrandy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerCR; + NonHighsSampleR = iirMidRollerCR; + + iirHeadBumpCR += (inputSampleR * 0.05); + iirHeadBumpCR -= (iirHeadBumpCR * iirHeadBumpCR * iirHeadBumpCR * HeadBumpFreq); + iirHeadBumpCR = (randy * iirHeadBumpAR) + (randy * iirHeadBumpBR) + (invrandy * iirHeadBumpCR); + break; + } + flip++; //increment the triplet counter + + SubtractL = HighsSampleL; + bridgerectifierL = fabs(SubtractL)*1.57079633; + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = 1-cos(bridgerectifierL); + if (SubtractL > 0) SubtractL = bridgerectifierL; + if (SubtractL < 0) SubtractL = -bridgerectifierL; + inputSampleL -= SubtractL; + + SubtractR = HighsSampleR; + bridgerectifierR = fabs(SubtractR)*1.57079633; + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = 1-cos(bridgerectifierR); + if (SubtractR > 0) SubtractR = bridgerectifierR; + if (SubtractR < 0) SubtractR = -bridgerectifierR; + inputSampleR -= SubtractR; + //Soften works using the MidRoller stuff, defining a bright parallel channel that we apply negative Density + //to, and then subtract from the main audio. That makes the 'highs channel subtract' hit only the loudest + //transients, plus we are subtracting any artifacts we got from the negative Density. + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0) inputSampleL = bridgerectifierL; + if (inputSampleL < 0) inputSampleL = -bridgerectifierL; + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0) inputSampleR = bridgerectifierR; + if (inputSampleR < 0) inputSampleR = -bridgerectifierR; + //drive section: the tape sound includes a very gentle saturation curve, which is always an attenuation. + //we cut back on highs before hitting this, and then we're going to subtract highs a second time after. + + HeadBumpL = iirHeadBumpAL + iirHeadBumpBL + iirHeadBumpCL; + HeadBumpR = iirHeadBumpAR + iirHeadBumpBR + iirHeadBumpCR; + //begin PhaseNudge + allpasstemp = hcount - 1; + if (allpasstemp < 0 || allpasstemp > maxdelay) {allpasstemp = maxdelay;} + + HeadBumpL -= eL[allpasstemp] * fpOld; + eL[hcount] = HeadBumpL; + inputSampleL *= fpOld; + + HeadBumpR -= eR[allpasstemp] * fpOld; + eR[hcount] = HeadBumpR; + inputSampleR *= fpOld; + + hcount--; if (hcount < 0 || hcount > maxdelay) {hcount = maxdelay;} + HeadBumpL += (eL[hcount]); + HeadBumpR += (eR[hcount]); + //end PhaseNudge on head bump in lieu of delay. + SubtractL -= (HeadBumpL * (HeadBumpControl+iirMinHeadBumpL)); + SubtractR -= (HeadBumpR * (HeadBumpControl+iirMinHeadBumpR)); + //makes a second soften and a single head bump after saturation. + //we are going to retain this, and then feed it into the highpass filter. That way, we can skip a subtract. + //Head Bump retains a trace which is roughly as large as what the highpass will do. + + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + iirMinHeadBumpL = (iirMinHeadBumpL * altHBoostAmount) + (fabs(inputSampleL) * iirHBoostAmount); + if (iirMinHeadBumpL > 0.01) iirMinHeadBumpL = 0.01; + + iirMinHeadBumpR = (iirMinHeadBumpR * altHBoostAmount) + (fabs(inputSampleR) * iirHBoostAmount); + if (iirMinHeadBumpR > 0.01) iirMinHeadBumpR = 0.01; + //we want this one rectified so that it's a relatively steady positive value. Boosts can cause it to be + //greater than 1 so we clamp it in that case. + + iirSampleAL = (iirSampleAL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleAL; SubtractL += iirSampleAL; + iirSampleBL = (iirSampleBL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleBL; SubtractL += iirSampleBL; + iirSampleCL = (iirSampleCL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleCL; SubtractL += iirSampleCL; + iirSampleDL = (iirSampleDL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleDL; SubtractL += iirSampleDL; + iirSampleEL = (iirSampleEL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleEL; SubtractL += iirSampleEL; + iirSampleFL = (iirSampleFL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleFL; SubtractL += iirSampleFL; + iirSampleGL = (iirSampleGL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleGL; SubtractL += iirSampleGL; + iirSampleHL = (iirSampleHL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleHL; SubtractL += iirSampleHL; + iirSampleIL = (iirSampleIL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleIL; SubtractL += iirSampleIL; + iirSampleJL = (iirSampleJL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleJL; SubtractL += iirSampleJL; + iirSampleKL = (iirSampleKL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleKL; SubtractL += iirSampleKL; + iirSampleLL = (iirSampleLL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleLL; SubtractL += iirSampleLL; + iirSampleML = (iirSampleML * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleML; SubtractL += iirSampleML; + iirSampleNL = (iirSampleNL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleNL; SubtractL += iirSampleNL; + iirSampleOL = (iirSampleOL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleOL; SubtractL += iirSampleOL; + iirSamplePL = (iirSamplePL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSamplePL; SubtractL += iirSamplePL; + iirSampleQL = (iirSampleQL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleQL; SubtractL += iirSampleQL; + iirSampleRL = (iirSampleRL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleRL; SubtractL += iirSampleRL; + iirSampleSL = (iirSampleSL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleSL; SubtractL += iirSampleSL; + iirSampleTL = (iirSampleTL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleTL; SubtractL += iirSampleTL; + iirSampleUL = (iirSampleUL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleUL; SubtractL += iirSampleUL; + iirSampleVL = (iirSampleVL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleVL; SubtractL += iirSampleVL; + iirSampleWL = (iirSampleWL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleWL; SubtractL += iirSampleWL; + iirSampleXL = (iirSampleXL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleXL; SubtractL += iirSampleXL; + iirSampleYL = (iirSampleYL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleYL; SubtractL += iirSampleYL; + iirSampleZL = (iirSampleZL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleZL; SubtractL += iirSampleZL; + + iirSampleAR = (iirSampleAR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleAR; SubtractR += iirSampleAR; + iirSampleBR = (iirSampleBR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleBR; SubtractR += iirSampleBR; + iirSampleCR = (iirSampleCR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleCR; SubtractR += iirSampleCR; + iirSampleDR = (iirSampleDR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleDR; SubtractR += iirSampleDR; + iirSampleER = (iirSampleER * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleER; SubtractR += iirSampleER; + iirSampleFR = (iirSampleFR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleFR; SubtractR += iirSampleFR; + iirSampleGR = (iirSampleGR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleGR; SubtractR += iirSampleGR; + iirSampleHR = (iirSampleHR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleHR; SubtractR += iirSampleHR; + iirSampleIR = (iirSampleIR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleIR; SubtractR += iirSampleIR; + iirSampleJR = (iirSampleJR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleJR; SubtractR += iirSampleJR; + iirSampleKR = (iirSampleKR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleKR; SubtractR += iirSampleKR; + iirSampleLR = (iirSampleLR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleLR; SubtractR += iirSampleLR; + iirSampleMR = (iirSampleMR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleMR; SubtractR += iirSampleMR; + iirSampleNR = (iirSampleNR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleNR; SubtractR += iirSampleNR; + iirSampleOR = (iirSampleOR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleOR; SubtractR += iirSampleOR; + iirSamplePR = (iirSamplePR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSamplePR; SubtractR += iirSamplePR; + iirSampleQR = (iirSampleQR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleQR; SubtractR += iirSampleQR; + iirSampleRR = (iirSampleRR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleRR; SubtractR += iirSampleRR; + iirSampleSR = (iirSampleSR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleSR; SubtractR += iirSampleSR; + iirSampleTR = (iirSampleTR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleTR; SubtractR += iirSampleTR; + iirSampleUR = (iirSampleUR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleUR; SubtractR += iirSampleUR; + iirSampleVR = (iirSampleVR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleVR; SubtractR += iirSampleVR; + iirSampleWR = (iirSampleWR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleWR; SubtractR += iirSampleWR; + iirSampleXR = (iirSampleXR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleXR; SubtractR += iirSampleXR; + iirSampleYR = (iirSampleYR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleYR; SubtractR += iirSampleYR; + iirSampleZR = (iirSampleZR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleZR; SubtractR += iirSampleZR; + //do the IIR on a dummy sample, and store up the correction in a variable at the same scale as the very low level + //numbers being used. Don't keep doing it against the possibly high level signal number. + //This has been known to add a resonant quality to the cutoff, which we're using on purpose. + + inputSampleL -= SubtractL; + inputSampleR -= SubtractR; + //apply stored up tiny corrections. + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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 ToTape5::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 inputgain = pow(A+1.0,3); + double outputgain = E; + double wet = F; + double dry = 1.0 - wet; + double trim = 0.211324865405187117745425; + double SoftenControl = pow(B,2); + double tempRandy = 0.06 + (SoftenControl/10.0); + double RollAmount = (1.0-(SoftenControl * 0.45))/overallscale; + double HeadBumpControl = pow(C,2); + int allpasstemp; + int maxdelay = (int)(floor(((HeadBumpControl+0.3)*2.2)*overallscale)); + HeadBumpControl *= fabs(HeadBumpControl); + double HeadBumpFreq = 0.044/overallscale; + double iirAmount = 0.000001/overallscale; + double altAmount = 1.0 - iirAmount; + double iirHBoostAmount = 0.0001/overallscale; + double altHBoostAmount = 1.0 - iirAmount; + double depth = pow(D,2)*overallscale; + double fluttertrim = 0.005/overallscale; + double sweeptrim = (0.0006*depth)/overallscale; + double offset; + double tupi = 3.141592653589793238 * 2.0; + double newrate = 0.005/overallscale; + double oldrate = 1.0-newrate; + double flutterrandy; + double randy; + double invrandy; + int count; + + double HighsSampleL = 0.0; + double NonHighsSampleL = 0.0; + double HeadBumpL = 0.0; + double SubtractL; + double bridgerectifierL; + double tempSampleL; + double drySampleL; + + double HighsSampleR = 0.0; + double NonHighsSampleR = 0.0; + double HeadBumpR = 0.0; + double SubtractR; + double bridgerectifierR; + double tempSampleR; + double drySampleR; + + 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; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + flutterrandy = (rand()/(double)RAND_MAX); + randy = flutterrandy * tempRandy; //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 + + //now we've got a random flutter, so we're messing with the pitch before tape effects go on + if (gcount < 0 || gcount > 300) {gcount = 300;} + count = gcount; + dL[count+301] = dL[count] = inputSampleL; + dR[count+301] = dR[count] = inputSampleR; + gcount--; + //we will also keep the buffer going, even when not in use + + if (depth != 0.0) { + offset = (1.0 + sin(sweep)) * depth; + count += (int)floor(offset); + + bridgerectifierL = (dL[count] * (1-(offset-floor(offset)))); + bridgerectifierL += (dL[count+1] * (offset-floor(offset))); + bridgerectifierL -= ((dL[count+2] * (offset-floor(offset)))*trim); + + bridgerectifierR = (dR[count] * (1-(offset-floor(offset)))); + bridgerectifierR += (dR[count+1] * (offset-floor(offset))); + bridgerectifierR -= ((dR[count+2] * (offset-floor(offset)))*trim); + + rateof = (nextmax * newrate) + (rateof * oldrate); + sweep += rateof * fluttertrim; + sweep += sweep * sweeptrim; + if (sweep >= tupi){sweep = 0.0; nextmax = 0.02 + (flutterrandy*0.98);} + inputSampleL = bridgerectifierL; + inputSampleR = bridgerectifierR; + //apply to input signal only when flutter is present, interpolate samples + } + + if (inputgain != 1.0) { + inputSampleL *= inputgain; + inputSampleR *= inputgain; + } + + if (flip < 1 || flip > 3) flip = 1; + switch (flip) + { + case 1: + iirMidRollerAL = (iirMidRollerAL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerAL = (invrandy * iirMidRollerAL) + (randy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerAL; + NonHighsSampleL = iirMidRollerAL; + + iirHeadBumpAL += (inputSampleL * 0.05); + iirHeadBumpAL -= (iirHeadBumpAL * iirHeadBumpAL * iirHeadBumpAL * HeadBumpFreq); + iirHeadBumpAL = (invrandy * iirHeadBumpAL) + (randy * iirHeadBumpBL) + (randy * iirHeadBumpCL); + + iirMidRollerAR = (iirMidRollerAR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerAR = (invrandy * iirMidRollerAR) + (randy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerAR; + NonHighsSampleR = iirMidRollerAR; + + iirHeadBumpAR += (inputSampleR * 0.05); + iirHeadBumpAR -= (iirHeadBumpAR * iirHeadBumpAR * iirHeadBumpAR * HeadBumpFreq); + iirHeadBumpAR = (invrandy * iirHeadBumpAR) + (randy * iirHeadBumpBR) + (randy * iirHeadBumpCR); + break; + case 2: + iirMidRollerBL = (iirMidRollerBL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerBL = (randy * iirMidRollerAL) + (invrandy * iirMidRollerBL) + (randy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerBL; + NonHighsSampleL = iirMidRollerBL; + + iirHeadBumpBL += (inputSampleL * 0.05); + iirHeadBumpBL -= (iirHeadBumpBL * iirHeadBumpBL * iirHeadBumpBL * HeadBumpFreq); + iirHeadBumpBL = (randy * iirHeadBumpAL) + (invrandy * iirHeadBumpBL) + (randy * iirHeadBumpCL); + + iirMidRollerBR = (iirMidRollerBR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerBR = (randy * iirMidRollerAR) + (invrandy * iirMidRollerBR) + (randy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerBR; + NonHighsSampleR = iirMidRollerBR; + + iirHeadBumpBR += (inputSampleR * 0.05); + iirHeadBumpBR -= (iirHeadBumpBR * iirHeadBumpBR * iirHeadBumpBR * HeadBumpFreq); + iirHeadBumpBR = (randy * iirHeadBumpAR) + (invrandy * iirHeadBumpBR) + (randy * iirHeadBumpCR); + break; + case 3: + iirMidRollerCL = (iirMidRollerCL * (1.0 - RollAmount)) + (inputSampleL * RollAmount); + iirMidRollerCL = (randy * iirMidRollerAL) + (randy * iirMidRollerBL) + (invrandy * iirMidRollerCL); + HighsSampleL = inputSampleL - iirMidRollerCL; + NonHighsSampleL = iirMidRollerCL; + + iirHeadBumpCL += (inputSampleL * 0.05); + iirHeadBumpCL -= (iirHeadBumpCL * iirHeadBumpCL * iirHeadBumpCL * HeadBumpFreq); + iirHeadBumpCL = (randy * iirHeadBumpAL) + (randy * iirHeadBumpBL) + (invrandy * iirHeadBumpCL); + + iirMidRollerCR = (iirMidRollerCR * (1.0 - RollAmount)) + (inputSampleR * RollAmount); + iirMidRollerCR = (randy * iirMidRollerAR) + (randy * iirMidRollerBR) + (invrandy * iirMidRollerCR); + HighsSampleR = inputSampleR - iirMidRollerCR; + NonHighsSampleR = iirMidRollerCR; + + iirHeadBumpCR += (inputSampleR * 0.05); + iirHeadBumpCR -= (iirHeadBumpCR * iirHeadBumpCR * iirHeadBumpCR * HeadBumpFreq); + iirHeadBumpCR = (randy * iirHeadBumpAR) + (randy * iirHeadBumpBR) + (invrandy * iirHeadBumpCR); + break; + } + flip++; //increment the triplet counter + + SubtractL = HighsSampleL; + bridgerectifierL = fabs(SubtractL)*1.57079633; + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = 1-cos(bridgerectifierL); + if (SubtractL > 0) SubtractL = bridgerectifierL; + if (SubtractL < 0) SubtractL = -bridgerectifierL; + inputSampleL -= SubtractL; + + SubtractR = HighsSampleR; + bridgerectifierR = fabs(SubtractR)*1.57079633; + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = 1-cos(bridgerectifierR); + if (SubtractR > 0) SubtractR = bridgerectifierR; + if (SubtractR < 0) SubtractR = -bridgerectifierR; + inputSampleR -= SubtractR; + //Soften works using the MidRoller stuff, defining a bright parallel channel that we apply negative Density + //to, and then subtract from the main audio. That makes the 'highs channel subtract' hit only the loudest + //transients, plus we are subtracting any artifacts we got from the negative Density. + + bridgerectifierL = fabs(inputSampleL); + if (bridgerectifierL > 1.57079633) bridgerectifierL = 1.57079633; + bridgerectifierL = sin(bridgerectifierL); + if (inputSampleL > 0) inputSampleL = bridgerectifierL; + if (inputSampleL < 0) inputSampleL = -bridgerectifierL; + + bridgerectifierR = fabs(inputSampleR); + if (bridgerectifierR > 1.57079633) bridgerectifierR = 1.57079633; + bridgerectifierR = sin(bridgerectifierR); + if (inputSampleR > 0) inputSampleR = bridgerectifierR; + if (inputSampleR < 0) inputSampleR = -bridgerectifierR; + //drive section: the tape sound includes a very gentle saturation curve, which is always an attenuation. + //we cut back on highs before hitting this, and then we're going to subtract highs a second time after. + + HeadBumpL = iirHeadBumpAL + iirHeadBumpBL + iirHeadBumpCL; + HeadBumpR = iirHeadBumpAR + iirHeadBumpBR + iirHeadBumpCR; + //begin PhaseNudge + allpasstemp = hcount - 1; + if (allpasstemp < 0 || allpasstemp > maxdelay) {allpasstemp = maxdelay;} + + HeadBumpL -= eL[allpasstemp] * fpOld; + eL[hcount] = HeadBumpL; + inputSampleL *= fpOld; + + HeadBumpR -= eR[allpasstemp] * fpOld; + eR[hcount] = HeadBumpR; + inputSampleR *= fpOld; + + hcount--; if (hcount < 0 || hcount > maxdelay) {hcount = maxdelay;} + HeadBumpL += (eL[hcount]); + HeadBumpR += (eR[hcount]); + //end PhaseNudge on head bump in lieu of delay. + SubtractL -= (HeadBumpL * (HeadBumpControl+iirMinHeadBumpL)); + SubtractR -= (HeadBumpR * (HeadBumpControl+iirMinHeadBumpR)); + //makes a second soften and a single head bump after saturation. + //we are going to retain this, and then feed it into the highpass filter. That way, we can skip a subtract. + //Head Bump retains a trace which is roughly as large as what the highpass will do. + + tempSampleL = inputSampleL; + tempSampleR = inputSampleR; + + iirMinHeadBumpL = (iirMinHeadBumpL * altHBoostAmount) + (fabs(inputSampleL) * iirHBoostAmount); + if (iirMinHeadBumpL > 0.01) iirMinHeadBumpL = 0.01; + + iirMinHeadBumpR = (iirMinHeadBumpR * altHBoostAmount) + (fabs(inputSampleR) * iirHBoostAmount); + if (iirMinHeadBumpR > 0.01) iirMinHeadBumpR = 0.01; + //we want this one rectified so that it's a relatively steady positive value. Boosts can cause it to be + //greater than 1 so we clamp it in that case. + + iirSampleAL = (iirSampleAL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleAL; SubtractL += iirSampleAL; + iirSampleBL = (iirSampleBL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleBL; SubtractL += iirSampleBL; + iirSampleCL = (iirSampleCL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleCL; SubtractL += iirSampleCL; + iirSampleDL = (iirSampleDL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleDL; SubtractL += iirSampleDL; + iirSampleEL = (iirSampleEL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleEL; SubtractL += iirSampleEL; + iirSampleFL = (iirSampleFL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleFL; SubtractL += iirSampleFL; + iirSampleGL = (iirSampleGL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleGL; SubtractL += iirSampleGL; + iirSampleHL = (iirSampleHL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleHL; SubtractL += iirSampleHL; + iirSampleIL = (iirSampleIL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleIL; SubtractL += iirSampleIL; + iirSampleJL = (iirSampleJL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleJL; SubtractL += iirSampleJL; + iirSampleKL = (iirSampleKL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleKL; SubtractL += iirSampleKL; + iirSampleLL = (iirSampleLL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleLL; SubtractL += iirSampleLL; + iirSampleML = (iirSampleML * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleML; SubtractL += iirSampleML; + iirSampleNL = (iirSampleNL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleNL; SubtractL += iirSampleNL; + iirSampleOL = (iirSampleOL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleOL; SubtractL += iirSampleOL; + iirSamplePL = (iirSamplePL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSamplePL; SubtractL += iirSamplePL; + iirSampleQL = (iirSampleQL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleQL; SubtractL += iirSampleQL; + iirSampleRL = (iirSampleRL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleRL; SubtractL += iirSampleRL; + iirSampleSL = (iirSampleSL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleSL; SubtractL += iirSampleSL; + iirSampleTL = (iirSampleTL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleTL; SubtractL += iirSampleTL; + iirSampleUL = (iirSampleUL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleUL; SubtractL += iirSampleUL; + iirSampleVL = (iirSampleVL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleVL; SubtractL += iirSampleVL; + iirSampleWL = (iirSampleWL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleWL; SubtractL += iirSampleWL; + iirSampleXL = (iirSampleXL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleXL; SubtractL += iirSampleXL; + iirSampleYL = (iirSampleYL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleYL; SubtractL += iirSampleYL; + iirSampleZL = (iirSampleZL * altAmount) + (tempSampleL * iirAmount); tempSampleL -= iirSampleZL; SubtractL += iirSampleZL; + + iirSampleAR = (iirSampleAR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleAR; SubtractR += iirSampleAR; + iirSampleBR = (iirSampleBR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleBR; SubtractR += iirSampleBR; + iirSampleCR = (iirSampleCR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleCR; SubtractR += iirSampleCR; + iirSampleDR = (iirSampleDR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleDR; SubtractR += iirSampleDR; + iirSampleER = (iirSampleER * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleER; SubtractR += iirSampleER; + iirSampleFR = (iirSampleFR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleFR; SubtractR += iirSampleFR; + iirSampleGR = (iirSampleGR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleGR; SubtractR += iirSampleGR; + iirSampleHR = (iirSampleHR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleHR; SubtractR += iirSampleHR; + iirSampleIR = (iirSampleIR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleIR; SubtractR += iirSampleIR; + iirSampleJR = (iirSampleJR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleJR; SubtractR += iirSampleJR; + iirSampleKR = (iirSampleKR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleKR; SubtractR += iirSampleKR; + iirSampleLR = (iirSampleLR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleLR; SubtractR += iirSampleLR; + iirSampleMR = (iirSampleMR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleMR; SubtractR += iirSampleMR; + iirSampleNR = (iirSampleNR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleNR; SubtractR += iirSampleNR; + iirSampleOR = (iirSampleOR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleOR; SubtractR += iirSampleOR; + iirSamplePR = (iirSamplePR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSamplePR; SubtractR += iirSamplePR; + iirSampleQR = (iirSampleQR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleQR; SubtractR += iirSampleQR; + iirSampleRR = (iirSampleRR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleRR; SubtractR += iirSampleRR; + iirSampleSR = (iirSampleSR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleSR; SubtractR += iirSampleSR; + iirSampleTR = (iirSampleTR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleTR; SubtractR += iirSampleTR; + iirSampleUR = (iirSampleUR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleUR; SubtractR += iirSampleUR; + iirSampleVR = (iirSampleVR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleVR; SubtractR += iirSampleVR; + iirSampleWR = (iirSampleWR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleWR; SubtractR += iirSampleWR; + iirSampleXR = (iirSampleXR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleXR; SubtractR += iirSampleXR; + iirSampleYR = (iirSampleYR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleYR; SubtractR += iirSampleYR; + iirSampleZR = (iirSampleZR * altAmount) + (tempSampleR * iirAmount); tempSampleR -= iirSampleZR; SubtractR += iirSampleZR; + //do the IIR on a dummy sample, and store up the correction in a variable at the same scale as the very low level + //numbers being used. Don't keep doing it against the possibly high level signal number. + //This has been known to add a resonant quality to the cutoff, which we're using on purpose. + + inputSampleL -= SubtractL; + inputSampleR -= SubtractR; + //apply stored up tiny corrections. + + if (outputgain != 1.0) { + inputSampleL *= outputgain; + inputSampleR *= outputgain; + } + + if (wet !=1.0) { + inputSampleL = (inputSampleL * wet) + (drySampleL * dry); + inputSampleR = (inputSampleR * wet) + (drySampleR * dry); + } + + //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/ToTape5/VSTProject.sln b/plugins/WinVST/ToTape5/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ToTape5/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/ToTape5/VSTProject.vcxproj b/plugins/WinVST/ToTape5/VSTProject.vcxproj new file mode 100755 index 0000000..acec5ef --- /dev/null +++ b/plugins/WinVST/ToTape5/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ToTape5.cpp" />
+ <ClCompile Include="ToTape5Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ToTape5.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ToTape564</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToTape5/VSTProject.vcxproj.filters b/plugins/WinVST/ToTape5/VSTProject.vcxproj.filters new file mode 100755 index 0000000..e31d0c2 --- /dev/null +++ b/plugins/WinVST/ToTape5/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToTape5.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToTape5Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ToTape5.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToTape5/VSTProject.vcxproj.user b/plugins/WinVST/ToTape5/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ToTape5/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToTape5/vstplug.def b/plugins/WinVST/ToTape5/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ToTape5/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ToVinyl4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ToVinyl4/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ToVinyl4/.vs/VSTProject/v14/.suo b/plugins/WinVST/ToVinyl4/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..33b5837 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4.cpp b/plugins/WinVST/ToVinyl4/ToVinyl4.cpp new file mode 100755 index 0000000..b0c91f8 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/ToVinyl4.cpp @@ -0,0 +1,217 @@ +/* ======================================== + * ToVinyl4 - ToVinyl4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToVinyl4_H +#include "ToVinyl4.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ToVinyl4(audioMaster);} + +ToVinyl4::ToVinyl4(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + for(int count = 0; count < 11; count++) { + aMid[count] = 0.0; + bMid[count] = 0.0; + fMid[count] = 0.0; + aSide[count] = 0.0; + bSide[count] = 0.0; + fSide[count] = 0.0; + } + aMidPrev = 0.0; aSidePrev = 0.0; + bMidPrev = 0.0; bSidePrev = 0.0; + ataLastOutL = ataLastOutR = 0.0; + midSampleA = 0.0; + midSampleB = 0.0; + midSampleC = 0.0; + midSampleD = 0.0; + midSampleE = 0.0; + midSampleF = 0.0; + midSampleG = 0.0; + midSampleH = 0.0; + midSampleI = 0.0; + midSampleJ = 0.0; + midSampleK = 0.0; + midSampleL = 0.0; + midSampleM = 0.0; + midSampleN = 0.0; + midSampleO = 0.0; + midSampleP = 0.0; + midSampleQ = 0.0; + midSampleR = 0.0; + midSampleS = 0.0; + midSampleT = 0.0; + midSampleU = 0.0; + midSampleV = 0.0; + midSampleW = 0.0; + midSampleX = 0.0; + midSampleY = 0.0; + midSampleZ = 0.0; + + sideSampleA = 0.0; + sideSampleB = 0.0; + sideSampleC = 0.0; + sideSampleD = 0.0; + sideSampleE = 0.0; + sideSampleF = 0.0; + sideSampleG = 0.0; + sideSampleH = 0.0; + sideSampleI = 0.0; + sideSampleJ = 0.0; + sideSampleK = 0.0; + sideSampleL = 0.0; + sideSampleM = 0.0; + sideSampleN = 0.0; + sideSampleO = 0.0; + sideSampleP = 0.0; + sideSampleQ = 0.0; + sideSampleR = 0.0; + sideSampleS = 0.0; + sideSampleT = 0.0; + sideSampleU = 0.0; + sideSampleV = 0.0; + sideSampleW = 0.0; + sideSampleX = 0.0; + sideSampleY = 0.0; + sideSampleZ = 0.0; + s1L = s2L = s3L = 0.0; + o1L = o2L = o3L = 0.0; + m1L = m2L = desL = 0.0; + s1R = s2R = s3R = 0.0; + o1R = o2R = o3R = 0.0; + m1R = m2R = desR = 0.0; + + A = 0.203419; //22.0 hz = ((A*A)*290)+10 (A*A)*290 = 12 (A*A) = 0.0413793 sqrt() = 0.203419 + B = 0.3424051; //44.0 hz = ((B*B)*290)+10 (B*B)*290 = 34 (B*B) = 0.1172413 sqrt() = 0.3424051 + C = 0.32; + D = 0.064; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +ToVinyl4::~ToVinyl4() {} +VstInt32 ToVinyl4::getVendorVersion () {return 1000;} +void ToVinyl4::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ToVinyl4::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 ToVinyl4::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + chunkData[0] = A; + chunkData[1] = B; + chunkData[2] = C; + chunkData[3] = D; + /* 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 ToVinyl4::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + float *chunkData = (float *)data; + A = pinParameter(chunkData[0]); + B = pinParameter(chunkData[1]); + C = pinParameter(chunkData[2]); + D = pinParameter(chunkData[3]); + /* 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 ToVinyl4::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + case kParamC: C = value; break; + case kParamD: D = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ToVinyl4::getParameter(VstInt32 index) { + switch (index) { + case kParamA: return A; break; + case kParamB: return B; break; + case kParamC: return C; break; + case kParamD: return D; 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 ToVinyl4::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Mid HiP", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "SideHiP", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "H Limit", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "Gv Wear", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ToVinyl4::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (((A*A)*290.0)+10.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string (((B*B)*290.0)+10.0, text, kVstMaxParamStrLen); break; + case kParamC: float2string (C, text, kVstMaxParamStrLen); break; + case kParamD: float2string (D, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void ToVinyl4::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "hz", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "hz", kVstMaxParamStrLen); break; + case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break; + case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ToVinyl4::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ToVinyl4::getEffectName(char* name) { + vst_strncpy(name, "ToVinyl4", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ToVinyl4::getPlugCategory() {return kPlugCategEffect;} + +bool ToVinyl4::getProductString(char* text) { + vst_strncpy (text, "airwindows ToVinyl4", kVstMaxProductStrLen); return true; +} + +bool ToVinyl4::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4.h b/plugins/WinVST/ToVinyl4/ToVinyl4.h new file mode 100755 index 0000000..57bffac --- /dev/null +++ b/plugins/WinVST/ToVinyl4/ToVinyl4.h @@ -0,0 +1,158 @@ +/* ======================================== + * ToVinyl4 - ToVinyl4.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ToVinyl4_H +#define __ToVinyl4_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kParamC = 2, + kParamD = 3, + kNumParameters = 4 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'tovb'; //Change this to what the AU identity is! + +class ToVinyl4 : + public AudioEffectX +{ +public: + ToVinyl4(audioMasterCallback audioMaster); + ~ToVinyl4(); + 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 ataLastOutL; + double ataLastOutR; + + double s1L; + double s2L; + double s3L; + double o1L; + double o2L; + double o3L; + double m1L; + double m2L; + double s1R; + double s2R; + double s3R; + double o1R; + double o2R; + double o3R; + double m1R; + double m2R; + double desL; + double desR; + + double midSampleA; + double midSampleB; + double midSampleC; + double midSampleD; + double midSampleE; + double midSampleF; + double midSampleG; + double midSampleH; + double midSampleI; + double midSampleJ; + double midSampleK; + double midSampleL; + double midSampleM; + double midSampleN; + double midSampleO; + double midSampleP; + double midSampleQ; + double midSampleR; + double midSampleS; + double midSampleT; + double midSampleU; + double midSampleV; + double midSampleW; + double midSampleX; + double midSampleY; + double midSampleZ; + + double sideSampleA; + double sideSampleB; + double sideSampleC; + double sideSampleD; + double sideSampleE; + double sideSampleF; + double sideSampleG; + double sideSampleH; + double sideSampleI; + double sideSampleJ; + double sideSampleK; + double sideSampleL; + double sideSampleM; + double sideSampleN; + double sideSampleO; + double sideSampleP; + double sideSampleQ; + double sideSampleR; + double sideSampleS; + double sideSampleT; + double sideSampleU; + double sideSampleV; + double sideSampleW; + double sideSampleX; + double sideSampleY; + double sideSampleZ; + + double aMid[11]; + double bMid[11]; + double fMid[11]; + double aSide[11]; + double bSide[11]; + double fSide[11]; + double aMidPrev; + double aSidePrev; + double bMidPrev; + double bSidePrev; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + float C; + float D; +}; + +#endif diff --git a/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp b/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp new file mode 100755 index 0000000..8d9dc0c --- /dev/null +++ b/plugins/WinVST/ToVinyl4/ToVinyl4Proc.cpp @@ -0,0 +1,981 @@ +/* ======================================== + * ToVinyl4 - ToVinyl4.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToVinyl4_H +#include "ToVinyl4.h" +#endif + +void ToVinyl4::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; + + double fusswithscale = 50000; //corrected + double cutofffreq = ((A*A)*290.0)+10.0; + double resonance = 0.992; + + double midAmount = cutofffreq/fusswithscale; + midAmount /= overallscale; + + double midAmountA = midAmount * resonance; + double midAmountB = midAmountA * resonance; + double midAmountC = midAmountB * resonance; + double midAmountD = midAmountC * resonance; + double midAmountE = midAmountD * resonance; + double midAmountF = midAmountE * resonance; + double midAmountG = midAmountF * resonance; + double midAmountH = midAmountG * resonance; + double midAmountI = midAmountH * resonance; + double midAmountJ = midAmountI * resonance; + double midAmountK = midAmountJ * resonance; + double midAmountL = midAmountK * resonance; + double midAmountM = midAmountL * resonance; + double midAmountN = midAmountM * resonance; + double midAmountO = midAmountN * resonance; + double midAmountP = midAmountO * resonance; + double midAmountQ = midAmountP * resonance; + double midAmountR = midAmountQ * resonance; + double midAmountS = midAmountR * resonance; + double midAmountT = midAmountS * resonance; + double midAmountU = midAmountT * resonance; + double midAmountV = midAmountU * resonance; + double midAmountW = midAmountV * resonance; + double midAmountX = midAmountW * resonance; + double midAmountY = midAmountX * resonance; + double midAmountZ = midAmountY * resonance; + + + double midaltAmountA = 1.0 - midAmountA; + double midaltAmountB = 1.0 - midAmountB; + double midaltAmountC = 1.0 - midAmountC; + double midaltAmountD = 1.0 - midAmountD; + double midaltAmountE = 1.0 - midAmountE; + double midaltAmountF = 1.0 - midAmountF; + double midaltAmountG = 1.0 - midAmountG; + double midaltAmountH = 1.0 - midAmountH; + double midaltAmountI = 1.0 - midAmountI; + double midaltAmountJ = 1.0 - midAmountJ; + double midaltAmountK = 1.0 - midAmountK; + double midaltAmountL = 1.0 - midAmountL; + double midaltAmountM = 1.0 - midAmountM; + double midaltAmountN = 1.0 - midAmountN; + double midaltAmountO = 1.0 - midAmountO; + double midaltAmountP = 1.0 - midAmountP; + double midaltAmountQ = 1.0 - midAmountQ; + double midaltAmountR = 1.0 - midAmountR; + double midaltAmountS = 1.0 - midAmountS; + double midaltAmountT = 1.0 - midAmountT; + double midaltAmountU = 1.0 - midAmountU; + double midaltAmountV = 1.0 - midAmountV; + double midaltAmountW = 1.0 - midAmountW; + double midaltAmountX = 1.0 - midAmountX; + double midaltAmountY = 1.0 - midAmountY; + double midaltAmountZ = 1.0 - midAmountZ; + + cutofffreq = ((B*B)*290.0)+10.0; + double sideAmount = cutofffreq/fusswithscale; + sideAmount /= overallscale; + double sideAmountA = sideAmount * resonance; + double sideAmountB = sideAmountA * resonance; + double sideAmountC = sideAmountB * resonance; + double sideAmountD = sideAmountC * resonance; + double sideAmountE = sideAmountD * resonance; + double sideAmountF = sideAmountE * resonance; + double sideAmountG = sideAmountF * resonance; + double sideAmountH = sideAmountG * resonance; + double sideAmountI = sideAmountH * resonance; + double sideAmountJ = sideAmountI * resonance; + double sideAmountK = sideAmountJ * resonance; + double sideAmountL = sideAmountK * resonance; + double sideAmountM = sideAmountL * resonance; + double sideAmountN = sideAmountM * resonance; + double sideAmountO = sideAmountN * resonance; + double sideAmountP = sideAmountO * resonance; + double sideAmountQ = sideAmountP * resonance; + double sideAmountR = sideAmountQ * resonance; + double sideAmountS = sideAmountR * resonance; + double sideAmountT = sideAmountS * resonance; + double sideAmountU = sideAmountT * resonance; + double sideAmountV = sideAmountU * resonance; + double sideAmountW = sideAmountV * resonance; + double sideAmountX = sideAmountW * resonance; + double sideAmountY = sideAmountX * resonance; + double sideAmountZ = sideAmountY * resonance; + + + double sidealtAmountA = 1.0 - sideAmountA; + double sidealtAmountB = 1.0 - sideAmountB; + double sidealtAmountC = 1.0 - sideAmountC; + double sidealtAmountD = 1.0 - sideAmountD; + double sidealtAmountE = 1.0 - sideAmountE; + double sidealtAmountF = 1.0 - sideAmountF; + double sidealtAmountG = 1.0 - sideAmountG; + double sidealtAmountH = 1.0 - sideAmountH; + double sidealtAmountI = 1.0 - sideAmountI; + double sidealtAmountJ = 1.0 - sideAmountJ; + double sidealtAmountK = 1.0 - sideAmountK; + double sidealtAmountL = 1.0 - sideAmountL; + double sidealtAmountM = 1.0 - sideAmountM; + double sidealtAmountN = 1.0 - sideAmountN; + double sidealtAmountO = 1.0 - sideAmountO; + double sidealtAmountP = 1.0 - sideAmountP; + double sidealtAmountQ = 1.0 - sideAmountQ; + double sidealtAmountR = 1.0 - sideAmountR; + double sidealtAmountS = 1.0 - sideAmountS; + double sidealtAmountT = 1.0 - sideAmountT; + double sidealtAmountU = 1.0 - sideAmountU; + double sidealtAmountV = 1.0 - sideAmountV; + double sidealtAmountW = 1.0 - sideAmountW; + double sidealtAmountX = 1.0 - sideAmountX; + double sidealtAmountY = 1.0 - sideAmountY; + double sidealtAmountZ = 1.0 - sideAmountZ; + double tempMid; + double tempSide; + + double intensity = pow(C,3)*(32/overallscale); + double inputSampleL; + double inputSampleR; + double senseL; + double senseR; + double smoothL; + double smoothR; + double mid; + double side; + + overallscale = (D*9.0)+1.0; + double gain = overallscale; + //mid groove wear + if (gain > 1.0) {fMid[0] = 1.0; gain -= 1.0;} else {fMid[0] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[1] = 1.0; gain -= 1.0;} else {fMid[1] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[2] = 1.0; gain -= 1.0;} else {fMid[2] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[3] = 1.0; gain -= 1.0;} else {fMid[3] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[4] = 1.0; gain -= 1.0;} else {fMid[4] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[5] = 1.0; gain -= 1.0;} else {fMid[5] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[6] = 1.0; gain -= 1.0;} else {fMid[6] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[7] = 1.0; gain -= 1.0;} else {fMid[7] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[8] = 1.0; gain -= 1.0;} else {fMid[8] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[9] = 1.0; gain -= 1.0;} else {fMid[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + fMid[0] /= overallscale; + fMid[1] /= overallscale; + fMid[2] /= overallscale; + fMid[3] /= overallscale; + fMid[4] /= overallscale; + fMid[5] /= overallscale; + fMid[6] /= overallscale; + fMid[7] /= overallscale; + fMid[8] /= overallscale; + fMid[9] /= overallscale; + //and now it's neatly scaled, too + + overallscale = (D*4.5)+1.0; + gain = overallscale; + //side groove wear + if (gain > 1.0) {fSide[0] = 1.0; gain -= 1.0;} else {fSide[0] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[1] = 1.0; gain -= 1.0;} else {fSide[1] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[2] = 1.0; gain -= 1.0;} else {fSide[2] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[3] = 1.0; gain -= 1.0;} else {fSide[3] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[4] = 1.0; gain -= 1.0;} else {fSide[4] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[5] = 1.0; gain -= 1.0;} else {fSide[5] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[6] = 1.0; gain -= 1.0;} else {fSide[6] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[7] = 1.0; gain -= 1.0;} else {fSide[7] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[8] = 1.0; gain -= 1.0;} else {fSide[8] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[9] = 1.0; gain -= 1.0;} else {fSide[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + fSide[0] /= overallscale; + fSide[1] /= overallscale; + fSide[2] /= overallscale; + fSide[3] /= overallscale; + fSide[4] /= overallscale; + fSide[5] /= overallscale; + fSide[6] /= overallscale; + fSide[7] /= overallscale; + fSide[8] /= overallscale; + fSide[9] /= overallscale; + //and now it's neatly scaled, too + + double tempSample; + double accumulatorSample; + double midCorrection; + double sideCorrection; + double correction; + + + 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. + } + + s3L = s2L; + s2L = s1L; + s1L = inputSampleL; + smoothL = (s3L + s2L + s1L) / 3.0; + m1L = (s1L-s2L)*((s1L-s2L)/1.3); + m2L = (s2L-s3L)*((s1L-s2L)/1.3); + senseL = fabs(m1L-m2L); + senseL = (intensity*intensity*senseL); + o3L = o2L; + o2L = o1L; + o1L = senseL; + if (o2L > senseL) senseL = o2L; + if (o3L > senseL) senseL = o3L; + //sense on the most intense + + s3R = s2R; + s2R = s1R; + s1R = inputSampleR; + smoothR = (s3R + s2R + s1R) / 3.0; + m1R = (s1R-s2R)*((s1R-s2R)/1.3); + m2R = (s2R-s3R)*((s1R-s2R)/1.3); + senseR = fabs(m1R-m2R); + senseR = (intensity*intensity*senseR); + o3R = o2R; + o2R = o1R; + o1R = senseR; + if (o2R > senseR) senseR = o2R; + if (o3R > senseR) senseR = o3R; + //sense on the most intense + + + if (senseL > 1.0) senseL = 1.0; + if (senseR > 1.0) senseR = 1.0; + + inputSampleL *= (1.0-senseL); + inputSampleR *= (1.0-senseR); + + inputSampleL += (smoothL*senseL); + inputSampleR += (smoothR*senseR); + //we need to do the de-ess before anything else, and feed the result into the antialiasing- + //but the trigger runs off just the input samples + + tempMid = mid = inputSampleL + inputSampleR; + tempSide = side = inputSampleL - inputSampleR; + //assign mid and side. + + tempSample = mid; + midSampleA = (midSampleA * midaltAmountA) + (tempSample * midAmountA); tempSample -= midSampleA; + midSampleB = (midSampleB * midaltAmountB) + (tempSample * midAmountB); tempSample -= midSampleB; + midSampleC = (midSampleC * midaltAmountC) + (tempSample * midAmountC); tempSample -= midSampleC; + midSampleD = (midSampleD * midaltAmountD) + (tempSample * midAmountD); tempSample -= midSampleD; + midSampleE = (midSampleE * midaltAmountE) + (tempSample * midAmountE); tempSample -= midSampleE; + midSampleF = (midSampleF * midaltAmountF) + (tempSample * midAmountF); tempSample -= midSampleF; + midSampleG = (midSampleG * midaltAmountG) + (tempSample * midAmountG); tempSample -= midSampleG; + midSampleH = (midSampleH * midaltAmountH) + (tempSample * midAmountH); tempSample -= midSampleH; + midSampleI = (midSampleI * midaltAmountI) + (tempSample * midAmountI); tempSample -= midSampleI; + midSampleJ = (midSampleJ * midaltAmountJ) + (tempSample * midAmountJ); tempSample -= midSampleJ; + midSampleK = (midSampleK * midaltAmountK) + (tempSample * midAmountK); tempSample -= midSampleK; + midSampleL = (midSampleL * midaltAmountL) + (tempSample * midAmountL); tempSample -= midSampleL; + midSampleM = (midSampleM * midaltAmountM) + (tempSample * midAmountM); tempSample -= midSampleM; + midSampleN = (midSampleN * midaltAmountN) + (tempSample * midAmountN); tempSample -= midSampleN; + midSampleO = (midSampleO * midaltAmountO) + (tempSample * midAmountO); tempSample -= midSampleO; + midSampleP = (midSampleP * midaltAmountP) + (tempSample * midAmountP); tempSample -= midSampleP; + midSampleQ = (midSampleQ * midaltAmountQ) + (tempSample * midAmountQ); tempSample -= midSampleQ; + midSampleR = (midSampleR * midaltAmountR) + (tempSample * midAmountR); tempSample -= midSampleR; + midSampleS = (midSampleS * midaltAmountS) + (tempSample * midAmountS); tempSample -= midSampleS; + midSampleT = (midSampleT * midaltAmountT) + (tempSample * midAmountT); tempSample -= midSampleT; + midSampleU = (midSampleU * midaltAmountU) + (tempSample * midAmountU); tempSample -= midSampleU; + midSampleV = (midSampleV * midaltAmountV) + (tempSample * midAmountV); tempSample -= midSampleV; + midSampleW = (midSampleW * midaltAmountW) + (tempSample * midAmountW); tempSample -= midSampleW; + midSampleX = (midSampleX * midaltAmountX) + (tempSample * midAmountX); tempSample -= midSampleX; + midSampleY = (midSampleY * midaltAmountY) + (tempSample * midAmountY); tempSample -= midSampleY; + midSampleZ = (midSampleZ * midaltAmountZ) + (tempSample * midAmountZ); tempSample -= midSampleZ; + correction = midCorrection = mid - tempSample; + mid -= correction; + + tempSample = side; + sideSampleA = (sideSampleA * sidealtAmountA) + (tempSample * sideAmountA); tempSample -= sideSampleA; + sideSampleB = (sideSampleB * sidealtAmountB) + (tempSample * sideAmountB); tempSample -= sideSampleB; + sideSampleC = (sideSampleC * sidealtAmountC) + (tempSample * sideAmountC); tempSample -= sideSampleC; + sideSampleD = (sideSampleD * sidealtAmountD) + (tempSample * sideAmountD); tempSample -= sideSampleD; + sideSampleE = (sideSampleE * sidealtAmountE) + (tempSample * sideAmountE); tempSample -= sideSampleE; + sideSampleF = (sideSampleF * sidealtAmountF) + (tempSample * sideAmountF); tempSample -= sideSampleF; + sideSampleG = (sideSampleG * sidealtAmountG) + (tempSample * sideAmountG); tempSample -= sideSampleG; + sideSampleH = (sideSampleH * sidealtAmountH) + (tempSample * sideAmountH); tempSample -= sideSampleH; + sideSampleI = (sideSampleI * sidealtAmountI) + (tempSample * sideAmountI); tempSample -= sideSampleI; + sideSampleJ = (sideSampleJ * sidealtAmountJ) + (tempSample * sideAmountJ); tempSample -= sideSampleJ; + sideSampleK = (sideSampleK * sidealtAmountK) + (tempSample * sideAmountK); tempSample -= sideSampleK; + sideSampleL = (sideSampleL * sidealtAmountL) + (tempSample * sideAmountL); tempSample -= sideSampleL; + sideSampleM = (sideSampleM * sidealtAmountM) + (tempSample * sideAmountM); tempSample -= sideSampleM; + sideSampleN = (sideSampleN * sidealtAmountN) + (tempSample * sideAmountN); tempSample -= sideSampleN; + sideSampleO = (sideSampleO * sidealtAmountO) + (tempSample * sideAmountO); tempSample -= sideSampleO; + sideSampleP = (sideSampleP * sidealtAmountP) + (tempSample * sideAmountP); tempSample -= sideSampleP; + sideSampleQ = (sideSampleQ * sidealtAmountQ) + (tempSample * sideAmountQ); tempSample -= sideSampleQ; + sideSampleR = (sideSampleR * sidealtAmountR) + (tempSample * sideAmountR); tempSample -= sideSampleR; + sideSampleS = (sideSampleS * sidealtAmountS) + (tempSample * sideAmountS); tempSample -= sideSampleS; + sideSampleT = (sideSampleT * sidealtAmountT) + (tempSample * sideAmountT); tempSample -= sideSampleT; + sideSampleU = (sideSampleU * sidealtAmountU) + (tempSample * sideAmountU); tempSample -= sideSampleU; + sideSampleV = (sideSampleV * sidealtAmountV) + (tempSample * sideAmountV); tempSample -= sideSampleV; + sideSampleW = (sideSampleW * sidealtAmountW) + (tempSample * sideAmountW); tempSample -= sideSampleW; + sideSampleX = (sideSampleX * sidealtAmountX) + (tempSample * sideAmountX); tempSample -= sideSampleX; + sideSampleY = (sideSampleY * sidealtAmountY) + (tempSample * sideAmountY); tempSample -= sideSampleY; + sideSampleZ = (sideSampleZ * sidealtAmountZ) + (tempSample * sideAmountZ); tempSample -= sideSampleZ; + correction = sideCorrection = side - tempSample; + side -= correction; + + + aMid[9] = aMid[8]; aMid[8] = aMid[7]; aMid[7] = aMid[6]; aMid[6] = aMid[5]; + aMid[5] = aMid[4]; aMid[4] = aMid[3]; aMid[3] = aMid[2]; aMid[2] = aMid[1]; + aMid[1] = aMid[0]; aMid[0] = accumulatorSample = (mid-aMidPrev); + + accumulatorSample *= fMid[0]; + accumulatorSample += (aMid[1] * fMid[1]); + accumulatorSample += (aMid[2] * fMid[2]); + accumulatorSample += (aMid[3] * fMid[3]); + accumulatorSample += (aMid[4] * fMid[4]); + accumulatorSample += (aMid[5] * fMid[5]); + accumulatorSample += (aMid[6] * fMid[6]); + accumulatorSample += (aMid[7] * fMid[7]); + accumulatorSample += (aMid[8] * fMid[8]); + accumulatorSample += (aMid[9] * fMid[9]); + //we are doing our repetitive calculations on a separate value + correction = (mid-aMidPrev) - accumulatorSample; + midCorrection += correction; + aMidPrev = mid; + mid -= correction; + + aSide[9] = aSide[8]; aSide[8] = aSide[7]; aSide[7] = aSide[6]; aSide[6] = aSide[5]; + aSide[5] = aSide[4]; aSide[4] = aSide[3]; aSide[3] = aSide[2]; aSide[2] = aSide[1]; + aSide[1] = aSide[0]; aSide[0] = accumulatorSample = (side-aSidePrev); + + accumulatorSample *= fSide[0]; + accumulatorSample += (aSide[1] * fSide[1]); + accumulatorSample += (aSide[2] * fSide[2]); + accumulatorSample += (aSide[3] * fSide[3]); + accumulatorSample += (aSide[4] * fSide[4]); + accumulatorSample += (aSide[5] * fSide[5]); + accumulatorSample += (aSide[6] * fSide[6]); + accumulatorSample += (aSide[7] * fSide[7]); + accumulatorSample += (aSide[8] * fSide[8]); + accumulatorSample += (aSide[9] * fSide[9]); + //we are doing our repetitive calculations on a separate value + correction = (side-aSidePrev) - accumulatorSample; + sideCorrection += correction; + aSidePrev = side; + side -= correction; + + + bMid[9] = bMid[8]; bMid[8] = bMid[7]; bMid[7] = bMid[6]; bMid[6] = bMid[5]; + bMid[5] = bMid[4]; bMid[4] = bMid[3]; bMid[3] = bMid[2]; bMid[2] = bMid[1]; + bMid[1] = bMid[0]; bMid[0] = accumulatorSample = (mid-bMidPrev); + + accumulatorSample *= fMid[0]; + accumulatorSample += (bMid[1] * fMid[1]); + accumulatorSample += (bMid[2] * fMid[2]); + accumulatorSample += (bMid[3] * fMid[3]); + accumulatorSample += (bMid[4] * fMid[4]); + accumulatorSample += (bMid[5] * fMid[5]); + accumulatorSample += (bMid[6] * fMid[6]); + accumulatorSample += (bMid[7] * fMid[7]); + accumulatorSample += (bMid[8] * fMid[8]); + accumulatorSample += (bMid[9] * fMid[9]); + //we are doing our repetitive calculations on a separate value + correction = (mid-bMidPrev) - accumulatorSample; + midCorrection += correction; + bMidPrev = mid; + + bSide[9] = bSide[8]; bSide[8] = bSide[7]; bSide[7] = bSide[6]; bSide[6] = bSide[5]; + bSide[5] = bSide[4]; bSide[4] = bSide[3]; bSide[3] = bSide[2]; bSide[2] = bSide[1]; + bSide[1] = bSide[0]; bSide[0] = accumulatorSample = (side-bSidePrev); + + accumulatorSample *= fSide[0]; + accumulatorSample += (bSide[1] * fSide[1]); + accumulatorSample += (bSide[2] * fSide[2]); + accumulatorSample += (bSide[3] * fSide[3]); + accumulatorSample += (bSide[4] * fSide[4]); + accumulatorSample += (bSide[5] * fSide[5]); + accumulatorSample += (bSide[6] * fSide[6]); + accumulatorSample += (bSide[7] * fSide[7]); + accumulatorSample += (bSide[8] * fSide[8]); + accumulatorSample += (bSide[9] * fSide[9]); + //we are doing our repetitive calculations on a separate value + correction = (side-bSidePrev) - accumulatorSample; + sideCorrection += correction; + bSidePrev = side; + + + mid = tempMid - midCorrection; + side = tempSide - sideCorrection; + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + senseL /= 2.0; + senseR /= 2.0; + + + accumulatorSample = (ataLastOutL*senseL)+(inputSampleL*(1.0-senseL)); + ataLastOutL = inputSampleL; + inputSampleL = accumulatorSample; + + accumulatorSample = (ataLastOutR*senseR)+(inputSampleR*(1.0-senseR)); + ataLastOutR = inputSampleR; + inputSampleR = accumulatorSample; + //we just re-use accumulatorSample to do this little shuffle + + //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 ToVinyl4::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; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double fusswithscale = 50000; //corrected + double cutofffreq = ((A*A)*290.0)+10.0; + double resonance = 0.992; + + double midAmount = cutofffreq/fusswithscale; + midAmount /= overallscale; + + double midAmountA = midAmount * resonance; + double midAmountB = midAmountA * resonance; + double midAmountC = midAmountB * resonance; + double midAmountD = midAmountC * resonance; + double midAmountE = midAmountD * resonance; + double midAmountF = midAmountE * resonance; + double midAmountG = midAmountF * resonance; + double midAmountH = midAmountG * resonance; + double midAmountI = midAmountH * resonance; + double midAmountJ = midAmountI * resonance; + double midAmountK = midAmountJ * resonance; + double midAmountL = midAmountK * resonance; + double midAmountM = midAmountL * resonance; + double midAmountN = midAmountM * resonance; + double midAmountO = midAmountN * resonance; + double midAmountP = midAmountO * resonance; + double midAmountQ = midAmountP * resonance; + double midAmountR = midAmountQ * resonance; + double midAmountS = midAmountR * resonance; + double midAmountT = midAmountS * resonance; + double midAmountU = midAmountT * resonance; + double midAmountV = midAmountU * resonance; + double midAmountW = midAmountV * resonance; + double midAmountX = midAmountW * resonance; + double midAmountY = midAmountX * resonance; + double midAmountZ = midAmountY * resonance; + + + double midaltAmountA = 1.0 - midAmountA; + double midaltAmountB = 1.0 - midAmountB; + double midaltAmountC = 1.0 - midAmountC; + double midaltAmountD = 1.0 - midAmountD; + double midaltAmountE = 1.0 - midAmountE; + double midaltAmountF = 1.0 - midAmountF; + double midaltAmountG = 1.0 - midAmountG; + double midaltAmountH = 1.0 - midAmountH; + double midaltAmountI = 1.0 - midAmountI; + double midaltAmountJ = 1.0 - midAmountJ; + double midaltAmountK = 1.0 - midAmountK; + double midaltAmountL = 1.0 - midAmountL; + double midaltAmountM = 1.0 - midAmountM; + double midaltAmountN = 1.0 - midAmountN; + double midaltAmountO = 1.0 - midAmountO; + double midaltAmountP = 1.0 - midAmountP; + double midaltAmountQ = 1.0 - midAmountQ; + double midaltAmountR = 1.0 - midAmountR; + double midaltAmountS = 1.0 - midAmountS; + double midaltAmountT = 1.0 - midAmountT; + double midaltAmountU = 1.0 - midAmountU; + double midaltAmountV = 1.0 - midAmountV; + double midaltAmountW = 1.0 - midAmountW; + double midaltAmountX = 1.0 - midAmountX; + double midaltAmountY = 1.0 - midAmountY; + double midaltAmountZ = 1.0 - midAmountZ; + + cutofffreq = ((B*B)*290.0)+10.0; + double sideAmount = cutofffreq/fusswithscale; + sideAmount /= overallscale; + double sideAmountA = sideAmount * resonance; + double sideAmountB = sideAmountA * resonance; + double sideAmountC = sideAmountB * resonance; + double sideAmountD = sideAmountC * resonance; + double sideAmountE = sideAmountD * resonance; + double sideAmountF = sideAmountE * resonance; + double sideAmountG = sideAmountF * resonance; + double sideAmountH = sideAmountG * resonance; + double sideAmountI = sideAmountH * resonance; + double sideAmountJ = sideAmountI * resonance; + double sideAmountK = sideAmountJ * resonance; + double sideAmountL = sideAmountK * resonance; + double sideAmountM = sideAmountL * resonance; + double sideAmountN = sideAmountM * resonance; + double sideAmountO = sideAmountN * resonance; + double sideAmountP = sideAmountO * resonance; + double sideAmountQ = sideAmountP * resonance; + double sideAmountR = sideAmountQ * resonance; + double sideAmountS = sideAmountR * resonance; + double sideAmountT = sideAmountS * resonance; + double sideAmountU = sideAmountT * resonance; + double sideAmountV = sideAmountU * resonance; + double sideAmountW = sideAmountV * resonance; + double sideAmountX = sideAmountW * resonance; + double sideAmountY = sideAmountX * resonance; + double sideAmountZ = sideAmountY * resonance; + + + double sidealtAmountA = 1.0 - sideAmountA; + double sidealtAmountB = 1.0 - sideAmountB; + double sidealtAmountC = 1.0 - sideAmountC; + double sidealtAmountD = 1.0 - sideAmountD; + double sidealtAmountE = 1.0 - sideAmountE; + double sidealtAmountF = 1.0 - sideAmountF; + double sidealtAmountG = 1.0 - sideAmountG; + double sidealtAmountH = 1.0 - sideAmountH; + double sidealtAmountI = 1.0 - sideAmountI; + double sidealtAmountJ = 1.0 - sideAmountJ; + double sidealtAmountK = 1.0 - sideAmountK; + double sidealtAmountL = 1.0 - sideAmountL; + double sidealtAmountM = 1.0 - sideAmountM; + double sidealtAmountN = 1.0 - sideAmountN; + double sidealtAmountO = 1.0 - sideAmountO; + double sidealtAmountP = 1.0 - sideAmountP; + double sidealtAmountQ = 1.0 - sideAmountQ; + double sidealtAmountR = 1.0 - sideAmountR; + double sidealtAmountS = 1.0 - sideAmountS; + double sidealtAmountT = 1.0 - sideAmountT; + double sidealtAmountU = 1.0 - sideAmountU; + double sidealtAmountV = 1.0 - sideAmountV; + double sidealtAmountW = 1.0 - sideAmountW; + double sidealtAmountX = 1.0 - sideAmountX; + double sidealtAmountY = 1.0 - sideAmountY; + double sidealtAmountZ = 1.0 - sideAmountZ; + double tempMid; + double tempSide; + + double intensity = pow(C,3)*(32/overallscale); + double inputSampleL; + double inputSampleR; + double senseL; + double senseR; + double smoothL; + double smoothR; + double mid; + double side; + + overallscale = (D*9.0)+1.0; + double gain = overallscale; + //mid groove wear + if (gain > 1.0) {fMid[0] = 1.0; gain -= 1.0;} else {fMid[0] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[1] = 1.0; gain -= 1.0;} else {fMid[1] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[2] = 1.0; gain -= 1.0;} else {fMid[2] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[3] = 1.0; gain -= 1.0;} else {fMid[3] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[4] = 1.0; gain -= 1.0;} else {fMid[4] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[5] = 1.0; gain -= 1.0;} else {fMid[5] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[6] = 1.0; gain -= 1.0;} else {fMid[6] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[7] = 1.0; gain -= 1.0;} else {fMid[7] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[8] = 1.0; gain -= 1.0;} else {fMid[8] = gain; gain = 0.0;} + if (gain > 1.0) {fMid[9] = 1.0; gain -= 1.0;} else {fMid[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + fMid[0] /= overallscale; + fMid[1] /= overallscale; + fMid[2] /= overallscale; + fMid[3] /= overallscale; + fMid[4] /= overallscale; + fMid[5] /= overallscale; + fMid[6] /= overallscale; + fMid[7] /= overallscale; + fMid[8] /= overallscale; + fMid[9] /= overallscale; + //and now it's neatly scaled, too + + overallscale = (D*4.5)+1.0; + gain = overallscale; + //side groove wear + if (gain > 1.0) {fSide[0] = 1.0; gain -= 1.0;} else {fSide[0] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[1] = 1.0; gain -= 1.0;} else {fSide[1] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[2] = 1.0; gain -= 1.0;} else {fSide[2] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[3] = 1.0; gain -= 1.0;} else {fSide[3] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[4] = 1.0; gain -= 1.0;} else {fSide[4] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[5] = 1.0; gain -= 1.0;} else {fSide[5] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[6] = 1.0; gain -= 1.0;} else {fSide[6] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[7] = 1.0; gain -= 1.0;} else {fSide[7] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[8] = 1.0; gain -= 1.0;} else {fSide[8] = gain; gain = 0.0;} + if (gain > 1.0) {fSide[9] = 1.0; gain -= 1.0;} else {fSide[9] = gain; gain = 0.0;} + //there, now we have a neat little moving average with remainders + + if (overallscale < 1.0) overallscale = 1.0; + fSide[0] /= overallscale; + fSide[1] /= overallscale; + fSide[2] /= overallscale; + fSide[3] /= overallscale; + fSide[4] /= overallscale; + fSide[5] /= overallscale; + fSide[6] /= overallscale; + fSide[7] /= overallscale; + fSide[8] /= overallscale; + fSide[9] /= overallscale; + //and now it's neatly scaled, too + + double tempSample; + double accumulatorSample; + double midCorrection; + double sideCorrection; + double correction; + + 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. + } + + s3L = s2L; + s2L = s1L; + s1L = inputSampleL; + smoothL = (s3L + s2L + s1L) / 3.0; + m1L = (s1L-s2L)*((s1L-s2L)/1.3); + m2L = (s2L-s3L)*((s1L-s2L)/1.3); + senseL = fabs(m1L-m2L); + senseL = (intensity*intensity*senseL); + o3L = o2L; + o2L = o1L; + o1L = senseL; + if (o2L > senseL) senseL = o2L; + if (o3L > senseL) senseL = o3L; + //sense on the most intense + + s3R = s2R; + s2R = s1R; + s1R = inputSampleR; + smoothR = (s3R + s2R + s1R) / 3.0; + m1R = (s1R-s2R)*((s1R-s2R)/1.3); + m2R = (s2R-s3R)*((s1R-s2R)/1.3); + senseR = fabs(m1R-m2R); + senseR = (intensity*intensity*senseR); + o3R = o2R; + o2R = o1R; + o1R = senseR; + if (o2R > senseR) senseR = o2R; + if (o3R > senseR) senseR = o3R; + //sense on the most intense + + + if (senseL > 1.0) senseL = 1.0; + if (senseR > 1.0) senseR = 1.0; + + inputSampleL *= (1.0-senseL); + inputSampleR *= (1.0-senseR); + + inputSampleL += (smoothL*senseL); + inputSampleR += (smoothR*senseR); + //we need to do the de-ess before anything else, and feed the result into the antialiasing- + //but the trigger runs off just the input samples + + tempMid = mid = inputSampleL + inputSampleR; + tempSide = side = inputSampleL - inputSampleR; + //assign mid and side. + + tempSample = mid; + midSampleA = (midSampleA * midaltAmountA) + (tempSample * midAmountA); tempSample -= midSampleA; + midSampleB = (midSampleB * midaltAmountB) + (tempSample * midAmountB); tempSample -= midSampleB; + midSampleC = (midSampleC * midaltAmountC) + (tempSample * midAmountC); tempSample -= midSampleC; + midSampleD = (midSampleD * midaltAmountD) + (tempSample * midAmountD); tempSample -= midSampleD; + midSampleE = (midSampleE * midaltAmountE) + (tempSample * midAmountE); tempSample -= midSampleE; + midSampleF = (midSampleF * midaltAmountF) + (tempSample * midAmountF); tempSample -= midSampleF; + midSampleG = (midSampleG * midaltAmountG) + (tempSample * midAmountG); tempSample -= midSampleG; + midSampleH = (midSampleH * midaltAmountH) + (tempSample * midAmountH); tempSample -= midSampleH; + midSampleI = (midSampleI * midaltAmountI) + (tempSample * midAmountI); tempSample -= midSampleI; + midSampleJ = (midSampleJ * midaltAmountJ) + (tempSample * midAmountJ); tempSample -= midSampleJ; + midSampleK = (midSampleK * midaltAmountK) + (tempSample * midAmountK); tempSample -= midSampleK; + midSampleL = (midSampleL * midaltAmountL) + (tempSample * midAmountL); tempSample -= midSampleL; + midSampleM = (midSampleM * midaltAmountM) + (tempSample * midAmountM); tempSample -= midSampleM; + midSampleN = (midSampleN * midaltAmountN) + (tempSample * midAmountN); tempSample -= midSampleN; + midSampleO = (midSampleO * midaltAmountO) + (tempSample * midAmountO); tempSample -= midSampleO; + midSampleP = (midSampleP * midaltAmountP) + (tempSample * midAmountP); tempSample -= midSampleP; + midSampleQ = (midSampleQ * midaltAmountQ) + (tempSample * midAmountQ); tempSample -= midSampleQ; + midSampleR = (midSampleR * midaltAmountR) + (tempSample * midAmountR); tempSample -= midSampleR; + midSampleS = (midSampleS * midaltAmountS) + (tempSample * midAmountS); tempSample -= midSampleS; + midSampleT = (midSampleT * midaltAmountT) + (tempSample * midAmountT); tempSample -= midSampleT; + midSampleU = (midSampleU * midaltAmountU) + (tempSample * midAmountU); tempSample -= midSampleU; + midSampleV = (midSampleV * midaltAmountV) + (tempSample * midAmountV); tempSample -= midSampleV; + midSampleW = (midSampleW * midaltAmountW) + (tempSample * midAmountW); tempSample -= midSampleW; + midSampleX = (midSampleX * midaltAmountX) + (tempSample * midAmountX); tempSample -= midSampleX; + midSampleY = (midSampleY * midaltAmountY) + (tempSample * midAmountY); tempSample -= midSampleY; + midSampleZ = (midSampleZ * midaltAmountZ) + (tempSample * midAmountZ); tempSample -= midSampleZ; + correction = midCorrection = mid - tempSample; + mid -= correction; + + tempSample = side; + sideSampleA = (sideSampleA * sidealtAmountA) + (tempSample * sideAmountA); tempSample -= sideSampleA; + sideSampleB = (sideSampleB * sidealtAmountB) + (tempSample * sideAmountB); tempSample -= sideSampleB; + sideSampleC = (sideSampleC * sidealtAmountC) + (tempSample * sideAmountC); tempSample -= sideSampleC; + sideSampleD = (sideSampleD * sidealtAmountD) + (tempSample * sideAmountD); tempSample -= sideSampleD; + sideSampleE = (sideSampleE * sidealtAmountE) + (tempSample * sideAmountE); tempSample -= sideSampleE; + sideSampleF = (sideSampleF * sidealtAmountF) + (tempSample * sideAmountF); tempSample -= sideSampleF; + sideSampleG = (sideSampleG * sidealtAmountG) + (tempSample * sideAmountG); tempSample -= sideSampleG; + sideSampleH = (sideSampleH * sidealtAmountH) + (tempSample * sideAmountH); tempSample -= sideSampleH; + sideSampleI = (sideSampleI * sidealtAmountI) + (tempSample * sideAmountI); tempSample -= sideSampleI; + sideSampleJ = (sideSampleJ * sidealtAmountJ) + (tempSample * sideAmountJ); tempSample -= sideSampleJ; + sideSampleK = (sideSampleK * sidealtAmountK) + (tempSample * sideAmountK); tempSample -= sideSampleK; + sideSampleL = (sideSampleL * sidealtAmountL) + (tempSample * sideAmountL); tempSample -= sideSampleL; + sideSampleM = (sideSampleM * sidealtAmountM) + (tempSample * sideAmountM); tempSample -= sideSampleM; + sideSampleN = (sideSampleN * sidealtAmountN) + (tempSample * sideAmountN); tempSample -= sideSampleN; + sideSampleO = (sideSampleO * sidealtAmountO) + (tempSample * sideAmountO); tempSample -= sideSampleO; + sideSampleP = (sideSampleP * sidealtAmountP) + (tempSample * sideAmountP); tempSample -= sideSampleP; + sideSampleQ = (sideSampleQ * sidealtAmountQ) + (tempSample * sideAmountQ); tempSample -= sideSampleQ; + sideSampleR = (sideSampleR * sidealtAmountR) + (tempSample * sideAmountR); tempSample -= sideSampleR; + sideSampleS = (sideSampleS * sidealtAmountS) + (tempSample * sideAmountS); tempSample -= sideSampleS; + sideSampleT = (sideSampleT * sidealtAmountT) + (tempSample * sideAmountT); tempSample -= sideSampleT; + sideSampleU = (sideSampleU * sidealtAmountU) + (tempSample * sideAmountU); tempSample -= sideSampleU; + sideSampleV = (sideSampleV * sidealtAmountV) + (tempSample * sideAmountV); tempSample -= sideSampleV; + sideSampleW = (sideSampleW * sidealtAmountW) + (tempSample * sideAmountW); tempSample -= sideSampleW; + sideSampleX = (sideSampleX * sidealtAmountX) + (tempSample * sideAmountX); tempSample -= sideSampleX; + sideSampleY = (sideSampleY * sidealtAmountY) + (tempSample * sideAmountY); tempSample -= sideSampleY; + sideSampleZ = (sideSampleZ * sidealtAmountZ) + (tempSample * sideAmountZ); tempSample -= sideSampleZ; + correction = sideCorrection = side - tempSample; + side -= correction; + + + aMid[9] = aMid[8]; aMid[8] = aMid[7]; aMid[7] = aMid[6]; aMid[6] = aMid[5]; + aMid[5] = aMid[4]; aMid[4] = aMid[3]; aMid[3] = aMid[2]; aMid[2] = aMid[1]; + aMid[1] = aMid[0]; aMid[0] = accumulatorSample = (mid-aMidPrev); + + accumulatorSample *= fMid[0]; + accumulatorSample += (aMid[1] * fMid[1]); + accumulatorSample += (aMid[2] * fMid[2]); + accumulatorSample += (aMid[3] * fMid[3]); + accumulatorSample += (aMid[4] * fMid[4]); + accumulatorSample += (aMid[5] * fMid[5]); + accumulatorSample += (aMid[6] * fMid[6]); + accumulatorSample += (aMid[7] * fMid[7]); + accumulatorSample += (aMid[8] * fMid[8]); + accumulatorSample += (aMid[9] * fMid[9]); + //we are doing our repetitive calculations on a separate value + correction = (mid-aMidPrev) - accumulatorSample; + midCorrection += correction; + aMidPrev = mid; + mid -= correction; + + aSide[9] = aSide[8]; aSide[8] = aSide[7]; aSide[7] = aSide[6]; aSide[6] = aSide[5]; + aSide[5] = aSide[4]; aSide[4] = aSide[3]; aSide[3] = aSide[2]; aSide[2] = aSide[1]; + aSide[1] = aSide[0]; aSide[0] = accumulatorSample = (side-aSidePrev); + + accumulatorSample *= fSide[0]; + accumulatorSample += (aSide[1] * fSide[1]); + accumulatorSample += (aSide[2] * fSide[2]); + accumulatorSample += (aSide[3] * fSide[3]); + accumulatorSample += (aSide[4] * fSide[4]); + accumulatorSample += (aSide[5] * fSide[5]); + accumulatorSample += (aSide[6] * fSide[6]); + accumulatorSample += (aSide[7] * fSide[7]); + accumulatorSample += (aSide[8] * fSide[8]); + accumulatorSample += (aSide[9] * fSide[9]); + //we are doing our repetitive calculations on a separate value + correction = (side-aSidePrev) - accumulatorSample; + sideCorrection += correction; + aSidePrev = side; + side -= correction; + + + bMid[9] = bMid[8]; bMid[8] = bMid[7]; bMid[7] = bMid[6]; bMid[6] = bMid[5]; + bMid[5] = bMid[4]; bMid[4] = bMid[3]; bMid[3] = bMid[2]; bMid[2] = bMid[1]; + bMid[1] = bMid[0]; bMid[0] = accumulatorSample = (mid-bMidPrev); + + accumulatorSample *= fMid[0]; + accumulatorSample += (bMid[1] * fMid[1]); + accumulatorSample += (bMid[2] * fMid[2]); + accumulatorSample += (bMid[3] * fMid[3]); + accumulatorSample += (bMid[4] * fMid[4]); + accumulatorSample += (bMid[5] * fMid[5]); + accumulatorSample += (bMid[6] * fMid[6]); + accumulatorSample += (bMid[7] * fMid[7]); + accumulatorSample += (bMid[8] * fMid[8]); + accumulatorSample += (bMid[9] * fMid[9]); + //we are doing our repetitive calculations on a separate value + correction = (mid-bMidPrev) - accumulatorSample; + midCorrection += correction; + bMidPrev = mid; + + bSide[9] = bSide[8]; bSide[8] = bSide[7]; bSide[7] = bSide[6]; bSide[6] = bSide[5]; + bSide[5] = bSide[4]; bSide[4] = bSide[3]; bSide[3] = bSide[2]; bSide[2] = bSide[1]; + bSide[1] = bSide[0]; bSide[0] = accumulatorSample = (side-bSidePrev); + + accumulatorSample *= fSide[0]; + accumulatorSample += (bSide[1] * fSide[1]); + accumulatorSample += (bSide[2] * fSide[2]); + accumulatorSample += (bSide[3] * fSide[3]); + accumulatorSample += (bSide[4] * fSide[4]); + accumulatorSample += (bSide[5] * fSide[5]); + accumulatorSample += (bSide[6] * fSide[6]); + accumulatorSample += (bSide[7] * fSide[7]); + accumulatorSample += (bSide[8] * fSide[8]); + accumulatorSample += (bSide[9] * fSide[9]); + //we are doing our repetitive calculations on a separate value + correction = (side-bSidePrev) - accumulatorSample; + sideCorrection += correction; + bSidePrev = side; + + + mid = tempMid - midCorrection; + side = tempSide - sideCorrection; + inputSampleL = (mid+side)/2.0; + inputSampleR = (mid-side)/2.0; + + senseL /= 2.0; + senseR /= 2.0; + + + accumulatorSample = (ataLastOutL*senseL)+(inputSampleL*(1.0-senseL)); + ataLastOutL = inputSampleL; + inputSampleL = accumulatorSample; + + accumulatorSample = (ataLastOutR*senseR)+(inputSampleR*(1.0-senseR)); + ataLastOutR = inputSampleR; + inputSampleR = accumulatorSample; + //we just re-use accumulatorSample to do this little shuffle + + //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/ToVinyl4/VSTProject.sln b/plugins/WinVST/ToVinyl4/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/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/ToVinyl4/VSTProject.vcxproj b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj new file mode 100755 index 0000000..cba0113 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ToVinyl4.cpp" />
+ <ClCompile Include="ToVinyl4Proc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ToVinyl4.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ToVinyl464</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.filters b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.filters new file mode 100755 index 0000000..e9344f3 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToVinyl4.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToVinyl4Proc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ToVinyl4.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.user b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ToVinyl4/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToVinyl4/vstplug.def b/plugins/WinVST/ToVinyl4/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ToVinyl4/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/ToneSlant/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/ToneSlant/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/ToneSlant/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/ToneSlant/.vs/VSTProject/v14/.suo b/plugins/WinVST/ToneSlant/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..b31a1bb --- /dev/null +++ b/plugins/WinVST/ToneSlant/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/ToneSlant/ToneSlant.cpp b/plugins/WinVST/ToneSlant/ToneSlant.cpp new file mode 100755 index 0000000..0ed3618 --- /dev/null +++ b/plugins/WinVST/ToneSlant/ToneSlant.cpp @@ -0,0 +1,131 @@ +/* ======================================== + * ToneSlant - ToneSlant.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToneSlant_H +#include "ToneSlant.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ToneSlant(audioMaster);} + +ToneSlant::ToneSlant(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.0; + B = 0.0; + for(int count = 0; count < 102; count++) {bL[count] = 0.0; bR[count] = 0.0; f[count] = 0.0;} + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +ToneSlant::~ToneSlant() {} +VstInt32 ToneSlant::getVendorVersion () {return 1000;} +void ToneSlant::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void ToneSlant::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 ToneSlant::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 ToneSlant::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 ToneSlant::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float ToneSlant::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 ToneSlant::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Voicing", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Highs", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void ToneSlant::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string ((A*99.0)+1.0, text, kVstMaxParamStrLen); break; + case kParamB: float2string ((B*2.0)-1.0, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void ToneSlant::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "taps", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 ToneSlant::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool ToneSlant::getEffectName(char* name) { + vst_strncpy(name, "ToneSlant", kVstMaxProductStrLen); return true; +} + +VstPlugCategory ToneSlant::getPlugCategory() {return kPlugCategEffect;} + +bool ToneSlant::getProductString(char* text) { + vst_strncpy (text, "airwindows ToneSlant", kVstMaxProductStrLen); return true; +} + +bool ToneSlant::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/ToneSlant/ToneSlant.h b/plugins/WinVST/ToneSlant/ToneSlant.h new file mode 100755 index 0000000..655cc55 --- /dev/null +++ b/plugins/WinVST/ToneSlant/ToneSlant.h @@ -0,0 +1,71 @@ +/* ======================================== + * ToneSlant - ToneSlant.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __ToneSlant_H +#define __ToneSlant_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'tosl'; //Change this to what the AU identity is! + +class ToneSlant : + public AudioEffectX +{ +public: + ToneSlant(audioMasterCallback audioMaster); + ~ToneSlant(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + float A; + float B; + double bL[102]; + double bR[102]; + double f[102]; + +}; + +#endif diff --git a/plugins/WinVST/ToneSlant/ToneSlantProc.cpp b/plugins/WinVST/ToneSlant/ToneSlantProc.cpp new file mode 100755 index 0000000..b594b05 --- /dev/null +++ b/plugins/WinVST/ToneSlant/ToneSlantProc.cpp @@ -0,0 +1,271 @@ +/* ======================================== + * ToneSlant - ToneSlant.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __ToneSlant_H +#include "ToneSlant.h" +#endif + +void ToneSlant::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + float fpTemp; + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputSampleL; + double inputSampleR; + double correctionSampleL; + double correctionSampleR; + double accumulatorSampleL; + double accumulatorSampleR; + double drySampleL; + double drySampleR; + double overallscale = (A*99.0)+1.0; + double applySlant = (B*2.0)-1.0; + + + f[0] = 1.0 / overallscale; + //count to f(gain) which will be 0. f(0) is x1 + for (int count = 1; count < 102; count++) { + if (count <= overallscale) { + f[count] = (1.0 - (count / overallscale)) / overallscale; + //recalc the filter and don't change the buffer it'll apply to + } else { + bL[count] = 0.0; //blank the unused buffer so when we return to it, no pops + bR[count] = 0.0; //blank the unused buffer so when we return to it, no pops + } + } + + while (--sampleFrames >= 0) + { + for (int count = overallscale; count >= 0; count--) { + bL[count+1] = bL[count]; + bR[count+1] = bR[count]; + } + + 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. + } + + bL[0] = accumulatorSampleL = drySampleL = inputSampleL; + bR[0] = accumulatorSampleR = drySampleR = inputSampleR; + + accumulatorSampleL *= f[0]; + accumulatorSampleR *= f[0]; + + for (int count = 1; count < overallscale; count++) { + accumulatorSampleL += (bL[count] * f[count]); + accumulatorSampleR += (bR[count] * f[count]); + } + + correctionSampleL = inputSampleL - (accumulatorSampleL*2.0); + correctionSampleR = inputSampleR - (accumulatorSampleR*2.0); + //we're gonna apply the total effect of all these calculations as a single subtract + + inputSampleL += (correctionSampleL * applySlant); + inputSampleR += (correctionSampleR * applySlant); + //our one math operation on the input data coming in + + //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 ToneSlant::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + double fpTemp; //this is different from singlereplacing + long double fpOld = 0.618033988749894848204586; //golden ratio! + long double fpNew = 1.0 - fpOld; + + double inputSampleL; + double inputSampleR; + double correctionSampleL; + double correctionSampleR; + double accumulatorSampleL; + double accumulatorSampleR; + double drySampleL; + double drySampleR; + double overallscale = (A*99.0)+1.0; + double applySlant = (B*2.0)-1.0; + + f[0] = 1.0 / overallscale; + //count to f(gain) which will be 0. f(0) is x1 + for (int count = 1; count < 102; count++) { + if (count <= overallscale) { + f[count] = (1.0 - (count / overallscale)) / overallscale; + //recalc the filter and don't change the buffer it'll apply to + } else { + bL[count] = 0.0; //blank the unused buffer so when we return to it, no pops + bR[count] = 0.0; //blank the unused buffer so when we return to it, no pops + } + } + + while (--sampleFrames >= 0) + { + for (int count = overallscale; count >= 0; count--) { + bL[count+1] = bL[count]; + bR[count+1] = bR[count]; + } + + 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. + } + + bL[0] = accumulatorSampleL = drySampleL = inputSampleL; + bR[0] = accumulatorSampleR = drySampleR = inputSampleR; + + accumulatorSampleL *= f[0]; + accumulatorSampleR *= f[0]; + + for (int count = 1; count < overallscale; count++) { + accumulatorSampleL += (bL[count] * f[count]); + accumulatorSampleR += (bR[count] * f[count]); + } + + correctionSampleL = inputSampleL - (accumulatorSampleL*2.0); + correctionSampleR = inputSampleR - (accumulatorSampleR*2.0); + //we're gonna apply the total effect of all these calculations as a single subtract + + inputSampleL += (correctionSampleL * applySlant); + inputSampleR += (correctionSampleR * applySlant); + //our one math operation on the input data coming in + + //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/ToneSlant/VSTProject.sln b/plugins/WinVST/ToneSlant/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/ToneSlant/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/ToneSlant/VSTProject.vcxproj b/plugins/WinVST/ToneSlant/VSTProject.vcxproj new file mode 100755 index 0000000..7efee4d --- /dev/null +++ b/plugins/WinVST/ToneSlant/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="ToneSlant.cpp" />
+ <ClCompile Include="ToneSlantProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="ToneSlant.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>ToneSlant64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToneSlant/VSTProject.vcxproj.filters b/plugins/WinVST/ToneSlant/VSTProject.vcxproj.filters new file mode 100755 index 0000000..50b01d3 --- /dev/null +++ b/plugins/WinVST/ToneSlant/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToneSlant.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ToneSlantProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ToneSlant.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToneSlant/VSTProject.vcxproj.user b/plugins/WinVST/ToneSlant/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/ToneSlant/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/ToneSlant/vstplug.def b/plugins/WinVST/ToneSlant/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/ToneSlant/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/TransDesk/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/TransDesk/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/TransDesk/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/TransDesk/.vs/VSTProject/v14/.suo b/plugins/WinVST/TransDesk/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..1e5676d --- /dev/null +++ b/plugins/WinVST/TransDesk/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/TransDesk/TransDesk.cpp b/plugins/WinVST/TransDesk/TransDesk.cpp new file mode 100755 index 0000000..24443bd --- /dev/null +++ b/plugins/WinVST/TransDesk/TransDesk.cpp @@ -0,0 +1,95 @@ +/* ======================================== + * TransDesk - TransDesk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TransDesk_H +#include "TransDesk.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new TransDesk(audioMaster);} + +TransDesk::TransDesk(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + for(int count = 0; count < 19; count++) {dL[count] = 0; dR[count] = 0;} + gcount = 0; + + controlL = 0; + lastSampleL = 0.0; + lastOutSampleL = 0.0; + lastSlewL = 0.0; + + controlR = 0; + lastSampleR = 0.0; + lastOutSampleR = 0.0; + lastSlewR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +TransDesk::~TransDesk() {} +VstInt32 TransDesk::getVendorVersion () {return 1000;} +void TransDesk::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void TransDesk::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! + +VstInt32 TransDesk::getChunk (void** data, bool isPreset) +{ + return kNumParameters * sizeof(float); +} + +VstInt32 TransDesk::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + return 0; +} + +void TransDesk::setParameter(VstInt32 index, float value) { +} + +float TransDesk::getParameter(VstInt32 index) { + return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void TransDesk::getParameterName(VstInt32 index, char *text) { +} + +void TransDesk::getParameterDisplay(VstInt32 index, char *text) { +} + +void TransDesk::getParameterLabel(VstInt32 index, char *text) { +} + +VstInt32 TransDesk::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool TransDesk::getEffectName(char* name) { + vst_strncpy(name, "TransDesk", kVstMaxProductStrLen); return true; +} + +VstPlugCategory TransDesk::getPlugCategory() {return kPlugCategEffect;} + +bool TransDesk::getProductString(char* text) { + vst_strncpy (text, "airwindows TransDesk", kVstMaxProductStrLen); return true; +} + +bool TransDesk::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/TransDesk/TransDesk.h b/plugins/WinVST/TransDesk/TransDesk.h new file mode 100755 index 0000000..b3b891d --- /dev/null +++ b/plugins/WinVST/TransDesk/TransDesk.h @@ -0,0 +1,76 @@ +/* ======================================== + * TransDesk - TransDesk.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __TransDesk_H +#define __TransDesk_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'rdsk'; //Change this to what the AU identity is! + +class TransDesk : + public AudioEffectX +{ +public: + TransDesk(audioMasterCallback audioMaster); + ~TransDesk(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + int gcount; + + double dL[20]; + double controlL; + long double lastSampleL; + long double lastOutSampleL; + double lastSlewL; + + double dR[20]; + double controlR; + long double lastSampleR; + long double lastOutSampleR; + double lastSlewR; + +}; + +#endif diff --git a/plugins/WinVST/TransDesk/TransDeskProc.cpp b/plugins/WinVST/TransDesk/TransDeskProc.cpp new file mode 100755 index 0000000..c7df5e8 --- /dev/null +++ b/plugins/WinVST/TransDesk/TransDeskProc.cpp @@ -0,0 +1,454 @@ +/* ======================================== + * TransDesk - TransDesk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TransDesk_H +#include "TransDesk.h" +#endif + +void TransDesk::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; + + double intensity = 0.02198359; + double depthA = 3.0; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 8) offsetA = 8; + + double clamp; + double thickness; + double out; + + double gain = 0.130; + double slewgain = 0.197; + double prevslew = 0.255; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combSample; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + if (gcount < 0 || gcount > 9) {gcount = 9;} + + //begin L + dL[gcount+9] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + combSample = fabs(drySampleL*lastSampleL); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combSample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end of Desk section + //end L + + //begin R + dR[gcount+9] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + combSample = fabs(drySampleR*lastSampleR); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combSample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end of Desk section + //end R + + gcount--; + + //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 TransDesk::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; + + double intensity = 0.02198359; + double depthA = 3.0; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 8) offsetA = 8; + + double clamp; + double thickness; + double out; + + double gain = 0.130; + double slewgain = 0.197; + double prevslew = 0.255; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combSample; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + if (gcount < 0 || gcount > 9) {gcount = 9;} + + //begin L + dL[gcount+9] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + combSample = fabs(drySampleL*lastSampleL); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combSample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end of Desk section + //end L + + //begin R + dR[gcount+9] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + combSample = fabs(drySampleR*lastSampleR); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combSample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end of Desk section + //end R + + gcount--; + + //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/TransDesk/VSTProject.sln b/plugins/WinVST/TransDesk/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/TransDesk/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/TransDesk/VSTProject.vcxproj b/plugins/WinVST/TransDesk/VSTProject.vcxproj new file mode 100755 index 0000000..972bd49 --- /dev/null +++ b/plugins/WinVST/TransDesk/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="TransDesk.cpp" />
+ <ClCompile Include="TransDeskProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="TransDesk.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>TransDesk64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TransDesk/VSTProject.vcxproj.filters b/plugins/WinVST/TransDesk/VSTProject.vcxproj.filters new file mode 100755 index 0000000..70cdc21 --- /dev/null +++ b/plugins/WinVST/TransDesk/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TransDesk.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TransDeskProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="TransDesk.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TransDesk/VSTProject.vcxproj.user b/plugins/WinVST/TransDesk/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/TransDesk/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TransDesk/vstplug.def b/plugins/WinVST/TransDesk/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/TransDesk/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/Tremolo/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Tremolo/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/Tremolo/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/Tremolo/.vs/VSTProject/v14/.suo b/plugins/WinVST/Tremolo/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..9d04545 --- /dev/null +++ b/plugins/WinVST/Tremolo/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/Tremolo/Tremolo.cpp b/plugins/WinVST/Tremolo/Tremolo.cpp new file mode 100755 index 0000000..be5d06d --- /dev/null +++ b/plugins/WinVST/Tremolo/Tremolo.cpp @@ -0,0 +1,137 @@ +/* ======================================== + * Tremolo - Tremolo.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Tremolo_H +#include "Tremolo.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Tremolo(audioMaster);} + +Tremolo::Tremolo(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + A = 0.5; + B = 1.0; + sweep = 3.141592653589793238 / 2.0; + speedChase = 0.0; + depthChase = 0.0; + speedAmount = 1.0; + depthAmount = 0.0; + lastSpeed = 1000.0; + lastDepth = 1000.0; + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +Tremolo::~Tremolo() {} +VstInt32 Tremolo::getVendorVersion () {return 1000;} +void Tremolo::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void Tremolo::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 Tremolo::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 Tremolo::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 Tremolo::setParameter(VstInt32 index, float value) { + switch (index) { + case kParamA: A = value; break; + case kParamB: B = value; break; + default: throw; // unknown parameter, shouldn't happen! + } +} + +float Tremolo::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 Tremolo::getParameterName(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, "Speed", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, "Depth", kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this is our labels for displaying in the VST host +} + +void Tremolo::getParameterDisplay(VstInt32 index, char *text) { + switch (index) { + case kParamA: float2string (A, text, kVstMaxParamStrLen); break; + case kParamB: float2string (B, text, kVstMaxParamStrLen); break; + default: break; // unknown parameter, shouldn't happen! + } //this displays the values and handles 'popups' where it's discrete choices +} + +void Tremolo::getParameterLabel(VstInt32 index, char *text) { + switch (index) { + case kParamA: vst_strncpy (text, " ", kVstMaxParamStrLen); break; + case kParamB: vst_strncpy (text, " ", kVstMaxParamStrLen); break; //the percent + default: break; // unknown parameter, shouldn't happen! + } +} + +VstInt32 Tremolo::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool Tremolo::getEffectName(char* name) { + vst_strncpy(name, "Tremolo", kVstMaxProductStrLen); return true; +} + +VstPlugCategory Tremolo::getPlugCategory() {return kPlugCategEffect;} + +bool Tremolo::getProductString(char* text) { + vst_strncpy (text, "airwindows Tremolo", kVstMaxProductStrLen); return true; +} + +bool Tremolo::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/Tremolo/Tremolo.h b/plugins/WinVST/Tremolo/Tremolo.h new file mode 100755 index 0000000..ea40aa6 --- /dev/null +++ b/plugins/WinVST/Tremolo/Tremolo.h @@ -0,0 +1,75 @@ +/* ======================================== + * Tremolo - Tremolo.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __Tremolo_H +#define __Tremolo_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kParamA = 0, + kParamB = 1, + kNumParameters = 2 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'trem'; //Change this to what the AU identity is! + +class Tremolo : + public AudioEffectX +{ +public: + Tremolo(audioMasterCallback audioMaster); + ~Tremolo(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + + double sweep; + double speedChase; + double depthChase; + double speedAmount; + double depthAmount; + double lastSpeed; + double lastDepth; + + float A; + float B; +}; + +#endif diff --git a/plugins/WinVST/Tremolo/TremoloProc.cpp b/plugins/WinVST/Tremolo/TremoloProc.cpp new file mode 100755 index 0000000..d0de7cc --- /dev/null +++ b/plugins/WinVST/Tremolo/TremoloProc.cpp @@ -0,0 +1,357 @@ +/* ======================================== + * Tremolo - Tremolo.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __Tremolo_H +#include "Tremolo.h" +#endif + +void Tremolo::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; + + speedChase = pow(A,4); + depthChase = B; + double speedSpeed = 300 / (fabs( lastSpeed - speedChase)+1.0); + double depthSpeed = 300 / (fabs( lastDepth - depthChase)+1.0); + lastSpeed = speedChase; + lastDepth = depthChase; + + double speed; + double depth; + double skew; + double density; + + double tupi = 3.141592653589793238; + double control; + double tempcontrol; + double thickness; + double out; + double bridgerectifier; + double offset; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + speedAmount = (((speedAmount*speedSpeed)+speedChase)/(speedSpeed + 1.0)); + depthAmount = (((depthAmount*depthSpeed)+depthChase)/(depthSpeed + 1.0)); + speed = 0.0001+(speedAmount/1000.0); + speed /= overallscale; + depth = 1.0 - pow(1.0-depthAmount,5); + skew = 1.0+pow(depthAmount,9); + density = ((1.0-depthAmount)*2.0) - 1.0; + + offset = sin(sweep); + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + control = fabs(offset); + if (density > 0) + { + tempcontrol = sin(control); + control = (control * (1.0-density))+(tempcontrol * density); + } + else + { + tempcontrol = 1-cos(control); + control = (control * (1.0+density))+(tempcontrol * -density); + } + //produce either boosted or starved version of control signal + //will go from 0 to 1 + + thickness = ((control * 2.0) - 1.0)*skew; + out = fabs(thickness); + + //do L + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= (1.0 - control); + inputSampleL *= 2.0; + //apply tremolo, apply gain boost to compensate for volume loss + inputSampleL = (drySampleL * (1-depth)) + (inputSampleL*depth); + //end L + + //do R + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= (1.0 - control); + inputSampleR *= 2.0; + //apply tremolo, apply gain boost to compensate for volume loss + inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); + //end R + + //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 Tremolo::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; + + speedChase = pow(A,4); + depthChase = B; + double speedSpeed = 300 / (fabs( lastSpeed - speedChase)+1.0); + double depthSpeed = 300 / (fabs( lastDepth - depthChase)+1.0); + lastSpeed = speedChase; + lastDepth = depthChase; + + double speed; + double depth; + double skew; + double density; + + double tupi = 3.141592653589793238; + double control; + double tempcontrol; + double thickness; + double out; + double bridgerectifier; + double offset; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + speedAmount = (((speedAmount*speedSpeed)+speedChase)/(speedSpeed + 1.0)); + depthAmount = (((depthAmount*depthSpeed)+depthChase)/(depthSpeed + 1.0)); + speed = 0.0001+(speedAmount/1000.0); + speed /= overallscale; + depth = 1.0 - pow(1.0-depthAmount,5); + skew = 1.0+pow(depthAmount,9); + density = ((1.0-depthAmount)*2.0) - 1.0; + + offset = sin(sweep); + sweep += speed; + if (sweep > tupi){sweep -= tupi;} + control = fabs(offset); + if (density > 0) + { + tempcontrol = sin(control); + control = (control * (1.0-density))+(tempcontrol * density); + } + else + { + tempcontrol = 1-cos(control); + control = (control * (1.0+density))+(tempcontrol * -density); + } + //produce either boosted or starved version of control signal + //will go from 0 to 1 + + thickness = ((control * 2.0) - 1.0)*skew; + out = fabs(thickness); + + //do L + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= (1.0 - control); + inputSampleL *= 2.0; + //apply tremolo, apply gain boost to compensate for volume loss + inputSampleL = (drySampleL * (1-depth)) + (inputSampleL*depth); + //end L + + //do R + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= (1.0 - control); + inputSampleR *= 2.0; + //apply tremolo, apply gain boost to compensate for volume loss + inputSampleR = (drySampleR * (1-depth)) + (inputSampleR*depth); + //end R + + //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/Tremolo/VSTProject.sln b/plugins/WinVST/Tremolo/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/Tremolo/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/Tremolo/VSTProject.vcxproj b/plugins/WinVST/Tremolo/VSTProject.vcxproj new file mode 100755 index 0000000..b0d3bdc --- /dev/null +++ b/plugins/WinVST/Tremolo/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="Tremolo.cpp" />
+ <ClCompile Include="TremoloProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="Tremolo.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>Tremolo64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Tremolo/VSTProject.vcxproj.filters b/plugins/WinVST/Tremolo/VSTProject.vcxproj.filters new file mode 100755 index 0000000..9b5305b --- /dev/null +++ b/plugins/WinVST/Tremolo/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Tremolo.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TremoloProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Tremolo.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Tremolo/VSTProject.vcxproj.user b/plugins/WinVST/Tremolo/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/Tremolo/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/Tremolo/vstplug.def b/plugins/WinVST/Tremolo/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/Tremolo/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file diff --git a/plugins/WinVST/TubeDesk/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/TubeDesk/.vs/Console4Channel64/v14/.suo Binary files differnew file mode 100755 index 0000000..777b846 --- /dev/null +++ b/plugins/WinVST/TubeDesk/.vs/Console4Channel64/v14/.suo diff --git a/plugins/WinVST/TubeDesk/.vs/VSTProject/v14/.suo b/plugins/WinVST/TubeDesk/.vs/VSTProject/v14/.suo Binary files differnew file mode 100755 index 0000000..318d2bc --- /dev/null +++ b/plugins/WinVST/TubeDesk/.vs/VSTProject/v14/.suo diff --git a/plugins/WinVST/TubeDesk/TubeDesk.cpp b/plugins/WinVST/TubeDesk/TubeDesk.cpp new file mode 100755 index 0000000..fc4bd75 --- /dev/null +++ b/plugins/WinVST/TubeDesk/TubeDesk.cpp @@ -0,0 +1,95 @@ +/* ======================================== + * TubeDesk - TubeDesk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TubeDesk_H +#include "TubeDesk.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new TubeDesk(audioMaster);} + +TubeDesk::TubeDesk(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + for(int count = 0; count < 4999; count++) {dL[count] = 0; dR[count] = 0;} + gcount = 0; + + controlL = 0; + lastSampleL = 0.0; + lastOutSampleL = 0.0; + lastSlewL = 0.0; + + controlR = 0; + lastSampleR = 0.0; + lastOutSampleR = 0.0; + lastSlewR = 0.0; + + fpNShapeLA = 0.0; + fpNShapeLB = 0.0; + fpNShapeRA = 0.0; + fpNShapeRB = 0.0; + fpFlip = true; + //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 +} + +TubeDesk::~TubeDesk() {} +VstInt32 TubeDesk::getVendorVersion () {return 1000;} +void TubeDesk::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void TubeDesk::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! + +VstInt32 TubeDesk::getChunk (void** data, bool isPreset) +{ + return kNumParameters * sizeof(float); +} + +VstInt32 TubeDesk::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + return 0; +} + +void TubeDesk::setParameter(VstInt32 index, float value) { +} + +float TubeDesk::getParameter(VstInt32 index) { + return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void TubeDesk::getParameterName(VstInt32 index, char *text) { +} + +void TubeDesk::getParameterDisplay(VstInt32 index, char *text) { +} + +void TubeDesk::getParameterLabel(VstInt32 index, char *text) { +} + +VstInt32 TubeDesk::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool TubeDesk::getEffectName(char* name) { + vst_strncpy(name, "TubeDesk", kVstMaxProductStrLen); return true; +} + +VstPlugCategory TubeDesk::getPlugCategory() {return kPlugCategEffect;} + +bool TubeDesk::getProductString(char* text) { + vst_strncpy (text, "airwindows TubeDesk", kVstMaxProductStrLen); return true; +} + +bool TubeDesk::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/WinVST/TubeDesk/TubeDesk.h b/plugins/WinVST/TubeDesk/TubeDesk.h new file mode 100755 index 0000000..b41b283 --- /dev/null +++ b/plugins/WinVST/TubeDesk/TubeDesk.h @@ -0,0 +1,76 @@ +/* ======================================== + * TubeDesk - TubeDesk.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __TubeDesk_H +#define __TubeDesk_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'tdsk'; //Change this to what the AU identity is! + +class TubeDesk : + public AudioEffectX +{ +public: + TubeDesk(audioMasterCallback audioMaster); + ~TubeDesk(); + 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; + + long double fpNShapeLA; + long double fpNShapeLB; + long double fpNShapeRA; + long double fpNShapeRB; + bool fpFlip; + //default stuff + int gcount; + + double dL[5000]; + double controlL; + long double lastSampleL; + long double lastOutSampleL; + double lastSlewL; + + double dR[5000]; + double controlR; + long double lastSampleR; + long double lastOutSampleR; + double lastSlewR; + +}; + +#endif diff --git a/plugins/WinVST/TubeDesk/TubeDeskProc.cpp b/plugins/WinVST/TubeDesk/TubeDeskProc.cpp new file mode 100755 index 0000000..2636076 --- /dev/null +++ b/plugins/WinVST/TubeDesk/TubeDeskProc.cpp @@ -0,0 +1,452 @@ +/* ======================================== + * TubeDesk - TubeDesk.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __TubeDesk_H +#include "TubeDesk.h" +#endif + +void TubeDesk::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; + + double intensity = 0.4384938; + double depthA = 549.0; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 2440) offsetA = 2440; + + double clamp; + double thickness; + double out; + double gain = 0.5; + double slewgain = 0.128; + double prevslew = 0.105; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combSample; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + if (gcount < 0 || gcount > 2450) {gcount = 2450;} + + //begin L + dL[gcount+2450] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + combSample = fabs(drySampleL*lastSampleL); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combSample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end of Desk section + //end L + + //begin R + dR[gcount+2450] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + combSample = fabs(drySampleR*lastSampleR); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combSample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end of Desk section + //end R + + gcount--; + + //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 TubeDesk::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; + + double intensity = 0.4384938; + double depthA = 549.0; + int offsetA = (int)(depthA * overallscale); + if (offsetA < 1) offsetA = 1; + if (offsetA > 2440) offsetA = 2440; + + double clamp; + double thickness; + double out; + double gain = 0.5; + double slewgain = 0.128; + double prevslew = 0.105; + double balanceB = 0.0001; + slewgain *= overallscale; + prevslew *= overallscale; + balanceB /= overallscale; + double balanceA = 1.0 - balanceB; + double slew; + double bridgerectifier; + double combSample; + + long double inputSampleL; + long double inputSampleR; + long double drySampleL; + long double drySampleR; + + 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. + } + drySampleL = inputSampleL; + drySampleR = inputSampleR; + + + if (gcount < 0 || gcount > 2450) {gcount = 2450;} + + //begin L + dL[gcount+2450] = dL[gcount] = fabs(inputSampleL)*intensity; + controlL += (dL[gcount] / offsetA); + controlL -= (dL[gcount+offsetA] / offsetA); + controlL -= 0.000001; + clamp = 1; + if (controlL < 0) {controlL = 0;} + if (controlL > 1) {clamp -= (controlL - 1); controlL = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlL) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleL > 0) inputSampleL = (inputSampleL*(1-out))+(bridgerectifier*out); + else inputSampleL = (inputSampleL*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleL *= clamp; + slew = inputSampleL - lastSampleL; + lastSampleL = inputSampleL; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleL = (lastOutSampleL*balanceA) + (lastSampleL*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleL = inputSampleL; + //Set up slewed reference + combSample = fabs(drySampleL*lastSampleL); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleL -= (lastSlewL * combSample * prevslew); + lastSlewL = slew; + //slew interaction with previous slew + inputSampleL *= gain; + bridgerectifier = fabs(inputSampleL); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleL > 0) inputSampleL = bridgerectifier; + else inputSampleL = -bridgerectifier; + //drive section + inputSampleL /= gain; + //end of Desk section + //end L + + //begin R + dR[gcount+2450] = dR[gcount] = fabs(inputSampleR)*intensity; + controlR += (dR[gcount] / offsetA); + controlR -= (dR[gcount+offsetA] / offsetA); + controlR -= 0.000001; + clamp = 1; + if (controlR < 0) {controlR = 0;} + if (controlR > 1) {clamp -= (controlR - 1); controlR = 1;} + if (clamp < 0.5) {clamp = 0.5;} + //control = 0 to 1 + thickness = ((1.0 - controlR) * 2.0) - 1.0; + out = fabs(thickness); + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.57079633; + //max value for sine function + if (thickness > 0) bridgerectifier = sin(bridgerectifier); + else bridgerectifier = 1-cos(bridgerectifier); + //produce either boosted or starved version + if (inputSampleR > 0) inputSampleR = (inputSampleR*(1-out))+(bridgerectifier*out); + else inputSampleR = (inputSampleR*(1-out))-(bridgerectifier*out); + //blend according to density control + inputSampleR *= clamp; + slew = inputSampleR - lastSampleR; + lastSampleR = inputSampleR; + //Set up direct reference for slew + bridgerectifier = fabs(slew*slewgain); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (slew > 0) slew = bridgerectifier/slewgain; + else slew = -(bridgerectifier/slewgain); + inputSampleR = (lastOutSampleR*balanceA) + (lastSampleR*balanceB) + slew; + //go from last slewed, but include some raw values + lastOutSampleR = inputSampleR; + //Set up slewed reference + combSample = fabs(drySampleR*lastSampleR); + if (combSample > 1.0) combSample = 1.0; + //bailout for very high input gains + inputSampleR -= (lastSlewR * combSample * prevslew); + lastSlewR = slew; + //slew interaction with previous slew + inputSampleR *= gain; + bridgerectifier = fabs(inputSampleR); + if (bridgerectifier > 1.57079633) bridgerectifier = 1.0; + else bridgerectifier = sin(bridgerectifier); + if (inputSampleR > 0) inputSampleR = bridgerectifier; + else inputSampleR = -bridgerectifier; + //drive section + inputSampleR /= gain; + //end of Desk section + //end R + + gcount--; + + //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/TubeDesk/VSTProject.sln b/plugins/WinVST/TubeDesk/VSTProject.sln new file mode 100755 index 0000000..694b424 --- /dev/null +++ b/plugins/WinVST/TubeDesk/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/TubeDesk/VSTProject.vcxproj b/plugins/WinVST/TubeDesk/VSTProject.vcxproj new file mode 100755 index 0000000..34f9055 --- /dev/null +++ b/plugins/WinVST/TubeDesk/VSTProject.vcxproj @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp" />
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp" />
+ <ClCompile Include="TubeDesk.cpp" />
+ <ClCompile Include="TubeDeskProc.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h" />
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h" />
+ <ClInclude Include="TubeDesk.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>TubeDesk64</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <WholeProgramOptimization>false</WholeProgramOptimization>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetExt>.dll</TargetExt>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir>$(Configuration)\</IntDir>
+ <ExecutablePath>$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)</ExecutablePath>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>C:\Users\christopherjohnson\Documents\Visual Studio 2015\Projects\VSTProject\vst2.x;C:\Users\christopherjohnson\Documents\vstsdk2.4;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <DebugInformationFormat>None</DebugInformationFormat>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <PreprocessorDefinitions>WINDOWS;_WINDOWS;WIN32;_USRDLL;_USE_MATH_DEFINES;_CRT_SECURE_NO_DEPRECATE;VST_FORCE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <IgnoreSpecificDefaultLibraries>libcmt.dll;libcmtd.dll;msvcrt.lib;libc.lib;libcd.lib;libcmt.lib;msvcrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <AdditionalDependencies>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)</AdditionalDependencies>
+ <ModuleDefinitionFile>vstplug.def</ModuleDefinitionFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TubeDesk/VSTProject.vcxproj.filters b/plugins/WinVST/TubeDesk/VSTProject.vcxproj.filters new file mode 100755 index 0000000..8ea7611 --- /dev/null +++ b/plugins/WinVST/TubeDesk/VSTProject.vcxproj.filters @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TubeDesk.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="TubeDeskProc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\aeffeditor.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffect.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="TubeDesk.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TubeDesk/VSTProject.vcxproj.user b/plugins/WinVST/TubeDesk/VSTProject.vcxproj.user new file mode 100755 index 0000000..2216267 --- /dev/null +++ b/plugins/WinVST/TubeDesk/VSTProject.vcxproj.user @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LocalDebuggerAmpDefaultAccelerator>{ADEFF70D-84BF-47A1-91C3-FF6B0FC71218}</LocalDebuggerAmpDefaultAccelerator>
+ <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+ </PropertyGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/WinVST/TubeDesk/vstplug.def b/plugins/WinVST/TubeDesk/vstplug.def new file mode 100755 index 0000000..5bf499a --- /dev/null +++ b/plugins/WinVST/TubeDesk/vstplug.def @@ -0,0 +1,3 @@ +EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain
\ No newline at end of file |