aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/WinVST/Logical4
diff options
context:
space:
mode:
authorChris Johnson <jinx6568@sover.net>2018-10-22 18:04:06 -0400
committerChris Johnson <jinx6568@sover.net>2018-10-22 18:04:06 -0400
commit633be2e22c6648c901f08f3b4cd4e8e14ea86443 (patch)
tree1e272c3d2b5bd29636b9f9f521af62734e4df012 /plugins/WinVST/Logical4
parent057757aa8eb0a463caf0cdfdb5894ac5f723ff3f (diff)
downloadairwindows-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/Logical4')
-rwxr-xr-xplugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suobin0 -> 32768 bytes
-rwxr-xr-xplugins/WinVST/Logical4/.vs/VSTProject/v14/.suobin0 -> 23040 bytes
-rwxr-xr-xplugins/WinVST/Logical4/Logical4.cpp215
-rwxr-xr-xplugins/WinVST/Logical4/Logical4.h160
-rwxr-xr-xplugins/WinVST/Logical4/Logical4Proc.cpp1794
-rwxr-xr-xplugins/WinVST/Logical4/VSTProject.sln28
-rwxr-xr-xplugins/WinVST/Logical4/VSTProject.vcxproj183
-rwxr-xr-xplugins/WinVST/Logical4/VSTProject.vcxproj.filters48
-rwxr-xr-xplugins/WinVST/Logical4/VSTProject.vcxproj.user19
-rwxr-xr-xplugins/WinVST/Logical4/vstplug.def3
10 files changed, 2450 insertions, 0 deletions
diff --git a/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo
new file mode 100755
index 0000000..777b846
--- /dev/null
+++ b/plugins/WinVST/Logical4/.vs/Console4Channel64/v14/.suo
Binary files differ
diff --git a/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo b/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo
new file mode 100755
index 0000000..0a67ad3
--- /dev/null
+++ b/plugins/WinVST/Logical4/.vs/VSTProject/v14/.suo
Binary files differ
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