aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/WinVST/NonlinearSpace
diff options
context:
space:
mode:
authorairwindows <jinx6568@sover.net>2018-04-01 21:07:49 -0400
committerairwindows <jinx6568@sover.net>2018-04-01 21:07:49 -0400
commit14e001ba28240d6a88045aea801ee8e38c6a235c (patch)
tree10ccbe0099ac6da1823c27ef38e3d311216ea6e2 /plugins/WinVST/NonlinearSpace
parent9f95683034d82bb246ae1bfd754b95515211dd93 (diff)
downloadairwindows-lv2-port-14e001ba28240d6a88045aea801ee8e38c6a235c.tar.gz
airwindows-lv2-port-14e001ba28240d6a88045aea801ee8e38c6a235c.tar.bz2
airwindows-lv2-port-14e001ba28240d6a88045aea801ee8e38c6a235c.zip
NonlinearSpace
Diffstat (limited to 'plugins/WinVST/NonlinearSpace')
-rwxr-xr-xplugins/WinVST/NonlinearSpace/.vs/Console4Channel64/v14/.suobin0 -> 32768 bytes
-rwxr-xr-xplugins/WinVST/NonlinearSpace/.vs/VSTProject/v14/.suobin0 -> 22528 bytes
-rwxr-xr-xplugins/WinVST/NonlinearSpace/NonlinearSpace.cpp348
-rwxr-xr-xplugins/WinVST/NonlinearSpace/NonlinearSpace.h226
-rwxr-xr-xplugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp1548
-rwxr-xr-xplugins/WinVST/NonlinearSpace/VSTProject.sln28
-rwxr-xr-xplugins/WinVST/NonlinearSpace/VSTProject.vcxproj183
-rwxr-xr-xplugins/WinVST/NonlinearSpace/VSTProject.vcxproj.filters48
-rwxr-xr-xplugins/WinVST/NonlinearSpace/VSTProject.vcxproj.user19
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/aeffeditor.h61
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/audioeffect.cpp703
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/audioeffect.h177
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.cpp1546
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.h252
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vst2.x/vstplugmain.cpp68
-rwxr-xr-xplugins/WinVST/NonlinearSpace/vstplug.def3
16 files changed, 5210 insertions, 0 deletions
diff --git a/plugins/WinVST/NonlinearSpace/.vs/Console4Channel64/v14/.suo b/plugins/WinVST/NonlinearSpace/.vs/Console4Channel64/v14/.suo
new file mode 100755
index 0000000..777b846
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/.vs/Console4Channel64/v14/.suo
Binary files differ
diff --git a/plugins/WinVST/NonlinearSpace/.vs/VSTProject/v14/.suo b/plugins/WinVST/NonlinearSpace/.vs/VSTProject/v14/.suo
new file mode 100755
index 0000000..7a7784d
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/.vs/VSTProject/v14/.suo
Binary files differ
diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp b/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp
new file mode 100755
index 0000000..6941556
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/NonlinearSpace.cpp
@@ -0,0 +1,348 @@
+/* ========================================
+ * NonlinearSpace - NonlinearSpace.h
+ * Copyright (c) 2016 airwindows, All rights reserved
+ * ======================================== */
+
+#ifndef __NonlinearSpace_H
+#include "NonlinearSpace.h"
+#endif
+
+AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new NonlinearSpace(audioMaster);}
+
+NonlinearSpace::NonlinearSpace(audioMasterCallback audioMaster) :
+ AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
+{
+ A = 0.3; //this is the sample rate so it will become a 'popup' with fixed values
+ B = 0.5;
+ C = 0.5;
+ D = 0.5;
+ E = 0.5; //this is nonlin, so it produces -1 to 1: 0.5 will become 0
+ F = 1.0;
+
+ int count;
+ for(count = 0; count < 2347; count++) {dMid[count] = 0.0;}
+ for(count = 0; count < 1333; count++) {dSide[count] = 0.0;}
+ for(count = 0; count < 5923; count++) {dLeft[count] = 0.0;}
+ for(count = 0; count < 5925; count++) {dRight[count] = 0.0;}
+
+ for(count = 0; count < 7574; count++) {dpreR[count] = 0.0;}
+ for(count = 0; count < 7574; count++) {dpreL[count] = 0.0;}
+
+ for(count = 0; count < 7574; count++) {dA[count] = 0.0;}
+ for(count = 0; count < 7308; count++) {dB[count] = 0.0;}
+ for(count = 0; count < 7178; count++) {dC[count] = 0.0;}
+ for(count = 0; count < 6908; count++) {dD[count] = 0.0;}
+ for(count = 0; count < 6780; count++) {dE[count] = 0.0;}
+ for(count = 0; count < 6522; count++) {dF[count] = 0.0;}
+ for(count = 0; count < 5982; count++) {dG[count] = 0.0;}
+ for(count = 0; count < 5564; count++) {dH[count] = 0.0;}
+ for(count = 0; count < 5298; count++) {dI[count] = 0.0;}
+ for(count = 0; count < 4904; count++) {dJ[count] = 0.0;}
+ for(count = 0; count < 4760; count++) {dK[count] = 0.0;}
+ for(count = 0; count < 4490; count++) {dL[count] = 0.0;}
+ for(count = 0; count < 4392; count++) {dM[count] = 0.0;}
+ for(count = 0; count < 4230; count++) {dN[count] = 0.0;}
+ for(count = 0; count < 4154; count++) {dO[count] = 0.0;}
+ for(count = 0; count < 3990; count++) {dP[count] = 0.0;}
+ for(count = 0; count < 3660; count++) {dQ[count] = 0.0;}
+ for(count = 0; count < 3408; count++) {dR[count] = 0.0;}
+ for(count = 0; count < 3252; count++) {dS[count] = 0.0;}
+ for(count = 0; count < 3000; count++) {dT[count] = 0.0;}
+ for(count = 0; count < 2918; count++) {dU[count] = 0.0;}
+ for(count = 0; count < 2750; count++) {dV[count] = 0.0;}
+ for(count = 0; count < 2504; count++) {dW[count] = 0.0;}
+ for(count = 0; count < 2424; count++) {dX[count] = 0.0;}
+ for(count = 0; count < 2147; count++) {dY[count] = 0.0;}
+ for(count = 0; count < 2089; count++) {dZ[count] = 0.0;}
+
+ oneMid = 1; delayMid = 2346; maxdelayMid = 2346;
+ oneSide = 1; delaySide = 1332; maxdelaySide = 1332;
+ oneLeft = 1; delayLeft = 5922; maxdelayLeft = 5922;
+ oneRight = 1; delayRight = 5924; maxdelayRight = 5924;
+ onepre = 1; delaypre = 7573; maxdelaypre = 7573;
+
+ oneA = 1; twoA = 2; treA = 3; delayA = 7573; maxdelayA = 7573;
+ oneB = 1; twoB = 2; treB = 3; delayB = 7307; maxdelayB = 7307;
+ oneC = 1; twoC = 2; treC = 3; delayC = 7177; maxdelayC = 7177;
+ oneD = 1; twoD = 2; treD = 3; delayD = 6907; maxdelayD = 6907;
+ oneE = 1; twoE = 2; treE = 3; delayE = 6779; maxdelayE = 6779;
+ oneF = 1; twoF = 2; treF = 3; delayF = 6521; maxdelayF = 6521;
+ oneG = 1; twoG = 2; treG = 3; delayG = 5981; maxdelayG = 5981;
+ oneH = 1; twoH = 2; treH = 3; delayH = 5563; maxdelayH = 5563;
+ oneI = 1; twoI = 2; treI = 3; delayI = 5297; maxdelayI = 5297;
+ oneJ = 1; twoJ = 2; treJ = 3; delayJ = 4903; maxdelayJ = 4903;
+ oneK = 1; twoK = 2; treK = 3; delayK = 4759; maxdelayK = 4759;
+ oneL = 1; twoL = 2; treL = 3; delayL = 4489; maxdelayL = 4489;
+ oneM = 1; twoM = 2; treM = 3; delayM = 4391; maxdelayM = 4391;
+ oneN = 1; twoN = 2; treN = 3; delayN = 4229; maxdelayN = 4229;
+ oneO = 1; twoO = 2; treO = 3; delayO = 4153; maxdelayO = 4153;
+ oneP = 1; twoP = 2; treP = 3; delayP = 3989; maxdelayP = 3989;
+ oneQ = 1; twoQ = 2; treQ = 3; delayQ = 3659; maxdelayQ = 3659;
+ oneR = 1; twoR = 2; treR = 3; delayR = 3407; maxdelayR = 3407;
+ oneS = 1; twoS = 2; treS = 3; delayS = 3251; maxdelayS = 3251;
+ oneT = 1; twoT = 2; treT = 3; delayT = 2999; maxdelayT = 2999;
+ oneU = 1; twoU = 2; treU = 3; delayU = 2917; maxdelayU = 2917;
+ oneV = 1; twoV = 2; treV = 3; delayV = 2749; maxdelayV = 2749;
+ oneW = 1; twoW = 2; treW = 3; delayW = 2503; maxdelayW = 2503;
+ oneX = 1; twoX = 2; treX = 3; delayX = 2423; maxdelayX = 2423;
+ oneY = 1; twoY = 2; treY = 3; delayY = 2146; maxdelayY = 2146;
+ oneZ = 1; twoZ = 2; treZ = 3; delayZ = 2088; maxdelayZ = 2088;
+
+ avgInputL = 0.0;
+ avgInputR = 0.0;
+ avgOutputL = 0.0;
+ avgOutputR = 0.0;
+ avg2InputL = 0.0;
+ avg2InputR = 0.0;
+ avg2OutputL = 0.0;
+ avg2OutputR = 0.0;
+ a2vgInputL = 0.0;
+ a2vgInputR = 0.0;
+ a2vgOutputL = 0.0;
+ a2vgOutputR = 0.0;
+ a2vg2InputL = 0.0;
+ a2vg2InputR = 0.0;
+ a2vg2OutputL = 0.0;
+ a2vg2OutputR = 0.0;
+
+ lowpassSampleAA = 0.0;
+ lowpassSampleAB = 0.0;
+ lowpassSampleBA = 0.0;
+ lowpassSampleBB = 0.0;
+ lowpassSampleCA = 0.0;
+ lowpassSampleCB = 0.0;
+ lowpassSampleDA = 0.0;
+ lowpassSampleDB = 0.0;
+ lowpassSampleE = 0.0;
+ lowpassSampleF = 0.0;
+ lowpassSampleG = 0.0;
+
+ rowpassSampleAA = 0.0;
+ rowpassSampleAB = 0.0;
+ rowpassSampleBA = 0.0;
+ rowpassSampleBB = 0.0;
+ rowpassSampleCA = 0.0;
+ rowpassSampleCB = 0.0;
+ rowpassSampleDA = 0.0;
+ rowpassSampleDB = 0.0;
+ rowpassSampleE = 0.0;
+ rowpassSampleF = 0.0;
+ rowpassSampleG = 0.0;
+
+ interpolA = 0.0;
+ interpolB = 0.0;
+ interpolC = 0.0;
+ interpolD = 0.0;
+ interpolE = 0.0;
+ interpolF = 0.0;
+ interpolG = 0.0;
+ interpolH = 0.0;
+ interpolI = 0.0;
+ interpolJ = 0.0;
+ interpolK = 0.0;
+ interpolL = 0.0;
+ interpolM = 0.0;
+ interpolN = 0.0;
+ interpolO = 0.0;
+ interpolP = 0.0;
+ interpolQ = 0.0;
+ interpolR = 0.0;
+ interpolS = 0.0;
+ interpolT = 0.0;
+ interpolU = 0.0;
+ interpolV = 0.0;
+ interpolW = 0.0;
+ interpolX = 0.0;
+ interpolY = 0.0;
+ interpolZ = 0.0;
+
+ pitchshiftA = 1.0 / maxdelayA;
+ pitchshiftB = 1.0 / maxdelayB;
+ pitchshiftC = 1.0 / maxdelayC;
+ pitchshiftD = 1.0 / maxdelayD;
+ pitchshiftE = 1.0 / maxdelayE;
+ pitchshiftF = 1.0 / maxdelayF;
+ pitchshiftG = 1.0 / maxdelayG;
+ pitchshiftH = 1.0 / maxdelayH;
+ pitchshiftI = 1.0 / maxdelayI;
+ pitchshiftJ = 1.0 / maxdelayJ;
+ pitchshiftK = 1.0 / maxdelayK;
+ pitchshiftL = 1.0 / maxdelayL;
+ pitchshiftM = 1.0 / maxdelayM;
+ pitchshiftN = 1.0 / maxdelayN;
+ pitchshiftO = 1.0 / maxdelayO;
+ pitchshiftP = 1.0 / maxdelayP;
+ pitchshiftQ = 1.0 / maxdelayQ;
+ pitchshiftR = 1.0 / maxdelayR;
+ pitchshiftS = 1.0 / maxdelayS;
+ pitchshiftT = 1.0 / maxdelayT;
+ pitchshiftU = 1.0 / maxdelayU;
+ pitchshiftV = 1.0 / maxdelayV;
+ pitchshiftW = 1.0 / maxdelayW;
+ pitchshiftX = 1.0 / maxdelayX;
+ pitchshiftY = 1.0 / maxdelayY;
+ pitchshiftZ = 1.0 / maxdelayZ;
+
+ nonlin = 0.0;
+
+ verboutL = 0.0;
+ verboutR = 0.0;
+ iirCCSampleL = 0.0;
+ iirCCSampleR = 0.0;
+ iirSampleL = 0.0;
+ iirSampleR = 0.0;
+ savedRoomsize = -1.0; //force update to begin
+ countdown = -1;
+ flip = true;
+
+ 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
+}
+
+NonlinearSpace::~NonlinearSpace() {}
+VstInt32 NonlinearSpace::getVendorVersion () {return 1000;}
+void NonlinearSpace::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
+void NonlinearSpace::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 NonlinearSpace::getChunk (void** data, bool isPreset)
+{
+ float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
+ chunkData[0] = A;
+ chunkData[1] = B;
+ chunkData[2] = C;
+ chunkData[3] = D;
+ chunkData[4] = E;
+ chunkData[5] = F;
+ /* Note: The way this is set up, it will break if you manage to save settings on an Intel
+ machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
+ started with. */
+
+ *data = chunkData;
+ return kNumParameters * sizeof(float);
+}
+
+VstInt32 NonlinearSpace::setChunk (void* data, VstInt32 byteSize, bool isPreset)
+{
+ float *chunkData = (float *)data;
+ A = pinParameter(chunkData[0]);
+ B = pinParameter(chunkData[1]);
+ C = pinParameter(chunkData[2]);
+ D = pinParameter(chunkData[3]);
+ E = pinParameter(chunkData[4]);
+ F = pinParameter(chunkData[5]);
+ /* We're ignoring byteSize as we found it to be a filthy liar */
+
+ /* calculate any other fields you need here - you could copy in
+ code from setParameter() here. */
+ return 0;
+}
+
+void NonlinearSpace::setParameter(VstInt32 index, float value) {
+ switch (index) {
+ case kParamA: A = value; break;
+ case kParamB: B = value; break;
+ case kParamC: C = value; break;
+ case kParamD: D = value; break;
+ case kParamE: E = value; break;
+ case kParamF: F = value; break;
+ default: throw; // unknown parameter, shouldn't happen!
+ }
+}
+
+float NonlinearSpace::getParameter(VstInt32 index) {
+ switch (index) {
+ case kParamA: return A; break;
+ case kParamB: return B; break;
+ case kParamC: return C; break;
+ case kParamD: return D; break;
+ case kParamE: return E; break;
+ case kParamF: return F; break;
+ default: break; // unknown parameter, shouldn't happen!
+ } return 0.0; //we only need to update the relevant name, this is simple to manage
+}
+
+void NonlinearSpace::getParameterName(VstInt32 index, char *text) {
+ switch (index) {
+ case kParamA: vst_strncpy (text, "SmpRate", kVstMaxParamStrLen); break;
+ case kParamB: vst_strncpy (text, "Livenes", kVstMaxParamStrLen); break;
+ case kParamC: vst_strncpy (text, "Treble", kVstMaxParamStrLen); break;
+ case kParamD: vst_strncpy (text, "Bass", kVstMaxParamStrLen); break;
+ case kParamE: vst_strncpy (text, "Nonlin", kVstMaxParamStrLen); break;
+ case kParamF: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
+ default: break; // unknown parameter, shouldn't happen!
+ } //this is our labels for displaying in the VST host
+}
+
+void NonlinearSpace::getParameterDisplay(VstInt32 index, char *text) {
+ switch (index) {
+ case kParamA: switch((VstInt32)( A * 6.999 )) //0 to almost edge of # of params
+ { case 0: vst_strncpy (text, "16K", kVstMaxParamStrLen); break;
+ case 1: vst_strncpy (text, "32K", kVstMaxParamStrLen); break;
+ case 2: vst_strncpy (text, "44.1K", kVstMaxParamStrLen); break;
+ case 3: vst_strncpy (text, "48K", kVstMaxParamStrLen); break;
+ case 4: vst_strncpy (text, "64K", kVstMaxParamStrLen); break;
+ case 5: vst_strncpy (text, "88.2K", kVstMaxParamStrLen); break;
+ case 6: vst_strncpy (text, "96K", kVstMaxParamStrLen); break;
+ default: break; // unknown parameter, shouldn't happen!
+ } break; //E as example 'popup' parameter with four values */
+ case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
+ case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
+ case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
+ case kParamE: float2string ((E*2.0)-1.0, text, kVstMaxParamStrLen); break;
+ case kParamF: float2string (F, text, kVstMaxParamStrLen); break;
+ default: break; // unknown parameter, shouldn't happen!
+ } //this displays the values and handles 'popups' where it's discrete choices
+}
+
+void NonlinearSpace::getParameterLabel(VstInt32 index, char *text) {
+ switch (index) {
+ case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
+ default: break; // unknown parameter, shouldn't happen!
+ }
+}
+
+VstInt32 NonlinearSpace::canDo(char *text)
+{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
+
+bool NonlinearSpace::getEffectName(char* name) {
+ vst_strncpy(name, "NonlinearSpace", kVstMaxProductStrLen); return true;
+}
+
+VstPlugCategory NonlinearSpace::getPlugCategory() {return kPlugCategEffect;}
+
+bool NonlinearSpace::getProductString(char* text) {
+ vst_strncpy (text, "airwindows NonlinearSpace", kVstMaxProductStrLen); return true;
+}
+
+bool NonlinearSpace::getVendorString(char* text) {
+ vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
+}
diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpace.h b/plugins/WinVST/NonlinearSpace/NonlinearSpace.h
new file mode 100755
index 0000000..e915b21
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/NonlinearSpace.h
@@ -0,0 +1,226 @@
+/* ========================================
+ * NonlinearSpace - NonlinearSpace.h
+ * Created 8/12/11 by SPIAdmin
+ * Copyright (c) 2011 __MyCompanyName__, All rights reserved
+ * ======================================== */
+
+#ifndef __NonlinearSpace_H
+#define __NonlinearSpace_H
+
+#ifndef __audioeffect__
+#include "audioeffectx.h"
+#endif
+
+#include <set>
+#include <string>
+#include <math.h>
+
+enum {
+ kParamA = 0,
+ kParamB = 1,
+ kParamC = 2,
+ kParamD = 3,
+ kParamE = 4,
+ kParamF = 5,
+ kNumParameters = 6
+}; //
+
+const int kNumPrograms = 0;
+const int kNumInputs = 2;
+const int kNumOutputs = 2;
+const unsigned long kUniqueId = 'nspc'; //Change this to what the AU identity is!
+
+class NonlinearSpace :
+ public AudioEffectX
+{
+public:
+ NonlinearSpace(audioMasterCallback audioMaster);
+ ~NonlinearSpace();
+ virtual bool getEffectName(char* name); // The plug-in name
+ virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
+ virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
+ virtual bool getVendorString(char* text); // Vendor info
+ virtual VstInt32 getVendorVersion(); // Version number
+ virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
+ virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
+ virtual void getProgramName(char *name); // read the name from the host
+ virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
+ virtual VstInt32 getChunk (void** data, bool isPreset);
+ virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
+ virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
+ virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
+ virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
+ virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
+ virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
+ virtual VstInt32 canDo(char *text);
+private:
+ char _programName[kVstMaxProgNameLen + 1];
+ std::set< std::string > _canDo;
+
+ double avgInputL;
+ double avgOutputL;
+ double avg2InputL;
+ double avg2OutputL;
+ double avgInputR;
+ double avgOutputR;
+ double avg2InputR;
+ double avg2OutputR;
+ double a2vgInputL;
+ double a2vgOutputL;
+ double a2vg2InputL;
+ double a2vg2OutputL;
+ double a2vgInputR;
+ double a2vgOutputR;
+ double a2vg2InputR;
+ double a2vg2OutputR;
+
+ double verboutL;
+ double verboutR;
+ double iirCCSampleL;
+ double iirCCSampleR;
+ double iirSampleL;
+ double iirSampleR;
+
+ double dMid[2348];
+ double dSide[1334];
+ double dLeft[5924];
+ double dRight[5926];
+
+ double dpreR[7575];
+ double dpreL[7575];
+
+ double dA[7575];
+ double dB[7309];
+ double dC[7179];
+ double dD[6909];
+ double dE[6781];
+ double dF[6523];
+ double dG[5983];
+ double dH[5565];
+ double dI[5299];
+ double dJ[4905];
+ double dK[4761];
+ double dL[4491];
+ double dM[4393];
+ double dN[4231];
+ double dO[4155];
+ double dP[3991];
+ double dQ[3661];
+ double dR[3409];
+ double dS[3253];
+ double dT[3001];
+ double dU[2919];
+ double dV[2751];
+ double dW[2505];
+ double dX[2425];
+ double dY[2148];
+ double dZ[2090];
+
+ double interpolA, pitchshiftA; //7575
+ double interpolB, pitchshiftB; //7309
+ double interpolC, pitchshiftC; //7179
+ double interpolD, pitchshiftD; //6909
+ double interpolE, pitchshiftE; //6781
+ double interpolF, pitchshiftF; //6523
+ double interpolG, pitchshiftG; //5983
+ double interpolH, pitchshiftH; //5565
+ double interpolI, pitchshiftI; //5299
+ double interpolJ, pitchshiftJ; //4905
+ double interpolK, pitchshiftK; //4761
+ double interpolL, pitchshiftL; //4491
+ double interpolM, pitchshiftM; //4393
+ double interpolN, pitchshiftN; //4231
+ double interpolO, pitchshiftO; //4155
+ double interpolP, pitchshiftP; //3991
+ double interpolQ, pitchshiftQ; //3661
+ double interpolR, pitchshiftR; //3409
+ double interpolS, pitchshiftS; //3253
+ double interpolT, pitchshiftT; //3001
+ double interpolU, pitchshiftU; //2919
+ double interpolV, pitchshiftV; //2751
+ double interpolW, pitchshiftW; //2505
+ double interpolX, pitchshiftX; //2425
+ double interpolY, pitchshiftY; //2148
+ double interpolZ, pitchshiftZ; //2090
+
+ int oneMid, delayMid, maxdelayMid;
+ int oneSide, delaySide, maxdelaySide;
+ int oneLeft, delayLeft, maxdelayLeft;
+ int oneRight, delayRight, maxdelayRight;
+
+ int onepre, delaypre, maxdelaypre;
+
+ int oneA, twoA, treA, delayA, maxdelayA;
+ int oneB, twoB, treB, delayB, maxdelayB;
+ int oneC, twoC, treC, delayC, maxdelayC;
+ int oneD, twoD, treD, delayD, maxdelayD;
+ int oneE, twoE, treE, delayE, maxdelayE;
+ int oneF, twoF, treF, delayF, maxdelayF;
+ int oneG, twoG, treG, delayG, maxdelayG;
+ int oneH, twoH, treH, delayH, maxdelayH;
+ int oneI, twoI, treI, delayI, maxdelayI;
+ int oneJ, twoJ, treJ, delayJ, maxdelayJ;
+ int oneK, twoK, treK, delayK, maxdelayK;
+ int oneL, twoL, treL, delayL, maxdelayL;
+ int oneM, twoM, treM, delayM, maxdelayM;
+ int oneN, twoN, treN, delayN, maxdelayN;
+ int oneO, twoO, treO, delayO, maxdelayO;
+ int oneP, twoP, treP, delayP, maxdelayP;
+ int oneQ, twoQ, treQ, delayQ, maxdelayQ;
+ int oneR, twoR, treR, delayR, maxdelayR;
+ int oneS, twoS, treS, delayS, maxdelayS;
+ int oneT, twoT, treT, delayT, maxdelayT;
+ int oneU, twoU, treU, delayU, maxdelayU;
+ int oneV, twoV, treV, delayV, maxdelayV;
+ int oneW, twoW, treW, delayW, maxdelayW;
+ int oneX, twoX, treX, delayX, maxdelayX;
+ int oneY, twoY, treY, delayY, maxdelayY;
+ int oneZ, twoZ, treZ, delayZ, maxdelayZ;
+ double savedPredelay;
+ double savedRoomsize;
+ int countdown;
+
+ double lowpassSampleAA;
+ double lowpassSampleAB;
+ double lowpassSampleBA;
+ double lowpassSampleBB;
+ double lowpassSampleCA;
+ double lowpassSampleCB;
+ double lowpassSampleDA;
+ double lowpassSampleDB;
+ double lowpassSampleE;
+ double lowpassSampleF;
+ double lowpassSampleG;
+
+ double rowpassSampleAA;
+ double rowpassSampleAB;
+ double rowpassSampleBA;
+ double rowpassSampleBB;
+ double rowpassSampleCA;
+ double rowpassSampleCB;
+ double rowpassSampleDA;
+ double rowpassSampleDB;
+ double rowpassSampleE;
+ double rowpassSampleF;
+ double rowpassSampleG;
+
+ bool flip;
+
+ double nonlin;
+
+ long double fpNShapeLA;
+ long double fpNShapeLB;
+ long double fpNShapeRA;
+ long double fpNShapeRB;
+ bool fpFlip;
+ //default stuff
+
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F; //parameters. Always 0-1, and we scale/alter them elsewhere.
+};
+
+#endif
diff --git a/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp b/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp
new file mode 100755
index 0000000..597e184
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/NonlinearSpaceProc.cpp
@@ -0,0 +1,1548 @@
+/* ========================================
+ * NonlinearSpace - NonlinearSpace.h
+ * Copyright (c) 2016 airwindows, All rights reserved
+ * ======================================== */
+
+#ifndef __NonlinearSpace_H
+#include "NonlinearSpace.h"
+#endif
+
+void NonlinearSpace::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
+{
+ float* in1 = inputs[0];
+ float* in2 = inputs[1];
+ float* out1 = outputs[0];
+ float* out2 = outputs[1];
+
+ float fpTemp;
+ long double fpOld = 0.618033988749894848204586; //golden ratio!
+ long double fpNew = 1.0 - fpOld;
+
+ double drySampleL;
+ double drySampleR;
+ long double inputSampleL;
+ long double inputSampleR;
+ long double mid;
+ long double side;
+ double overallscale = 1.0;
+ int samplerate = (int)( A * 6.999 )+1;
+ switch (samplerate)
+ {
+ case 1: overallscale *= (16.0/44.1); break; //16
+ case 2: overallscale *= (32.0/44.1); break; //32
+ case 3: overallscale *= 1.0; break; //44.1
+ case 4: overallscale *= (48.0/44.1); break; //48
+ case 5: overallscale *= (64.0/44.1); break; //64
+ case 6: overallscale *= 2.0; break; //88.2
+ case 7: overallscale *= (96.0/44.1); break; //96
+ }
+ nonlin *= 0.001; //scale suitably to apply to our liveness value
+ double basefeedback = 0.45 + (nonlin * pow(((E*2.0)-1.0),3)); //nonlin from previous sample, positive adds liveness when loud
+ nonlin = 0.0; //reset it here for setting up again next time
+ double tankfeedback = basefeedback + (pow(B,2) * 0.05);
+ //liveness
+ if (tankfeedback > 0.5) tankfeedback = 0.5;
+ if (tankfeedback < 0.4) tankfeedback = 0.4;
+ double iirAmountC = 1.0-pow(1.0-C,2);
+ //most of the range is up at the top end
+ iirAmountC += (iirAmountC/overallscale);
+ iirAmountC /= 2.0;
+ if (iirAmountC > 1.1) iirAmountC = 1.1;
+ //lowpass, check to see if it's working reasonably at 96K
+ double iirAmount = (((1.0-pow(D,2)) * 0.09)/overallscale)+0.001;
+ if (iirAmount > 1.0) iirAmount = 1.0;
+ if (iirAmount < 0.001) iirAmount = 0.001;
+ double wetness = F;
+ double dryness = 1.0 - wetness;
+ double roomsize = overallscale*0.203;
+ double lean = 0.125;
+ double invlean = 1.0 - lean;
+ double pspeed = 0.145;
+ double outcouple = 0.5 - tankfeedback;
+ double constallpass = 0.618033988749894848204586; //golden ratio!
+ double temp;
+ int allpasstemp;
+ double predelay = 0.222 * overallscale;
+
+ //reverb setup
+
+ delayA = (int(maxdelayA * roomsize));
+ delayB = (int(maxdelayB * roomsize));
+ delayC = (int(maxdelayC * roomsize));
+ delayD = (int(maxdelayD * roomsize));
+ delayE = (int(maxdelayE * roomsize));
+ delayF = (int(maxdelayF * roomsize));
+ delayG = (int(maxdelayG * roomsize));
+ delayH = (int(maxdelayH * roomsize));
+ delayI = (int(maxdelayI * roomsize));
+ delayJ = (int(maxdelayJ * roomsize));
+ delayK = (int(maxdelayK * roomsize));
+ delayL = (int(maxdelayL * roomsize));
+ delayM = (int(maxdelayM * roomsize));
+ delayN = (int(maxdelayN * roomsize));
+ delayO = (int(maxdelayO * roomsize));
+ delayP = (int(maxdelayP * roomsize));
+ delayQ = (int(maxdelayQ * roomsize));
+ delayR = (int(maxdelayR * roomsize));
+ delayS = (int(maxdelayS * roomsize));
+ delayT = (int(maxdelayT * roomsize));
+ delayU = (int(maxdelayU * roomsize));
+ delayV = (int(maxdelayV * roomsize));
+ delayW = (int(maxdelayW * roomsize));
+ delayX = (int(maxdelayX * roomsize));
+ delayY = (int(maxdelayY * roomsize));
+ delayZ = (int(maxdelayZ * roomsize));
+ delayMid = (int(maxdelayMid * roomsize));
+ delaySide = (int(maxdelaySide * roomsize));
+ delayLeft = (int(maxdelayLeft * roomsize));
+ delayRight = (int(maxdelayRight * roomsize));
+ delaypre = (int(maxdelaypre * predelay));
+
+ 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;
+
+
+ dpreL[onepre] = inputSampleL;
+ dpreR[onepre] = inputSampleR;
+ onepre--; if (onepre < 0 || onepre > delaypre) {onepre = delaypre;}
+ inputSampleL = (dpreL[onepre]);
+ inputSampleR = (dpreR[onepre]);
+ //predelay
+
+ interpolA += pitchshiftA*pspeed;
+ interpolB += pitchshiftB*pspeed;
+ interpolC += pitchshiftC*pspeed;
+ interpolD += pitchshiftD*pspeed;
+ interpolE += pitchshiftE*pspeed;
+ interpolF += pitchshiftF*pspeed;
+ interpolG += pitchshiftG*pspeed;
+ interpolH += pitchshiftH*pspeed;
+ interpolI += pitchshiftI*pspeed;
+ interpolJ += pitchshiftJ*pspeed;
+ interpolK += pitchshiftK*pspeed;
+ interpolL += pitchshiftL*pspeed;
+ interpolM += pitchshiftM*pspeed;
+ interpolN += pitchshiftN*pspeed;
+ interpolO += pitchshiftO*pspeed;
+ interpolP += pitchshiftP*pspeed;
+ interpolQ += pitchshiftQ*pspeed;
+ interpolR += pitchshiftR*pspeed;
+ interpolS += pitchshiftS*pspeed;
+ interpolT += pitchshiftT*pspeed;
+ interpolU += pitchshiftU*pspeed;
+ interpolV += pitchshiftV*pspeed;
+ interpolW += pitchshiftW*pspeed;
+ interpolX += pitchshiftX*pspeed;
+ interpolY += pitchshiftY*pspeed;
+ interpolZ += pitchshiftZ*pspeed;
+ //increment all the sub-sample offsets for the pitch shifting of combs
+
+ if (interpolA > 1.0) {pitchshiftA = -fabs(pitchshiftA); interpolA += pitchshiftA*pspeed;}
+ if (interpolB > 1.0) {pitchshiftB = -fabs(pitchshiftB); interpolB += pitchshiftB*pspeed;}
+ if (interpolC > 1.0) {pitchshiftC = -fabs(pitchshiftC); interpolC += pitchshiftC*pspeed;}
+ if (interpolD > 1.0) {pitchshiftD = -fabs(pitchshiftD); interpolD += pitchshiftD*pspeed;}
+ if (interpolE > 1.0) {pitchshiftE = -fabs(pitchshiftE); interpolE += pitchshiftE*pspeed;}
+ if (interpolF > 1.0) {pitchshiftF = -fabs(pitchshiftF); interpolF += pitchshiftF*pspeed;}
+ if (interpolG > 1.0) {pitchshiftG = -fabs(pitchshiftG); interpolG += pitchshiftG*pspeed;}
+ if (interpolH > 1.0) {pitchshiftH = -fabs(pitchshiftH); interpolH += pitchshiftH*pspeed;}
+ if (interpolI > 1.0) {pitchshiftI = -fabs(pitchshiftI); interpolI += pitchshiftI*pspeed;}
+ if (interpolJ > 1.0) {pitchshiftJ = -fabs(pitchshiftJ); interpolJ += pitchshiftJ*pspeed;}
+ if (interpolK > 1.0) {pitchshiftK = -fabs(pitchshiftK); interpolK += pitchshiftK*pspeed;}
+ if (interpolL > 1.0) {pitchshiftL = -fabs(pitchshiftL); interpolL += pitchshiftL*pspeed;}
+ if (interpolM > 1.0) {pitchshiftM = -fabs(pitchshiftM); interpolM += pitchshiftM*pspeed;}
+ if (interpolN > 1.0) {pitchshiftN = -fabs(pitchshiftN); interpolN += pitchshiftN*pspeed;}
+ if (interpolO > 1.0) {pitchshiftO = -fabs(pitchshiftO); interpolO += pitchshiftO*pspeed;}
+ if (interpolP > 1.0) {pitchshiftP = -fabs(pitchshiftP); interpolP += pitchshiftP*pspeed;}
+ if (interpolQ > 1.0) {pitchshiftQ = -fabs(pitchshiftQ); interpolQ += pitchshiftQ*pspeed;}
+ if (interpolR > 1.0) {pitchshiftR = -fabs(pitchshiftR); interpolR += pitchshiftR*pspeed;}
+ if (interpolS > 1.0) {pitchshiftS = -fabs(pitchshiftS); interpolS += pitchshiftS*pspeed;}
+ if (interpolT > 1.0) {pitchshiftT = -fabs(pitchshiftT); interpolT += pitchshiftT*pspeed;}
+ if (interpolU > 1.0) {pitchshiftU = -fabs(pitchshiftU); interpolU += pitchshiftU*pspeed;}
+ if (interpolV > 1.0) {pitchshiftV = -fabs(pitchshiftV); interpolV += pitchshiftV*pspeed;}
+ if (interpolW > 1.0) {pitchshiftW = -fabs(pitchshiftW); interpolW += pitchshiftW*pspeed;}
+ if (interpolX > 1.0) {pitchshiftX = -fabs(pitchshiftX); interpolX += pitchshiftX*pspeed;}
+ if (interpolY > 1.0) {pitchshiftY = -fabs(pitchshiftY); interpolY += pitchshiftY*pspeed;}
+ if (interpolZ > 1.0) {pitchshiftZ = -fabs(pitchshiftZ); interpolZ += pitchshiftZ*pspeed;}
+
+ if (interpolA < 0.0) {pitchshiftA = fabs(pitchshiftA); interpolA += pitchshiftA*pspeed;}
+ if (interpolB < 0.0) {pitchshiftB = fabs(pitchshiftB); interpolB += pitchshiftB*pspeed;}
+ if (interpolC < 0.0) {pitchshiftC = fabs(pitchshiftC); interpolC += pitchshiftC*pspeed;}
+ if (interpolD < 0.0) {pitchshiftD = fabs(pitchshiftD); interpolD += pitchshiftD*pspeed;}
+ if (interpolE < 0.0) {pitchshiftE = fabs(pitchshiftE); interpolE += pitchshiftE*pspeed;}
+ if (interpolF < 0.0) {pitchshiftF = fabs(pitchshiftF); interpolF += pitchshiftF*pspeed;}
+ if (interpolG < 0.0) {pitchshiftG = fabs(pitchshiftG); interpolG += pitchshiftG*pspeed;}
+ if (interpolH < 0.0) {pitchshiftH = fabs(pitchshiftH); interpolH += pitchshiftH*pspeed;}
+ if (interpolI < 0.0) {pitchshiftI = fabs(pitchshiftI); interpolI += pitchshiftI*pspeed;}
+ if (interpolJ < 0.0) {pitchshiftJ = fabs(pitchshiftJ); interpolJ += pitchshiftJ*pspeed;}
+ if (interpolK < 0.0) {pitchshiftK = fabs(pitchshiftK); interpolK += pitchshiftK*pspeed;}
+ if (interpolL < 0.0) {pitchshiftL = fabs(pitchshiftL); interpolL += pitchshiftL*pspeed;}
+ if (interpolM < 0.0) {pitchshiftM = fabs(pitchshiftM); interpolM += pitchshiftM*pspeed;}
+ if (interpolN < 0.0) {pitchshiftN = fabs(pitchshiftN); interpolN += pitchshiftN*pspeed;}
+ if (interpolO < 0.0) {pitchshiftO = fabs(pitchshiftO); interpolO += pitchshiftO*pspeed;}
+ if (interpolP < 0.0) {pitchshiftP = fabs(pitchshiftP); interpolP += pitchshiftP*pspeed;}
+ if (interpolQ < 0.0) {pitchshiftQ = fabs(pitchshiftQ); interpolQ += pitchshiftQ*pspeed;}
+ if (interpolR < 0.0) {pitchshiftR = fabs(pitchshiftR); interpolR += pitchshiftR*pspeed;}
+ if (interpolS < 0.0) {pitchshiftS = fabs(pitchshiftS); interpolS += pitchshiftS*pspeed;}
+ if (interpolT < 0.0) {pitchshiftT = fabs(pitchshiftT); interpolT += pitchshiftT*pspeed;}
+ if (interpolU < 0.0) {pitchshiftU = fabs(pitchshiftU); interpolU += pitchshiftU*pspeed;}
+ if (interpolV < 0.0) {pitchshiftV = fabs(pitchshiftV); interpolV += pitchshiftV*pspeed;}
+ if (interpolW < 0.0) {pitchshiftW = fabs(pitchshiftW); interpolW += pitchshiftW*pspeed;}
+ if (interpolX < 0.0) {pitchshiftX = fabs(pitchshiftX); interpolX += pitchshiftX*pspeed;}
+ if (interpolY < 0.0) {pitchshiftY = fabs(pitchshiftY); interpolY += pitchshiftY*pspeed;}
+ if (interpolZ < 0.0) {pitchshiftZ = fabs(pitchshiftZ); interpolZ += pitchshiftZ*pspeed;}
+ //all of the sanity checks for interpol for all combs
+
+ if (verboutR > 1.0) verboutR = 1.0;
+ if (verboutR < -1.0) verboutR = -1.0;
+ if (verboutL > 1.0) verboutL = 1.0;
+ if (verboutL < -1.0) verboutL = -1.0;
+
+ inputSampleL += verboutR;
+ inputSampleR += verboutL;
+ verboutL = 0.0;
+ verboutR = 0.0;
+ //here we add in the cross-coupling- output of L tank to R, output of R tank to L
+
+
+ mid = inputSampleL + inputSampleR;
+ side = inputSampleL - inputSampleR;
+ //assign mid and side.
+
+ allpasstemp = oneMid - 1;
+ if (allpasstemp < 0 || allpasstemp > delayMid) {allpasstemp = delayMid;}
+ mid -= dMid[allpasstemp]*constallpass;
+ dMid[oneMid] = mid;
+ mid *= constallpass;
+ oneMid--; if (oneMid < 0 || oneMid > delayMid) {oneMid = delayMid;}
+ mid += (dMid[oneMid]);
+ nonlin += fabs(dMid[oneMid]);
+ //allpass filter mid
+
+ allpasstemp = oneSide - 1;
+ if (allpasstemp < 0 || allpasstemp > delaySide) {allpasstemp = delaySide;}
+ side -= dSide[allpasstemp]*constallpass;
+ dSide[oneSide] = side;
+ side *= constallpass;
+ oneSide--; if (oneSide < 0 || oneSide > delaySide) {oneSide = delaySide;}
+ side += (dSide[oneSide]);
+ nonlin += fabs(dSide[oneSide]);
+ //allpass filter side
+
+ //here we do allpasses on the mid and side
+
+ allpasstemp = oneLeft - 1;
+ if (allpasstemp < 0 || allpasstemp > delayLeft) {allpasstemp = delayLeft;}
+ inputSampleL -= dLeft[allpasstemp]*constallpass;
+ dLeft[oneLeft] = verboutL;
+ inputSampleL *= constallpass;
+ oneLeft--; if (oneLeft < 0 || oneLeft > delayLeft) {oneLeft = delayLeft;}
+ inputSampleL += (dLeft[oneLeft]);
+ nonlin += fabs(dLeft[oneLeft]);
+ //allpass filter left
+
+
+ allpasstemp = oneRight - 1;
+ if (allpasstemp < 0 || allpasstemp > delayRight) {allpasstemp = delayRight;}
+ inputSampleR -= dRight[allpasstemp]*constallpass;
+ dRight[oneRight] = verboutR;
+ inputSampleR *= constallpass;
+ oneRight--; if (oneRight < 0 || oneRight > delayRight) {oneRight = delayRight;}
+ inputSampleR += (dRight[oneRight]);
+ nonlin += fabs(dRight[oneRight]);
+ //allpass filter right
+
+
+ inputSampleL += (mid+side)/2.0;
+ inputSampleR += (mid-side)/2.0;
+ //here we get back to a L/R topology by adding the mid/side in parallel with L/R
+
+
+
+ temp = (dA[oneA]*interpolA );
+ temp += (dA[treA]*( 1.0 - interpolA ));
+ temp += ((dA[twoA]));
+ dA[treA] = (temp*tankfeedback);
+ dA[treA] += inputSampleL;
+ oneA--; if (oneA < 0 || oneA > delayA) {oneA = delayA;}
+ twoA--; if (twoA < 0 || twoA > delayA) {twoA = delayA;}
+ treA--; if (treA < 0 || treA > delayA) {treA = delayA;}
+ temp = (dA[oneA]*interpolA );
+ temp += (dA[treA]*( 1.0 - interpolA ));
+ temp *= (invlean + (lean*fabs(dA[twoA])));
+ verboutL += temp;
+ //comb filter A
+ temp = (dC[oneC]*interpolC );
+ temp += (dC[treC]*( 1.0 - interpolC ));
+ temp += ((dC[twoC]));
+ dC[treC] = (temp*tankfeedback);
+ dC[treC] += inputSampleL;
+ oneC--; if (oneC < 0 || oneC > delayC) {oneC = delayC;}
+ twoC--; if (twoC < 0 || twoC > delayC) {twoC = delayC;}
+ treC--; if (treC < 0 || treC > delayC) {treC = delayC;}
+ temp = (dC[oneC]*interpolC );
+ temp += (dC[treC]*( 1.0 - interpolC ));
+ temp *= (invlean + (lean*fabs(dC[twoC])));
+ verboutL += temp;
+ //comb filter C
+ temp = (dE[oneE]*interpolE );
+ temp += (dE[treE]*( 1.0 - interpolE ));
+ temp += ((dE[twoE]));
+ dE[treE] = (temp*tankfeedback);
+ dE[treE] += inputSampleL;
+ oneE--; if (oneE < 0 || oneE > delayE) {oneE = delayE;}
+ twoE--; if (twoE < 0 || twoE > delayE) {twoE = delayE;}
+ treE--; if (treE < 0 || treE > delayE) {treE = delayE;}
+ temp = (dE[oneE]*interpolE );
+ temp += (dE[treE]*( 1.0 - interpolE ));
+ temp *= (invlean + (lean*fabs(dE[twoE])));
+ verboutL += temp;
+ //comb filter E
+ temp = (dG[oneG]*interpolG );
+ temp += (dG[treG]*( 1.0 - interpolG ));
+ temp += ((dG[twoG]));
+ dG[treG] = (temp*tankfeedback);
+ dG[treG] += inputSampleL;
+ oneG--; if (oneG < 0 || oneG > delayG) {oneG = delayG;}
+ twoG--; if (twoG < 0 || twoG > delayG) {twoG = delayG;}
+ treG--; if (treG < 0 || treG > delayG) {treG = delayG;}
+ temp = (dG[oneG]*interpolG );
+ temp += (dG[treG]*( 1.0 - interpolG ));
+ temp *= (invlean + (lean*fabs(dG[twoG])));
+ verboutL += temp;
+ //comb filter G
+ temp = (dI[oneI]*interpolI );
+ temp += (dI[treI]*( 1.0 - interpolI ));
+ temp += ((dI[twoI]));
+ dI[treI] = (temp*tankfeedback);
+ dI[treI] += inputSampleL;
+ oneI--; if (oneI < 0 || oneI > delayI) {oneI = delayI;}
+ twoI--; if (twoI < 0 || twoI > delayI) {twoI = delayI;}
+ treI--; if (treI < 0 || treI > delayI) {treI = delayI;}
+ temp = (dI[oneI]*interpolI );
+ temp += (dI[treI]*( 1.0 - interpolI ));
+ temp *= (invlean + (lean*fabs(dI[twoI])));
+ verboutL += temp;
+ //comb filter I
+ temp = (dK[oneK]*interpolK );
+ temp += (dK[treK]*( 1.0 - interpolK ));
+ temp += ((dK[twoK]));
+ dK[treK] = (temp*tankfeedback);
+ dK[treK] += inputSampleL;
+ oneK--; if (oneK < 0 || oneK > delayK) {oneK = delayK;}
+ twoK--; if (twoK < 0 || twoK > delayK) {twoK = delayK;}
+ treK--; if (treK < 0 || treK > delayK) {treK = delayK;}
+ temp = (dK[oneK]*interpolK );
+ temp += (dK[treK]*( 1.0 - interpolK ));
+ temp *= (invlean + (lean*fabs(dK[twoK])));
+ verboutL += temp;
+ //comb filter K
+ temp = (dM[oneM]*interpolM );
+ temp += (dM[treM]*( 1.0 - interpolM ));
+ temp += ((dM[twoM]));
+ dM[treM] = (temp*tankfeedback);
+ dM[treM] += inputSampleL;
+ oneM--; if (oneM < 0 || oneM > delayM) {oneM = delayM;}
+ twoM--; if (twoM < 0 || twoM > delayM) {twoM = delayM;}
+ treM--; if (treM < 0 || treM > delayM) {treM = delayM;}
+ temp = (dM[oneM]*interpolM );
+ temp += (dM[treM]*( 1.0 - interpolM ));
+ temp *= (invlean + (lean*fabs(dM[twoM])));
+ verboutL += temp;
+ //comb filter M
+ temp = (dO[oneO]*interpolO );
+ temp += (dO[treO]*( 1.0 - interpolO ));
+ temp += ((dO[twoO]));
+ dO[treO] = (temp*tankfeedback);
+ dO[treO] += inputSampleL;
+ oneO--; if (oneO < 0 || oneO > delayO) {oneO = delayO;}
+ twoO--; if (twoO < 0 || twoO > delayO) {twoO = delayO;}
+ treO--; if (treO < 0 || treO > delayO) {treO = delayO;}
+ temp = (dO[oneO]*interpolO );
+ temp += (dO[treO]*( 1.0 - interpolO ));
+ temp *= (invlean + (lean*fabs(dO[twoO])));
+ verboutL += temp;
+ //comb filter O
+ temp = (dQ[oneQ]*interpolQ );
+ temp += (dQ[treQ]*( 1.0 - interpolQ ));
+ temp += ((dQ[twoQ]));
+ dQ[treQ] = (temp*tankfeedback);
+ dQ[treQ] += inputSampleL;
+ oneQ--; if (oneQ < 0 || oneQ > delayQ) {oneQ = delayQ;}
+ twoQ--; if (twoQ < 0 || twoQ > delayQ) {twoQ = delayQ;}
+ treQ--; if (treQ < 0 || treQ > delayQ) {treQ = delayQ;}
+ temp = (dQ[oneQ]*interpolQ );
+ temp += (dQ[treQ]*( 1.0 - interpolQ ));
+ temp *= (invlean + (lean*fabs(dQ[twoQ])));
+ verboutL += temp;
+ //comb filter Q
+ temp = (dS[oneS]*interpolS );
+ temp += (dS[treS]*( 1.0 - interpolS ));
+ temp += ((dS[twoS]));
+ dS[treS] = (temp*tankfeedback);
+ dS[treS] += inputSampleL;
+ oneS--; if (oneS < 0 || oneS > delayS) {oneS = delayS;}
+ twoS--; if (twoS < 0 || twoS > delayS) {twoS = delayS;}
+ treS--; if (treS < 0 || treS > delayS) {treS = delayS;}
+ temp = (dS[oneS]*interpolS );
+ temp += (dS[treS]*( 1.0 - interpolS ));
+ temp *= (invlean + (lean*fabs(dS[twoS])));
+ verboutL += temp;
+ //comb filter S
+ temp = (dU[oneU]*interpolU );
+ temp += (dU[treU]*( 1.0 - interpolU ));
+ temp += ((dU[twoU]));
+ dU[treU] = (temp*tankfeedback);
+ dU[treU] += inputSampleL;
+ oneU--; if (oneU < 0 || oneU > delayU) {oneU = delayU;}
+ twoU--; if (twoU < 0 || twoU > delayU) {twoU = delayU;}
+ treU--; if (treU < 0 || treU > delayU) {treU = delayU;}
+ temp = (dU[oneU]*interpolU );
+ temp += (dU[treU]*( 1.0 - interpolU ));
+ temp *= (invlean + (lean*fabs(dU[twoU])));
+ verboutL += temp;
+ //comb filter U
+ temp = (dW[oneW]*interpolW );
+ temp += (dW[treW]*( 1.0 - interpolW ));
+ temp += ((dW[twoW]));
+ dW[treW] = (temp*tankfeedback);
+ dW[treW] += inputSampleL;
+ oneW--; if (oneW < 0 || oneW > delayW) {oneW = delayW;}
+ twoW--; if (twoW < 0 || twoW > delayW) {twoW = delayW;}
+ treW--; if (treW < 0 || treW > delayW) {treW = delayW;}
+ temp = (dW[oneW]*interpolW );
+ temp += (dW[treW]*( 1.0 - interpolW ));
+ temp *= (invlean + (lean*fabs(dW[twoW])));
+ verboutL += temp;
+ //comb filter W
+ temp = (dY[oneY]*interpolY );
+ temp += (dY[treY]*( 1.0 - interpolY ));
+ temp += ((dY[twoY]));
+ dY[treY] = (temp*tankfeedback);
+ dY[treY] += inputSampleL;
+ oneY--; if (oneY < 0 || oneY > delayY) {oneY = delayY;}
+ twoY--; if (twoY < 0 || twoY > delayY) {twoY = delayY;}
+ treY--; if (treY < 0 || treY > delayY) {treY = delayY;}
+ temp = (dY[oneY]*interpolY );
+ temp += (dY[treY]*( 1.0 - interpolY ));
+ temp *= (invlean + (lean*fabs(dY[twoY])));
+ verboutL += temp;
+ //comb filter Y
+ //here we do the L delay tank, every other letter A C E G I
+
+ temp = (dB[oneB]*interpolB );
+ temp += (dB[treB]*( 1.0 - interpolB ));
+ temp += ((dB[twoB]));
+ dB[treB] = (temp*tankfeedback);
+ dB[treB] += inputSampleR;
+ oneB--; if (oneB < 0 || oneB > delayB) {oneB = delayB;}
+ twoB--; if (twoB < 0 || twoB > delayB) {twoB = delayB;}
+ treB--; if (treB < 0 || treB > delayB) {treB = delayB;}
+ temp = (dB[oneB]*interpolB );
+ temp += (dB[treB]*( 1.0 - interpolB ));
+ temp *= (invlean + (lean*fabs(dB[twoB])));
+ verboutR += temp;
+ //comb filter B
+ temp = (dD[oneD]*interpolD );
+ temp += (dD[treD]*( 1.0 - interpolD ));
+ temp += ((dD[twoD]));
+ dD[treD] = (temp*tankfeedback);
+ dD[treD] += inputSampleR;
+ oneD--; if (oneD < 0 || oneD > delayD) {oneD = delayD;}
+ twoD--; if (twoD < 0 || twoD > delayD) {twoD = delayD;}
+ treD--; if (treD < 0 || treD > delayD) {treD = delayD;}
+ temp = (dD[oneD]*interpolD );
+ temp += (dD[treD]*( 1.0 - interpolD ));
+ temp *= (invlean + (lean*fabs(dD[twoD])));
+ verboutR += temp;
+ //comb filter D
+ temp = (dF[oneF]*interpolF );
+ temp += (dF[treF]*( 1.0 - interpolF ));
+ temp += ((dF[twoF]));
+ dF[treF] = (temp*tankfeedback);
+ dF[treF] += inputSampleR;
+ oneF--; if (oneF < 0 || oneF > delayF) {oneF = delayF;}
+ twoF--; if (twoF < 0 || twoF > delayF) {twoF = delayF;}
+ treF--; if (treF < 0 || treF > delayF) {treF = delayF;}
+ temp = (dF[oneF]*interpolF );
+ temp += (dF[treF]*( 1.0 - interpolF ));
+ temp *= (invlean + (lean*fabs(dF[twoF])));
+ verboutR += temp;
+ //comb filter F
+ temp = (dH[oneH]*interpolH );
+ temp += (dH[treH]*( 1.0 - interpolH ));
+ temp += ((dH[twoH]));
+ dH[treH] = (temp*tankfeedback);
+ dH[treH] += inputSampleR;
+ oneH--; if (oneH < 0 || oneH > delayH) {oneH = delayH;}
+ twoH--; if (twoH < 0 || twoH > delayH) {twoH = delayH;}
+ treH--; if (treH < 0 || treH > delayH) {treH = delayH;}
+ temp = (dH[oneH]*interpolH );
+ temp += (dH[treH]*( 1.0 - interpolH ));
+ temp *= (invlean + (lean*fabs(dH[twoH])));
+ verboutR += temp;
+ //comb filter H
+ temp = (dJ[oneJ]*interpolJ );
+ temp += (dJ[treJ]*( 1.0 - interpolJ ));
+ temp += ((dJ[twoJ]));
+ dJ[treJ] = (temp*tankfeedback);
+ dJ[treJ] += inputSampleR;
+ oneJ--; if (oneJ < 0 || oneJ > delayJ) {oneJ = delayJ;}
+ twoJ--; if (twoJ < 0 || twoJ > delayJ) {twoJ = delayJ;}
+ treJ--; if (treJ < 0 || treJ > delayJ) {treJ = delayJ;}
+ temp = (dJ[oneJ]*interpolJ );
+ temp += (dJ[treJ]*( 1.0 - interpolJ ));
+ temp *= (invlean + (lean*fabs(dJ[twoJ])));
+ verboutR += temp;
+ //comb filter J
+ temp = (dL[oneL]*interpolL );
+ temp += (dL[treL]*( 1.0 - interpolL ));
+ temp += ((dL[twoL]));
+ dL[treL] = (temp*tankfeedback);
+ dL[treL] += inputSampleR;
+ oneL--; if (oneL < 0 || oneL > delayL) {oneL = delayL;}
+ twoL--; if (twoL < 0 || twoL > delayL) {twoL = delayL;}
+ treL--; if (treL < 0 || treL > delayL) {treL = delayL;}
+ temp = (dL[oneL]*interpolL );
+ temp += (dL[treL]*( 1.0 - interpolL ));
+ temp *= (invlean + (lean*fabs(dL[twoL])));
+ verboutR += temp;
+ //comb filter L
+ temp = (dN[oneN]*interpolN );
+ temp += (dN[treN]*( 1.0 - interpolN ));
+ temp += ((dN[twoN]));
+ dN[treN] = (temp*tankfeedback);
+ dN[treN] += inputSampleR;
+ oneN--; if (oneN < 0 || oneN > delayN) {oneN = delayN;}
+ twoN--; if (twoN < 0 || twoN > delayN) {twoN = delayN;}
+ treN--; if (treN < 0 || treN > delayN) {treN = delayN;}
+ temp = (dN[oneN]*interpolN );
+ temp += (dN[treN]*( 1.0 - interpolN ));
+ temp *= (invlean + (lean*fabs(dN[twoN])));
+ verboutR += temp;
+ //comb filter N
+ temp = (dP[oneP]*interpolP );
+ temp += (dP[treP]*( 1.0 - interpolP ));
+ temp += ((dP[twoP]));
+ dP[treP] = (temp*tankfeedback);
+ dP[treP] += inputSampleR;
+ oneP--; if (oneP < 0 || oneP > delayP) {oneP = delayP;}
+ twoP--; if (twoP < 0 || twoP > delayP) {twoP = delayP;}
+ treP--; if (treP < 0 || treP > delayP) {treP = delayP;}
+ temp = (dP[oneP]*interpolP );
+ temp += (dP[treP]*( 1.0 - interpolP ));
+ temp *= (invlean + (lean*fabs(dP[twoP])));
+ verboutR += temp;
+ //comb filter P
+ temp = (dR[oneR]*interpolR );
+ temp += (dR[treR]*( 1.0 - interpolR ));
+ temp += ((dR[twoR]));
+ dR[treR] = (temp*tankfeedback);
+ dR[treR] += inputSampleR;
+ oneR--; if (oneR < 0 || oneR > delayR) {oneR = delayR;}
+ twoR--; if (twoR < 0 || twoR > delayR) {twoR = delayR;}
+ treR--; if (treR < 0 || treR > delayR) {treR = delayR;}
+ temp = (dR[oneR]*interpolR );
+ temp += (dR[treR]*( 1.0 - interpolR ));
+ temp *= (invlean + (lean*fabs(dR[twoR])));
+ verboutR += temp;
+ //comb filter R
+ temp = (dT[oneT]*interpolT );
+ temp += (dT[treT]*( 1.0 - interpolT ));
+ temp += ((dT[twoT]));
+ dT[treT] = (temp*tankfeedback);
+ dT[treT] += inputSampleR;
+ oneT--; if (oneT < 0 || oneT > delayT) {oneT = delayT;}
+ twoT--; if (twoT < 0 || twoT > delayT) {twoT = delayT;}
+ treT--; if (treT < 0 || treT > delayT) {treT = delayT;}
+ temp = (dT[oneT]*interpolT );
+ temp += (dT[treT]*( 1.0 - interpolT ));
+ temp *= (invlean + (lean*fabs(dT[twoT])));
+ verboutR += temp;
+ //comb filter T
+ temp = (dV[oneV]*interpolV );
+ temp += (dV[treV]*( 1.0 - interpolV ));
+ temp += ((dV[twoV]));
+ dV[treV] = (temp*tankfeedback);
+ dV[treV] += inputSampleR;
+ oneV--; if (oneV < 0 || oneV > delayV) {oneV = delayV;}
+ twoV--; if (twoV < 0 || twoV > delayV) {twoV = delayV;}
+ treV--; if (treV < 0 || treV > delayV) {treV = delayV;}
+ temp = (dV[oneV]*interpolV );
+ temp += (dV[treV]*( 1.0 - interpolV ));
+ temp *= (invlean + (lean*fabs(dV[twoV])));
+ verboutR += temp;
+ //comb filter V
+ temp = (dX[oneX]*interpolX );
+ temp += (dX[treX]*( 1.0 - interpolX ));
+ temp += ((dX[twoX]));
+ dX[treX] = (temp*tankfeedback);
+ dX[treX] += inputSampleR;
+ oneX--; if (oneX < 0 || oneX > delayX) {oneX = delayX;}
+ twoX--; if (twoX < 0 || twoX > delayX) {twoX = delayX;}
+ treX--; if (treX < 0 || treX > delayX) {treX = delayX;}
+ temp = (dX[oneX]*interpolX );
+ temp += (dX[treX]*( 1.0 - interpolX ));
+ temp *= (invlean + (lean*fabs(dX[twoX])));
+ verboutR += temp;
+ //comb filter X
+ temp = (dZ[oneZ]*interpolZ );
+ temp += (dZ[treZ]*( 1.0 - interpolZ ));
+ temp += ((dZ[twoZ]));
+ dZ[treZ] = (temp*tankfeedback);
+ dZ[treZ] += inputSampleR;
+ oneZ--; if (oneZ < 0 || oneZ > delayZ) {oneZ = delayZ;}
+ twoZ--; if (twoZ < 0 || twoZ > delayZ) {twoZ = delayZ;}
+ treZ--; if (treZ < 0 || treZ > delayZ) {treZ = delayZ;}
+ temp = (dZ[oneZ]*interpolZ );
+ temp += (dZ[treZ]*( 1.0 - interpolZ ));
+ temp *= (invlean + (lean*fabs(dZ[twoZ])));
+ verboutR += temp;
+ //comb filter Z
+ //here we do the R delay tank, every other letter B D F H J
+
+ verboutL /= 8;
+ verboutR /= 8;
+
+ iirSampleL = (iirSampleL * (1 - iirAmount)) + (verboutL * iirAmount);
+ verboutL = verboutL - iirSampleL;
+
+ iirSampleR = (iirSampleR * (1 - iirAmount)) + (verboutR * iirAmount);
+ verboutR = verboutR - iirSampleR;
+ //we need to highpass the crosscoupling, it's making DC runaway
+
+ verboutL *= (invlean + (lean*fabs(verboutL)));
+ verboutR *= (invlean + (lean*fabs(verboutR)));
+ //scale back the verb tank the same way we scaled the combs
+
+ inputSampleL = verboutL;
+ inputSampleR = verboutR;
+
+ //EQ lowpass is after all processing like the compressor that might produce hash
+ if (flip)
+ {
+ lowpassSampleAA = (lowpassSampleAA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleAA;
+ lowpassSampleBA = (lowpassSampleBA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleBA;
+ lowpassSampleCA = (lowpassSampleCA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleCA;
+ lowpassSampleDA = (lowpassSampleDA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleDA;
+ lowpassSampleE = (lowpassSampleE * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleE;
+ }
+ else
+ {
+ lowpassSampleAB = (lowpassSampleAB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleAB;
+ lowpassSampleBB = (lowpassSampleBB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleBB;
+ lowpassSampleCB = (lowpassSampleCB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleCB;
+ lowpassSampleDB = (lowpassSampleDB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleDB;
+ lowpassSampleF = (lowpassSampleF * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleF;
+ }
+ lowpassSampleG = (lowpassSampleG * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = (lowpassSampleG * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+
+
+ if (flip)
+ {
+ rowpassSampleAA = (rowpassSampleAA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleAA;
+ rowpassSampleBA = (rowpassSampleBA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleBA;
+ rowpassSampleCA = (rowpassSampleCA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleCA;
+ rowpassSampleDA = (rowpassSampleDA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleDA;
+ rowpassSampleE = (rowpassSampleE * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleE;
+ }
+ else
+ {
+ rowpassSampleAB = (rowpassSampleAB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleAB;
+ rowpassSampleBB = (rowpassSampleBB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleBB;
+ rowpassSampleCB = (rowpassSampleCB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleCB;
+ rowpassSampleDB = (rowpassSampleDB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleDB;
+ rowpassSampleF = (rowpassSampleF * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleF;
+ }
+ rowpassSampleG = (rowpassSampleG * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = (rowpassSampleG * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+
+ iirCCSampleL = (iirCCSampleL * (1 - iirAmount)) + (verboutL * iirAmount);
+ verboutL = verboutL - iirCCSampleL;
+
+ iirCCSampleR = (iirCCSampleR * (1 - iirAmount)) + (verboutR * iirAmount);
+ verboutR = verboutR - iirCCSampleR;
+ //we need to highpass the crosscoupling, it's making DC runaway
+
+ verboutL *= (invlean + (lean*fabs(verboutL)));
+ verboutR *= (invlean + (lean*fabs(verboutR)));
+ //scale back the crosscouple the same way we scaled the combs
+ verboutL = (inputSampleL) * outcouple;
+ verboutR = (inputSampleR) * outcouple;
+ //send it off to the input again
+
+ nonlin += fabs(verboutL);
+ nonlin += fabs(verboutR);//post highpassing and a lot of processing
+
+ drySampleL *= dryness;
+ drySampleR *= dryness;
+
+ inputSampleL *= wetness;
+ inputSampleR *= wetness;
+
+ inputSampleL += drySampleL;
+ inputSampleR += drySampleR;
+ //here we combine the tanks with the dry signal
+
+ //noise shaping to 32-bit floating point
+ if (fpFlip) {
+ fpTemp = inputSampleL;
+ fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
+ inputSampleL += fpNShapeLA;
+ fpTemp = inputSampleR;
+ fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
+ inputSampleR += fpNShapeRA;
+ }
+ else {
+ fpTemp = inputSampleL;
+ fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
+ inputSampleL += fpNShapeLB;
+ fpTemp = inputSampleR;
+ fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
+ inputSampleR += fpNShapeRB;
+ }
+ fpFlip = !fpFlip;
+ //end noise shaping on 32 bit output
+ flip = !flip;
+
+ *out1 = inputSampleL;
+ *out2 = inputSampleR;
+
+ *in1++;
+ *in2++;
+ *out1++;
+ *out2++;
+ }
+}
+
+void NonlinearSpace::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
+{
+ double* in1 = inputs[0];
+ double* in2 = inputs[1];
+ double* out1 = outputs[0];
+ double* out2 = outputs[1];
+
+ double fpTemp;
+ long double fpOld = 0.618033988749894848204586; //golden ratio!
+ long double fpNew = 1.0 - fpOld;
+
+ double drySampleL;
+ double drySampleR;
+ long double inputSampleL;
+ long double inputSampleR;
+ long double mid;
+ long double side;
+ double overallscale = 1.0;
+ int samplerate = (int)( A * 6.999 )+1;
+ switch (samplerate)
+ {
+ case 1: overallscale *= (16.0/44.1); break; //16
+ case 2: overallscale *= (32.0/44.1); break; //32
+ case 3: overallscale *= 1.0; break; //44.1
+ case 4: overallscale *= (48.0/44.1); break; //48
+ case 5: overallscale *= (64.0/44.1); break; //64
+ case 6: overallscale *= 2.0; break; //88.2
+ case 7: overallscale *= (96.0/44.1); break; //96
+ }
+ nonlin *= 0.001; //scale suitably to apply to our liveness value
+ double basefeedback = 0.45 + (nonlin * pow(((E*2.0)-1.0),3)); //nonlin from previous sample, positive adds liveness when loud
+ nonlin = 0.0; //reset it here for setting up again next time
+ double tankfeedback = basefeedback + (pow(B,2) * 0.05);
+ //liveness
+ if (tankfeedback > 0.5) tankfeedback = 0.5;
+ if (tankfeedback < 0.4) tankfeedback = 0.4;
+ double iirAmountC = 1.0-pow(1.0-C,2);
+ //most of the range is up at the top end
+ iirAmountC += (iirAmountC/overallscale);
+ iirAmountC /= 2.0;
+ if (iirAmountC > 1.1) iirAmountC = 1.1;
+ //lowpass, check to see if it's working reasonably at 96K
+ double iirAmount = (((1.0-pow(D,2)) * 0.09)/overallscale)+0.001;
+ if (iirAmount > 1.0) iirAmount = 1.0;
+ if (iirAmount < 0.001) iirAmount = 0.001;
+ double wetness = F;
+ double dryness = 1.0 - wetness;
+ double roomsize = overallscale*0.203;
+ double lean = 0.125;
+ double invlean = 1.0 - lean;
+ double pspeed = 0.145;
+ double outcouple = 0.5 - tankfeedback;
+ double constallpass = 0.618033988749894848204586; //golden ratio!
+ double temp;
+ int allpasstemp;
+ double predelay = 0.222 * overallscale;
+
+ //reverb setup
+
+ delayA = (int(maxdelayA * roomsize));
+ delayB = (int(maxdelayB * roomsize));
+ delayC = (int(maxdelayC * roomsize));
+ delayD = (int(maxdelayD * roomsize));
+ delayE = (int(maxdelayE * roomsize));
+ delayF = (int(maxdelayF * roomsize));
+ delayG = (int(maxdelayG * roomsize));
+ delayH = (int(maxdelayH * roomsize));
+ delayI = (int(maxdelayI * roomsize));
+ delayJ = (int(maxdelayJ * roomsize));
+ delayK = (int(maxdelayK * roomsize));
+ delayL = (int(maxdelayL * roomsize));
+ delayM = (int(maxdelayM * roomsize));
+ delayN = (int(maxdelayN * roomsize));
+ delayO = (int(maxdelayO * roomsize));
+ delayP = (int(maxdelayP * roomsize));
+ delayQ = (int(maxdelayQ * roomsize));
+ delayR = (int(maxdelayR * roomsize));
+ delayS = (int(maxdelayS * roomsize));
+ delayT = (int(maxdelayT * roomsize));
+ delayU = (int(maxdelayU * roomsize));
+ delayV = (int(maxdelayV * roomsize));
+ delayW = (int(maxdelayW * roomsize));
+ delayX = (int(maxdelayX * roomsize));
+ delayY = (int(maxdelayY * roomsize));
+ delayZ = (int(maxdelayZ * roomsize));
+ delayMid = (int(maxdelayMid * roomsize));
+ delaySide = (int(maxdelaySide * roomsize));
+ delayLeft = (int(maxdelayLeft * roomsize));
+ delayRight = (int(maxdelayRight * roomsize));
+ delaypre = (int(maxdelaypre * predelay));
+
+ 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;
+
+
+ dpreL[onepre] = inputSampleL;
+ dpreR[onepre] = inputSampleR;
+ onepre--; if (onepre < 0 || onepre > delaypre) {onepre = delaypre;}
+ inputSampleL = (dpreL[onepre]);
+ inputSampleR = (dpreR[onepre]);
+ //predelay
+
+ interpolA += pitchshiftA*pspeed;
+ interpolB += pitchshiftB*pspeed;
+ interpolC += pitchshiftC*pspeed;
+ interpolD += pitchshiftD*pspeed;
+ interpolE += pitchshiftE*pspeed;
+ interpolF += pitchshiftF*pspeed;
+ interpolG += pitchshiftG*pspeed;
+ interpolH += pitchshiftH*pspeed;
+ interpolI += pitchshiftI*pspeed;
+ interpolJ += pitchshiftJ*pspeed;
+ interpolK += pitchshiftK*pspeed;
+ interpolL += pitchshiftL*pspeed;
+ interpolM += pitchshiftM*pspeed;
+ interpolN += pitchshiftN*pspeed;
+ interpolO += pitchshiftO*pspeed;
+ interpolP += pitchshiftP*pspeed;
+ interpolQ += pitchshiftQ*pspeed;
+ interpolR += pitchshiftR*pspeed;
+ interpolS += pitchshiftS*pspeed;
+ interpolT += pitchshiftT*pspeed;
+ interpolU += pitchshiftU*pspeed;
+ interpolV += pitchshiftV*pspeed;
+ interpolW += pitchshiftW*pspeed;
+ interpolX += pitchshiftX*pspeed;
+ interpolY += pitchshiftY*pspeed;
+ interpolZ += pitchshiftZ*pspeed;
+ //increment all the sub-sample offsets for the pitch shifting of combs
+
+ if (interpolA > 1.0) {pitchshiftA = -fabs(pitchshiftA); interpolA += pitchshiftA*pspeed;}
+ if (interpolB > 1.0) {pitchshiftB = -fabs(pitchshiftB); interpolB += pitchshiftB*pspeed;}
+ if (interpolC > 1.0) {pitchshiftC = -fabs(pitchshiftC); interpolC += pitchshiftC*pspeed;}
+ if (interpolD > 1.0) {pitchshiftD = -fabs(pitchshiftD); interpolD += pitchshiftD*pspeed;}
+ if (interpolE > 1.0) {pitchshiftE = -fabs(pitchshiftE); interpolE += pitchshiftE*pspeed;}
+ if (interpolF > 1.0) {pitchshiftF = -fabs(pitchshiftF); interpolF += pitchshiftF*pspeed;}
+ if (interpolG > 1.0) {pitchshiftG = -fabs(pitchshiftG); interpolG += pitchshiftG*pspeed;}
+ if (interpolH > 1.0) {pitchshiftH = -fabs(pitchshiftH); interpolH += pitchshiftH*pspeed;}
+ if (interpolI > 1.0) {pitchshiftI = -fabs(pitchshiftI); interpolI += pitchshiftI*pspeed;}
+ if (interpolJ > 1.0) {pitchshiftJ = -fabs(pitchshiftJ); interpolJ += pitchshiftJ*pspeed;}
+ if (interpolK > 1.0) {pitchshiftK = -fabs(pitchshiftK); interpolK += pitchshiftK*pspeed;}
+ if (interpolL > 1.0) {pitchshiftL = -fabs(pitchshiftL); interpolL += pitchshiftL*pspeed;}
+ if (interpolM > 1.0) {pitchshiftM = -fabs(pitchshiftM); interpolM += pitchshiftM*pspeed;}
+ if (interpolN > 1.0) {pitchshiftN = -fabs(pitchshiftN); interpolN += pitchshiftN*pspeed;}
+ if (interpolO > 1.0) {pitchshiftO = -fabs(pitchshiftO); interpolO += pitchshiftO*pspeed;}
+ if (interpolP > 1.0) {pitchshiftP = -fabs(pitchshiftP); interpolP += pitchshiftP*pspeed;}
+ if (interpolQ > 1.0) {pitchshiftQ = -fabs(pitchshiftQ); interpolQ += pitchshiftQ*pspeed;}
+ if (interpolR > 1.0) {pitchshiftR = -fabs(pitchshiftR); interpolR += pitchshiftR*pspeed;}
+ if (interpolS > 1.0) {pitchshiftS = -fabs(pitchshiftS); interpolS += pitchshiftS*pspeed;}
+ if (interpolT > 1.0) {pitchshiftT = -fabs(pitchshiftT); interpolT += pitchshiftT*pspeed;}
+ if (interpolU > 1.0) {pitchshiftU = -fabs(pitchshiftU); interpolU += pitchshiftU*pspeed;}
+ if (interpolV > 1.0) {pitchshiftV = -fabs(pitchshiftV); interpolV += pitchshiftV*pspeed;}
+ if (interpolW > 1.0) {pitchshiftW = -fabs(pitchshiftW); interpolW += pitchshiftW*pspeed;}
+ if (interpolX > 1.0) {pitchshiftX = -fabs(pitchshiftX); interpolX += pitchshiftX*pspeed;}
+ if (interpolY > 1.0) {pitchshiftY = -fabs(pitchshiftY); interpolY += pitchshiftY*pspeed;}
+ if (interpolZ > 1.0) {pitchshiftZ = -fabs(pitchshiftZ); interpolZ += pitchshiftZ*pspeed;}
+
+ if (interpolA < 0.0) {pitchshiftA = fabs(pitchshiftA); interpolA += pitchshiftA*pspeed;}
+ if (interpolB < 0.0) {pitchshiftB = fabs(pitchshiftB); interpolB += pitchshiftB*pspeed;}
+ if (interpolC < 0.0) {pitchshiftC = fabs(pitchshiftC); interpolC += pitchshiftC*pspeed;}
+ if (interpolD < 0.0) {pitchshiftD = fabs(pitchshiftD); interpolD += pitchshiftD*pspeed;}
+ if (interpolE < 0.0) {pitchshiftE = fabs(pitchshiftE); interpolE += pitchshiftE*pspeed;}
+ if (interpolF < 0.0) {pitchshiftF = fabs(pitchshiftF); interpolF += pitchshiftF*pspeed;}
+ if (interpolG < 0.0) {pitchshiftG = fabs(pitchshiftG); interpolG += pitchshiftG*pspeed;}
+ if (interpolH < 0.0) {pitchshiftH = fabs(pitchshiftH); interpolH += pitchshiftH*pspeed;}
+ if (interpolI < 0.0) {pitchshiftI = fabs(pitchshiftI); interpolI += pitchshiftI*pspeed;}
+ if (interpolJ < 0.0) {pitchshiftJ = fabs(pitchshiftJ); interpolJ += pitchshiftJ*pspeed;}
+ if (interpolK < 0.0) {pitchshiftK = fabs(pitchshiftK); interpolK += pitchshiftK*pspeed;}
+ if (interpolL < 0.0) {pitchshiftL = fabs(pitchshiftL); interpolL += pitchshiftL*pspeed;}
+ if (interpolM < 0.0) {pitchshiftM = fabs(pitchshiftM); interpolM += pitchshiftM*pspeed;}
+ if (interpolN < 0.0) {pitchshiftN = fabs(pitchshiftN); interpolN += pitchshiftN*pspeed;}
+ if (interpolO < 0.0) {pitchshiftO = fabs(pitchshiftO); interpolO += pitchshiftO*pspeed;}
+ if (interpolP < 0.0) {pitchshiftP = fabs(pitchshiftP); interpolP += pitchshiftP*pspeed;}
+ if (interpolQ < 0.0) {pitchshiftQ = fabs(pitchshiftQ); interpolQ += pitchshiftQ*pspeed;}
+ if (interpolR < 0.0) {pitchshiftR = fabs(pitchshiftR); interpolR += pitchshiftR*pspeed;}
+ if (interpolS < 0.0) {pitchshiftS = fabs(pitchshiftS); interpolS += pitchshiftS*pspeed;}
+ if (interpolT < 0.0) {pitchshiftT = fabs(pitchshiftT); interpolT += pitchshiftT*pspeed;}
+ if (interpolU < 0.0) {pitchshiftU = fabs(pitchshiftU); interpolU += pitchshiftU*pspeed;}
+ if (interpolV < 0.0) {pitchshiftV = fabs(pitchshiftV); interpolV += pitchshiftV*pspeed;}
+ if (interpolW < 0.0) {pitchshiftW = fabs(pitchshiftW); interpolW += pitchshiftW*pspeed;}
+ if (interpolX < 0.0) {pitchshiftX = fabs(pitchshiftX); interpolX += pitchshiftX*pspeed;}
+ if (interpolY < 0.0) {pitchshiftY = fabs(pitchshiftY); interpolY += pitchshiftY*pspeed;}
+ if (interpolZ < 0.0) {pitchshiftZ = fabs(pitchshiftZ); interpolZ += pitchshiftZ*pspeed;}
+ //all of the sanity checks for interpol for all combs
+
+ if (verboutR > 1.0) verboutR = 1.0;
+ if (verboutR < -1.0) verboutR = -1.0;
+ if (verboutL > 1.0) verboutL = 1.0;
+ if (verboutL < -1.0) verboutL = -1.0;
+
+ inputSampleL += verboutR;
+ inputSampleR += verboutL;
+ verboutL = 0.0;
+ verboutR = 0.0;
+ //here we add in the cross-coupling- output of L tank to R, output of R tank to L
+
+
+ mid = inputSampleL + inputSampleR;
+ side = inputSampleL - inputSampleR;
+ //assign mid and side.
+
+ allpasstemp = oneMid - 1;
+ if (allpasstemp < 0 || allpasstemp > delayMid) {allpasstemp = delayMid;}
+ mid -= dMid[allpasstemp]*constallpass;
+ dMid[oneMid] = mid;
+ mid *= constallpass;
+ oneMid--; if (oneMid < 0 || oneMid > delayMid) {oneMid = delayMid;}
+ mid += (dMid[oneMid]);
+ nonlin += fabs(dMid[oneMid]);
+ //allpass filter mid
+
+ allpasstemp = oneSide - 1;
+ if (allpasstemp < 0 || allpasstemp > delaySide) {allpasstemp = delaySide;}
+ side -= dSide[allpasstemp]*constallpass;
+ dSide[oneSide] = side;
+ side *= constallpass;
+ oneSide--; if (oneSide < 0 || oneSide > delaySide) {oneSide = delaySide;}
+ side += (dSide[oneSide]);
+ nonlin += fabs(dSide[oneSide]);
+ //allpass filter side
+
+ //here we do allpasses on the mid and side
+
+ allpasstemp = oneLeft - 1;
+ if (allpasstemp < 0 || allpasstemp > delayLeft) {allpasstemp = delayLeft;}
+ inputSampleL -= dLeft[allpasstemp]*constallpass;
+ dLeft[oneLeft] = verboutL;
+ inputSampleL *= constallpass;
+ oneLeft--; if (oneLeft < 0 || oneLeft > delayLeft) {oneLeft = delayLeft;}
+ inputSampleL += (dLeft[oneLeft]);
+ nonlin += fabs(dLeft[oneLeft]);
+ //allpass filter left
+
+
+ allpasstemp = oneRight - 1;
+ if (allpasstemp < 0 || allpasstemp > delayRight) {allpasstemp = delayRight;}
+ inputSampleR -= dRight[allpasstemp]*constallpass;
+ dRight[oneRight] = verboutR;
+ inputSampleR *= constallpass;
+ oneRight--; if (oneRight < 0 || oneRight > delayRight) {oneRight = delayRight;}
+ inputSampleR += (dRight[oneRight]);
+ nonlin += fabs(dRight[oneRight]);
+ //allpass filter right
+
+
+ inputSampleL += (mid+side)/2.0;
+ inputSampleR += (mid-side)/2.0;
+ //here we get back to a L/R topology by adding the mid/side in parallel with L/R
+
+
+
+ temp = (dA[oneA]*interpolA );
+ temp += (dA[treA]*( 1.0 - interpolA ));
+ temp += ((dA[twoA]));
+ dA[treA] = (temp*tankfeedback);
+ dA[treA] += inputSampleL;
+ oneA--; if (oneA < 0 || oneA > delayA) {oneA = delayA;}
+ twoA--; if (twoA < 0 || twoA > delayA) {twoA = delayA;}
+ treA--; if (treA < 0 || treA > delayA) {treA = delayA;}
+ temp = (dA[oneA]*interpolA );
+ temp += (dA[treA]*( 1.0 - interpolA ));
+ temp *= (invlean + (lean*fabs(dA[twoA])));
+ verboutL += temp;
+ //comb filter A
+ temp = (dC[oneC]*interpolC );
+ temp += (dC[treC]*( 1.0 - interpolC ));
+ temp += ((dC[twoC]));
+ dC[treC] = (temp*tankfeedback);
+ dC[treC] += inputSampleL;
+ oneC--; if (oneC < 0 || oneC > delayC) {oneC = delayC;}
+ twoC--; if (twoC < 0 || twoC > delayC) {twoC = delayC;}
+ treC--; if (treC < 0 || treC > delayC) {treC = delayC;}
+ temp = (dC[oneC]*interpolC );
+ temp += (dC[treC]*( 1.0 - interpolC ));
+ temp *= (invlean + (lean*fabs(dC[twoC])));
+ verboutL += temp;
+ //comb filter C
+ temp = (dE[oneE]*interpolE );
+ temp += (dE[treE]*( 1.0 - interpolE ));
+ temp += ((dE[twoE]));
+ dE[treE] = (temp*tankfeedback);
+ dE[treE] += inputSampleL;
+ oneE--; if (oneE < 0 || oneE > delayE) {oneE = delayE;}
+ twoE--; if (twoE < 0 || twoE > delayE) {twoE = delayE;}
+ treE--; if (treE < 0 || treE > delayE) {treE = delayE;}
+ temp = (dE[oneE]*interpolE );
+ temp += (dE[treE]*( 1.0 - interpolE ));
+ temp *= (invlean + (lean*fabs(dE[twoE])));
+ verboutL += temp;
+ //comb filter E
+ temp = (dG[oneG]*interpolG );
+ temp += (dG[treG]*( 1.0 - interpolG ));
+ temp += ((dG[twoG]));
+ dG[treG] = (temp*tankfeedback);
+ dG[treG] += inputSampleL;
+ oneG--; if (oneG < 0 || oneG > delayG) {oneG = delayG;}
+ twoG--; if (twoG < 0 || twoG > delayG) {twoG = delayG;}
+ treG--; if (treG < 0 || treG > delayG) {treG = delayG;}
+ temp = (dG[oneG]*interpolG );
+ temp += (dG[treG]*( 1.0 - interpolG ));
+ temp *= (invlean + (lean*fabs(dG[twoG])));
+ verboutL += temp;
+ //comb filter G
+ temp = (dI[oneI]*interpolI );
+ temp += (dI[treI]*( 1.0 - interpolI ));
+ temp += ((dI[twoI]));
+ dI[treI] = (temp*tankfeedback);
+ dI[treI] += inputSampleL;
+ oneI--; if (oneI < 0 || oneI > delayI) {oneI = delayI;}
+ twoI--; if (twoI < 0 || twoI > delayI) {twoI = delayI;}
+ treI--; if (treI < 0 || treI > delayI) {treI = delayI;}
+ temp = (dI[oneI]*interpolI );
+ temp += (dI[treI]*( 1.0 - interpolI ));
+ temp *= (invlean + (lean*fabs(dI[twoI])));
+ verboutL += temp;
+ //comb filter I
+ temp = (dK[oneK]*interpolK );
+ temp += (dK[treK]*( 1.0 - interpolK ));
+ temp += ((dK[twoK]));
+ dK[treK] = (temp*tankfeedback);
+ dK[treK] += inputSampleL;
+ oneK--; if (oneK < 0 || oneK > delayK) {oneK = delayK;}
+ twoK--; if (twoK < 0 || twoK > delayK) {twoK = delayK;}
+ treK--; if (treK < 0 || treK > delayK) {treK = delayK;}
+ temp = (dK[oneK]*interpolK );
+ temp += (dK[treK]*( 1.0 - interpolK ));
+ temp *= (invlean + (lean*fabs(dK[twoK])));
+ verboutL += temp;
+ //comb filter K
+ temp = (dM[oneM]*interpolM );
+ temp += (dM[treM]*( 1.0 - interpolM ));
+ temp += ((dM[twoM]));
+ dM[treM] = (temp*tankfeedback);
+ dM[treM] += inputSampleL;
+ oneM--; if (oneM < 0 || oneM > delayM) {oneM = delayM;}
+ twoM--; if (twoM < 0 || twoM > delayM) {twoM = delayM;}
+ treM--; if (treM < 0 || treM > delayM) {treM = delayM;}
+ temp = (dM[oneM]*interpolM );
+ temp += (dM[treM]*( 1.0 - interpolM ));
+ temp *= (invlean + (lean*fabs(dM[twoM])));
+ verboutL += temp;
+ //comb filter M
+ temp = (dO[oneO]*interpolO );
+ temp += (dO[treO]*( 1.0 - interpolO ));
+ temp += ((dO[twoO]));
+ dO[treO] = (temp*tankfeedback);
+ dO[treO] += inputSampleL;
+ oneO--; if (oneO < 0 || oneO > delayO) {oneO = delayO;}
+ twoO--; if (twoO < 0 || twoO > delayO) {twoO = delayO;}
+ treO--; if (treO < 0 || treO > delayO) {treO = delayO;}
+ temp = (dO[oneO]*interpolO );
+ temp += (dO[treO]*( 1.0 - interpolO ));
+ temp *= (invlean + (lean*fabs(dO[twoO])));
+ verboutL += temp;
+ //comb filter O
+ temp = (dQ[oneQ]*interpolQ );
+ temp += (dQ[treQ]*( 1.0 - interpolQ ));
+ temp += ((dQ[twoQ]));
+ dQ[treQ] = (temp*tankfeedback);
+ dQ[treQ] += inputSampleL;
+ oneQ--; if (oneQ < 0 || oneQ > delayQ) {oneQ = delayQ;}
+ twoQ--; if (twoQ < 0 || twoQ > delayQ) {twoQ = delayQ;}
+ treQ--; if (treQ < 0 || treQ > delayQ) {treQ = delayQ;}
+ temp = (dQ[oneQ]*interpolQ );
+ temp += (dQ[treQ]*( 1.0 - interpolQ ));
+ temp *= (invlean + (lean*fabs(dQ[twoQ])));
+ verboutL += temp;
+ //comb filter Q
+ temp = (dS[oneS]*interpolS );
+ temp += (dS[treS]*( 1.0 - interpolS ));
+ temp += ((dS[twoS]));
+ dS[treS] = (temp*tankfeedback);
+ dS[treS] += inputSampleL;
+ oneS--; if (oneS < 0 || oneS > delayS) {oneS = delayS;}
+ twoS--; if (twoS < 0 || twoS > delayS) {twoS = delayS;}
+ treS--; if (treS < 0 || treS > delayS) {treS = delayS;}
+ temp = (dS[oneS]*interpolS );
+ temp += (dS[treS]*( 1.0 - interpolS ));
+ temp *= (invlean + (lean*fabs(dS[twoS])));
+ verboutL += temp;
+ //comb filter S
+ temp = (dU[oneU]*interpolU );
+ temp += (dU[treU]*( 1.0 - interpolU ));
+ temp += ((dU[twoU]));
+ dU[treU] = (temp*tankfeedback);
+ dU[treU] += inputSampleL;
+ oneU--; if (oneU < 0 || oneU > delayU) {oneU = delayU;}
+ twoU--; if (twoU < 0 || twoU > delayU) {twoU = delayU;}
+ treU--; if (treU < 0 || treU > delayU) {treU = delayU;}
+ temp = (dU[oneU]*interpolU );
+ temp += (dU[treU]*( 1.0 - interpolU ));
+ temp *= (invlean + (lean*fabs(dU[twoU])));
+ verboutL += temp;
+ //comb filter U
+ temp = (dW[oneW]*interpolW );
+ temp += (dW[treW]*( 1.0 - interpolW ));
+ temp += ((dW[twoW]));
+ dW[treW] = (temp*tankfeedback);
+ dW[treW] += inputSampleL;
+ oneW--; if (oneW < 0 || oneW > delayW) {oneW = delayW;}
+ twoW--; if (twoW < 0 || twoW > delayW) {twoW = delayW;}
+ treW--; if (treW < 0 || treW > delayW) {treW = delayW;}
+ temp = (dW[oneW]*interpolW );
+ temp += (dW[treW]*( 1.0 - interpolW ));
+ temp *= (invlean + (lean*fabs(dW[twoW])));
+ verboutL += temp;
+ //comb filter W
+ temp = (dY[oneY]*interpolY );
+ temp += (dY[treY]*( 1.0 - interpolY ));
+ temp += ((dY[twoY]));
+ dY[treY] = (temp*tankfeedback);
+ dY[treY] += inputSampleL;
+ oneY--; if (oneY < 0 || oneY > delayY) {oneY = delayY;}
+ twoY--; if (twoY < 0 || twoY > delayY) {twoY = delayY;}
+ treY--; if (treY < 0 || treY > delayY) {treY = delayY;}
+ temp = (dY[oneY]*interpolY );
+ temp += (dY[treY]*( 1.0 - interpolY ));
+ temp *= (invlean + (lean*fabs(dY[twoY])));
+ verboutL += temp;
+ //comb filter Y
+ //here we do the L delay tank, every other letter A C E G I
+
+ temp = (dB[oneB]*interpolB );
+ temp += (dB[treB]*( 1.0 - interpolB ));
+ temp += ((dB[twoB]));
+ dB[treB] = (temp*tankfeedback);
+ dB[treB] += inputSampleR;
+ oneB--; if (oneB < 0 || oneB > delayB) {oneB = delayB;}
+ twoB--; if (twoB < 0 || twoB > delayB) {twoB = delayB;}
+ treB--; if (treB < 0 || treB > delayB) {treB = delayB;}
+ temp = (dB[oneB]*interpolB );
+ temp += (dB[treB]*( 1.0 - interpolB ));
+ temp *= (invlean + (lean*fabs(dB[twoB])));
+ verboutR += temp;
+ //comb filter B
+ temp = (dD[oneD]*interpolD );
+ temp += (dD[treD]*( 1.0 - interpolD ));
+ temp += ((dD[twoD]));
+ dD[treD] = (temp*tankfeedback);
+ dD[treD] += inputSampleR;
+ oneD--; if (oneD < 0 || oneD > delayD) {oneD = delayD;}
+ twoD--; if (twoD < 0 || twoD > delayD) {twoD = delayD;}
+ treD--; if (treD < 0 || treD > delayD) {treD = delayD;}
+ temp = (dD[oneD]*interpolD );
+ temp += (dD[treD]*( 1.0 - interpolD ));
+ temp *= (invlean + (lean*fabs(dD[twoD])));
+ verboutR += temp;
+ //comb filter D
+ temp = (dF[oneF]*interpolF );
+ temp += (dF[treF]*( 1.0 - interpolF ));
+ temp += ((dF[twoF]));
+ dF[treF] = (temp*tankfeedback);
+ dF[treF] += inputSampleR;
+ oneF--; if (oneF < 0 || oneF > delayF) {oneF = delayF;}
+ twoF--; if (twoF < 0 || twoF > delayF) {twoF = delayF;}
+ treF--; if (treF < 0 || treF > delayF) {treF = delayF;}
+ temp = (dF[oneF]*interpolF );
+ temp += (dF[treF]*( 1.0 - interpolF ));
+ temp *= (invlean + (lean*fabs(dF[twoF])));
+ verboutR += temp;
+ //comb filter F
+ temp = (dH[oneH]*interpolH );
+ temp += (dH[treH]*( 1.0 - interpolH ));
+ temp += ((dH[twoH]));
+ dH[treH] = (temp*tankfeedback);
+ dH[treH] += inputSampleR;
+ oneH--; if (oneH < 0 || oneH > delayH) {oneH = delayH;}
+ twoH--; if (twoH < 0 || twoH > delayH) {twoH = delayH;}
+ treH--; if (treH < 0 || treH > delayH) {treH = delayH;}
+ temp = (dH[oneH]*interpolH );
+ temp += (dH[treH]*( 1.0 - interpolH ));
+ temp *= (invlean + (lean*fabs(dH[twoH])));
+ verboutR += temp;
+ //comb filter H
+ temp = (dJ[oneJ]*interpolJ );
+ temp += (dJ[treJ]*( 1.0 - interpolJ ));
+ temp += ((dJ[twoJ]));
+ dJ[treJ] = (temp*tankfeedback);
+ dJ[treJ] += inputSampleR;
+ oneJ--; if (oneJ < 0 || oneJ > delayJ) {oneJ = delayJ;}
+ twoJ--; if (twoJ < 0 || twoJ > delayJ) {twoJ = delayJ;}
+ treJ--; if (treJ < 0 || treJ > delayJ) {treJ = delayJ;}
+ temp = (dJ[oneJ]*interpolJ );
+ temp += (dJ[treJ]*( 1.0 - interpolJ ));
+ temp *= (invlean + (lean*fabs(dJ[twoJ])));
+ verboutR += temp;
+ //comb filter J
+ temp = (dL[oneL]*interpolL );
+ temp += (dL[treL]*( 1.0 - interpolL ));
+ temp += ((dL[twoL]));
+ dL[treL] = (temp*tankfeedback);
+ dL[treL] += inputSampleR;
+ oneL--; if (oneL < 0 || oneL > delayL) {oneL = delayL;}
+ twoL--; if (twoL < 0 || twoL > delayL) {twoL = delayL;}
+ treL--; if (treL < 0 || treL > delayL) {treL = delayL;}
+ temp = (dL[oneL]*interpolL );
+ temp += (dL[treL]*( 1.0 - interpolL ));
+ temp *= (invlean + (lean*fabs(dL[twoL])));
+ verboutR += temp;
+ //comb filter L
+ temp = (dN[oneN]*interpolN );
+ temp += (dN[treN]*( 1.0 - interpolN ));
+ temp += ((dN[twoN]));
+ dN[treN] = (temp*tankfeedback);
+ dN[treN] += inputSampleR;
+ oneN--; if (oneN < 0 || oneN > delayN) {oneN = delayN;}
+ twoN--; if (twoN < 0 || twoN > delayN) {twoN = delayN;}
+ treN--; if (treN < 0 || treN > delayN) {treN = delayN;}
+ temp = (dN[oneN]*interpolN );
+ temp += (dN[treN]*( 1.0 - interpolN ));
+ temp *= (invlean + (lean*fabs(dN[twoN])));
+ verboutR += temp;
+ //comb filter N
+ temp = (dP[oneP]*interpolP );
+ temp += (dP[treP]*( 1.0 - interpolP ));
+ temp += ((dP[twoP]));
+ dP[treP] = (temp*tankfeedback);
+ dP[treP] += inputSampleR;
+ oneP--; if (oneP < 0 || oneP > delayP) {oneP = delayP;}
+ twoP--; if (twoP < 0 || twoP > delayP) {twoP = delayP;}
+ treP--; if (treP < 0 || treP > delayP) {treP = delayP;}
+ temp = (dP[oneP]*interpolP );
+ temp += (dP[treP]*( 1.0 - interpolP ));
+ temp *= (invlean + (lean*fabs(dP[twoP])));
+ verboutR += temp;
+ //comb filter P
+ temp = (dR[oneR]*interpolR );
+ temp += (dR[treR]*( 1.0 - interpolR ));
+ temp += ((dR[twoR]));
+ dR[treR] = (temp*tankfeedback);
+ dR[treR] += inputSampleR;
+ oneR--; if (oneR < 0 || oneR > delayR) {oneR = delayR;}
+ twoR--; if (twoR < 0 || twoR > delayR) {twoR = delayR;}
+ treR--; if (treR < 0 || treR > delayR) {treR = delayR;}
+ temp = (dR[oneR]*interpolR );
+ temp += (dR[treR]*( 1.0 - interpolR ));
+ temp *= (invlean + (lean*fabs(dR[twoR])));
+ verboutR += temp;
+ //comb filter R
+ temp = (dT[oneT]*interpolT );
+ temp += (dT[treT]*( 1.0 - interpolT ));
+ temp += ((dT[twoT]));
+ dT[treT] = (temp*tankfeedback);
+ dT[treT] += inputSampleR;
+ oneT--; if (oneT < 0 || oneT > delayT) {oneT = delayT;}
+ twoT--; if (twoT < 0 || twoT > delayT) {twoT = delayT;}
+ treT--; if (treT < 0 || treT > delayT) {treT = delayT;}
+ temp = (dT[oneT]*interpolT );
+ temp += (dT[treT]*( 1.0 - interpolT ));
+ temp *= (invlean + (lean*fabs(dT[twoT])));
+ verboutR += temp;
+ //comb filter T
+ temp = (dV[oneV]*interpolV );
+ temp += (dV[treV]*( 1.0 - interpolV ));
+ temp += ((dV[twoV]));
+ dV[treV] = (temp*tankfeedback);
+ dV[treV] += inputSampleR;
+ oneV--; if (oneV < 0 || oneV > delayV) {oneV = delayV;}
+ twoV--; if (twoV < 0 || twoV > delayV) {twoV = delayV;}
+ treV--; if (treV < 0 || treV > delayV) {treV = delayV;}
+ temp = (dV[oneV]*interpolV );
+ temp += (dV[treV]*( 1.0 - interpolV ));
+ temp *= (invlean + (lean*fabs(dV[twoV])));
+ verboutR += temp;
+ //comb filter V
+ temp = (dX[oneX]*interpolX );
+ temp += (dX[treX]*( 1.0 - interpolX ));
+ temp += ((dX[twoX]));
+ dX[treX] = (temp*tankfeedback);
+ dX[treX] += inputSampleR;
+ oneX--; if (oneX < 0 || oneX > delayX) {oneX = delayX;}
+ twoX--; if (twoX < 0 || twoX > delayX) {twoX = delayX;}
+ treX--; if (treX < 0 || treX > delayX) {treX = delayX;}
+ temp = (dX[oneX]*interpolX );
+ temp += (dX[treX]*( 1.0 - interpolX ));
+ temp *= (invlean + (lean*fabs(dX[twoX])));
+ verboutR += temp;
+ //comb filter X
+ temp = (dZ[oneZ]*interpolZ );
+ temp += (dZ[treZ]*( 1.0 - interpolZ ));
+ temp += ((dZ[twoZ]));
+ dZ[treZ] = (temp*tankfeedback);
+ dZ[treZ] += inputSampleR;
+ oneZ--; if (oneZ < 0 || oneZ > delayZ) {oneZ = delayZ;}
+ twoZ--; if (twoZ < 0 || twoZ > delayZ) {twoZ = delayZ;}
+ treZ--; if (treZ < 0 || treZ > delayZ) {treZ = delayZ;}
+ temp = (dZ[oneZ]*interpolZ );
+ temp += (dZ[treZ]*( 1.0 - interpolZ ));
+ temp *= (invlean + (lean*fabs(dZ[twoZ])));
+ verboutR += temp;
+ //comb filter Z
+ //here we do the R delay tank, every other letter B D F H J
+
+ verboutL /= 8;
+ verboutR /= 8;
+
+ iirSampleL = (iirSampleL * (1 - iirAmount)) + (verboutL * iirAmount);
+ verboutL = verboutL - iirSampleL;
+
+ iirSampleR = (iirSampleR * (1 - iirAmount)) + (verboutR * iirAmount);
+ verboutR = verboutR - iirSampleR;
+ //we need to highpass the crosscoupling, it's making DC runaway
+
+ verboutL *= (invlean + (lean*fabs(verboutL)));
+ verboutR *= (invlean + (lean*fabs(verboutR)));
+ //scale back the verb tank the same way we scaled the combs
+
+ inputSampleL = verboutL;
+ inputSampleR = verboutR;
+
+ //EQ lowpass is after all processing like the compressor that might produce hash
+ if (flip)
+ {
+ lowpassSampleAA = (lowpassSampleAA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleAA;
+ lowpassSampleBA = (lowpassSampleBA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleBA;
+ lowpassSampleCA = (lowpassSampleCA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleCA;
+ lowpassSampleDA = (lowpassSampleDA * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleDA;
+ lowpassSampleE = (lowpassSampleE * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleE;
+ }
+ else
+ {
+ lowpassSampleAB = (lowpassSampleAB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleAB;
+ lowpassSampleBB = (lowpassSampleBB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleBB;
+ lowpassSampleCB = (lowpassSampleCB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleCB;
+ lowpassSampleDB = (lowpassSampleDB * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleDB;
+ lowpassSampleF = (lowpassSampleF * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = lowpassSampleF;
+ }
+ lowpassSampleG = (lowpassSampleG * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+ inputSampleL = (lowpassSampleG * (1 - iirAmountC)) + (inputSampleL * iirAmountC);
+
+
+ if (flip)
+ {
+ rowpassSampleAA = (rowpassSampleAA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleAA;
+ rowpassSampleBA = (rowpassSampleBA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleBA;
+ rowpassSampleCA = (rowpassSampleCA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleCA;
+ rowpassSampleDA = (rowpassSampleDA * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleDA;
+ rowpassSampleE = (rowpassSampleE * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleE;
+ }
+ else
+ {
+ rowpassSampleAB = (rowpassSampleAB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleAB;
+ rowpassSampleBB = (rowpassSampleBB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleBB;
+ rowpassSampleCB = (rowpassSampleCB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleCB;
+ rowpassSampleDB = (rowpassSampleDB * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleDB;
+ rowpassSampleF = (rowpassSampleF * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = rowpassSampleF;
+ }
+ rowpassSampleG = (rowpassSampleG * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+ inputSampleR = (rowpassSampleG * (1 - iirAmountC)) + (inputSampleR * iirAmountC);
+
+ iirCCSampleL = (iirCCSampleL * (1 - iirAmount)) + (verboutL * iirAmount);
+ verboutL = verboutL - iirCCSampleL;
+
+ iirCCSampleR = (iirCCSampleR * (1 - iirAmount)) + (verboutR * iirAmount);
+ verboutR = verboutR - iirCCSampleR;
+ //we need to highpass the crosscoupling, it's making DC runaway
+
+ verboutL *= (invlean + (lean*fabs(verboutL)));
+ verboutR *= (invlean + (lean*fabs(verboutR)));
+ //scale back the crosscouple the same way we scaled the combs
+ verboutL = (inputSampleL) * outcouple;
+ verboutR = (inputSampleR) * outcouple;
+ //send it off to the input again
+
+ nonlin += fabs(verboutL);
+ nonlin += fabs(verboutR);//post highpassing and a lot of processing
+
+ drySampleL *= dryness;
+ drySampleR *= dryness;
+
+ inputSampleL *= wetness;
+ inputSampleR *= wetness;
+
+ inputSampleL += drySampleL;
+ inputSampleR += drySampleR;
+ //here we combine the tanks with the dry signal
+
+ //noise shaping to 64-bit floating point
+ if (fpFlip) {
+ fpTemp = inputSampleL;
+ fpNShapeLA = (fpNShapeLA*fpOld)+((inputSampleL-fpTemp)*fpNew);
+ inputSampleL += fpNShapeLA;
+ fpTemp = inputSampleR;
+ fpNShapeRA = (fpNShapeRA*fpOld)+((inputSampleR-fpTemp)*fpNew);
+ inputSampleR += fpNShapeRA;
+ }
+ else {
+ fpTemp = inputSampleL;
+ fpNShapeLB = (fpNShapeLB*fpOld)+((inputSampleL-fpTemp)*fpNew);
+ inputSampleL += fpNShapeLB;
+ fpTemp = inputSampleR;
+ fpNShapeRB = (fpNShapeRB*fpOld)+((inputSampleR-fpTemp)*fpNew);
+ inputSampleR += fpNShapeRB;
+ }
+ fpFlip = !fpFlip;
+ //end noise shaping on 64 bit output
+ flip = !flip;
+
+ *out1 = inputSampleL;
+ *out2 = inputSampleR;
+
+ *in1++;
+ *in2++;
+ *out1++;
+ *out2++;
+ }
+} \ No newline at end of file
diff --git a/plugins/WinVST/NonlinearSpace/VSTProject.sln b/plugins/WinVST/NonlinearSpace/VSTProject.sln
new file mode 100755
index 0000000..694b424
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/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/NonlinearSpace/VSTProject.vcxproj b/plugins/WinVST/NonlinearSpace/VSTProject.vcxproj
new file mode 100755
index 0000000..0f34a9b
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/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="NonlinearSpace.cpp" />
+ <ClCompile Include="NonlinearSpaceProc.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="NonlinearSpace.h" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
+ <RootNamespace>VSTProject</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <ProjectName>NonlinearSpace64</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/NonlinearSpace/VSTProject.vcxproj.filters b/plugins/WinVST/NonlinearSpace/VSTProject.vcxproj.filters
new file mode 100755
index 0000000..d862634
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/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="NonlinearSpace.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="NonlinearSpaceProc.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="NonlinearSpace.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/WinVST/NonlinearSpace/VSTProject.vcxproj.user b/plugins/WinVST/NonlinearSpace/VSTProject.vcxproj.user
new file mode 100755
index 0000000..2216267
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/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/NonlinearSpace/vst2.x/aeffeditor.h b/plugins/WinVST/NonlinearSpace/vst2.x/aeffeditor.h
new file mode 100755
index 0000000..04f7339
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/aeffeditor.h
@@ -0,0 +1,61 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/01/12 09:05:31 $
+//
+// Category : VST 2.x Classes
+// Filename : aeffeditor.h
+// Created by : Steinberg Media Technologies
+// Description : Editor Class for VST Plug-Ins
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __aeffeditor__
+#define __aeffeditor__
+
+#include "audioeffectx.h"
+
+//-------------------------------------------------------------------------------------------------------
+/** VST Effect Editor class. */
+//-------------------------------------------------------------------------------------------------------
+class AEffEditor
+{
+public:
+//-------------------------------------------------------------------------------------------------------
+ AEffEditor (AudioEffect* effect = 0) ///< Editor class constructor. Requires pointer to associated effect instance.
+ : effect (effect)
+ , systemWindow (0)
+ {}
+
+ virtual ~AEffEditor () ///< Editor class destructor.
+ {}
+
+ virtual AudioEffect* getEffect () { return effect; } ///< Returns associated effect instance
+ virtual bool getRect (ERect** rect) { *rect = 0; return false; } ///< Query editor size as #ERect
+ virtual bool open (void* ptr) { systemWindow = ptr; return 0; } ///< Open editor, pointer to parent windows is platform-dependent (HWND on Windows, WindowRef on Mac).
+ virtual void close () { systemWindow = 0; } ///< Close editor (detach from parent window)
+ virtual bool isOpen () { return systemWindow != 0; } ///< Returns true if editor is currently open
+ virtual void idle () {} ///< Idle call supplied by Host application
+
+#if TARGET_API_MAC_CARBON
+ virtual void DECLARE_VST_DEPRECATED (draw) (ERect* rect) {}
+ virtual VstInt32 DECLARE_VST_DEPRECATED (mouse) (VstInt32 x, VstInt32 y) { return 0; }
+ virtual VstInt32 DECLARE_VST_DEPRECATED (key) (VstInt32 keyCode) { return 0; }
+ virtual void DECLARE_VST_DEPRECATED (top) () {}
+ virtual void DECLARE_VST_DEPRECATED (sleep) () {}
+#endif
+
+#if VST_2_1_EXTENSIONS
+ virtual bool onKeyDown (VstKeyCode& keyCode) { return false; } ///< Receive key down event. Return true only if key was really used!
+ virtual bool onKeyUp (VstKeyCode& keyCode) { return false; } ///< Receive key up event. Return true only if key was really used!
+ virtual bool onWheel (float distance) { return false; } ///< Handle mouse wheel event, distance is positive or negative to indicate wheel direction.
+ virtual bool setKnobMode (VstInt32 val) { return false; } ///< Set knob mode (if supported by Host). See CKnobMode in VSTGUI.
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+protected:
+ AudioEffect* effect; ///< associated effect instance
+ void* systemWindow; ///< platform-dependent parent window (HWND or WindowRef)
+};
+
+#endif // __aeffeditor__
diff --git a/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.cpp b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.cpp
new file mode 100755
index 0000000..e7440d2
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.cpp
@@ -0,0 +1,703 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/06/07 08:22:01 $
+//
+// Category : VST 2.x Classes
+// Filename : audioeffect.cpp
+// Created by : Steinberg Media Technologies
+// Description : Class AudioEffect (VST 1.0)
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#include "audioeffect.h"
+#include "aeffeditor.h"
+
+#include <stddef.h>
+#include <stdio.h>
+#include <math.h>
+
+//-------------------------------------------------------------------------------------------------------
+VstIntPtr AudioEffect::dispatchEffectClass (AEffect* e, VstInt32 opCode, VstInt32 index, VstIntPtr value, void* ptr, float opt)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+
+ if (opCode == effClose)
+ {
+ ae->dispatcher (opCode, index, value, ptr, opt);
+ delete ae;
+ return 1;
+ }
+
+ return ae->dispatcher (opCode, index, value, ptr, opt);
+}
+
+//-------------------------------------------------------------------------------------------------------
+float AudioEffect::getParameterClass (AEffect* e, VstInt32 index)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+ return ae->getParameter (index);
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::setParameterClass (AEffect* e, VstInt32 index, float value)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+ ae->setParameter (index, value);
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (processClass) (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+ ae->DECLARE_VST_DEPRECATED (process) (inputs, outputs, sampleFrames);
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::processClassReplacing (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+ ae->processReplacing (inputs, outputs, sampleFrames);
+}
+
+//-------------------------------------------------------------------------------------------------------
+#if VST_2_4_EXTENSIONS
+void AudioEffect::processClassDoubleReplacing (AEffect* e, double** inputs, double** outputs, VstInt32 sampleFrames)
+{
+ AudioEffect* ae = (AudioEffect*)(e->object);
+ ae->processDoubleReplacing (inputs, outputs, sampleFrames);
+}
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+// Class AudioEffect Implementation
+//-------------------------------------------------------------------------------------------------------
+/*!
+ The constructor of your class is passed a parameter of the type \e audioMasterCallback. The actual
+ mechanism in which your class gets constructed is not important right now. Effectively your class is
+ constructed by the hosting application, which passes an object of type \e audioMasterCallback that
+ handles the interaction with the plug-in. You pass this on to the base class' constructor and then
+ can forget about it.
+
+ \param audioMaster Passed by the Host and handles interaction
+ \param numPrograms Pass the number of programs the plug-in provides
+ \param numParams Pass the number of parameters the plug-in provides
+
+\code
+MyPlug::MyPlug (audioMasterCallback audioMaster)
+: AudioEffectX (audioMaster, 1, 1) // 1 program, 1 parameter only
+{
+ setNumInputs (2); // stereo in
+ setNumOutputs (2); // stereo out
+ setUniqueID ('MyPl'); // you must change this for other plug-ins!
+ canProcessReplacing (); // supports replacing mode
+}
+\endcode
+
+ \sa setNumInputs, setNumOutputs, setUniqueID, canProcessReplacing
+*/
+AudioEffect::AudioEffect (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams)
+: audioMaster (audioMaster)
+, editor (0)
+, sampleRate (44100.f)
+, blockSize (1024)
+, numPrograms (numPrograms)
+, numParams (numParams)
+, curProgram (0)
+{
+ memset (&cEffect, 0, sizeof (cEffect));
+
+ cEffect.magic = kEffectMagic;
+ cEffect.dispatcher = dispatchEffectClass;
+ cEffect.DECLARE_VST_DEPRECATED (process) = DECLARE_VST_DEPRECATED (processClass);
+ cEffect.setParameter = setParameterClass;
+ cEffect.getParameter = getParameterClass;
+ cEffect.numPrograms = numPrograms;
+ cEffect.numParams = numParams;
+ cEffect.numInputs = 1; // mono input
+ cEffect.numOutputs = 2; // stereo output
+ cEffect.DECLARE_VST_DEPRECATED (ioRatio) = 1.f;
+ cEffect.object = this;
+ cEffect.uniqueID = CCONST ('N', 'o', 'E', 'f');
+ cEffect.version = 1;
+ cEffect.processReplacing = processClassReplacing;
+
+#if VST_2_4_EXTENSIONS
+ canProcessReplacing (); // mandatory in VST 2.4!
+ cEffect.processDoubleReplacing = processClassDoubleReplacing;
+#endif
+}
+
+//-------------------------------------------------------------------------------------------------------
+AudioEffect::~AudioEffect ()
+{
+ if (editor)
+ delete editor;
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::setEditor (AEffEditor* editor)
+{
+ this->editor = editor;
+ if (editor)
+ cEffect.flags |= effFlagsHasEditor;
+ else
+ cEffect.flags &= ~effFlagsHasEditor;
+}
+
+//-------------------------------------------------------------------------------------------------------
+VstIntPtr AudioEffect::dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt)
+{
+ VstIntPtr v = 0;
+
+ switch (opcode)
+ {
+ case effOpen: open (); break;
+ case effClose: close (); break;
+ case effSetProgram: if (value < numPrograms) setProgram ((VstInt32)value); break;
+ case effGetProgram: v = getProgram (); break;
+ case effSetProgramName: setProgramName ((char*)ptr); break;
+ case effGetProgramName: getProgramName ((char*)ptr); break;
+ case effGetParamLabel: getParameterLabel (index, (char*)ptr); break;
+ case effGetParamDisplay: getParameterDisplay (index, (char*)ptr); break;
+ case effGetParamName: getParameterName (index, (char*)ptr); break;
+
+ case effSetSampleRate: setSampleRate (opt); break;
+ case effSetBlockSize: setBlockSize ((VstInt32)value); break;
+ case effMainsChanged: if (!value) suspend (); else resume (); break;
+ #if !VST_FORCE_DEPRECATED
+ case effGetVu: v = (VstIntPtr)(getVu () * 32767.); break;
+ #endif
+
+ //---Editor------------
+ case effEditGetRect: if (editor) v = editor->getRect ((ERect**)ptr) ? 1 : 0; break;
+ case effEditOpen: if (editor) v = editor->open (ptr) ? 1 : 0; break;
+ case effEditClose: if (editor) editor->close (); break;
+ case effEditIdle: if (editor) editor->idle (); break;
+
+ #if (TARGET_API_MAC_CARBON && !VST_FORCE_DEPRECATED)
+ case effEditDraw: if (editor) editor->draw ((ERect*)ptr); break;
+ case effEditMouse: if (editor) v = editor->mouse (index, value); break;
+ case effEditKey: if (editor) v = editor->key (value); break;
+ case effEditTop: if (editor) editor->top (); break;
+ case effEditSleep: if (editor) editor->sleep (); break;
+ #endif
+
+ case DECLARE_VST_DEPRECATED (effIdentify): v = CCONST ('N', 'v', 'E', 'f'); break;
+
+ //---Persistence-------
+ case effGetChunk: v = getChunk ((void**)ptr, index ? true : false); break;
+ case effSetChunk: v = setChunk (ptr, (VstInt32)value, index ? true : false); break;
+ }
+ return v;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ Use to ask for the Host's version
+ \return The Host's version
+*/
+VstInt32 AudioEffect::getMasterVersion ()
+{
+ VstInt32 version = 1;
+ if (audioMaster)
+ {
+ version = (VstInt32)audioMaster (&cEffect, audioMasterVersion, 0, 0, 0, 0);
+ if (!version) // old
+ version = 1;
+ }
+ return version;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \sa AudioEffectX::getNextShellPlugin
+*/
+VstInt32 AudioEffect::getCurrentUniqueId ()
+{
+ VstInt32 id = 0;
+ if (audioMaster)
+ id = (VstInt32)audioMaster (&cEffect, audioMasterCurrentId, 0, 0, 0, 0);
+ return id;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ Give idle time to Host application, e.g. if plug-in editor is doing mouse tracking in a modal loop.
+*/
+void AudioEffect::masterIdle ()
+{
+ if (audioMaster)
+ audioMaster (&cEffect, audioMasterIdle, 0, 0, 0, 0);
+}
+
+//-------------------------------------------------------------------------------------------------------
+bool AudioEffect::DECLARE_VST_DEPRECATED (isInputConnected) (VstInt32 input)
+{
+ VstInt32 ret = 0;
+ if (audioMaster)
+ ret = (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterPinConnected), input, 0, 0, 0);
+ return ret ? false : true; // return value is 0 for true
+}
+
+//-------------------------------------------------------------------------------------------------------
+bool AudioEffect::DECLARE_VST_DEPRECATED (isOutputConnected) (VstInt32 output)
+{
+ VstInt32 ret = 0;
+ if (audioMaster)
+ ret = (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterPinConnected), output, 1, 0, 0);
+ return ret ? false : true; // return value is 0 for true
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param index parameter index
+ \param float parameter value
+
+ \note An important thing to notice is that if the user changes a parameter in your editor, which is
+ out of the Host's control if you are not using the default string based interface, you should
+ call setParameterAutomated (). This ensures that the Host is notified of the parameter change, which
+ allows it to record these changes for automation.
+
+ \sa setParameter
+*/
+void AudioEffect::setParameterAutomated (VstInt32 index, float value)
+{
+ setParameter (index, value);
+ if (audioMaster)
+ audioMaster (&cEffect, audioMasterAutomate, index, 0, 0, value); // value is in opt
+}
+
+//-------------------------------------------------------------------------------------------------------
+// Flags
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (hasVu) (bool state)
+{
+ if (state)
+ cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsHasVu);
+ else
+ cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsHasVu);
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (hasClip) (bool state)
+{
+ if (state)
+ cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsHasClip);
+ else
+ cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsHasClip);
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (canMono) (bool state)
+{
+ if (state)
+ cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsCanMono);
+ else
+ cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsCanMono);
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param state Set to \e true if supported
+
+ \note Needs to be called in the plug-in's constructor
+*/
+void AudioEffect::canProcessReplacing (bool state)
+{
+ if (state)
+ cEffect.flags |= effFlagsCanReplacing;
+ else
+ cEffect.flags &= ~effFlagsCanReplacing;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param state Set to \e true if supported
+
+ \note Needs to be called in the plug-in's constructor
+*/
+#if VST_2_4_EXTENSIONS
+void AudioEffect::canDoubleReplacing (bool state)
+{
+ if (state)
+ cEffect.flags |= effFlagsCanDoubleReplacing;
+ else
+ cEffect.flags &= ~effFlagsCanDoubleReplacing;
+}
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param state Set \e true if programs are chunks
+
+ \note Needs to be called in the plug-in's constructor
+*/
+void AudioEffect::programsAreChunks (bool state)
+{
+ if (state)
+ cEffect.flags |= effFlagsProgramChunks;
+ else
+ cEffect.flags &= ~effFlagsProgramChunks;
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (setRealtimeQualities) (VstInt32 qualities)
+{
+ cEffect.DECLARE_VST_DEPRECATED (realQualities) = qualities;
+}
+
+//-------------------------------------------------------------------------------------------------------
+void AudioEffect::DECLARE_VST_DEPRECATED (setOfflineQualities) (VstInt32 qualities)
+{
+ cEffect.DECLARE_VST_DEPRECATED (offQualities) = qualities;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ Use to report the Plug-in's latency (Group Delay)
+
+ \param delay Plug-ins delay in samples
+*/
+void AudioEffect::setInitialDelay (VstInt32 delay)
+{
+ cEffect.initialDelay = delay;
+}
+
+//-------------------------------------------------------------------------------------------------------
+// Strings Conversion
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param value Value to convert
+ \param text String up to length char
+ \param maxLen Maximal length of the string
+*/
+void AudioEffect::dB2string (float value, char* text, VstInt32 maxLen)
+{
+ if (value <= 0)
+ vst_strncpy (text, "-oo", maxLen);
+ else
+ float2string ((float)(20. * log10 (value)), text, maxLen);
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param samples Number of samples
+ \param text String up to length char
+ \param maxLen Maximal length of the string
+*/
+void AudioEffect::Hz2string (float samples, char* text, VstInt32 maxLen)
+{
+ float sampleRate = getSampleRate ();
+ if (!samples)
+ float2string (0, text, maxLen);
+ else
+ float2string (sampleRate / samples, text, maxLen);
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param samples Number of samples
+ \param text String up to length char
+ \param maxLen Maximal length of the string
+*/
+void AudioEffect::ms2string (float samples, char* text, VstInt32 maxLen)
+{
+ float2string ((float)(samples * 1000. / getSampleRate ()), text, maxLen);
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param value Value to convert
+ \param text String up to length char
+ \param maxLen Maximal length of the string
+*/
+void AudioEffect::float2string (float value, char* text, VstInt32 maxLen)
+{
+ VstInt32 c = 0, neg = 0;
+ char string[32];
+ char* s;
+ double v, integ, i10, mantissa, m10, ten = 10.;
+
+ v = (double)value;
+ if (v < 0)
+ {
+ neg = 1;
+ value = -value;
+ v = -v;
+ c++;
+ if (v > 9999999.)
+ {
+ vst_strncpy (string, "Huge!", 31);
+ return;
+ }
+ }
+ else if (v > 99999999.)
+ {
+ vst_strncpy (string, "Huge!", 31);
+ return;
+ }
+
+ s = string + 31;
+ *s-- = 0;
+ *s-- = '.';
+ c++;
+
+ integ = floor (v);
+ i10 = fmod (integ, ten);
+ *s-- = (char)((VstInt32)i10 + '0');
+ integ /= ten;
+ c++;
+ while (integ >= 1. && c < 8)
+ {
+ i10 = fmod (integ, ten);
+ *s-- = (char)((VstInt32)i10 + '0');
+ integ /= ten;
+ c++;
+ }
+ if (neg)
+ *s-- = '-';
+ vst_strncpy (text, s + 1, maxLen);
+ if (c >= 8)
+ return;
+
+ s = string + 31;
+ *s-- = 0;
+ mantissa = fmod (v, 1.);
+ mantissa *= pow (ten, (double)(8 - c));
+ while (c < 8)
+ {
+ if (mantissa <= 0)
+ *s-- = '0';
+ else
+ {
+ m10 = fmod (mantissa, ten);
+ *s-- = (char)((VstInt32)m10 + '0');
+ mantissa /= 10.;
+ }
+ c++;
+ }
+ vst_strncat (text, s + 1, maxLen);
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \param value Value to convert
+ \param text String up to length char
+ \param maxLen Maximal length of the string
+*/
+void AudioEffect::int2string (VstInt32 value, char* text, VstInt32 maxLen)
+{
+ if (value >= 100000000)
+ {
+ vst_strncpy (text, "Huge!", maxLen);
+ return;
+ }
+
+ if (value < 0)
+ {
+ vst_strncpy (text, "-", maxLen);
+ value = -value;
+ }
+ else
+ vst_strncpy (text, "", maxLen);
+
+ bool state = false;
+ for (VstInt32 div = 100000000; div >= 1; div /= 10)
+ {
+ VstInt32 digit = value / div;
+ value -= digit * div;
+ if (state || digit > 0)
+ {
+ char temp[2] = {'0' + (char)digit, '\0'};
+ vst_strncat (text, temp, maxLen);
+ state = true;
+ }
+ }
+}
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames)
+
+ This process method must be provided. It takes input data, applies its pocessing algorithm, and then puts the
+ result to the output by overwriting the output buffer.
+
+ \param inputs An array of pointers to the data
+ \param outputs An array of pointers to where the data can be written to
+ \param sampleFrames Number of sample frames to process
+
+ \warning Never call any Mac OS 9 functions (or other functions which call into the OS) inside your
+ audio process function! This will crash the system when your plug-in is run in MP (multiprocessor) mode.
+ If you must call into the OS, you must use MPRemoteCall () (see Apples' documentation), or
+ explicitly use functions which are documented by Apple to be MP safe. On Mac OS X read the system
+ header files to be sure that you only call thread safe functions.
+
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setBlockSize (VstInt32 blockSize)
+
+ This is called by the Host, and tells the plug-in that the maximum block size passed to
+ processReplacing() will be \e blockSize.
+
+ \param blockSize Maximum number of sample frames
+
+ \warning You <b>must</b> process <b>exactly</b> \e sampleFrames number of samples in inside processReplacing, not more!
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setParameter (VstInt32 index, float value)
+
+ Parameters are the individual parameter settings the user can adjust. A VST Host can automate these
+ parameters. Set parameter \e index to \e value.
+
+ \param index Index of the parameter to change
+ \param value A float value between 0.0 and 1.0 inclusive
+
+ \note Parameter values, like all VST parameters, are declared as floats with an inclusive range of
+ 0.0 to 1.0. How data is presented to the user is merely in the user-interface handling. This is a
+ convention, but still worth regarding. Maybe the VST-Host's automation system depends on this range.
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn float AudioEffect::getParameter (VstInt32 index)
+
+ Return the \e value of parameter \e index
+
+ \param index Index of the parameter
+ \return A float value between 0.0 and 1.0 inclusive
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::getParameterLabel (VstInt32 index, char* label)
+
+ \param index Index of the parameter
+ \param label A string up to 8 char
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::getParameterDisplay (VstInt32 index, char* text)
+
+ \param index Index of the parameter
+ \param text A string up to 8 char
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffect::getProgram ()
+
+ \return Index of the current program
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setProgram (VstInt32 program)
+
+ \param Program of the current program
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::getParameterName (VstInt32 index, char* text)
+
+ \param index Index of the parameter
+ \param text A string up to 8 char
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setProgramName (char* name)
+
+ The program name is displayed in the rack, and can be edited by the user.
+
+ \param name A string up to 24 char
+
+ \warning Please be aware that the string lengths supported by the default VST interface are normally
+ limited to 24 characters. If you copy too much data into the buffers provided, you will break the
+ Host application.
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::getProgramName (char* name)
+
+ The program name is displayed in the rack, and can be edited by the user.
+
+ \param name A string up to 24 char
+
+ \warning Please be aware that the string lengths supported by the default VST interface are normally
+ limited to 24 characters. If you copy too much data into the buffers provided, you will break the
+ Host application.
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffect::getChunk (void** data, bool isPreset)
+
+ \param data should point to the newly allocated memory block containg state data. You can savely release it in next suspend/resume call.
+ \param isPreset true when saving a single program, false for all programs
+
+ \note
+ If your plug-in is configured to use chunks (see AudioEffect::programsAreChunks), the Host
+ will ask for a block of memory describing the current plug-in state for saving.
+ To restore the state at a later stage, the same data is passed back to AudioEffect::setChunk.
+ Alternatively, when not using chunk, the Host will simply save all parameter values.
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffect::setChunk (void* data, VstInt32 byteSize, bool isPreset)
+
+ \param data pointer to state data (owned by Host)
+ \param byteSize size of state data
+ \param isPreset true when restoring a single program, false for all programs
+
+ \sa getChunk
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setNumInputs (VstInt32 inputs)
+
+ This number is fixed at construction time and can't change until the plug-in is destroyed.
+
+ \param inputs The number of inputs
+
+ \sa isInputConnected()
+
+ \note Needs to be called in the plug-in's constructor
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setNumOutputs (VstInt32 outputs)
+
+ This number is fixed at construction time and can't change until the plug-in is destroyed.
+
+ \param outputs The number of outputs
+
+ \sa isOutputConnected()
+
+ \note Needs to be called in the plug-in's constructor
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/*!
+ \fn void AudioEffect::setUniqueID (VstInt32 iD)
+
+ Must call this! Set the plug-in's unique identifier. The Host uses this to identify the plug-in, for
+ instance when it is loading effect programs and banks. On Steinberg Web Page you can find an UniqueID
+ Database where you can record your UniqueID, it will check if the ID is already used by an another
+ vendor. You can use CCONST('a','b','c','d') (defined in VST 2.0) to be platform independent to
+ initialize an UniqueID.
+
+ \param iD Plug-in's unique ID
+
+ \note Needs to be called in the plug-in's constructor
+*/
diff --git a/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.h b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.h
new file mode 100755
index 0000000..a506bde
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffect.h
@@ -0,0 +1,177 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/06/06 16:01:34 $
+//
+// Category : VST 2.x Classes
+// Filename : audioeffect.h
+// Created by : Steinberg Media Technologies
+// Description : Class AudioEffect (VST 1.0)
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __audioeffect__
+#define __audioeffect__
+
+#include "pluginterfaces/vst2.x/aeffect.h" // "c" interface
+
+class AEffEditor;
+
+//-------------------------------------------------------------------------------------------------------
+/** VST Effect Base Class (VST 1.0). */
+//-------------------------------------------------------------------------------------------------------
+class AudioEffect
+{
+public:
+//-------------------------------------------------------------------------------------------------------
+ AudioEffect (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams); ///< Create an \e AudioEffect object
+ virtual ~AudioEffect (); ///< Destroy an \e AudioEffect object
+
+ virtual VstIntPtr dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); ///< Opcodes dispatcher
+
+//-------------------------------------------------------------------------------------------------------
+/// \name State Transitions
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void open () {} ///< Called when plug-in is initialized
+ virtual void close () {} ///< Called when plug-in will be released
+ virtual void suspend () {} ///< Called when plug-in is switched to off
+ virtual void resume () {} ///< Called when plug-in is switched to on
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Processing
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void setSampleRate (float sampleRate) { this->sampleRate = sampleRate; } ///< Called when the sample rate changes (always in a suspend state)
+ virtual void setBlockSize (VstInt32 blockSize) { this->blockSize = blockSize; } ///< Called when the Maximun block size changes (always in a suspend state). Note that the sampleFrames in Process Calls could be smaller than this block size, but NOT bigger.
+
+ virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) = 0; ///< Process 32 bit (single precision) floats (always in a resume state)
+
+#if VST_2_4_EXTENSIONS
+ virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames) {} ///< Process 64 bit (double precision) floats (always in a resume state) \sa processReplacing
+#endif // VST_2_4_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Parameters
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void setParameter (VstInt32 index, float value) {} ///< Called when a parameter changed
+ virtual float getParameter (VstInt32 index) { return 0; } ///< Return the value of the parameter with \e index
+ virtual void setParameterAutomated (VstInt32 index, float value);///< Called after a control has changed in the editor and when the associated parameter should be automated
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Programs and Persistence
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual VstInt32 getProgram () { return curProgram; } ///< Return the index to the current program
+ virtual void setProgram (VstInt32 program) { curProgram = program; } ///< Set the current program to \e program
+
+ virtual void setProgramName (char* name) {} ///< Stuff the name field of the current program with \e name. Limited to #kVstMaxProgNameLen.
+ virtual void getProgramName (char* name) { *name = 0; } ///< Stuff \e name with the name of the current program. Limited to #kVstMaxProgNameLen.
+
+ virtual void getParameterLabel (VstInt32 index, char* label) { *label = 0; } ///< Stuff \e label with the units in which parameter \e index is displayed (i.e. "sec", "dB", "type", etc...). Limited to #kVstMaxParamStrLen.
+ virtual void getParameterDisplay (VstInt32 index, char* text) { *text = 0; } ///< Stuff \e text with a string representation ("0.5", "-3", "PLATE", etc...) of the value of parameter \e index. Limited to #kVstMaxParamStrLen.
+ virtual void getParameterName (VstInt32 index, char* text) { *text = 0; } ///< Stuff \e text with the name ("Time", "Gain", "RoomType", etc...) of parameter \e index. Limited to #kVstMaxParamStrLen.
+
+ virtual VstInt32 getChunk (void** data, bool isPreset = false) { return 0; } ///< Host stores plug-in state. Returns the size in bytes of the chunk (plug-in allocates the data array)
+ virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset = false) { return 0; } ///< Host restores plug-in state
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Internal Setup
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void setUniqueID (VstInt32 iD) { cEffect.uniqueID = iD; } ///< Must be called to set the plug-ins unique ID!
+ virtual void setNumInputs (VstInt32 inputs) { cEffect.numInputs = inputs; } ///< Set the number of inputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available inputs.
+ virtual void setNumOutputs (VstInt32 outputs) { cEffect.numOutputs = outputs; } ///< Set the number of outputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available ouputs.
+
+ virtual void canProcessReplacing (bool state = true); ///< Tells that processReplacing() could be used. Mandatory in VST 2.4!
+
+#if VST_2_4_EXTENSIONS
+ virtual void canDoubleReplacing (bool state = true); ///< Tells that processDoubleReplacing() is implemented.
+#endif // VST_2_4_EXTENSIONS
+
+ virtual void programsAreChunks (bool state = true); ///< Program data is handled in formatless chunks (using getChunk-setChunks)
+ virtual void setInitialDelay (VstInt32 delay); ///< Use to report the plug-in's latency (Group Delay)
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Editor
+//-------------------------------------------------------------------------------------------------------
+//@{
+ void setEditor (AEffEditor* editor); ///< Should be called if you want to define your own editor
+ virtual AEffEditor* getEditor () { return editor; } ///< Returns the attached editor
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Inquiry
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual AEffect* getAeffect () { return &cEffect; } ///< Returns the #AEffect structure
+ virtual float getSampleRate () { return sampleRate; } ///< Returns the current sample rate
+ virtual VstInt32 getBlockSize () { return blockSize; } ///< Returns the current Maximum block size
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Host Communication
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual VstInt32 getMasterVersion (); ///< Returns the Host's version (for example 2400 for VST 2.4)
+ virtual VstInt32 getCurrentUniqueId (); ///< Returns current unique identifier when loading shell plug-ins
+ virtual void masterIdle (); ///< Give idle time to Host application
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Tools (helpers)
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void dB2string (float value, char* text, VstInt32 maxLen); ///< Stuffs \e text with an amplitude on the [0.0, 1.0] scale converted to its value in decibels.
+ virtual void Hz2string (float samples, char* text, VstInt32 maxLen); ///< Stuffs \e text with the frequency in Hertz that has a period of \e samples.
+ virtual void ms2string (float samples, char* text, VstInt32 maxLen); ///< Stuffs \e text with the duration in milliseconds of \e samples frames.
+ virtual void float2string (float value, char* text, VstInt32 maxLen); ///< Stuffs \e text with a string representation on the floating point \e value.
+ virtual void int2string (VstInt32 value, char* text, VstInt32 maxLen); ///< Stuffs \e text with a string representation on the integer \e value.
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+// Deprecated methods
+//-------------------------------------------------------------------------------------------------------
+/// @cond ignore
+ virtual void DECLARE_VST_DEPRECATED (process) (float** inputs, float** outputs, VstInt32 sampleFrames) {}
+ virtual float DECLARE_VST_DEPRECATED (getVu) () { return 0; }
+ virtual void DECLARE_VST_DEPRECATED (hasVu) (bool state = true);
+ virtual void DECLARE_VST_DEPRECATED (hasClip) (bool state = true);
+ virtual void DECLARE_VST_DEPRECATED (canMono) (bool state = true);
+ virtual void DECLARE_VST_DEPRECATED (setRealtimeQualities) (VstInt32 qualities);
+ virtual void DECLARE_VST_DEPRECATED (setOfflineQualities) (VstInt32 qualities);
+ virtual bool DECLARE_VST_DEPRECATED (isInputConnected) (VstInt32 input);
+ virtual bool DECLARE_VST_DEPRECATED (isOutputConnected) (VstInt32 output);
+/// @endcond
+
+//-------------------------------------------------------------------------------------------------------
+protected:
+ audioMasterCallback audioMaster; ///< Host callback
+ AEffEditor* editor; ///< Pointer to the plug-in's editor
+ float sampleRate; ///< Current sample rate
+ VstInt32 blockSize; ///< Maximum block size
+ VstInt32 numPrograms; ///< Number of programs
+ VstInt32 numParams; ///< Number of parameters
+ VstInt32 curProgram; ///< Current program
+ AEffect cEffect; ///< #AEffect object
+
+/// @cond ignore
+ static VstIntPtr dispatchEffectClass (AEffect* e, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
+ static float getParameterClass (AEffect* e, VstInt32 index);
+ static void setParameterClass (AEffect* e, VstInt32 index, float value);
+ static void DECLARE_VST_DEPRECATED (processClass) (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames);
+ static void processClassReplacing (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames);
+
+#if VST_2_4_EXTENSIONS
+ static void processClassDoubleReplacing (AEffect* e, double** inputs, double** outputs, VstInt32 sampleFrames);
+#endif // VST_2_4_EXTENSIONS
+/// @endcond
+};
+
+#endif // __audioeffect__
diff --git a/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.cpp b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.cpp
new file mode 100755
index 0000000..5f07f7c
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.cpp
@@ -0,0 +1,1546 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/10/05 14:23:59 $
+//
+// Category : VST 2.x Classes
+// Filename : audioeffectx.cpp
+// Created by : Steinberg Media Technologies
+// Description : Class AudioEffectX extends AudioEffect with new features. You should derive
+// your plug-in from AudioEffectX.
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#include "audioeffectx.h"
+#include "aeffeditor.h"
+
+//-------------------------------------------------------------------------------------------------------
+/*! hostCanDos strings Plug-in -> Host */
+namespace HostCanDos
+{
+ const char* canDoSendVstEvents = "sendVstEvents"; ///< Host supports send of Vst events to plug-in
+ const char* canDoSendVstMidiEvent = "sendVstMidiEvent"; ///< Host supports send of MIDI events to plug-in
+ const char* canDoSendVstTimeInfo = "sendVstTimeInfo"; ///< Host supports send of VstTimeInfo to plug-in
+ const char* canDoReceiveVstEvents = "receiveVstEvents"; ///< Host can receive Vst events from plug-in
+ const char* canDoReceiveVstMidiEvent = "receiveVstMidiEvent"; ///< Host can receive MIDI events from plug-in
+ const char* canDoReportConnectionChanges = "reportConnectionChanges"; ///< Host will indicates the plug-in when something change in plug-in´s routing/connections with #suspend/#resume/#setSpeakerArrangement
+ const char* canDoAcceptIOChanges = "acceptIOChanges"; ///< Host supports #ioChanged ()
+ const char* canDoSizeWindow = "sizeWindow"; ///< used by VSTGUI
+ const char* canDoOffline = "offline"; ///< Host supports offline feature
+ const char* canDoOpenFileSelector = "openFileSelector"; ///< Host supports function #openFileSelector ()
+ const char* canDoCloseFileSelector = "closeFileSelector"; ///< Host supports function #closeFileSelector ()
+ const char* canDoStartStopProcess = "startStopProcess"; ///< Host supports functions #startProcess () and #stopProcess ()
+ const char* canDoShellCategory = "shellCategory"; ///< 'shell' handling via uniqueID. If supported by the Host and the Plug-in has the category #kPlugCategShell
+ const char* canDoSendVstMidiEventFlagIsRealtime = "sendVstMidiEventFlagIsRealtime"; ///< Host supports flags for #VstMidiEvent
+}
+
+//-------------------------------------------------------------------------------------------------------
+/*! plugCanDos strings Host -> Plug-in */
+namespace PlugCanDos
+{
+ const char* canDoSendVstEvents = "sendVstEvents"; ///< plug-in will send Vst events to Host
+ const char* canDoSendVstMidiEvent = "sendVstMidiEvent"; ///< plug-in will send MIDI events to Host
+ const char* canDoReceiveVstEvents = "receiveVstEvents"; ///< plug-in can receive MIDI events from Host
+ const char* canDoReceiveVstMidiEvent = "receiveVstMidiEvent"; ///< plug-in can receive MIDI events from Host
+ const char* canDoReceiveVstTimeInfo = "receiveVstTimeInfo"; ///< plug-in can receive Time info from Host
+ const char* canDoOffline = "offline"; ///< plug-in supports offline functions (#offlineNotify, #offlinePrepare, #offlineRun)
+ const char* canDoMidiProgramNames = "midiProgramNames"; ///< plug-in supports function #getMidiProgramName ()
+ const char* canDoBypass = "bypass"; ///< plug-in supports function #setBypass ()
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+// Class AudioEffectX Implementation
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \sa AudioEffect()
+*/
+AudioEffectX::AudioEffectX (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams)
+: AudioEffect (audioMaster, numPrograms, numParams)
+{}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstIntPtr AudioEffectX::dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt)
+{
+ VstIntPtr v = 0;
+ switch (opcode)
+ {
+ //---VstEvents----------------------
+ case effProcessEvents:
+ v = processEvents ((VstEvents*)ptr);
+ break;
+
+ //---Parameters and Programs----------------------
+ case effCanBeAutomated:
+ v = canParameterBeAutomated (index) ? 1 : 0;
+ break;
+ case effString2Parameter:
+ v = string2parameter (index, (char*)ptr) ? 1 : 0;
+ break;
+
+ case effGetProgramNameIndexed:
+ v = getProgramNameIndexed ((VstInt32)value, index, (char*)ptr) ? 1 : 0;
+ break;
+ #if !VST_FORCE_DEPRECATED
+ case effGetNumProgramCategories:
+ v = getNumCategories ();
+ break;
+ case effCopyProgram:
+ v = copyProgram (index) ? 1 : 0;
+ break;
+
+ //---Connections, Configuration----------------------
+ case effConnectInput:
+ inputConnected (index, value ? true : false);
+ v = 1;
+ break;
+ case effConnectOutput:
+ outputConnected (index, value ? true : false);
+ v = 1;
+ break;
+ #endif // !VST_FORCE_DEPRECATED
+
+ case effGetInputProperties:
+ v = getInputProperties (index, (VstPinProperties*)ptr) ? 1 : 0;
+ break;
+ case effGetOutputProperties:
+ v = getOutputProperties (index, (VstPinProperties*)ptr) ? 1 : 0;
+ break;
+ case effGetPlugCategory:
+ v = (VstIntPtr)getPlugCategory ();
+ break;
+
+ #if !VST_FORCE_DEPRECATED
+ //---Realtime----------------------
+ case effGetCurrentPosition:
+ v = reportCurrentPosition ();
+ break;
+
+ case effGetDestinationBuffer:
+ v = ToVstPtr<float> (reportDestinationBuffer ());
+ break;
+ #endif // !VST_FORCE_DEPRECATED
+
+ //---Offline----------------------
+ case effOfflineNotify:
+ v = offlineNotify ((VstAudioFile*)ptr, (VstInt32)value, index != 0);
+ break;
+ case effOfflinePrepare:
+ v = offlinePrepare ((VstOfflineTask*)ptr, (VstInt32)value);
+ break;
+ case effOfflineRun:
+ v = offlineRun ((VstOfflineTask*)ptr, (VstInt32)value);
+ break;
+
+ //---Others----------------------
+ case effSetSpeakerArrangement:
+ v = setSpeakerArrangement (FromVstPtr<VstSpeakerArrangement> (value), (VstSpeakerArrangement*)ptr) ? 1 : 0;
+ break;
+ case effProcessVarIo:
+ v = processVariableIo ((VstVariableIo*)ptr) ? 1 : 0;
+ break;
+ #if !VST_FORCE_DEPRECATED
+ case effSetBlockSizeAndSampleRate:
+ setBlockSizeAndSampleRate ((VstInt32)value, opt);
+ v = 1;
+ break;
+ #endif // !VST_FORCE_DEPRECATED
+ case effSetBypass:
+ v = setBypass (value ? true : false) ? 1 : 0;
+ break;
+ case effGetEffectName:
+ v = getEffectName ((char*)ptr) ? 1 : 0;
+ break;
+ case effGetVendorString:
+ v = getVendorString ((char*)ptr) ? 1 : 0;
+ break;
+ case effGetProductString:
+ v = getProductString ((char*)ptr) ? 1 : 0;
+ break;
+ case effGetVendorVersion:
+ v = getVendorVersion ();
+ break;
+ case effVendorSpecific:
+ v = vendorSpecific (index, value, ptr, opt);
+ break;
+ case effCanDo:
+ v = canDo ((char*)ptr);
+ break;
+
+ case effGetTailSize:
+ v = getGetTailSize ();
+ break;
+
+ #if !VST_FORCE_DEPRECATED
+ case effGetErrorText:
+ v = getErrorText ((char*)ptr) ? 1 : 0;
+ break;
+
+ case effGetIcon:
+ v = ToVstPtr<void> (getIcon ());
+ break;
+
+ case effSetViewPosition:
+ v = setViewPosition (index, (VstInt32)value) ? 1 : 0;
+ break;
+
+ case effIdle:
+ v = fxIdle ();
+ break;
+
+ case effKeysRequired:
+ v = (keysRequired () ? 0 : 1); // reversed to keep v1 compatibility
+ break;
+ #endif // !VST_FORCE_DEPRECATED
+
+ case effGetParameterProperties:
+ v = getParameterProperties (index, (VstParameterProperties*)ptr) ? 1 : 0;
+ break;
+
+ case effGetVstVersion:
+ v = getVstVersion ();
+ break;
+
+ //---Others----------------------
+ #if VST_2_1_EXTENSIONS
+ case effEditKeyDown:
+ if (editor)
+ {
+ VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt};
+ v = editor->onKeyDown (keyCode) ? 1 : 0;
+ }
+ break;
+
+ case effEditKeyUp:
+ if (editor)
+ {
+ VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt};
+ v = editor->onKeyUp (keyCode) ? 1 : 0;
+ }
+ break;
+
+ case effSetEditKnobMode:
+ if (editor)
+ v = editor->setKnobMode ((VstInt32)value) ? 1 : 0;
+ break;
+
+ case effGetMidiProgramName:
+ v = getMidiProgramName (index, (MidiProgramName*)ptr);
+ break;
+ case effGetCurrentMidiProgram:
+ v = getCurrentMidiProgram (index, (MidiProgramName*)ptr);
+ break;
+ case effGetMidiProgramCategory:
+ v = getMidiProgramCategory (index, (MidiProgramCategory*)ptr);
+ break;
+ case effHasMidiProgramsChanged:
+ v = hasMidiProgramsChanged (index) ? 1 : 0;
+ break;
+ case effGetMidiKeyName:
+ v = getMidiKeyName (index, (MidiKeyName*)ptr) ? 1 : 0;
+ break;
+ case effBeginSetProgram:
+ v = beginSetProgram () ? 1 : 0;
+ break;
+ case effEndSetProgram:
+ v = endSetProgram () ? 1 : 0;
+ break;
+ #endif // VST_2_1_EXTENSIONS
+
+ #if VST_2_3_EXTENSIONS
+ case effGetSpeakerArrangement:
+ v = getSpeakerArrangement (FromVstPtr<VstSpeakerArrangement*> (value), (VstSpeakerArrangement**)ptr) ? 1 : 0;
+ break;
+
+ case effSetTotalSampleToProcess:
+ v = setTotalSampleToProcess ((VstInt32)value);
+ break;
+
+ case effShellGetNextPlugin:
+ v = getNextShellPlugin ((char*)ptr);
+ break;
+
+ case effStartProcess:
+ v = startProcess ();
+ break;
+ case effStopProcess:
+ v = stopProcess ();
+ break;
+
+ case effSetPanLaw:
+ v = setPanLaw ((VstInt32)value, opt) ? 1 : 0;
+ break;
+
+ case effBeginLoadBank:
+ v = beginLoadBank ((VstPatchChunkInfo*)ptr);
+ break;
+ case effBeginLoadProgram:
+ v = beginLoadProgram ((VstPatchChunkInfo*)ptr);
+ break;
+ #endif // VST_2_3_EXTENSIONS
+
+ #if VST_2_4_EXTENSIONS
+ case effSetProcessPrecision :
+ v = setProcessPrecision ((VstInt32)value) ? 1 : 0;
+ break;
+
+ case effGetNumMidiInputChannels :
+ v = getNumMidiInputChannels ();
+ break;
+
+ case effGetNumMidiOutputChannels :
+ v = getNumMidiOutputChannels ();
+ break;
+ #endif // VST_2_4_EXTENSIONS
+
+ //---Version 1.0 or unknown-----------------
+ default:
+ v = AudioEffect::dispatcher (opcode, index, value, ptr, opt);
+ }
+ return v;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*! if this effect is a synth or can receive midi events, we call the deprecated wantEvents() as some host rely on it.
+*/
+void AudioEffectX::resume ()
+{
+ if (cEffect.flags & effFlagsIsSynth || canDo ("receiveVstMidiEvent") == 1)
+ DECLARE_VST_DEPRECATED (wantEvents) ();
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+void AudioEffectX::DECLARE_VST_DEPRECATED (wantEvents) (VstInt32 filter)
+{
+ if (audioMaster)
+ audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterWantMidi), 0, filter, 0, 0);
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ A plug-in will request time info by calling the function getTimeInfo() which returns a \e #VstTimeInfo
+ pointer (or NULL if not implemented by the Host). The mask parameter is composed of the same flags which
+ will be found in the flags field of \e #VstTimeInfo when returned, that is, if you need information about tempo.
+ The parameter passed to getTimeInfo() should have the \e #kVstTempoValid flag set. This request and delivery
+ system is important, as a request like this may cause significant calculations at the application's end, which
+ may take a lot of our precious time. This obviously means you should only set those flags that are required to
+ get the information you need. Also please be aware that requesting information does not necessarily mean that
+ that information is provided in return. Check the \e flags field in the \e #VstTimeInfo structure to see if your
+ request was actually met.
+
+ \param filter A mask indicating which fields are requested, as some items may require extensive conversions.
+ See the \e flags in #VstTimeInfo
+ \return A pointer to a #VstTimeInfo structure or NULL if not implemented by the Host
+*/
+VstTimeInfo* AudioEffectX::getTimeInfo (VstInt32 filter)
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, audioMasterGetTime, 0, filter, 0, 0);
+ return FromVstPtr<VstTimeInfo> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (tempoAt) (VstInt32 pos)
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterTempoAt), 0, pos, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::sendVstEventsToHost (VstEvents* events)
+/*!
+ Can be called inside processReplacing.
+
+ \param events Fill with VST events
+ \return Returns \e true on success
+*/
+{
+ if (audioMaster)
+ return audioMaster (&cEffect, audioMasterProcessEvents, 0, 0, events, 0) == 1;
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::processEvents (VstEvents* events)
+
+ \return return value is ignored
+
+ \remarks Events are always related to the current audio block. For each process cycle, processEvents() is called
+ <b>once</b> before a processReplacing() call (if new events are available).
+
+ \sa VstEvents, VstMidiEvent
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+// Parameters Functions
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::canParameterBeAutomated (VstInt32 index)
+
+ Obviously only useful when the application supports this.
+
+ \param index Index of the parameter
+ \return \true if supported
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::string2parameter (VstInt32 index, char* text)
+
+ Especially useful for plug-ins without user interface. The application can then implement a text edit field for
+ the user to set a parameter by entering text.
+
+ \param index Index of the parameter
+ \param text A textual description of the parameter's value. A NULL pointer is used to check the capability
+ (return true).
+ \return \e true on success
+
+ \note Implies setParameter (). text==0 is to be expected to check the capability (returns true)
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getProgramNameIndexed (VstInt32 category, VstInt32 index, char* text)
+
+ Allows a Host application to list the plug-in's programs (presets).
+
+ \param category unused in VST 2.4
+ \param index Index of the program in a given category, starting with 0.
+ \param text A string up to 24 chars.
+ \return \e true on success
+*/
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (getNumAutomatableParameters) ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetNumAutomatableParameters), 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (getParameterQuantization) ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetParameterQuantization), 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+// Configuration/Settings Functions
+//-----------------------------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ The Host could call a suspend() (if the plug-in was enabled (in resume() state)) and then ask for
+ getSpeakerArrangement() and/or check the \e numInputs and \e numOutputs and \e initialDelay and then call a
+ resume().
+
+ \return \e true on success
+
+ \sa setSpeakerArrangement(), getSpeakerArrangement()
+*/
+bool AudioEffectX::ioChanged ()
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterIOChanged, 0, 0, 0, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::DECLARE_VST_DEPRECATED (needIdle) ()
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterNeedIdle), 0, 0, 0, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param width The window's width in pixel
+ \param height The window's height in pixel
+ \return \e true on success
+*/
+bool AudioEffectX::sizeWindow (VstInt32 width, VstInt32 height)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterSizeWindow, width, height, 0, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+double AudioEffectX::updateSampleRate ()
+/*!
+ \return The Host's sample rate
+*/
+{
+ if (audioMaster)
+ {
+ VstIntPtr res = audioMaster (&cEffect, audioMasterGetSampleRate, 0, 0, 0, 0);
+ if (res > 0)
+ sampleRate = (float)res;
+ }
+ return sampleRate;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::updateBlockSize ()
+/*!
+ \return The Host's block size
+
+ \note Will cause application to call AudioEffect's setSampleRate() to be called (when implemented).
+*/
+{
+ if (audioMaster)
+ {
+ VstInt32 res = (VstInt32)audioMaster (&cEffect, audioMasterGetBlockSize, 0, 0, 0, 0);
+ if (res > 0)
+ blockSize = res;
+ }
+ return blockSize;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return ASIO input latency
+ \sa getOutputLatency()
+*/
+VstInt32 AudioEffectX::getInputLatency ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetInputLatency, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ While inputLatency is probably not of concern, outputLatency may be used in conjunction with getTimeInfo().
+ \e samplePos of VstTimeInfo is ahead of the 'visual' sequencer play time by the output latency, such that
+ when outputLatency samples have passed by, our processing result becomes audible.
+
+ \return ASIO output latency
+ \sa getInputLatency()
+*/
+VstInt32 AudioEffectX::getOutputLatency ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetOutputLatency, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getInputProperties (VstInt32 index, VstPinProperties* properties)
+
+ \param index The index to the input, starting with 0
+ \param properties A pointer to a VstPinProperties structure
+ \return \e true on success
+ \sa getOutputProperties()
+ \note Example
+ <pre>
+ bool MyPlug::getInputProperties (VstInt32 index, VstPinProperties* properties)
+ {
+ bool returnCode = false;
+ if (index < kNumInputs)
+ {
+ sprintf (properties->label, "My %1d In", index + 1);
+ properties->flags = kVstPinIsStereo | kVstPinIsActive;
+ returnCode = true;
+ }
+ return returnCode;
+ }
+ </pre>
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getOutputProperties (VstInt32 index, VstPinProperties* properties)
+
+ \param index The index to the output, starting with 0
+ \param properties A pointer to a VstPinProperties structure
+ \return \e true on success
+ \sa getInputProperties()
+ \note Example 1
+ <pre>
+ bool MyPlug::getOutputProperties (VstInt32 index, VstPinProperties* properties)
+ {
+ bool returnCode = false;
+ if (index < kNumOutputs)
+ {
+ sprintf (properties->label, "My %1d Out", index + 1);
+ properties->flags = kVstPinIsStereo | kVstPinIsActive;
+ returnCode = true;
+ }
+ return (returnCode);
+ }
+ </pre>
+
+ \note Example 2 : plug-in with 1 mono, 1 stereo and one 5.1 outputs (kNumOutputs = 9):
+ <pre>
+ bool MyPlug::getOutputProperties (VstInt32 index, VstPinProperties* properties)
+ {
+ bool returnCode = false;
+ if (index >= 0 && index < kNumOutputs)
+ {
+ properties->flags = kVstPinIsActive;
+ if (index == 0) // mono
+ {
+ strcpy (properties->label, "Mono Out");
+ properties->arrangementType = kSpeakerArrMono;
+ }
+ else if (index == 1) // stereo (1 -> 2)
+ {
+ strcpy (properties->label, "Stereo Out");
+ properties->flags |= kVstPinIsStereo;
+ properties->arrangementType = kSpeakerArrStereo;
+ }
+ else if (index >= 3) // 5.1 (3 -> 8)
+ {
+ strcpy (properties->label, "5.1 Out");
+ properties->flags |= kVstPinUseSpeaker;
+ properties->arrangementType = kSpeakerArr51;
+ // for old VST Host < 2.3, make 5.1 to stereo/mono/mono/stereo (L R C Lfe Ls Rs)
+ if (index == 3 || index == 7)
+ properties->flags |= kVstPinIsStereo;
+ if (index == 5)
+ strcpy (properties->label, "Center");
+ else if (index == 6)
+ strcpy (properties->label, "Lfe");
+ else if (index == 7) // (7 -> 8)
+ strcpy (properties->label, "Stereo Back");
+ }
+ returnCode = true;
+ }
+ return returnCode;
+ }
+ </pre>
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+AEffect* AudioEffectX::DECLARE_VST_DEPRECATED (getPreviousPlug) (VstInt32 input)
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetPreviousPlug), 0, 0, 0, 0);
+ return FromVstPtr<AEffect> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+AEffect* AudioEffectX::DECLARE_VST_DEPRECATED (getNextPlug) (VstInt32 output)
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetNextPlug), 0, 0, 0, 0);
+ return FromVstPtr<AEffect> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return Plug-in's category defined in VstPlugCategory
+*/
+VstPlugCategory AudioEffectX::getPlugCategory ()
+{
+ if (cEffect.flags & effFlagsIsSynth)
+ return kPlugCategSynth;
+ return kPlugCategUnknown;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (willProcessReplacing) ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterWillReplaceOrAccumulate), 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ A plug-in is like a black box processing some audio coming in on some inputs (if any) and going out of some
+ outputs (if any). This may be used to do offline or real-time processing, and sometimes it may be desirable to
+ know the current context.
+
+ \return #VstProcessLevels in aeffectx.h
+
+*/
+VstInt32 AudioEffectX::getCurrentProcessLevel ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetCurrentProcessLevel, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return #VstAutomationStates in aeffectx.h
+*/
+VstInt32 AudioEffectX::getAutomationState ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetAutomationState, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+void AudioEffectX::DECLARE_VST_DEPRECATED (wantAsyncOperation) (bool state)
+{
+ if (state)
+ cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsExtIsAsync);
+ else
+ cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsExtIsAsync);
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+void AudioEffectX::DECLARE_VST_DEPRECATED (hasExternalBuffer) (bool state)
+{
+ if (state)
+ cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer);
+ else
+ cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer);
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+// Offline Functions
+//-----------------------------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::offlineRead (VstOfflineTask* offline, VstOfflineOption option, bool readSource)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterOfflineRead, readSource, option, offline, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::offlineWrite (VstOfflineTask* offline, VstOfflineOption option)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterOfflineWrite, 0, option, offline, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::offlineStart (VstAudioFile* audioFiles, VstInt32 numAudioFiles, VstInt32 numNewAudioFiles)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterOfflineStart, numNewAudioFiles, numAudioFiles, audioFiles, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::offlineGetCurrentPass ()
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterOfflineGetCurrentPass, 0, 0, 0, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstInt32 AudioEffectX::offlineGetCurrentMetaPass ()
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterOfflineGetCurrentMetaPass, 0, 0, 0, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+// Other
+//-----------------------------------------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------------------------------------------
+void AudioEffectX::DECLARE_VST_DEPRECATED (setOutputSamplerate) (float sampleRate)
+{
+ if (audioMaster)
+ audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterSetOutputSampleRate), 0, 0, 0, sampleRate);
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstSpeakerArrangement* AudioEffectX::DECLARE_VST_DEPRECATED (getInputSpeakerArrangement) ()
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetInputSpeakerArrangement), 0, 0, 0, 0);
+ return FromVstPtr<VstSpeakerArrangement> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstSpeakerArrangement* AudioEffectX::DECLARE_VST_DEPRECATED (getOutputSpeakerArrangement) ()
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetOutputSpeakerArrangement), 0, 0, 0, 0);
+ return FromVstPtr<VstSpeakerArrangement> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param text String of maximum 64 char
+ \return \e true if supported
+*/
+bool AudioEffectX::getHostVendorString (char* text)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterGetVendorString, 0, 0, text, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param text String of maximum 64 char
+ \return \e true if supported
+*/
+bool AudioEffectX::getHostProductString (char* text)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterGetProductString, 0, 0, text, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return Host vendor version
+*/
+VstInt32 AudioEffectX::getHostVendorVersion ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetVendorVersion, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+VstIntPtr AudioEffectX::hostVendorSpecific (VstInt32 lArg1, VstIntPtr lArg2, void* ptrArg, float floatArg)
+{
+ if (audioMaster)
+ return audioMaster (&cEffect, audioMasterVendorSpecific, lArg1, lArg2, ptrArg, floatArg);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ Asks Host if it implements the feature text. A plug-in cannot assume a 2.x feature is available from the Host.
+ Use this method to ascertain the environment in which the plug-in finds itself. Ignoring this inquiry methods and
+ trying to access a 2.x feature in a 1.0 Host will mean your plug-in or Host application will break. It is not
+ the end-users job to pick and choose which plug-ins can be supported by which Host.
+
+ \param text A string from #hostCanDos
+ \return
+ - 0 : don't know (default)
+ - 1 : yes
+ - -1: no
+*/
+VstInt32 AudioEffectX::canHostDo (char* text)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterCanDo, 0, 0, text, 0) != 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ Tells the Host that the plug-in is an instrument, i.e. that it will call wantEvents().
+
+ \param state
+ - true: is an instrument (default)
+ - false: is a simple audio effect
+*/
+void AudioEffectX::isSynth (bool state)
+{
+ if (state)
+ cEffect.flags |= effFlagsIsSynth;
+ else
+ cEffect.flags &= ~effFlagsIsSynth;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ Enables Host to omit processReplacing() when no data is present on any input.
+*/
+void AudioEffectX::noTail (bool state)
+{
+ if (state)
+ cEffect.flags |= effFlagsNoSoundInStop;
+ else
+ cEffect.flags &= ~effFlagsNoSoundInStop;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return #VstHostLanguage in aeffectx.h
+*/
+VstInt32 AudioEffectX::getHostLanguage ()
+{
+ if (audioMaster)
+ return (VstInt32)audioMaster (&cEffect, audioMasterGetLanguage, 0, 0, 0, 0);
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+void* AudioEffectX::DECLARE_VST_DEPRECATED (openWindow) (DECLARE_VST_DEPRECATED (VstWindow)* window)
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterOpenWindow), 0, 0, window, 0);
+ return FromVstPtr<void> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+bool AudioEffectX::DECLARE_VST_DEPRECATED (closeWindow) (DECLARE_VST_DEPRECATED (VstWindow)* window)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterCloseWindow), 0, 0, window, 0) != 0);
+ return false;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return FSSpec on MAC, else char*
+*/
+void* AudioEffectX::getDirectory ()
+{
+ if (audioMaster)
+ {
+ VstIntPtr ret = (audioMaster (&cEffect, audioMasterGetDirectory, 0, 0, 0, 0));
+ return FromVstPtr<void> (ret);
+ }
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \return \e true if supported
+*/
+bool AudioEffectX::updateDisplay ()
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterUpdateDisplay, 0, 0, 0, 0)) ? true : false;
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::processVariableIo (VstVariableIo* varIo)
+
+ If called with \e varIo NULL, returning \e true indicates that this call is supported by the plug-in.
+ Host will use processReplacing otherwise. The Host should call setTotalSampleToProcess before starting the processIO
+ to inform the plug-in about how many samples will be processed in total. The Host should provide an output buffer at least 5 times bigger than input buffer.
+
+ \param varIo
+ \return \true on success
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput)
+
+ Set the plug-in's speaker arrangements. If a (VST >= 2.3) plug-in returns \e true, it means that it accepts this IO
+ arrangement. The Host doesn't need to ask for getSpeakerArrangement(). If the plug-in returns \e false it means that it
+ doesn't accept this arrangement, the Host should then ask for getSpeakerArrangement() and then can (optional)
+ recall setSpeakerArrangement().
+
+ \param pluginInput A pointer to the input's #VstSpeakerArrangement structure.
+ \param pluginOutput A pointer to the output's #VstSpeakerArrangement structure.
+ \return \e true on success
+
+ \note setSpeakerArrangement() and getSpeakerArrangement() are always called in suspended state.
+ (like setSampleRate() or setBlockSize()).
+
+ \sa getSpeakerArrangement()
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput)
+
+ \param pluginInput A pointer to the input's #VstSpeakerArrangement structure.
+ \param pluginOutput A pointer to the output's #VstSpeakerArrangement structure.
+ \return \e true on success
+
+ \note setSpeakerArrangement() and getSpeakerArrangement() are always called in suspended state.
+ (like setSampleRate() or setBlockSize()).\n
+ <pre>Here an example code to show how the host uses getSpeakerArrangement()
+ VstSpeakerArrangement *plugInputVstArr = 0;
+ VstSpeakerArrangement *plugOutputVstArr = 0;
+ if (getFormatVersion () >= 2300 && #getSpeakerArrangement (&plugInputVstArr, &plugOutputVstArr))
+ ....
+ </pre>
+
+ \sa setSpeakerArrangement()
+*/
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::setBypass (bool onOff)
+
+ process still called (if Supported) although the plug-in was bypassed. Some plugs need to stay 'alive' even
+ when bypassed. An example is a surround decoder which has more inputs than outputs and must maintain some
+ reasonable signal distribution even when being bypassed. A CanDo 'bypass' allows to ask the plug-in if it
+ supports soft bypass or not.
+
+ \note This bypass feature could be automated by the Host (this means avoid to much CPU requirement in this call)
+ \note If the plug-in supports SoftBypass and it has a latency (initialDelay), in Bypassed state the plug-in has to used
+ the same latency value.
+
+ \param onOff
+ \return
+ - true: supports SoftBypass, process will be called, the plug-in should compensate its latency, and copy inputs to outputs
+ - false: doesn't support SoftBypass, process will not be called, the Host should bypass the process call
+
+ \sa processReplacing()
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getEffectName (char* name)
+
+ \param name A string up to 32 chars
+ \return \e true on success
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getVendorString (char* text)
+
+ \param text A string up to 64 chars
+ \return \e true on success
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getProductString (char* text)
+
+ \param text A string up to 64 chars
+ \return \e true on success
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getVendorVersion ()
+
+ \return The version of the plug-in
+
+ \note This should be upported
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::canDo (char* text)
+
+ Report what the plug-in is able to do. In general you can but don't have to report whatever you support or not
+ support via canDo. Some application functionality may require some specific reply, but in that case you will
+ probably know. Best is to report whatever you know for sure. A Host application cannot make assumptions about
+ the presence of the new 2.x features of a plug-in. Ignoring this inquiry methods and trying to access a 2.x
+ feature from a 1.0 plug, or vice versa, will mean the plug-in or Host application will break. It is not the
+ end-users job to pick and choose which plug-ins can be supported by which Host.
+
+ \param text A string from #plugCanDos
+ \return
+ - 0: don't know (default)
+ - 1: yes
+ - -1: no
+
+ \note This should be supported.
+*/
+
+//----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::canDo (char* text)
+
+ \param text A string from #plugCanDos
+ \return
+ - 0: don't know (default).
+ - 1: yes.
+ - -1: no
+*/
+
+//----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getParameterProperties (VstInt32 index, VstParameterProperties* p)
+
+ \param index Index of the parameter
+ \param p Pointer to #VstParameterProperties
+ \return Return \e true on success
+*/
+
+//----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getVstVersion ()
+ \return
+ - 2xxx : the last VST 2.x plug-in version (by default)
+ - 0 : older versions
+
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName)
+ Ask plug-in if MidiPrograms are used and if so, query for names, numbers
+ (ProgramChange-Number + BankSelect-Number), categories and keynames of each
+ MIDI Program, on each MIDI-channel. If this function is called, your plug-in has to read
+ MidiProgramName::thisProgramIndex, fill out the other fields with the information
+ assigned to a certain MIDI Program and return the number of available MIDI Programs on
+ that MIDI Channel.
+
+ \note plug-in canDo "midiProgramNames". No effect, if 0 is returned.
+
+ \warning don't mix concepts: the MIDI Programs are totally independent from all other
+ programs present in VST. The main difference is, that there are upto 16 simultaneous
+ active MIDI Programs (one per channel), while there can be only one active "VST"-Program.
+ (You should see the "VST"-Program as the one single main global program, which contains
+ the entire current state of the plug-in.) This function can be called in any sequence.
+
+ \param channel MidiChannel: 0-15
+ \param midiProgramName Points to \e #MidiProgramName struct
+ \return Number of available MIDI Programs on that \e channel
+ - number of used programIndexes
+ - 0 if no MidiProgramNames supported
+
+ \note Example : plug-in has 3 MidiPrograms on MidiChannel 0.
+ <pre>
+ Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 0.
+ Plug fills out:
+ MidiProgramName::name[64] = "Program A"
+ MidiProgramName::midiProgram = 0
+ MidiProgramName::midiBankMsb = -1
+ MidiProgramName::midiBankLsb = -1
+ MidiProgramName::parentCategoryIndex = -1
+ MidiProgramName::flags = 0 (if plug isn't "Omni").
+ Plug returns 3.
+ Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 1.
+ Plug fills out:
+ MidiProgramName::name[64] = "Program B"
+ MidiProgramName::midiProgram = 1
+ MidiProgramName::midiBankMsb = -1
+ MidiProgramName::midiBankLsb = -1
+ MidiProgramName::parentCategoryIndex = -1
+ MidiProgramName::flags = 0 (if plug isn't "Omni").
+ Plug returns 3.
+ Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 2.
+ Plug fills out:
+ MidiProgramName::name[64] = "Program C"
+ MidiProgramName::midiProgram = 2
+ MidiProgramName::midiBankMsb = -1
+ MidiProgramName::midiBankLsb = -1
+ MidiProgramName::parentCategoryIndex = -1
+ MidiProgramName::flags = 0 (if plug isn't "Omni").
+ Plug returns 3.
+ </pre>
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram)
+
+ \param channel
+ \param currentProgram
+ \return
+ - programIndex of the current program
+ - -1 if not supported
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category)
+
+ \param channel
+ \param category
+ \return
+ - number of used categoryIndexes.
+ - 0 if no #MidiProgramCategory supported/used.
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::hasMidiProgramsChanged (VstInt32 channel)
+
+ Ask plug-in for the currently active program on a certain MIDI Channel. Just like
+ getMidiProgramName(), but MidiProgramName::thisProgramIndex has to be filled out with
+ the currently active MIDI Program-index, which also has to be returned.
+
+ \param channel
+ \return
+ - true: if the #MidiProgramNames, #MidiKeyNames or #MidiControllerNames had changed on
+ this channel
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::getMidiKeyName (VstInt32 channel, MidiKeyName* keyName)
+
+ \param channel
+ \param keyName If keyName is "" the standard name of the key will be displayed
+ \return Return \e false if no #MidiKeyNames defined for 'thisProgramIndex'
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::beginSetProgram ()
+
+ \return
+ - true: the plug-in took the notification into account
+ - false: it did not...
+
+ \sa endSetProgram()
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::endSetProgram ()
+
+ \return
+ - true: the plug-in took the notification into account
+ - false: it did not...
+
+ \sa beginSetProgram()
+*/
+
+#if VST_2_1_EXTENSIONS
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ It tells the Host that if it needs to, it has to record automation data for this control.
+
+ \param index Index of the parameter
+ \return Returns \e true on success
+
+ \sa endEdit()
+*/
+bool AudioEffectX::beginEdit (VstInt32 index)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterBeginEdit, index, 0, 0, 0)) ? true : false;
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ It notifies the Host that this control is no longer moved by the mouse.
+
+ \param index Index of the parameter
+ \return Returns \e true on success
+
+ \sa beginEdit()
+*/
+bool AudioEffectX::endEdit (VstInt32 index)
+{
+ if (audioMaster)
+ return (audioMaster (&cEffect, audioMasterEndEdit, index, 0, 0, 0)) ? true : false;
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param ptr
+ \return Returns \e true on success
+
+ \sa closeFileSelector()
+*/
+bool AudioEffectX::openFileSelector (VstFileSelect* ptr)
+{
+ if (audioMaster && ptr)
+ return (audioMaster (&cEffect, audioMasterOpenFileSelector, 0, 0, ptr, 0)) ? true : false;
+ return 0;
+}
+#endif // VST_2_1_EXTENSIONS
+
+#if VST_2_2_EXTENSIONS
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param ptr
+ \return Returns \e true on success
+
+ \sa openFileSelector()
+*/
+bool AudioEffectX::closeFileSelector (VstFileSelect* ptr)
+{
+ if (audioMaster && ptr)
+ return (audioMaster (&cEffect, audioMasterCloseFileSelector, 0, 0, ptr, 0)) ? true : false;
+ return 0;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ It indicates how many samples will be processed.
+
+ \param nativePath
+ \return Returns \e true on success
+
+ \sa getChunk(), setChunk()
+*/
+bool AudioEffectX::DECLARE_VST_DEPRECATED (getChunkFile) (void* nativePath)
+{
+ if (audioMaster && nativePath)
+ return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetChunkFile), 0, 0, nativePath, 0)) ? true : false;
+ return 0;
+}
+#endif // VST_2_2_EXTENSIONS
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::setTotalSampleToProcess (VstInt32 value)
+
+ It indicates how many samples will be processed in total.
+
+ \param value Number of samples to process
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getNextShellPlugin (char* name) { return 0; }
+
+ \param name Points to a char buffer of size 64, which is to be filled with the name of the
+ plug-in including the terminating zero
+ \return Return the next plug-in's uniqueID
+ \note Example of Implementation
+<pre>
+ //---From the Host side : if found plugin is a Shell category-----------
+ if (effect->getCategory () == kPlugCategShell)
+ {
+ // scan shell for subplugins
+ char tempName[64] = {0};
+ VstInt32 plugUniqueID = 0;
+ while ((plugUniqueID = effect->dispatchEffect (effShellGetNextPlugin, 0, 0, tempName)) != 0)
+ {
+ // subplug needs a name
+ if (tempName[0] != 0)
+ {
+ ...do what you want with this tempName and plugUniqueID
+ }
+ }
+ }
+ //---From the Host side : Intanciate a subplugin of a shell plugin---
+ // retreive the uniqueID of this subplugin the host wants to load
+ // set it to the host currentID
+ currentID = subplugInfo->uniqueID;
+ // call the its shell plugin (main function)
+ main ();
+ // the shell plugin will ask for the currentUniqueID
+ // and should return the chosen subplugin
+ ...
+ //---From the plugin-Shell Side: for enumeration of subplugins---------
+ category = kPlugCategShell;
+ ->can ask the host if "shellCategory" is supported
+ // at start (instanciation) reset the index for the getNextShellPlugin call.
+ myPluginShell::index = 0;
+ // implementation of getNextShellPlugin (char* name);
+ VstInt32 myPluginShell::getNextShellPlugin (char* name)
+ {
+ strcpy (name, MyNameTable[index]);
+ return MyUniqueIDTable[index++];
+ }
+ ....
+ //---From the plugin-Shell Side: when instanciation-----
+ VstInt32 uniqueID = host->getCurrentUniqueID ();
+ if (uniqueID == 0) // the host instanciates the shell
+ {}
+ else // host try to instanciate one of my subplugin...identified by the uniqueID
+ {}
+</pre>
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::setPanLaw (VstInt32 type, float val)
+
+ \param type
+ \param val
+
+ \return Returns \e true on success
+
+ \note Gain: for Linear : [1.0 => 0dB PanLaw], [~0.58 => -4.5dB], [0.5 => -6.02dB]
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::beginLoadBank (VstPatchChunkInfo* ptr)
+
+ \param ptr
+ \return
+ - -1: if the Bank cannot be loaded,
+ - 1: if it can be loaded
+ - 0: else (for compatibility)
+
+ \sa beginLoadProgram()
+
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::beginLoadProgram (VstPatchChunkInfo* ptr)
+
+ \param ptr
+ \return
+ - -1: if the Program cannot be loaded,
+ - 1: it can be loaded else,
+ - 0: else (for compatibility)
+
+ \sa beginLoadBank()
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+// Speaker Arrangement Helpers
+//-----------------------------------------------------------------------------------------------------------------
+
+#if VST_2_3_EXTENSIONS
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param arrangement Pointer to a \e #VstSpeakerArrangement structure
+ \param nbChannels Number of Channels
+ \return Returns \e true on success
+
+ \sa deallocateArrangement(), copySpeaker(), matchArrangement()
+*/
+bool AudioEffectX::allocateArrangement (VstSpeakerArrangement** arrangement, VstInt32 nbChannels)
+{
+ if (*arrangement)
+ {
+ char *ptr = (char*)(*arrangement);
+ delete [] ptr;
+ }
+
+ VstInt32 size = 2 * sizeof (VstInt32) + nbChannels * sizeof (VstSpeakerProperties);
+ char* ptr = new char[size];
+ if (!ptr)
+ return false;
+
+ memset (ptr, 0, size);
+ *arrangement = (VstSpeakerArrangement*)ptr;
+ (*arrangement)->numChannels = nbChannels;
+ return true;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \param arrangement Pointer to a \e #VstSpeakerArrangement structure
+ \return Returns \e true on success
+
+ \sa allocateArrangement(), copySpeaker(), matchArrangement()
+*/
+bool AudioEffectX::deallocateArrangement (VstSpeakerArrangement** arrangement)
+{
+ if (*arrangement)
+ {
+ char *ptr = (char*)(*arrangement);
+ delete [] ptr;
+ *arrangement = 0;
+ }
+ return true;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ Feed the \e to speaker properties with the same values than \e from 's ones.
+ It is assumed here that \e to exists yet, ie this function won't
+ allocate memory for the speaker (this will prevent from having
+ a difference between an Arrangement's number of channels and
+ its actual speakers...)
+
+ \param to
+ \param from
+ \return Returns \e true on success
+
+ \sa allocateArrangement(), deallocateArrangement(), matchArrangement()
+*/
+bool AudioEffectX::copySpeaker (VstSpeakerProperties* to, VstSpeakerProperties* from)
+{
+ if ((from == NULL) || (to == NULL))
+ return false;
+
+ vst_strncpy (to->name, from->name, 63);
+ to->type = from->type;
+ to->azimuth = from->azimuth;
+ to->elevation = from->elevation;
+ to->radius = from->radius;
+ to->reserved = from->reserved;
+ memcpy (to->future, from->future, 28);
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \e to is deleted, then created and initialized with the same values as \e from (must exist!).
+ It's notably useful when setSpeakerArrangement() is called by the Host.
+
+ \param to
+ \param from
+ \return Returns \e true on success
+
+ \sa allocateArrangement(), deallocateArrangement(), copySpeaker()
+*/
+
+bool AudioEffectX::matchArrangement (VstSpeakerArrangement** to, VstSpeakerArrangement* from)
+{
+ if (from == NULL)
+ return false;
+
+ if ((!deallocateArrangement (to)) || (!allocateArrangement (to, from->numChannels)))
+ return false;
+
+ (*to)->type = from->type;
+ for (VstInt32 i = 0; i < (*to)->numChannels; i++)
+ {
+ if (!copySpeaker (&((*to)->speakers[i]), &(from->speakers[i])))
+ return false;
+ }
+
+ return true;
+}
+#endif // VST_2_3_EXTENSIONS
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn bool AudioEffectX::setProcessPrecision (VstInt32 precision)
+
+ Is called in suspended state, similar to #setBlockSize. Default (if not called) is single precision float.
+
+ \param precision kVstProcessPrecision32 or kVstProcessPrecision64
+ \return Returns \e true on success
+ \sa VstProcessPrecision
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getNumMidiInputChannels ()
+
+ Called by the host application to determine how many MIDI input channels are actually used by a plugin
+ e.g. to hide unused channels from the user.
+ For compatibility with VST 2.3 and below, the default return value 0 means 'not implemented' -
+ in this case the host assumes 16 MIDI channels to be present (or none at all).
+
+ \return Number of MIDI input channels: 1-15, otherwise: 16 or no MIDI channels at all (0)
+
+ \note The VST 2.x protocol is limited to a maximum of 16 MIDI channels as defined by the MIDI Standard. This might change in future revisions of the API.
+
+ \sa
+ getNumMidiOutputChannels() @n
+ PlugCanDos::canDoReceiveVstMidiEvent
+*/
+
+//-----------------------------------------------------------------------------------------------------------------
+/*!
+ \fn VstInt32 AudioEffectX::getNumMidiOutputChannels ()
+
+ Called by the host application to determine how many MIDI output channels are actually used by a plugin
+ e.g. to hide unused channels from the user.
+ For compatibility with VST 2.3 and below, the default return value 0 means 'not implemented' -
+ in this case the host assumes 16 MIDI channels to be present (or none at all).
+
+ \return Number of MIDI output channels: 1-15, otherwise: 16 or no MIDI channels at all (0)
+
+ \note The VST 2.x protocol is limited to a maximum of 16 MIDI channels as defined by the MIDI Standard. This might change in future revisions of the API.
+
+ \sa
+ getNumMidiInputChannels() @n
+ PlugCanDos::canDoSendVstMidiEvent
+*/
diff --git a/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.h b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.h
new file mode 100755
index 0000000..c04a6a0
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/audioeffectx.h
@@ -0,0 +1,252 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/06/20 12:42:46 $
+//
+// Category : VST 2.x Classes
+// Filename : audioeffectx.h
+// Created by : Steinberg Media Technologies
+// Description : Class AudioEffectX extends AudioEffect with new features. You should derive
+// your plug-in from AudioEffectX.
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __audioeffectx__
+#define __audioeffectx__
+
+#include "audioeffect.h" // Version 1.0 base class AudioEffect
+
+#include "pluginterfaces/vst2.x/aeffectx.h" // Version 2.x 'C' Extensions and Structures
+
+//-------------------------------------------------------------------------------------------------------
+/** Extended VST Effect Class (VST 2.x). */
+//-------------------------------------------------------------------------------------------------------
+class AudioEffectX : public AudioEffect
+{
+public:
+ AudioEffectX (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams); ///< Create an \e AudioEffectX object
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Parameters
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool canParameterBeAutomated (VstInt32 index) { return true; } ///< Indicates if a parameter can be automated
+ virtual bool string2parameter (VstInt32 index, char* text) { return false; } ///< Convert a string representation to a parameter value
+ virtual bool getParameterProperties (VstInt32 index, VstParameterProperties* p) { return false; } ///< Return parameter properties
+
+#if VST_2_1_EXTENSIONS
+ virtual bool beginEdit (VstInt32 index); ///< To be called before #setParameterAutomated (on Mouse Down). This will be used by the Host for specific Automation Recording.
+ virtual bool endEdit (VstInt32 index); ///< To be called after #setParameterAutomated (on Mouse Up)
+#endif // VST_2_1_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Programs and Persistence
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool getProgramNameIndexed (VstInt32 category, VstInt32 index, char* text) { return false; } ///< Fill \e text with name of program \e index (\e category deprecated in VST 2.4)
+
+#if VST_2_1_EXTENSIONS
+ virtual bool beginSetProgram () { return false; } ///< Called before a program is loaded
+ virtual bool endSetProgram () { return false; } ///< Called after a program was loaded
+#endif // VST_2_1_EXTENSIONS
+
+#if VST_2_3_EXTENSIONS
+ virtual VstInt32 beginLoadBank (VstPatchChunkInfo* ptr) { return 0; } ///< Called before a Bank is loaded.
+ virtual VstInt32 beginLoadProgram (VstPatchChunkInfo* ptr) { return 0; } ///< Called before a Program is loaded. (called before #beginSetProgram).
+#endif // VST_2_3_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Connections and Configuration
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool ioChanged (); ///< Tell Host numInputs and/or numOutputs and/or initialDelay (and/or numParameters: to be avoid) have changed
+
+ virtual double updateSampleRate (); ///< Returns sample rate from Host (may issue setSampleRate())
+ virtual VstInt32 updateBlockSize (); ///< Returns block size from Host (may issue getBlockSize())
+ virtual VstInt32 getInputLatency (); ///< Returns the Audio (maybe ASIO) input latency values
+ virtual VstInt32 getOutputLatency (); ///< Returns the Audio (maybe ASIO) output latency values
+
+ virtual bool getInputProperties (VstInt32 index, VstPinProperties* properties) { return false; } ///< Return the \e properties of output \e index
+ virtual bool getOutputProperties (VstInt32 index, VstPinProperties* properties) { return false; }///< Return the \e properties of input \e index
+
+ virtual bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput) { return false; } ///< Set the plug-in's speaker arrangements
+ virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput) { *pluginInput = 0; *pluginOutput = 0; return false; } ///< Return the plug-in's speaker arrangements
+ virtual bool setBypass (bool onOff) { return false; } ///< For 'soft-bypass' (this could be automated (in Audio Thread) that why you could NOT call iochanged (if needed) in this function, do it in fxidle).
+
+#if VST_2_3_EXTENSIONS
+ virtual bool setPanLaw (VstInt32 type, float val) { return false; } ///< Set the Panning Law used by the Host @see VstPanLawType.
+#endif // VST_2_3_EXTENSIONS
+
+#if VST_2_4_EXTENSIONS
+ virtual bool setProcessPrecision (VstInt32 precision) { return false; } ///< Set floating-point precision used for processing (32 or 64 bit)
+
+ virtual VstInt32 getNumMidiInputChannels () { return 0; } ///< Returns number of MIDI input channels used [0, 16]
+ virtual VstInt32 getNumMidiOutputChannels () { return 0; } ///< Returns number of MIDI output channels used [0, 16]
+#endif // VST_2_4_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Realtime
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual VstTimeInfo* getTimeInfo (VstInt32 filter); ///< Get time information from Host
+ virtual VstInt32 getCurrentProcessLevel (); ///< Returns the Host's process level
+ virtual VstInt32 getAutomationState (); ///< Returns the Host's automation state
+
+ virtual VstInt32 processEvents (VstEvents* events) { return 0; } ///< Called when new MIDI events come in
+ bool sendVstEventsToHost (VstEvents* events); ///< Send MIDI events back to Host application
+
+#if VST_2_3_EXTENSIONS
+ virtual VstInt32 startProcess () { return 0; } ///< Called one time before the start of process call. This indicates that the process call will be interrupted (due to Host reconfiguration or bypass state when the plug-in doesn't support softBypass)
+ virtual VstInt32 stopProcess () { return 0;} ///< Called after the stop of process call
+#endif // VST_2_3_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Variable I/O (Offline)
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool processVariableIo (VstVariableIo* varIo) { return false; } ///< Used for variable I/O processing (offline processing like timestreching)
+
+#if VST_2_3_EXTENSIONS
+ virtual VstInt32 setTotalSampleToProcess (VstInt32 value) { return value; } ///< Called in offline mode before process() or processVariableIo ()
+#endif // VST_2_3_EXTENSIONS
+ //@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Host Properties
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool getHostVendorString (char* text); ///< Fills \e text with a string identifying the vendor
+ virtual bool getHostProductString (char* text); ///< Fills \e text with a string with product name
+ virtual VstInt32 getHostVendorVersion (); ///< Returns vendor-specific version (for example 3200 for Nuendo 3.2)
+ virtual VstIntPtr hostVendorSpecific (VstInt32 lArg1, VstIntPtr lArg2, void* ptrArg, float floatArg); ///< No specific definition
+ virtual VstInt32 canHostDo (char* text); ///< Reports what the Host is able to do (#hostCanDos in audioeffectx.cpp)
+ virtual VstInt32 getHostLanguage (); ///< Returns the Host's language (#VstHostLanguage)
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Plug-in Properties
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual void isSynth (bool state = true); ///< Set if plug-in is a synth
+ virtual void noTail (bool state = true); ///< Plug-in won't produce output signals while there is no input
+ virtual VstInt32 getGetTailSize () { return 0; }///< Returns tail size; 0 is default (return 1 for 'no tail'), used in offline processing too
+ virtual void* getDirectory (); ///< Returns the plug-in's directory
+ virtual bool getEffectName (char* name) { return false; } ///< Fill \e text with a string identifying the effect
+ virtual bool getVendorString (char* text) { return false; } ///< Fill \e text with a string identifying the vendor
+ virtual bool getProductString (char* text) { return false; }///< Fill \e text with a string identifying the product name
+ virtual VstInt32 getVendorVersion () { return 0; } ///< Return vendor-specific version
+ virtual VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) { return 0; } ///< No definition, vendor specific handling
+ virtual VstInt32 canDo (char* text) { return 0; } ///< Reports what the plug-in is able to do (#plugCanDos in audioeffectx.cpp)
+ virtual VstInt32 getVstVersion () { return kVstVersion; } ///< Returns the current VST Version (#kVstVersion)
+ virtual VstPlugCategory getPlugCategory (); ///< Specify a category that fits the plug (#VstPlugCategory)
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name MIDI Channel Programs
+//-------------------------------------------------------------------------------------------------------
+//@{
+#if VST_2_1_EXTENSIONS
+ virtual VstInt32 getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName) { return 0; } ///< Fill \e midiProgramName with information for 'thisProgramIndex'.
+ virtual VstInt32 getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram) { return -1; } ///< Fill \e currentProgram with information for the current MIDI program.
+ virtual VstInt32 getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category) { return 0; } ///< Fill \e category with information for 'thisCategoryIndex'.
+ virtual bool hasMidiProgramsChanged (VstInt32 channel) { return false; } ///< Return true if the #MidiProgramNames, #MidiKeyNames or #MidiControllerNames had changed on this MIDI channel.
+ virtual bool getMidiKeyName (VstInt32 channel, MidiKeyName* keyName) { return false; } ///< Fill \e keyName with information for 'thisProgramIndex' and 'thisKeyNumber'
+#endif // VST_2_1_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Others
+//-------------------------------------------------------------------------------------------------------
+//@{
+ virtual bool updateDisplay (); ///< Something has changed in plug-in, request an update display like program (MIDI too) and parameters list in Host
+ virtual bool sizeWindow (VstInt32 width, VstInt32 height); ///< Requests to resize the editor window
+
+#if VST_2_1_EXTENSIONS
+ virtual bool openFileSelector (VstFileSelect* ptr); ///< Open a Host File selector (see aeffectx.h for #VstFileSelect definition)
+#endif // VST_2_1_EXTENSIONS
+
+#if VST_2_2_EXTENSIONS
+ virtual bool closeFileSelector (VstFileSelect* ptr); ///< Close the Host File selector which was opened by #openFileSelector
+#endif // VST_2_2_EXTENSIONS
+
+#if VST_2_3_EXTENSIONS
+ virtual VstInt32 getNextShellPlugin (char* name) { return 0; } ///< This opcode is only called, if the plug-in is of type #kPlugCategShell, in order to extract all included sub-plugin´s names.
+#endif // VST_2_3_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+/// \name Tools
+//-------------------------------------------------------------------------------------------------------
+//@{
+#if VST_2_3_EXTENSIONS
+ virtual bool allocateArrangement (VstSpeakerArrangement** arrangement, VstInt32 nbChannels);///< Allocate memory for a #VstSpeakerArrangement
+ virtual bool deallocateArrangement (VstSpeakerArrangement** arrangement); ///< Delete/free memory for an allocated speaker arrangement
+ virtual bool copySpeaker (VstSpeakerProperties* to, VstSpeakerProperties* from); ///< Copy properties \e from to \e to
+ virtual bool matchArrangement (VstSpeakerArrangement** to, VstSpeakerArrangement* from); ///< "to" is deleted, then created and initialized with the same values as "from" ones ("from" must exist).
+#endif // VST_2_3_EXTENSIONS
+//@}
+
+//-------------------------------------------------------------------------------------------------------
+// Offline
+//-------------------------------------------------------------------------------------------------------
+/// @cond ignore
+ virtual bool offlineRead (VstOfflineTask* offline, VstOfflineOption option, bool readSource = true);
+ virtual bool offlineWrite (VstOfflineTask* offline, VstOfflineOption option);
+ virtual bool offlineStart (VstAudioFile* ptr, VstInt32 numAudioFiles, VstInt32 numNewAudioFiles);
+ virtual VstInt32 offlineGetCurrentPass ();
+ virtual VstInt32 offlineGetCurrentMetaPass ();
+ virtual bool offlineNotify (VstAudioFile* ptr, VstInt32 numAudioFiles, bool start) { return false; }
+ virtual bool offlinePrepare (VstOfflineTask* offline, VstInt32 count) { return false; }
+ virtual bool offlineRun (VstOfflineTask* offline, VstInt32 count) { return false; }
+ virtual VstInt32 offlineGetNumPasses () { return 0; }
+ virtual VstInt32 offlineGetNumMetaPasses () { return 0; }
+
+//-------------------------------------------------------------------------------------------------------
+// AudioEffect overrides
+//-------------------------------------------------------------------------------------------------------
+ virtual VstIntPtr dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
+ virtual void resume ();
+
+//-------------------------------------------------------------------------------------------------------
+// Deprecated methods
+//-------------------------------------------------------------------------------------------------------
+ virtual void DECLARE_VST_DEPRECATED (wantEvents) (VstInt32 filter = 1);
+ virtual VstInt32 DECLARE_VST_DEPRECATED (tempoAt) (VstInt32 pos);
+ virtual VstInt32 DECLARE_VST_DEPRECATED (getNumAutomatableParameters) ();
+ virtual VstInt32 DECLARE_VST_DEPRECATED (getParameterQuantization) ();
+ virtual VstInt32 DECLARE_VST_DEPRECATED (getNumCategories) () { return 1L; }
+ virtual bool DECLARE_VST_DEPRECATED (copyProgram) (VstInt32 destination) { return false; }
+ virtual bool DECLARE_VST_DEPRECATED (needIdle) ();
+ virtual AEffect* DECLARE_VST_DEPRECATED (getPreviousPlug) (VstInt32 input);
+ virtual AEffect* DECLARE_VST_DEPRECATED (getNextPlug) (VstInt32 output);
+ virtual void DECLARE_VST_DEPRECATED (inputConnected) (VstInt32 index, bool state) {}
+ virtual void DECLARE_VST_DEPRECATED (outputConnected) (VstInt32 index, bool state) {}
+ virtual VstInt32 DECLARE_VST_DEPRECATED (willProcessReplacing) ();
+ virtual void DECLARE_VST_DEPRECATED (wantAsyncOperation) (bool state = true);
+ virtual void DECLARE_VST_DEPRECATED (hasExternalBuffer) (bool state = true);
+ virtual VstInt32 DECLARE_VST_DEPRECATED (reportCurrentPosition) () { return 0; }
+ virtual float* DECLARE_VST_DEPRECATED (reportDestinationBuffer) () { return 0; }
+ virtual void DECLARE_VST_DEPRECATED (setOutputSamplerate) (float samplerate);
+ virtual VstSpeakerArrangement* DECLARE_VST_DEPRECATED (getInputSpeakerArrangement) ();
+ virtual VstSpeakerArrangement* DECLARE_VST_DEPRECATED (getOutputSpeakerArrangement) ();
+ virtual void* DECLARE_VST_DEPRECATED (openWindow) (DECLARE_VST_DEPRECATED (VstWindow)*);
+ virtual bool DECLARE_VST_DEPRECATED (closeWindow) (DECLARE_VST_DEPRECATED (VstWindow)*);
+ virtual void DECLARE_VST_DEPRECATED (setBlockSizeAndSampleRate) (VstInt32 _blockSize, float _sampleRate) { blockSize = _blockSize; sampleRate = _sampleRate; }
+ virtual bool DECLARE_VST_DEPRECATED (getErrorText) (char* text) { return false; }
+ virtual void* DECLARE_VST_DEPRECATED (getIcon) () { return 0; }
+ virtual bool DECLARE_VST_DEPRECATED (setViewPosition) (VstInt32 x, VstInt32 y) { return false; }
+ virtual VstInt32 DECLARE_VST_DEPRECATED (fxIdle) () { return 0; }
+ virtual bool DECLARE_VST_DEPRECATED (keysRequired) () { return false; }
+
+#if VST_2_2_EXTENSIONS
+ virtual bool DECLARE_VST_DEPRECATED (getChunkFile) (void* nativePath); ///< Returns in platform format the path of the current chunk (could be called in #setChunk ()) (FSSpec on MAC else char*)
+#endif // VST_2_2_EXTENSIONS
+/// @endcond
+//-------------------------------------------------------------------------------------------------------
+};
+
+#endif //__audioeffectx__
diff --git a/plugins/WinVST/NonlinearSpace/vst2.x/vstplugmain.cpp b/plugins/WinVST/NonlinearSpace/vst2.x/vstplugmain.cpp
new file mode 100755
index 0000000..7e1ae71
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vst2.x/vstplugmain.cpp
@@ -0,0 +1,68 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/08/29 12:08:50 $
+//
+// Category : VST 2.x Classes
+// Filename : vstplugmain.cpp
+// Created by : Steinberg Media Technologies
+// Description : VST Plug-In Main Entry
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#include "audioeffect.h"
+
+//------------------------------------------------------------------------
+/** Must be implemented externally. */
+extern AudioEffect* createEffectInstance (audioMasterCallback audioMaster);
+
+extern "C" {
+
+#if defined (__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
+ #define VST_EXPORT __attribute__ ((visibility ("default")))
+#else
+ #define VST_EXPORT
+#endif
+
+//------------------------------------------------------------------------
+/** Prototype of the export function main */
+//------------------------------------------------------------------------
+VST_EXPORT AEffect* VSTPluginMain (audioMasterCallback audioMaster)
+{
+ // Get VST Version of the Host
+ if (!audioMaster (0, audioMasterVersion, 0, 0, 0, 0))
+ return 0; // old version
+
+ // Create the AudioEffect
+ AudioEffect* effect = createEffectInstance (audioMaster);
+ if (!effect)
+ return 0;
+
+ // Return the VST AEffect structur
+ return effect->getAeffect ();
+}
+
+// support for old hosts not looking for VSTPluginMain
+#if (TARGET_API_MAC_CARBON && __ppc__)
+VST_EXPORT AEffect* main_macho (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
+#elif WIN32
+VST_EXPORT AEffect* MAIN (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
+#elif BEOS
+VST_EXPORT AEffect* main_plugin (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); }
+#endif
+
+} // extern "C"
+
+//------------------------------------------------------------------------
+#if WIN32
+#include <windows.h>
+void* hInstance;
+
+extern "C" {
+BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved)
+{
+ hInstance = hInst;
+ return 1;
+}
+} // extern "C"
+#endif
diff --git a/plugins/WinVST/NonlinearSpace/vstplug.def b/plugins/WinVST/NonlinearSpace/vstplug.def
new file mode 100755
index 0000000..5bf499a
--- /dev/null
+++ b/plugins/WinVST/NonlinearSpace/vstplug.def
@@ -0,0 +1,3 @@
+EXPORTS
+ VSTPluginMain
+ main=VSTPluginMain \ No newline at end of file