High Impact shows up in Consolidated if it's spelled HighImpact

This commit is contained in:
Christopher Johnson 2024-05-10 17:13:49 -04:00
parent ad8ecb58b2
commit 1e0fd756ed
605 changed files with 117800 additions and 14921 deletions

Binary file not shown.

View file

@ -0,0 +1,128 @@
/* ========================================
* BiquadHiLo - BiquadHiLo.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadHiLo_H
#include "BiquadHiLo.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BiquadHiLo(audioMaster);}
BiquadHiLo::BiquadHiLo(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.0;
B = 0.0;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
BiquadHiLo::~BiquadHiLo() {}
VstInt32 BiquadHiLo::getVendorVersion () {return 1000;}
void BiquadHiLo::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BiquadHiLo::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 BiquadHiLo::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */
*data = chunkData;
return kNumParameters * sizeof(float);
}
VstInt32 BiquadHiLo::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}
void BiquadHiLo::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float BiquadHiLo::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void BiquadHiLo::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Highpas", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void BiquadHiLo::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void BiquadHiLo::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 BiquadHiLo::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool BiquadHiLo::getEffectName(char* name) {
vst_strncpy(name, "BiquadHiLo", kVstMaxProductStrLen); return true;
}
VstPlugCategory BiquadHiLo::getPlugCategory() {return kPlugCategEffect;}
bool BiquadHiLo::getProductString(char* text) {
vst_strncpy (text, "airwindows BiquadHiLo", kVstMaxProductStrLen); return true;
}
bool BiquadHiLo::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -0,0 +1,77 @@
/* ========================================
* BiquadHiLo - BiquadHiLo.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadHiLo_H
#define __BiquadHiLo_H
#ifndef __audioeffect__
#include "audioeffectx.h"
#endif
#include <set>
#include <string>
#include <math.h>
enum {
kParamA =0,
kParamB =1,
kNumParameters = 2
}; //
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'biqh'; //Change this to what the AU identity is!
class BiquadHiLo :
public AudioEffectX
{
public:
BiquadHiLo(audioMasterCallback audioMaster);
~BiquadHiLo();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
float A;
float B;
enum {
hilp_freq, hilp_temp,
hilp_a0, hilp_a1, hilp_b1, hilp_b2,
hilp_c0, hilp_c1, hilp_d1, hilp_d2,
hilp_e0, hilp_e1, hilp_f1, hilp_f2,
hilp_aL1, hilp_aL2, hilp_aR1, hilp_aR2,
hilp_cL1, hilp_cL2, hilp_cR1, hilp_cR2,
hilp_eL1, hilp_eL2, hilp_eR1, hilp_eR2,
hilp_total
};
double highpass[hilp_total];
double lowpass[hilp_total];
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

View file

@ -0,0 +1,258 @@
/* ========================================
* BiquadHiLo - BiquadHiLo.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadHiLo_H
#include "BiquadHiLo.h"
#endif
void BiquadHiLo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
highpass[hilp_freq] = ((A*330.0)+20.0)/getSampleRate();
bool highpassEngage = true; if (A == 0.0) highpassEngage = false;
lowpass[hilp_freq] = ((pow(1.0-B,2)*17000.0)+3000.0)/getSampleRate();
bool lowpassEngage = true; if (B == 0.0) lowpassEngage = false;
double K = tan(M_PI * highpass[hilp_freq]); //highpass
double norm = 1.0 / (1.0 + K / 1.93185165 + K * K);
highpass[hilp_a0] = norm;
highpass[hilp_a1] = -2.0 * highpass[hilp_a0];
highpass[hilp_b1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_b2] = (1.0 - K / 1.93185165 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.70710678 + K * K);
highpass[hilp_c0] = norm;
highpass[hilp_c1] = -2.0 * highpass[hilp_c0];
highpass[hilp_d1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_d2] = (1.0 - K / 0.70710678 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.51763809 + K * K);
highpass[hilp_e0] = norm;
highpass[hilp_e1] = -2.0 * highpass[hilp_e0];
highpass[hilp_f1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_f2] = (1.0 - K / 0.51763809 + K * K) * norm;
K = tan(M_PI * lowpass[hilp_freq]); //lowpass
norm = 1.0 / (1.0 + K / 1.93185165 + K * K);
lowpass[hilp_a0] = K * K * norm;
lowpass[hilp_a1] = 2.0 * lowpass[hilp_a0];
lowpass[hilp_b1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_b2] = (1.0 - K / 1.93185165 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.70710678 + K * K);
lowpass[hilp_c0] = K * K * norm;
lowpass[hilp_c1] = 2.0 * lowpass[hilp_c0];
lowpass[hilp_d1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_d2] = (1.0 - K / 0.70710678 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.51763809 + K * K);
lowpass[hilp_e0] = K * K * norm;
lowpass[hilp_e1] = 2.0 * lowpass[hilp_e0];
lowpass[hilp_f1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_f2] = (1.0 - K / 0.51763809 + K * K) * norm;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (highpassEngage) { //begin Stacked Highpass
highpass[hilp_temp] = (inputSampleL*highpass[hilp_a0])+highpass[hilp_aL1];
highpass[hilp_aL1] = (inputSampleL*highpass[hilp_a1])-(highpass[hilp_temp]*highpass[hilp_b1])+highpass[hilp_aL2];
highpass[hilp_aL2] = (inputSampleL*highpass[hilp_a0])-(highpass[hilp_temp]*highpass[hilp_b2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleL*highpass[hilp_c0])+highpass[hilp_cL1];
highpass[hilp_cL1] = (inputSampleL*highpass[hilp_c1])-(highpass[hilp_temp]*highpass[hilp_d1])+highpass[hilp_cL2];
highpass[hilp_cL2] = (inputSampleL*highpass[hilp_c0])-(highpass[hilp_temp]*highpass[hilp_d2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleL*highpass[hilp_e0])+highpass[hilp_eL1];
highpass[hilp_eL1] = (inputSampleL*highpass[hilp_e1])-(highpass[hilp_temp]*highpass[hilp_f1])+highpass[hilp_eL2];
highpass[hilp_eL2] = (inputSampleL*highpass[hilp_e0])-(highpass[hilp_temp]*highpass[hilp_f2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_a0])+highpass[hilp_aR1];
highpass[hilp_aR1] = (inputSampleR*highpass[hilp_a1])-(highpass[hilp_temp]*highpass[hilp_b1])+highpass[hilp_aR2];
highpass[hilp_aR2] = (inputSampleR*highpass[hilp_a0])-(highpass[hilp_temp]*highpass[hilp_b2]); inputSampleR = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_c0])+highpass[hilp_cR1];
highpass[hilp_cR1] = (inputSampleR*highpass[hilp_c1])-(highpass[hilp_temp]*highpass[hilp_d1])+highpass[hilp_cR2];
highpass[hilp_cR2] = (inputSampleR*highpass[hilp_c0])-(highpass[hilp_temp]*highpass[hilp_d2]); inputSampleR = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_e0])+highpass[hilp_eR1];
highpass[hilp_eR1] = (inputSampleR*highpass[hilp_e1])-(highpass[hilp_temp]*highpass[hilp_f1])+highpass[hilp_eR2];
highpass[hilp_eR2] = (inputSampleR*highpass[hilp_e0])-(highpass[hilp_temp]*highpass[hilp_f2]); inputSampleR = highpass[hilp_temp];
} else {
highpass[hilp_aL1] = highpass[hilp_aL2] = highpass[hilp_aR1] = highpass[hilp_aR2] = 0.0;
} //end Stacked Highpass
//rest of control strip goes here
if (lowpassEngage) { //begin Stacked Lowpass
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_a0])+lowpass[hilp_aL1];
lowpass[hilp_aL1] = (inputSampleL*lowpass[hilp_a1])-(lowpass[hilp_temp]*lowpass[hilp_b1])+lowpass[hilp_aL2];
lowpass[hilp_aL2] = (inputSampleL*lowpass[hilp_a0])-(lowpass[hilp_temp]*lowpass[hilp_b2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_c0])+lowpass[hilp_cL1];
lowpass[hilp_cL1] = (inputSampleL*lowpass[hilp_c1])-(lowpass[hilp_temp]*lowpass[hilp_d1])+lowpass[hilp_cL2];
lowpass[hilp_cL2] = (inputSampleL*lowpass[hilp_c0])-(lowpass[hilp_temp]*lowpass[hilp_d2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_e0])+lowpass[hilp_eL1];
lowpass[hilp_eL1] = (inputSampleL*lowpass[hilp_e1])-(lowpass[hilp_temp]*lowpass[hilp_f1])+lowpass[hilp_eL2];
lowpass[hilp_eL2] = (inputSampleL*lowpass[hilp_e0])-(lowpass[hilp_temp]*lowpass[hilp_f2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_a0])+lowpass[hilp_aR1];
lowpass[hilp_aR1] = (inputSampleR*lowpass[hilp_a1])-(lowpass[hilp_temp]*lowpass[hilp_b1])+lowpass[hilp_aR2];
lowpass[hilp_aR2] = (inputSampleR*lowpass[hilp_a0])-(lowpass[hilp_temp]*lowpass[hilp_b2]); inputSampleR = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_c0])+lowpass[hilp_cR1];
lowpass[hilp_cR1] = (inputSampleR*lowpass[hilp_c1])-(lowpass[hilp_temp]*lowpass[hilp_d1])+lowpass[hilp_cR2];
lowpass[hilp_cR2] = (inputSampleR*lowpass[hilp_c0])-(lowpass[hilp_temp]*lowpass[hilp_d2]); inputSampleR = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_e0])+lowpass[hilp_eR1];
lowpass[hilp_eR1] = (inputSampleR*lowpass[hilp_e1])-(lowpass[hilp_temp]*lowpass[hilp_f1])+lowpass[hilp_eR2];
lowpass[hilp_eR2] = (inputSampleR*lowpass[hilp_e0])-(lowpass[hilp_temp]*lowpass[hilp_f2]); inputSampleR = lowpass[hilp_temp];
} else {
lowpass[hilp_aL1] = lowpass[hilp_aL2] = lowpass[hilp_aR1] = lowpass[hilp_aR2] = 0.0;
} //end Stacked Lowpass
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void BiquadHiLo::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
highpass[hilp_freq] = ((A*330.0)+20.0)/getSampleRate();
bool highpassEngage = true; if (A == 0.0) highpassEngage = false;
lowpass[hilp_freq] = ((pow(1.0-B,2)*17000.0)+3000.0)/getSampleRate();
bool lowpassEngage = true; if (B == 0.0) lowpassEngage = false;
double K = tan(M_PI * highpass[hilp_freq]); //highpass
double norm = 1.0 / (1.0 + K / 1.93185165 + K * K);
highpass[hilp_a0] = norm;
highpass[hilp_a1] = -2.0 * highpass[hilp_a0];
highpass[hilp_b1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_b2] = (1.0 - K / 1.93185165 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.70710678 + K * K);
highpass[hilp_c0] = norm;
highpass[hilp_c1] = -2.0 * highpass[hilp_c0];
highpass[hilp_d1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_d2] = (1.0 - K / 0.70710678 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.51763809 + K * K);
highpass[hilp_e0] = norm;
highpass[hilp_e1] = -2.0 * highpass[hilp_e0];
highpass[hilp_f1] = 2.0 * (K * K - 1.0) * norm;
highpass[hilp_f2] = (1.0 - K / 0.51763809 + K * K) * norm;
K = tan(M_PI * lowpass[hilp_freq]); //lowpass
norm = 1.0 / (1.0 + K / 1.93185165 + K * K);
lowpass[hilp_a0] = K * K * norm;
lowpass[hilp_a1] = 2.0 * lowpass[hilp_a0];
lowpass[hilp_b1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_b2] = (1.0 - K / 1.93185165 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.70710678 + K * K);
lowpass[hilp_c0] = K * K * norm;
lowpass[hilp_c1] = 2.0 * lowpass[hilp_c0];
lowpass[hilp_d1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_d2] = (1.0 - K / 0.70710678 + K * K) * norm;
norm = 1.0 / (1.0 + K / 0.51763809 + K * K);
lowpass[hilp_e0] = K * K * norm;
lowpass[hilp_e1] = 2.0 * lowpass[hilp_e0];
lowpass[hilp_f1] = 2.0 * (K * K - 1.0) * norm;
lowpass[hilp_f2] = (1.0 - K / 0.51763809 + K * K) * norm;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (highpassEngage) { //begin Stacked Highpass
highpass[hilp_temp] = (inputSampleL*highpass[hilp_a0])+highpass[hilp_aL1];
highpass[hilp_aL1] = (inputSampleL*highpass[hilp_a1])-(highpass[hilp_temp]*highpass[hilp_b1])+highpass[hilp_aL2];
highpass[hilp_aL2] = (inputSampleL*highpass[hilp_a0])-(highpass[hilp_temp]*highpass[hilp_b2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleL*highpass[hilp_c0])+highpass[hilp_cL1];
highpass[hilp_cL1] = (inputSampleL*highpass[hilp_c1])-(highpass[hilp_temp]*highpass[hilp_d1])+highpass[hilp_cL2];
highpass[hilp_cL2] = (inputSampleL*highpass[hilp_c0])-(highpass[hilp_temp]*highpass[hilp_d2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleL*highpass[hilp_e0])+highpass[hilp_eL1];
highpass[hilp_eL1] = (inputSampleL*highpass[hilp_e1])-(highpass[hilp_temp]*highpass[hilp_f1])+highpass[hilp_eL2];
highpass[hilp_eL2] = (inputSampleL*highpass[hilp_e0])-(highpass[hilp_temp]*highpass[hilp_f2]); inputSampleL = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_a0])+highpass[hilp_aR1];
highpass[hilp_aR1] = (inputSampleR*highpass[hilp_a1])-(highpass[hilp_temp]*highpass[hilp_b1])+highpass[hilp_aR2];
highpass[hilp_aR2] = (inputSampleR*highpass[hilp_a0])-(highpass[hilp_temp]*highpass[hilp_b2]); inputSampleR = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_c0])+highpass[hilp_cR1];
highpass[hilp_cR1] = (inputSampleR*highpass[hilp_c1])-(highpass[hilp_temp]*highpass[hilp_d1])+highpass[hilp_cR2];
highpass[hilp_cR2] = (inputSampleR*highpass[hilp_c0])-(highpass[hilp_temp]*highpass[hilp_d2]); inputSampleR = highpass[hilp_temp];
highpass[hilp_temp] = (inputSampleR*highpass[hilp_e0])+highpass[hilp_eR1];
highpass[hilp_eR1] = (inputSampleR*highpass[hilp_e1])-(highpass[hilp_temp]*highpass[hilp_f1])+highpass[hilp_eR2];
highpass[hilp_eR2] = (inputSampleR*highpass[hilp_e0])-(highpass[hilp_temp]*highpass[hilp_f2]); inputSampleR = highpass[hilp_temp];
} else {
highpass[hilp_aL1] = highpass[hilp_aL2] = highpass[hilp_aR1] = highpass[hilp_aR2] = 0.0;
} //end Stacked Highpass
//rest of control strip goes here
if (lowpassEngage) { //begin Stacked Lowpass
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_a0])+lowpass[hilp_aL1];
lowpass[hilp_aL1] = (inputSampleL*lowpass[hilp_a1])-(lowpass[hilp_temp]*lowpass[hilp_b1])+lowpass[hilp_aL2];
lowpass[hilp_aL2] = (inputSampleL*lowpass[hilp_a0])-(lowpass[hilp_temp]*lowpass[hilp_b2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_c0])+lowpass[hilp_cL1];
lowpass[hilp_cL1] = (inputSampleL*lowpass[hilp_c1])-(lowpass[hilp_temp]*lowpass[hilp_d1])+lowpass[hilp_cL2];
lowpass[hilp_cL2] = (inputSampleL*lowpass[hilp_c0])-(lowpass[hilp_temp]*lowpass[hilp_d2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleL*lowpass[hilp_e0])+lowpass[hilp_eL1];
lowpass[hilp_eL1] = (inputSampleL*lowpass[hilp_e1])-(lowpass[hilp_temp]*lowpass[hilp_f1])+lowpass[hilp_eL2];
lowpass[hilp_eL2] = (inputSampleL*lowpass[hilp_e0])-(lowpass[hilp_temp]*lowpass[hilp_f2]); inputSampleL = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_a0])+lowpass[hilp_aR1];
lowpass[hilp_aR1] = (inputSampleR*lowpass[hilp_a1])-(lowpass[hilp_temp]*lowpass[hilp_b1])+lowpass[hilp_aR2];
lowpass[hilp_aR2] = (inputSampleR*lowpass[hilp_a0])-(lowpass[hilp_temp]*lowpass[hilp_b2]); inputSampleR = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_c0])+lowpass[hilp_cR1];
lowpass[hilp_cR1] = (inputSampleR*lowpass[hilp_c1])-(lowpass[hilp_temp]*lowpass[hilp_d1])+lowpass[hilp_cR2];
lowpass[hilp_cR2] = (inputSampleR*lowpass[hilp_c0])-(lowpass[hilp_temp]*lowpass[hilp_d2]); inputSampleR = lowpass[hilp_temp];
lowpass[hilp_temp] = (inputSampleR*lowpass[hilp_e0])+lowpass[hilp_eR1];
lowpass[hilp_eR1] = (inputSampleR*lowpass[hilp_e1])-(lowpass[hilp_temp]*lowpass[hilp_f1])+lowpass[hilp_eR2];
lowpass[hilp_eR2] = (inputSampleR*lowpass[hilp_e0])-(lowpass[hilp_temp]*lowpass[hilp_f2]); inputSampleR = lowpass[hilp_temp];
} else {
lowpass[hilp_aL1] = lowpass[hilp_aL2] = lowpass[hilp_aR1] = lowpass[hilp_aR2] = 0.0;
} //end Stacked Lowpass
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -22,20 +22,20 @@
<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="ConsoleXSubIn.cpp" />
<ClCompile Include="ConsoleXSubInProc.cpp" />
<ClCompile Include="BiquadHiLo.cpp" />
<ClCompile Include="BiquadHiLoProc.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="ConsoleXSubIn.h" />
<ClInclude Include="BiquadHiLo.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>ConsoleXSubIn64</ProjectName>
<ProjectName>BiquadHiLo64</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

View file

@ -24,10 +24,10 @@
<ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleXSubIn.cpp">
<ClCompile Include="BiquadHiLo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleXSubInProc.cpp">
<ClCompile Include="BiquadHiLoProc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@ -41,7 +41,7 @@
<ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConsoleXSubIn.h">
<ClInclude Include="BiquadHiLo.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>

Binary file not shown.

View file

@ -0,0 +1,138 @@
/* ========================================
* BiquadStack - BiquadStack.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadStack_H
#include "BiquadStack.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BiquadStack(audioMaster);}
BiquadStack::BiquadStack(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 0.5;
for (int x = 0; x < biqs_total; x++) {biqs[x] = 0.0;}
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
BiquadStack::~BiquadStack() {}
VstInt32 BiquadStack::getVendorVersion () {return 1000;}
void BiquadStack::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BiquadStack::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 BiquadStack::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */
*data = chunkData;
return kNumParameters * sizeof(float);
}
VstInt32 BiquadStack::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}
void BiquadStack::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float BiquadStack::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void BiquadStack::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Freq", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Level", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Reso", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void BiquadStack::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void BiquadStack::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 BiquadStack::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool BiquadStack::getEffectName(char* name) {
vst_strncpy(name, "BiquadStack", kVstMaxProductStrLen); return true;
}
VstPlugCategory BiquadStack::getPlugCategory() {return kPlugCategEffect;}
bool BiquadStack::getProductString(char* text) {
vst_strncpy (text, "airwindows BiquadStack", kVstMaxProductStrLen); return true;
}
bool BiquadStack::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -0,0 +1,78 @@
/* ========================================
* BiquadStack - BiquadStack.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadStack_H
#define __BiquadStack_H
#ifndef __audioeffect__
#include "audioeffectx.h"
#endif
#include <set>
#include <string>
#include <math.h>
enum {
kParamA =0,
kParamB =1,
kParamC =2,
kNumParameters = 3
}; //
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'biqk'; //Change this to what the AU identity is!
class BiquadStack :
public AudioEffectX
{
public:
BiquadStack(audioMasterCallback audioMaster);
~BiquadStack();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
float A;
float B;
float C;
enum {
biqs_freq, biqs_reso, biqs_level, biqs_levelA, biqs_levelB, biqs_nonlin, biqs_temp, biqs_dis,
biqs_a0, biqs_aA0, biqs_aB0, biqs_b1, biqs_bA1, biqs_bB1, biqs_b2, biqs_bA2, biqs_bB2,
biqs_c0, biqs_cA0, biqs_cB0, biqs_d1, biqs_dA1, biqs_dB1, biqs_d2, biqs_dA2, biqs_dB2,
biqs_e0, biqs_eA0, biqs_eB0, biqs_f1, biqs_fA1, biqs_fB1, biqs_f2, biqs_fA2, biqs_fB2,
biqs_aL1, biqs_aL2, biqs_aR1, biqs_aR2,
biqs_cL1, biqs_cL2, biqs_cR1, biqs_cR2,
biqs_eL1, biqs_eL2, biqs_eR1, biqs_eR2,
biqs_outL, biqs_outR, biqs_total
};
double biqs[biqs_total];
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

View file

@ -0,0 +1,302 @@
/* ========================================
* BiquadStack - BiquadStack.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __BiquadStack_H
#include "BiquadStack.h"
#endif
void BiquadStack::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
biqs[biqs_levelA] = biqs[biqs_levelB];
biqs[biqs_aA0] = biqs[biqs_aB0];
biqs[biqs_bA1] = biqs[biqs_bB1];
biqs[biqs_bA2] = biqs[biqs_bB2];
biqs[biqs_cA0] = biqs[biqs_cB0];
biqs[biqs_dA1] = biqs[biqs_dB1];
biqs[biqs_dA2] = biqs[biqs_dB2];
biqs[biqs_eA0] = biqs[biqs_eB0];
biqs[biqs_fA1] = biqs[biqs_fB1];
biqs[biqs_fA2] = biqs[biqs_fB2];
//previous run through the buffer is still in the filter, so we move it
//to the A section and now it's the new starting point.
biqs[biqs_freq] = (((pow(A,4)*19980.0)+20.0)/getSampleRate());
biqs[biqs_nonlin] = B;
biqs[biqs_levelB] = (biqs[biqs_nonlin]*2.0)-1.0;
if (biqs[biqs_levelB] > 0.0) biqs[biqs_levelB] *= 2.0;
biqs[biqs_reso] = ((0.5+(biqs[biqs_nonlin]*0.5)+sqrt(biqs[biqs_freq]))-(1.0-pow(1.0-C,2.0)))+0.5+(biqs[biqs_nonlin]*0.5);
double K = tan(M_PI * biqs[biqs_freq]);
double norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*1.93185165) + K * K);
biqs[biqs_aB0] = K / (biqs[biqs_reso]*1.93185165) * norm;
biqs[biqs_bB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_bB2] = (1.0 - K / (biqs[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*0.70710678) + K * K);
biqs[biqs_cB0] = K / (biqs[biqs_reso]*0.70710678) * norm;
biqs[biqs_dB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_dB2] = (1.0 - K / (biqs[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*0.51763809) + K * K);
biqs[biqs_eB0] = K / (biqs[biqs_reso]*0.51763809) * norm;
biqs[biqs_fB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_fB2] = (1.0 - K / (biqs[biqs_reso]*0.51763809) + K * K) * norm;
if (biqs[biqs_aA0] == 0.0) { // if we have just started, start directly with raw info
biqs[biqs_levelA] = biqs[biqs_levelB];
biqs[biqs_aA0] = biqs[biqs_aB0];
biqs[biqs_bA1] = biqs[biqs_bB1];
biqs[biqs_bA2] = biqs[biqs_bB2];
biqs[biqs_cA0] = biqs[biqs_cB0];
biqs[biqs_dA1] = biqs[biqs_dB1];
biqs[biqs_dA2] = biqs[biqs_dB2];
biqs[biqs_eA0] = biqs[biqs_eB0];
biqs[biqs_fA1] = biqs[biqs_fB1];
biqs[biqs_fA2] = biqs[biqs_fB2];
}
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double buf = (double)sampleFrames/inFramesToProcess;
biqs[biqs_level] = (biqs[biqs_levelA]*buf)+(biqs[biqs_levelB]*(1.0-buf));
biqs[biqs_a0] = (biqs[biqs_aA0]*buf)+(biqs[biqs_aB0]*(1.0-buf));
biqs[biqs_b1] = (biqs[biqs_bA1]*buf)+(biqs[biqs_bB1]*(1.0-buf));
biqs[biqs_b2] = (biqs[biqs_bA2]*buf)+(biqs[biqs_bB2]*(1.0-buf));
biqs[biqs_c0] = (biqs[biqs_cA0]*buf)+(biqs[biqs_cB0]*(1.0-buf));
biqs[biqs_d1] = (biqs[biqs_dA1]*buf)+(biqs[biqs_dB1]*(1.0-buf));
biqs[biqs_d2] = (biqs[biqs_dA2]*buf)+(biqs[biqs_dB2]*(1.0-buf));
biqs[biqs_e0] = (biqs[biqs_eA0]*buf)+(biqs[biqs_eB0]*(1.0-buf));
biqs[biqs_f1] = (biqs[biqs_fA1]*buf)+(biqs[biqs_fB1]*(1.0-buf));
biqs[biqs_f2] = (biqs[biqs_fA2]*buf)+(biqs[biqs_fB2]*(1.0-buf));
//begin Stacked Biquad With Reversed Neutron Flow L
biqs[biqs_outL] = inputSampleL * fabs(biqs[biqs_level]);
biqs[biqs_dis] = fabs(biqs[biqs_a0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_aL1];
biqs[biqs_aL1] = biqs[biqs_aL2] - (biqs[biqs_temp]*biqs[biqs_b1]);
biqs[biqs_aL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_b2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_c0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_cL1];
biqs[biqs_cL1] = biqs[biqs_cL2] - (biqs[biqs_temp]*biqs[biqs_d1]);
biqs[biqs_cL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_d2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_e0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_eL1];
biqs[biqs_eL1] = biqs[biqs_eL2] - (biqs[biqs_temp]*biqs[biqs_f1]);
biqs[biqs_eL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_f2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_outL] *= biqs[biqs_level];
if (biqs[biqs_level] > 1.0) biqs[biqs_outL] *= biqs[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow R
biqs[biqs_outR] = inputSampleR * fabs(biqs[biqs_level]);
biqs[biqs_dis] = fabs(biqs[biqs_a0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_aR1];
biqs[biqs_aR1] = biqs[biqs_aR2] - (biqs[biqs_temp]*biqs[biqs_b1]);
biqs[biqs_aR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_b2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_c0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_cR1];
biqs[biqs_cR1] = biqs[biqs_cR2] - (biqs[biqs_temp]*biqs[biqs_d1]);
biqs[biqs_cR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_d2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_e0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_eR1];
biqs[biqs_eR1] = biqs[biqs_eR2] - (biqs[biqs_temp]*biqs[biqs_f1]);
biqs[biqs_eR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_f2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_outR] *= biqs[biqs_level];
if (biqs[biqs_level] > 1.0) biqs[biqs_outR] *= biqs[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
inputSampleL += biqs[biqs_outL]; //purely a parallel filter stage here
inputSampleR += biqs[biqs_outR]; //purely a parallel filter stage here
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void BiquadStack::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
biqs[biqs_levelA] = biqs[biqs_levelB];
biqs[biqs_aA0] = biqs[biqs_aB0];
biqs[biqs_bA1] = biqs[biqs_bB1];
biqs[biqs_bA2] = biqs[biqs_bB2];
biqs[biqs_cA0] = biqs[biqs_cB0];
biqs[biqs_dA1] = biqs[biqs_dB1];
biqs[biqs_dA2] = biqs[biqs_dB2];
biqs[biqs_eA0] = biqs[biqs_eB0];
biqs[biqs_fA1] = biqs[biqs_fB1];
biqs[biqs_fA2] = biqs[biqs_fB2];
//previous run through the buffer is still in the filter, so we move it
//to the A section and now it's the new starting point.
biqs[biqs_freq] = (((pow(A,4)*19980.0)+20.0)/getSampleRate());
biqs[biqs_nonlin] = B;
biqs[biqs_levelB] = (biqs[biqs_nonlin]*2.0)-1.0;
if (biqs[biqs_levelB] > 0.0) biqs[biqs_levelB] *= 2.0;
biqs[biqs_reso] = ((0.5+(biqs[biqs_nonlin]*0.5)+sqrt(biqs[biqs_freq]))-(1.0-pow(1.0-C,2.0)))+0.5+(biqs[biqs_nonlin]*0.5);
double K = tan(M_PI * biqs[biqs_freq]);
double norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*1.93185165) + K * K);
biqs[biqs_aB0] = K / (biqs[biqs_reso]*1.93185165) * norm;
biqs[biqs_bB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_bB2] = (1.0 - K / (biqs[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*0.70710678) + K * K);
biqs[biqs_cB0] = K / (biqs[biqs_reso]*0.70710678) * norm;
biqs[biqs_dB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_dB2] = (1.0 - K / (biqs[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (biqs[biqs_reso]*0.51763809) + K * K);
biqs[biqs_eB0] = K / (biqs[biqs_reso]*0.51763809) * norm;
biqs[biqs_fB1] = 2.0 * (K * K - 1.0) * norm;
biqs[biqs_fB2] = (1.0 - K / (biqs[biqs_reso]*0.51763809) + K * K) * norm;
if (biqs[biqs_aA0] == 0.0) { // if we have just started, start directly with raw info
biqs[biqs_levelA] = biqs[biqs_levelB];
biqs[biqs_aA0] = biqs[biqs_aB0];
biqs[biqs_bA1] = biqs[biqs_bB1];
biqs[biqs_bA2] = biqs[biqs_bB2];
biqs[biqs_cA0] = biqs[biqs_cB0];
biqs[biqs_dA1] = biqs[biqs_dB1];
biqs[biqs_dA2] = biqs[biqs_dB2];
biqs[biqs_eA0] = biqs[biqs_eB0];
biqs[biqs_fA1] = biqs[biqs_fB1];
biqs[biqs_fA2] = biqs[biqs_fB2];
}
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double buf = (double)sampleFrames/inFramesToProcess;
biqs[biqs_level] = (biqs[biqs_levelA]*buf)+(biqs[biqs_levelB]*(1.0-buf));
biqs[biqs_a0] = (biqs[biqs_aA0]*buf)+(biqs[biqs_aB0]*(1.0-buf));
biqs[biqs_b1] = (biqs[biqs_bA1]*buf)+(biqs[biqs_bB1]*(1.0-buf));
biqs[biqs_b2] = (biqs[biqs_bA2]*buf)+(biqs[biqs_bB2]*(1.0-buf));
biqs[biqs_c0] = (biqs[biqs_cA0]*buf)+(biqs[biqs_cB0]*(1.0-buf));
biqs[biqs_d1] = (biqs[biqs_dA1]*buf)+(biqs[biqs_dB1]*(1.0-buf));
biqs[biqs_d2] = (biqs[biqs_dA2]*buf)+(biqs[biqs_dB2]*(1.0-buf));
biqs[biqs_e0] = (biqs[biqs_eA0]*buf)+(biqs[biqs_eB0]*(1.0-buf));
biqs[biqs_f1] = (biqs[biqs_fA1]*buf)+(biqs[biqs_fB1]*(1.0-buf));
biqs[biqs_f2] = (biqs[biqs_fA2]*buf)+(biqs[biqs_fB2]*(1.0-buf));
//begin Stacked Biquad With Reversed Neutron Flow L
biqs[biqs_outL] = inputSampleL * fabs(biqs[biqs_level]);
biqs[biqs_dis] = fabs(biqs[biqs_a0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_aL1];
biqs[biqs_aL1] = biqs[biqs_aL2] - (biqs[biqs_temp]*biqs[biqs_b1]);
biqs[biqs_aL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_b2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_c0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_cL1];
biqs[biqs_cL1] = biqs[biqs_cL2] - (biqs[biqs_temp]*biqs[biqs_d1]);
biqs[biqs_cL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_d2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_e0] * (1.0+(biqs[biqs_outL]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outL] * biqs[biqs_dis]) + biqs[biqs_eL1];
biqs[biqs_eL1] = biqs[biqs_eL2] - (biqs[biqs_temp]*biqs[biqs_f1]);
biqs[biqs_eL2] = (biqs[biqs_outL] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_f2]);
biqs[biqs_outL] = biqs[biqs_temp];
biqs[biqs_outL] *= biqs[biqs_level];
if (biqs[biqs_level] > 1.0) biqs[biqs_outL] *= biqs[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow R
biqs[biqs_outR] = inputSampleR * fabs(biqs[biqs_level]);
biqs[biqs_dis] = fabs(biqs[biqs_a0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_aR1];
biqs[biqs_aR1] = biqs[biqs_aR2] - (biqs[biqs_temp]*biqs[biqs_b1]);
biqs[biqs_aR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_b2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_c0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_cR1];
biqs[biqs_cR1] = biqs[biqs_cR2] - (biqs[biqs_temp]*biqs[biqs_d1]);
biqs[biqs_cR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_d2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_dis] = fabs(biqs[biqs_e0] * (1.0+(biqs[biqs_outR]*biqs[biqs_nonlin])));
if (biqs[biqs_dis] > 1.0) biqs[biqs_dis] = 1.0;
biqs[biqs_temp] = (biqs[biqs_outR] * biqs[biqs_dis]) + biqs[biqs_eR1];
biqs[biqs_eR1] = biqs[biqs_eR2] - (biqs[biqs_temp]*biqs[biqs_f1]);
biqs[biqs_eR2] = (biqs[biqs_outR] * -biqs[biqs_dis]) - (biqs[biqs_temp]*biqs[biqs_f2]);
biqs[biqs_outR] = biqs[biqs_temp];
biqs[biqs_outR] *= biqs[biqs_level];
if (biqs[biqs_level] > 1.0) biqs[biqs_outR] *= biqs[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
inputSampleL += biqs[biqs_outL]; //purely a parallel filter stage here
inputSampleR += biqs[biqs_outR]; //purely a parallel filter stage here
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -22,20 +22,20 @@
<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="ConsoleXSubOut.cpp" />
<ClCompile Include="ConsoleXSubOutProc.cpp" />
<ClCompile Include="BiquadStack.cpp" />
<ClCompile Include="BiquadStackProc.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="ConsoleXSubOut.h" />
<ClInclude Include="BiquadStack.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>ConsoleXSubOut64</ProjectName>
<ProjectName>BiquadStack64</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

View file

@ -24,10 +24,10 @@
<ClCompile Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\vstplugmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleXSubOut.cpp">
<ClCompile Include="BiquadStack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleXSubOutProc.cpp">
<ClCompile Include="BiquadStackProc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@ -41,7 +41,7 @@
<ClInclude Include="..\..\..\vstsdk2.4\public.sdk\source\vst2.x\audioeffectx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConsoleXSubOut.h">
<ClInclude Include="BiquadStack.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>

View file

@ -12,24 +12,64 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new C
ConsoleXBuss::ConsoleXBuss(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 0.5;
D = 0.5;
E = 0.5;
F = 0.5;
G = 0.5;
H = 0.5;
HIP = 0.0;
LOP = 0.0;
AIR = 0.5;
FIR = 0.5;
STO = 0.5;
RNG = 0.5;
FCT = 1.0;
SCT = 1.0;
FCR = 1.0;
SCR = 1.0;
FCA = 0.5;
SCA = 0.5;
FCL = 0.5;
SCL = 0.5;
FGT = 0.0;
SGT = 0.0;
FGR = 1.0;
SGR = 1.0;
FGS = 0.5;
SGS = 0.5;
FGL = 0.5;
SGL = 0.5;
TRF = 0.5;
TRG = 0.5;
TRR = 0.5;
HMF = 0.5;
HMG = 0.5;
HMR = 0.5;
LMF = 0.5;
LMG = 0.5;
LMR = 0.5;
BSF = 0.5;
BSG = 0.5;
BSR = 0.5;
DSC = 0.5;
PAN = 0.5;
FAD = 0.5;
for (int x = 0; x < hilp_total; x++) {
highpass[x] = 0.0;
lowpass[x] = 0.0;
}
for (int x = 0; x < biq_total; x++) {biquad[x] = 0.0;}
for (int x = 0; x < air_total; x++) air[x] = 0.0;
for (int x = 0; x < kal_total; x++) kal[x] = 0.0;
fireCompL = 1.0;
fireCompR = 1.0;
fireGate = 1.0;
stoneCompL = 1.0;
stoneCompR = 1.0;
stoneGate = 1.0;
for(int count = 0; count < 2004; count++) {mpkL[count] = 0.0; mpkR[count] = 0.0;}
for(int count = 0; count < 65; count++) {f[count] = 0.0;}
prevfreqMPeak = -1;
prevamountMPeak = -1;
mpc = 1;
for (int x = 0; x < biqs_total; x++) {
high[x] = 0.0;
hmid[x] = 0.0;
lmid[x] = 0.0;
bass[x] = 0.0;
}
for(int count = 0; count < dscBuf+2; count++) {
dBaL[count] = 0.0;
@ -39,13 +79,13 @@ ConsoleXBuss::ConsoleXBuss(audioMasterCallback audioMaster) :
dBaPosR = 0.0;
dBaXL = 1;
dBaXR = 1;
trebleGainA = 1.0; trebleGainB = 1.0;
midGainA = 1.0; midGainB = 1.0;
mPeakA = 1.0; mPeakB = 1.0;
bassGainA = 1.0; bassGainB = 1.0;
airGainA = 0.5; airGainB = 0.5;
fireGainA = 0.5; fireGainB = 0.5;
stoneGainA = 0.5; stoneGainB = 0.5;
panA = 0.5; panB = 0.5;
inTrimA = 1.0; inTrimB = 1.0;
inTrimA = 1.0; inTrimB = 1.0;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
@ -79,14 +119,43 @@ static float pinParameter(float data)
VstInt32 ConsoleXBuss::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
chunkData[4] = E;
chunkData[5] = F;
chunkData[6] = G;
chunkData[7] = H;
chunkData[0] = HIP;
chunkData[1] = LOP;
chunkData[2] = AIR;
chunkData[3] = FIR;
chunkData[4] = STO;
chunkData[5] = RNG;
chunkData[6] = FCT;
chunkData[7] = SCT;
chunkData[8] = FCR;
chunkData[9] = SCR;
chunkData[10] = FCA;
chunkData[11] = SCA;
chunkData[12] = FCL;
chunkData[13] = SCL;
chunkData[14] = FGT;
chunkData[15] = SGT;
chunkData[16] = FGR;
chunkData[17] = SGR;
chunkData[18] = FGS;
chunkData[19] = SGS;
chunkData[20] = FGL;
chunkData[21] = SGL;
chunkData[22] = TRF;
chunkData[23] = TRG;
chunkData[24] = TRR;
chunkData[25] = HMF;
chunkData[26] = HMG;
chunkData[27] = HMR;
chunkData[28] = LMF;
chunkData[29] = LMG;
chunkData[30] = LMR;
chunkData[31] = BSF;
chunkData[32] = BSG;
chunkData[33] = BSR;
chunkData[34] = DSC;
chunkData[35] = PAN;
chunkData[36] = FAD;
/* 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. */
@ -98,14 +167,43 @@ VstInt32 ConsoleXBuss::getChunk (void** data, bool isPreset)
VstInt32 ConsoleXBuss::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
E = pinParameter(chunkData[4]);
F = pinParameter(chunkData[5]);
G = pinParameter(chunkData[6]);
H = pinParameter(chunkData[7]);
HIP = pinParameter(chunkData[0]);
LOP = pinParameter(chunkData[1]);
AIR = pinParameter(chunkData[2]);
FIR = pinParameter(chunkData[3]);
STO = pinParameter(chunkData[4]);
RNG = pinParameter(chunkData[5]);
FCT = pinParameter(chunkData[6]);
SCT = pinParameter(chunkData[7]);
FCR = pinParameter(chunkData[8]);
SCR = pinParameter(chunkData[9]);
FCA = pinParameter(chunkData[10]);
SCA = pinParameter(chunkData[11]);
FCL = pinParameter(chunkData[12]);
SCL = pinParameter(chunkData[13]);
FGT = pinParameter(chunkData[14]);
SGT = pinParameter(chunkData[15]);
FGR = pinParameter(chunkData[16]);
SGR = pinParameter(chunkData[17]);
FGS = pinParameter(chunkData[18]);
SGS = pinParameter(chunkData[19]);
FGL = pinParameter(chunkData[20]);
SGL = pinParameter(chunkData[21]);
TRF = pinParameter(chunkData[22]);
TRG = pinParameter(chunkData[23]);
TRR = pinParameter(chunkData[24]);
HMF = pinParameter(chunkData[25]);
HMG = pinParameter(chunkData[26]);
HMR = pinParameter(chunkData[27]);
LMF = pinParameter(chunkData[28]);
LMG = pinParameter(chunkData[29]);
LMR = pinParameter(chunkData[30]);
BSF = pinParameter(chunkData[31]);
BSG = pinParameter(chunkData[32]);
BSR = pinParameter(chunkData[33]);
DSC = pinParameter(chunkData[34]);
PAN = pinParameter(chunkData[35]);
FAD = pinParameter(chunkData[36]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
@ -115,70 +213,215 @@ VstInt32 ConsoleXBuss::setChunk (void* data, VstInt32 byteSize, bool isPreset)
void ConsoleXBuss::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
case kParamE: E = value; break;
case kParamF: F = value; break;
case kParamG: G = value; break;
case kParamH: H = value; break;
case kParamHIP: HIP = value; break;
case kParamLOP: LOP = value; break;
case kParamAIR: AIR = value; break;
case kParamFIR: FIR = value; break;
case kParamSTO: STO = value; break;
case kParamRNG: RNG = value; break;
case kParamFCT: FCT = value; break;
case kParamSCT: SCT = value; break;
case kParamFCR: FCR = value; break;
case kParamSCR: SCR = value; break;
case kParamFCA: FCA = value; break;
case kParamSCA: SCA = value; break;
case kParamFCL: FCL = value; break;
case kParamSCL: SCL = value; break;
case kParamFGT: FGT = value; break;
case kParamSGT: SGT = value; break;
case kParamFGR: FGR = value; break;
case kParamSGR: SGR = value; break;
case kParamFGS: FGS = value; break;
case kParamSGS: SGS = value; break;
case kParamFGL: FGL = value; break;
case kParamSGL: SGL = value; break;
case kParamTRF: TRF = value; break;
case kParamTRG: TRG = value; break;
case kParamTRR: TRR = value; break;
case kParamHMF: HMF = value; break;
case kParamHMG: HMG = value; break;
case kParamHMR: HMR = value; break;
case kParamLMF: LMF = value; break;
case kParamLMG: LMG = value; break;
case kParamLMR: LMR = value; break;
case kParamBSF: BSF = value; break;
case kParamBSG: BSG = value; break;
case kParamBSR: BSR = value; break;
case kParamDSC: DSC = value; break;
case kParamPAN: PAN = value; break;
case kParamFAD: FAD = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float ConsoleXBuss::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
case kParamE: return E; break;
case kParamF: return F; break;
case kParamG: return G; break;
case kParamH: return H; break;
case kParamHIP: return HIP; break;
case kParamLOP: return LOP; break;
case kParamAIR: return AIR; break;
case kParamFIR: return FIR; break;
case kParamSTO: return STO; break;
case kParamRNG: return RNG; break;
case kParamFCT: return FCT; break;
case kParamSCT: return SCT; break;
case kParamFCR: return FCR; break;
case kParamSCR: return SCR; break;
case kParamFCA: return FCA; break;
case kParamSCA: return SCA; break;
case kParamFCL: return FCL; break;
case kParamSCL: return SCL; break;
case kParamFGT: return FGT; break;
case kParamSGT: return SGT; break;
case kParamFGR: return FGR; break;
case kParamSGR: return SGR; break;
case kParamFGS: return FGS; break;
case kParamSGS: return SGS; break;
case kParamFGL: return FGL; break;
case kParamSGL: return SGL; break;
case kParamTRF: return TRF; break;
case kParamTRG: return TRG; break;
case kParamTRR: return TRR; break;
case kParamHMF: return HMF; break;
case kParamHMG: return HMG; break;
case kParamHMR: return HMR; break;
case kParamLMF: return LMF; break;
case kParamLMG: return LMG; break;
case kParamLMR: return LMR; break;
case kParamBSF: return BSF; break;
case kParamBSG: return BSG; break;
case kParamBSR: return BSR; break;
case kParamDSC: return DSC; break;
case kParamPAN: return PAN; break;
case kParamFAD: return FAD; 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 ConsoleXBuss::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Air", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Reso", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "Pan", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "Fader", kVstMaxParamStrLen); break;
case kParamHIP: vst_strncpy (text, "Highpas", kVstMaxParamStrLen); break;
case kParamLOP: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break;
case kParamAIR: vst_strncpy (text, "Air", kVstMaxParamStrLen); break;
case kParamFIR: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamSTO: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamRNG: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamFCT: vst_strncpy (text, "FC Thrs", kVstMaxParamStrLen); break;
case kParamSCT: vst_strncpy (text, "SC Thrs", kVstMaxParamStrLen); break;
case kParamFCR: vst_strncpy (text, "FC Rati", kVstMaxParamStrLen); break;
case kParamSCR: vst_strncpy (text, "SC Rati", kVstMaxParamStrLen); break;
case kParamFCA: vst_strncpy (text, "FC Atk", kVstMaxParamStrLen); break;
case kParamSCA: vst_strncpy (text, "SC Atk", kVstMaxParamStrLen); break;
case kParamFCL: vst_strncpy (text, "FC Rls", kVstMaxParamStrLen); break;
case kParamSCL: vst_strncpy (text, "SC Rls", kVstMaxParamStrLen); break;
case kParamFGT: vst_strncpy (text, "FG Thrs", kVstMaxParamStrLen); break;
case kParamSGT: vst_strncpy (text, "SG Thrs", kVstMaxParamStrLen); break;
case kParamFGR: vst_strncpy (text, "FG Rati", kVstMaxParamStrLen); break;
case kParamSGR: vst_strncpy (text, "SG Rati", kVstMaxParamStrLen); break;
case kParamFGS: vst_strncpy (text, "FG Sust", kVstMaxParamStrLen); break;
case kParamSGS: vst_strncpy (text, "SG Sust", kVstMaxParamStrLen); break;
case kParamFGL: vst_strncpy (text, "FG Rls", kVstMaxParamStrLen); break;
case kParamSGL: vst_strncpy (text, "SG Rls", kVstMaxParamStrLen); break;
case kParamTRF: vst_strncpy (text, "Tr Freq", kVstMaxParamStrLen); break;
case kParamTRG: vst_strncpy (text, "Treble", kVstMaxParamStrLen); break;
case kParamTRR: vst_strncpy (text, "Tr Reso", kVstMaxParamStrLen); break;
case kParamHMF: vst_strncpy (text, "HM Freq", kVstMaxParamStrLen); break;
case kParamHMG: vst_strncpy (text, "HighMid", kVstMaxParamStrLen); break;
case kParamHMR: vst_strncpy (text, "HM Reso", kVstMaxParamStrLen); break;
case kParamLMF: vst_strncpy (text, "LM Freq", kVstMaxParamStrLen); break;
case kParamLMG: vst_strncpy (text, "LowMid", kVstMaxParamStrLen); break;
case kParamLMR: vst_strncpy (text, "LM Reso", kVstMaxParamStrLen); break;
case kParamBSF: vst_strncpy (text, "Bs Freq", kVstMaxParamStrLen); break;
case kParamBSG: vst_strncpy (text, "Bass", kVstMaxParamStrLen); break;
case kParamBSR: vst_strncpy (text, "Bs Reso", kVstMaxParamStrLen); break;
case kParamDSC: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamPAN: vst_strncpy (text, "Pan", kVstMaxParamStrLen); break;
case kParamFAD: vst_strncpy (text, "Fader", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void ConsoleXBuss::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
case kParamF: float2string ((F*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamG: float2string (G, text, kVstMaxParamStrLen); break;
case kParamH: float2string (H, text, kVstMaxParamStrLen); break;
case kParamHIP: float2string (HIP, text, kVstMaxParamStrLen); break;
case kParamLOP: float2string (LOP, text, kVstMaxParamStrLen); break;
case kParamAIR: float2string (AIR, text, kVstMaxParamStrLen); break;
case kParamFIR: float2string (FIR, text, kVstMaxParamStrLen); break;
case kParamSTO: float2string (STO, text, kVstMaxParamStrLen); break;
case kParamRNG: float2string (RNG, text, kVstMaxParamStrLen); break;
case kParamFCT: float2string (FCT, text, kVstMaxParamStrLen); break;
case kParamSCT: float2string (SCT, text, kVstMaxParamStrLen); break;
case kParamFCR: float2string (FCR, text, kVstMaxParamStrLen); break;
case kParamSCR: float2string (SCR, text, kVstMaxParamStrLen); break;
case kParamFCA: float2string (FCA, text, kVstMaxParamStrLen); break;
case kParamSCA: float2string (SCA, text, kVstMaxParamStrLen); break;
case kParamFCL: float2string (FCL, text, kVstMaxParamStrLen); break;
case kParamSCL: float2string (SCL, text, kVstMaxParamStrLen); break;
case kParamFGT: float2string (FGT, text, kVstMaxParamStrLen); break;
case kParamSGT: float2string (SGT, text, kVstMaxParamStrLen); break;
case kParamFGR: float2string (FGR, text, kVstMaxParamStrLen); break;
case kParamSGR: float2string (SGR, text, kVstMaxParamStrLen); break;
case kParamFGS: float2string (FGS, text, kVstMaxParamStrLen); break;
case kParamSGS: float2string (SGS, text, kVstMaxParamStrLen); break;
case kParamFGL: float2string (FGL, text, kVstMaxParamStrLen); break;
case kParamSGL: float2string (SGL, text, kVstMaxParamStrLen); break;
case kParamTRF: float2string (TRF, text, kVstMaxParamStrLen); break;
case kParamTRG: float2string (TRG, text, kVstMaxParamStrLen); break;
case kParamTRR: float2string (TRR, text, kVstMaxParamStrLen); break;
case kParamHMF: float2string (HMF, text, kVstMaxParamStrLen); break;
case kParamHMG: float2string (HMG, text, kVstMaxParamStrLen); break;
case kParamHMR: float2string (HMR, text, kVstMaxParamStrLen); break;
case kParamLMF: float2string (LMF, text, kVstMaxParamStrLen); break;
case kParamLMG: float2string (LMG, text, kVstMaxParamStrLen); break;
case kParamLMR: float2string (LMR, text, kVstMaxParamStrLen); break;
case kParamBSF: float2string (BSF, text, kVstMaxParamStrLen); break;
case kParamBSG: float2string (BSG, text, kVstMaxParamStrLen); break;
case kParamBSR: float2string (BSR, text, kVstMaxParamStrLen); break;
case kParamDSC: float2string ((DSC*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamPAN: float2string (PAN, text, kVstMaxParamStrLen); break;
case kParamFAD: float2string (FAD, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void ConsoleXBuss::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, "dB", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHIP: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLOP: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamAIR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFIR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSTO: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamRNG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGS: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGS: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamDSC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break;
case kParamPAN: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFAD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

View file

@ -16,18 +16,48 @@
#include <math.h>
enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kParamE = 4,
kParamF = 5,
kParamG = 6,
kParamH = 7,
kNumParameters = 8
kParamHIP = 0,
kParamLOP = 1,
kParamAIR = 2,
kParamFIR = 3,
kParamSTO = 4,
kParamRNG = 5,
kParamFCT = 6,
kParamSCT = 7,
kParamFCR = 8,
kParamSCR = 9,
kParamFCA = 10,
kParamSCA = 11,
kParamFCL = 12,
kParamSCL = 13,
kParamFGT = 14,
kParamSGT = 15,
kParamFGR = 16,
kParamSGR = 17,
kParamFGS = 18,
kParamSGS = 19,
kParamFGL = 20,
kParamSGL = 21,
kParamTRF = 22,
kParamTRG = 23,
kParamTRR = 24,
kParamHMF = 25,
kParamHMG = 26,
kParamHMR = 27,
kParamLMF = 28,
kParamLMG = 29,
kParamLMR = 30,
kParamBSF = 31,
kParamBSG = 32,
kParamBSR = 33,
kParamDSC = 34,
kParamPAN = 35,
kParamFAD = 36,
kNumParameters = 37
}; //
const int dscBuf = 90;
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
@ -60,96 +90,112 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
float HIP;
float LOP;
float AIR;
float FIR;
float STO;
float RNG;
float FCT;
float SCT;
float FCR;
float SCR;
float FCA;
float SCA;
float FCL;
float SCL;
float FGT;
float SGT;
float FGR;
float SGR;
float FGS;
float SGS;
float FGL;
float SGL;
float TRF;
float TRG;
float TRR;
float HMF;
float HMG;
float HMR;
float LMF;
float LMG;
float LMR;
float BSF;
float BSG;
float BSR;
float DSC;
float PAN;
float FAD;
enum {
biq_freq,
biq_reso,
biq_a0,
biq_a1,
biq_a2,
biq_b1,
biq_b2,
biq_sL1,
biq_sL2,
biq_sR1,
biq_sR2,
biq_total
hilp_freq, hilp_temp,
hilp_a0, hilp_aA0, hilp_aB0, hilp_a1, hilp_aA1, hilp_aB1, hilp_b1, hilp_bA1, hilp_bB1, hilp_b2, hilp_bA2, hilp_bB2,
hilp_c0, hilp_cA0, hilp_cB0, hilp_c1, hilp_cA1, hilp_cB1, hilp_d1, hilp_dA1, hilp_dB1, hilp_d2, hilp_dA2, hilp_dB2,
hilp_e0, hilp_eA0, hilp_eB0, hilp_e1, hilp_eA1, hilp_eB1, hilp_f1, hilp_fA1, hilp_fB1, hilp_f2, hilp_fA2, hilp_fB2,
hilp_aL1, hilp_aL2, hilp_aR1, hilp_aR2,
hilp_cL1, hilp_cL2, hilp_cR1, hilp_cR2,
hilp_eL1, hilp_eL2, hilp_eR1, hilp_eR2,
hilp_total
};
double biquad[biq_total];
double highpass[hilp_total];
double lowpass[hilp_total];
enum {
pvAL1,
pvSL1,
accSL1,
acc2SL1,
pvAL2,
pvSL2,
accSL2,
acc2SL2,
pvAL3,
pvSL3,
accSL3,
pvAL4,
pvSL4,
gndavgL,
outAL,
gainAL,
pvAR1,
pvSR1,
accSR1,
acc2SR1,
pvAR2,
pvSR2,
accSR2,
acc2SR2,
pvAR3,
pvSR3,
accSR3,
pvAR4,
pvSR4,
gndavgR,
outAR,
gainAR,
pvAL1, pvSL1, accSL1, acc2SL1,
pvAL2, pvSL2, accSL2, acc2SL2,
pvAL3, pvSL3, accSL3,
pvAL4, pvSL4,
gndavgL, outAL, gainAL,
pvAR1, pvSR1, accSR1, acc2SR1,
pvAR2, pvSR2, accSR2, acc2SR2,
pvAR3, pvSR3, accSR3,
pvAR4, pvSR4,
gndavgR, outAR, gainAR,
air_total
};
double air[air_total];
enum {
prevSampL1,
prevSlewL1,
accSlewL1,
prevSampL2,
prevSlewL2,
accSlewL2,
prevSampL3,
prevSlewL3,
accSlewL3,
kalGainL,
kalOutL,
prevSampR1,
prevSlewR1,
accSlewR1,
prevSampR2,
prevSlewR2,
accSlewR2,
prevSampR3,
prevSlewR3,
accSlewR3,
kalGainR,
kalOutR,
prevSampL1, prevSlewL1, accSlewL1,
prevSampL2, prevSlewL2, accSlewL2,
prevSampL3, prevSlewL3, accSlewL3,
kalGainL, kalOutL,
prevSampR1, prevSlewR1, accSlewR1,
prevSampR2, prevSlewR2, accSlewR2,
prevSampR3, prevSlewR3, accSlewR3,
kalGainR, kalOutR,
kal_total
};
double kal[kal_total];
double fireCompL;
double fireCompR;
double fireGate;
double stoneCompL;
double stoneCompR;
double stoneGate;
double airGainA;
double airGainB;
double fireGainA;
double fireGainB;
double stoneGainA;
double stoneGainB;
double mpkL[2005];
double mpkR[2005];
double f[66];
double prevfreqMPeak;
double prevamountMPeak;
int mpc;
enum {
biqs_freq, biqs_reso, biqs_level,
biqs_nonlin, biqs_temp, biqs_dis,
biqs_a0, biqs_a1, biqs_b1, biqs_b2,
biqs_c0, biqs_c1, biqs_d1, biqs_d2,
biqs_e0, biqs_e1, biqs_f1, biqs_f2,
biqs_aL1, biqs_aL2, biqs_aR1, biqs_aR2,
biqs_cL1, biqs_cL2, biqs_cR1, biqs_cR2,
biqs_eL1, biqs_eL2, biqs_eR1, biqs_eR2,
biqs_outL, biqs_outR, biqs_total
};
double high[biqs_total];
double hmid[biqs_total];
double lmid[biqs_total];
double bass[biqs_total];
double dBaL[dscBuf+5];
double dBaR[dscBuf+5];
@ -158,27 +204,14 @@ private:
int dBaXL;
int dBaXR;
double trebleGainA;
double trebleGainB;
double midGainA;
double midGainB;
double mPeakA;
double mPeakB;
double bassGainA;
double bassGainB;
double panA;
double panB;
double inTrimA;
double inTrimB;
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -12,24 +12,64 @@ AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new C
ConsoleXChannel::ConsoleXChannel(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 0.5;
D = 0.5;
E = 0.5;
F = 0.5;
G = 0.5;
H = 0.5;
HIP = 0.0;
LOP = 0.0;
AIR = 0.5;
FIR = 0.5;
STO = 0.5;
RNG = 0.5;
FCT = 1.0;
SCT = 1.0;
FCR = 1.0;
SCR = 1.0;
FCA = 0.5;
SCA = 0.5;
FCL = 0.5;
SCL = 0.5;
FGT = 0.0;
SGT = 0.0;
FGR = 1.0;
SGR = 1.0;
FGS = 0.5;
SGS = 0.5;
FGL = 0.5;
SGL = 0.5;
TRF = 0.5;
TRG = 0.5;
TRR = 0.5;
HMF = 0.5;
HMG = 0.5;
HMR = 0.5;
LMF = 0.5;
LMG = 0.5;
LMR = 0.5;
BSF = 0.5;
BSG = 0.5;
BSR = 0.5;
DSC = 0.5;
PAN = 0.5;
FAD = 0.5;
for (int x = 0; x < hilp_total; x++) {
highpass[x] = 0.0;
lowpass[x] = 0.0;
}
for (int x = 0; x < biq_total; x++) {biquad[x] = 0.0;}
for (int x = 0; x < air_total; x++) air[x] = 0.0;
for (int x = 0; x < kal_total; x++) kal[x] = 0.0;
fireCompL = 1.0;
fireCompR = 1.0;
fireGate = 1.0;
stoneCompL = 1.0;
stoneCompR = 1.0;
stoneGate = 1.0;
for(int count = 0; count < 2004; count++) {mpkL[count] = 0.0; mpkR[count] = 0.0;}
for(int count = 0; count < 65; count++) {f[count] = 0.0;}
prevfreqMPeak = -1;
prevamountMPeak = -1;
mpc = 1;
for (int x = 0; x < biqs_total; x++) {
high[x] = 0.0;
hmid[x] = 0.0;
lmid[x] = 0.0;
bass[x] = 0.0;
}
for(int count = 0; count < dscBuf+2; count++) {
dBaL[count] = 0.0;
@ -40,12 +80,12 @@ ConsoleXChannel::ConsoleXChannel(audioMasterCallback audioMaster) :
dBaXL = 1;
dBaXR = 1;
trebleGainA = 1.0; trebleGainB = 1.0;
midGainA = 1.0; midGainB = 1.0;
mPeakA = 1.0; mPeakB = 1.0;
bassGainA = 1.0; bassGainB = 1.0;
airGainA = 0.5; airGainB = 0.5;
fireGainA = 0.5; fireGainB = 0.5;
stoneGainA = 0.5; stoneGainB = 0.5;
panA = 0.5; panB = 0.5;
inTrimA = 1.0; inTrimB = 1.0;
inTrimA = 1.0; inTrimB = 1.0;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
@ -79,14 +119,43 @@ static float pinParameter(float data)
VstInt32 ConsoleXChannel::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
chunkData[4] = E;
chunkData[5] = F;
chunkData[6] = G;
chunkData[7] = H;
chunkData[0] = HIP;
chunkData[1] = LOP;
chunkData[2] = AIR;
chunkData[3] = FIR;
chunkData[4] = STO;
chunkData[5] = RNG;
chunkData[6] = FCT;
chunkData[7] = SCT;
chunkData[8] = FCR;
chunkData[9] = SCR;
chunkData[10] = FCA;
chunkData[11] = SCA;
chunkData[12] = FCL;
chunkData[13] = SCL;
chunkData[14] = FGT;
chunkData[15] = SGT;
chunkData[16] = FGR;
chunkData[17] = SGR;
chunkData[18] = FGS;
chunkData[19] = SGS;
chunkData[20] = FGL;
chunkData[21] = SGL;
chunkData[22] = TRF;
chunkData[23] = TRG;
chunkData[24] = TRR;
chunkData[25] = HMF;
chunkData[26] = HMG;
chunkData[27] = HMR;
chunkData[28] = LMF;
chunkData[29] = LMG;
chunkData[30] = LMR;
chunkData[31] = BSF;
chunkData[32] = BSG;
chunkData[33] = BSR;
chunkData[34] = DSC;
chunkData[35] = PAN;
chunkData[36] = FAD;
/* 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. */
@ -98,14 +167,43 @@ VstInt32 ConsoleXChannel::getChunk (void** data, bool isPreset)
VstInt32 ConsoleXChannel::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
E = pinParameter(chunkData[4]);
F = pinParameter(chunkData[5]);
G = pinParameter(chunkData[6]);
H = pinParameter(chunkData[7]);
HIP = pinParameter(chunkData[0]);
LOP = pinParameter(chunkData[1]);
AIR = pinParameter(chunkData[2]);
FIR = pinParameter(chunkData[3]);
STO = pinParameter(chunkData[4]);
RNG = pinParameter(chunkData[5]);
FCT = pinParameter(chunkData[6]);
SCT = pinParameter(chunkData[7]);
FCR = pinParameter(chunkData[8]);
SCR = pinParameter(chunkData[9]);
FCA = pinParameter(chunkData[10]);
SCA = pinParameter(chunkData[11]);
FCL = pinParameter(chunkData[12]);
SCL = pinParameter(chunkData[13]);
FGT = pinParameter(chunkData[14]);
SGT = pinParameter(chunkData[15]);
FGR = pinParameter(chunkData[16]);
SGR = pinParameter(chunkData[17]);
FGS = pinParameter(chunkData[18]);
SGS = pinParameter(chunkData[19]);
FGL = pinParameter(chunkData[20]);
SGL = pinParameter(chunkData[21]);
TRF = pinParameter(chunkData[22]);
TRG = pinParameter(chunkData[23]);
TRR = pinParameter(chunkData[24]);
HMF = pinParameter(chunkData[25]);
HMG = pinParameter(chunkData[26]);
HMR = pinParameter(chunkData[27]);
LMF = pinParameter(chunkData[28]);
LMG = pinParameter(chunkData[29]);
LMR = pinParameter(chunkData[30]);
BSF = pinParameter(chunkData[31]);
BSG = pinParameter(chunkData[32]);
BSR = pinParameter(chunkData[33]);
DSC = pinParameter(chunkData[34]);
PAN = pinParameter(chunkData[35]);
FAD = pinParameter(chunkData[36]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
@ -115,70 +213,215 @@ VstInt32 ConsoleXChannel::setChunk (void* data, VstInt32 byteSize, bool isPreset
void ConsoleXChannel::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
case kParamE: E = value; break;
case kParamF: F = value; break;
case kParamG: G = value; break;
case kParamH: H = value; break;
case kParamHIP: HIP = value; break;
case kParamLOP: LOP = value; break;
case kParamAIR: AIR = value; break;
case kParamFIR: FIR = value; break;
case kParamSTO: STO = value; break;
case kParamRNG: RNG = value; break;
case kParamFCT: FCT = value; break;
case kParamSCT: SCT = value; break;
case kParamFCR: FCR = value; break;
case kParamSCR: SCR = value; break;
case kParamFCA: FCA = value; break;
case kParamSCA: SCA = value; break;
case kParamFCL: FCL = value; break;
case kParamSCL: SCL = value; break;
case kParamFGT: FGT = value; break;
case kParamSGT: SGT = value; break;
case kParamFGR: FGR = value; break;
case kParamSGR: SGR = value; break;
case kParamFGS: FGS = value; break;
case kParamSGS: SGS = value; break;
case kParamFGL: FGL = value; break;
case kParamSGL: SGL = value; break;
case kParamTRF: TRF = value; break;
case kParamTRG: TRG = value; break;
case kParamTRR: TRR = value; break;
case kParamHMF: HMF = value; break;
case kParamHMG: HMG = value; break;
case kParamHMR: HMR = value; break;
case kParamLMF: LMF = value; break;
case kParamLMG: LMG = value; break;
case kParamLMR: LMR = value; break;
case kParamBSF: BSF = value; break;
case kParamBSG: BSG = value; break;
case kParamBSR: BSR = value; break;
case kParamDSC: DSC = value; break;
case kParamPAN: PAN = value; break;
case kParamFAD: FAD = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float ConsoleXChannel::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
case kParamE: return E; break;
case kParamF: return F; break;
case kParamG: return G; break;
case kParamH: return H; break;
case kParamHIP: return HIP; break;
case kParamLOP: return LOP; break;
case kParamAIR: return AIR; break;
case kParamFIR: return FIR; break;
case kParamSTO: return STO; break;
case kParamRNG: return RNG; break;
case kParamFCT: return FCT; break;
case kParamSCT: return SCT; break;
case kParamFCR: return FCR; break;
case kParamSCR: return SCR; break;
case kParamFCA: return FCA; break;
case kParamSCA: return SCA; break;
case kParamFCL: return FCL; break;
case kParamSCL: return SCL; break;
case kParamFGT: return FGT; break;
case kParamSGT: return SGT; break;
case kParamFGR: return FGR; break;
case kParamSGR: return SGR; break;
case kParamFGS: return FGS; break;
case kParamSGS: return SGS; break;
case kParamFGL: return FGL; break;
case kParamSGL: return SGL; break;
case kParamTRF: return TRF; break;
case kParamTRG: return TRG; break;
case kParamTRR: return TRR; break;
case kParamHMF: return HMF; break;
case kParamHMG: return HMG; break;
case kParamHMR: return HMR; break;
case kParamLMF: return LMF; break;
case kParamLMG: return LMG; break;
case kParamLMR: return LMR; break;
case kParamBSF: return BSF; break;
case kParamBSG: return BSG; break;
case kParamBSR: return BSR; break;
case kParamDSC: return DSC; break;
case kParamPAN: return PAN; break;
case kParamFAD: return FAD; 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 ConsoleXChannel::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Air", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Reso", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "Pan", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "Fader", kVstMaxParamStrLen); break;
case kParamHIP: vst_strncpy (text, "Highpas", kVstMaxParamStrLen); break;
case kParamLOP: vst_strncpy (text, "Lowpass", kVstMaxParamStrLen); break;
case kParamAIR: vst_strncpy (text, "Air", kVstMaxParamStrLen); break;
case kParamFIR: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamSTO: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamRNG: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamFCT: vst_strncpy (text, "FC Thrs", kVstMaxParamStrLen); break;
case kParamSCT: vst_strncpy (text, "SC Thrs", kVstMaxParamStrLen); break;
case kParamFCR: vst_strncpy (text, "FC Rati", kVstMaxParamStrLen); break;
case kParamSCR: vst_strncpy (text, "SC Rati", kVstMaxParamStrLen); break;
case kParamFCA: vst_strncpy (text, "FC Atk", kVstMaxParamStrLen); break;
case kParamSCA: vst_strncpy (text, "SC Atk", kVstMaxParamStrLen); break;
case kParamFCL: vst_strncpy (text, "FC Rls", kVstMaxParamStrLen); break;
case kParamSCL: vst_strncpy (text, "SC Rls", kVstMaxParamStrLen); break;
case kParamFGT: vst_strncpy (text, "FG Thrs", kVstMaxParamStrLen); break;
case kParamSGT: vst_strncpy (text, "SG Thrs", kVstMaxParamStrLen); break;
case kParamFGR: vst_strncpy (text, "FG Rati", kVstMaxParamStrLen); break;
case kParamSGR: vst_strncpy (text, "SG Rati", kVstMaxParamStrLen); break;
case kParamFGS: vst_strncpy (text, "FG Sust", kVstMaxParamStrLen); break;
case kParamSGS: vst_strncpy (text, "SG Sust", kVstMaxParamStrLen); break;
case kParamFGL: vst_strncpy (text, "FG Rls", kVstMaxParamStrLen); break;
case kParamSGL: vst_strncpy (text, "SG Rls", kVstMaxParamStrLen); break;
case kParamTRF: vst_strncpy (text, "Tr Freq", kVstMaxParamStrLen); break;
case kParamTRG: vst_strncpy (text, "Treble", kVstMaxParamStrLen); break;
case kParamTRR: vst_strncpy (text, "Tr Reso", kVstMaxParamStrLen); break;
case kParamHMF: vst_strncpy (text, "HM Freq", kVstMaxParamStrLen); break;
case kParamHMG: vst_strncpy (text, "HighMid", kVstMaxParamStrLen); break;
case kParamHMR: vst_strncpy (text, "HM Reso", kVstMaxParamStrLen); break;
case kParamLMF: vst_strncpy (text, "LM Freq", kVstMaxParamStrLen); break;
case kParamLMG: vst_strncpy (text, "LowMid", kVstMaxParamStrLen); break;
case kParamLMR: vst_strncpy (text, "LM Reso", kVstMaxParamStrLen); break;
case kParamBSF: vst_strncpy (text, "Bs Freq", kVstMaxParamStrLen); break;
case kParamBSG: vst_strncpy (text, "Bass", kVstMaxParamStrLen); break;
case kParamBSR: vst_strncpy (text, "Bs Reso", kVstMaxParamStrLen); break;
case kParamDSC: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamPAN: vst_strncpy (text, "Pan", kVstMaxParamStrLen); break;
case kParamFAD: vst_strncpy (text, "Fader", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void ConsoleXChannel::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
case kParamF: float2string ((F*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamG: float2string (G, text, kVstMaxParamStrLen); break;
case kParamH: float2string (H, text, kVstMaxParamStrLen); break;
case kParamHIP: float2string (HIP, text, kVstMaxParamStrLen); break;
case kParamLOP: float2string (LOP, text, kVstMaxParamStrLen); break;
case kParamAIR: float2string (AIR, text, kVstMaxParamStrLen); break;
case kParamFIR: float2string (FIR, text, kVstMaxParamStrLen); break;
case kParamSTO: float2string (STO, text, kVstMaxParamStrLen); break;
case kParamRNG: float2string (RNG, text, kVstMaxParamStrLen); break;
case kParamFCT: float2string (FCT, text, kVstMaxParamStrLen); break;
case kParamSCT: float2string (SCT, text, kVstMaxParamStrLen); break;
case kParamFCR: float2string (FCR, text, kVstMaxParamStrLen); break;
case kParamSCR: float2string (SCR, text, kVstMaxParamStrLen); break;
case kParamFCA: float2string (FCA, text, kVstMaxParamStrLen); break;
case kParamSCA: float2string (SCA, text, kVstMaxParamStrLen); break;
case kParamFCL: float2string (FCL, text, kVstMaxParamStrLen); break;
case kParamSCL: float2string (SCL, text, kVstMaxParamStrLen); break;
case kParamFGT: float2string (FGT, text, kVstMaxParamStrLen); break;
case kParamSGT: float2string (SGT, text, kVstMaxParamStrLen); break;
case kParamFGR: float2string (FGR, text, kVstMaxParamStrLen); break;
case kParamSGR: float2string (SGR, text, kVstMaxParamStrLen); break;
case kParamFGS: float2string (FGS, text, kVstMaxParamStrLen); break;
case kParamSGS: float2string (SGS, text, kVstMaxParamStrLen); break;
case kParamFGL: float2string (FGL, text, kVstMaxParamStrLen); break;
case kParamSGL: float2string (SGL, text, kVstMaxParamStrLen); break;
case kParamTRF: float2string (TRF, text, kVstMaxParamStrLen); break;
case kParamTRG: float2string (TRG, text, kVstMaxParamStrLen); break;
case kParamTRR: float2string (TRR, text, kVstMaxParamStrLen); break;
case kParamHMF: float2string (HMF, text, kVstMaxParamStrLen); break;
case kParamHMG: float2string (HMG, text, kVstMaxParamStrLen); break;
case kParamHMR: float2string (HMR, text, kVstMaxParamStrLen); break;
case kParamLMF: float2string (LMF, text, kVstMaxParamStrLen); break;
case kParamLMG: float2string (LMG, text, kVstMaxParamStrLen); break;
case kParamLMR: float2string (LMR, text, kVstMaxParamStrLen); break;
case kParamBSF: float2string (BSF, text, kVstMaxParamStrLen); break;
case kParamBSG: float2string (BSG, text, kVstMaxParamStrLen); break;
case kParamBSR: float2string (BSR, text, kVstMaxParamStrLen); break;
case kParamDSC: float2string ((DSC*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamPAN: float2string (PAN, text, kVstMaxParamStrLen); break;
case kParamFAD: float2string (FAD, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void ConsoleXChannel::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, "dB", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHIP: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLOP: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamAIR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFIR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSTO: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamRNG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFCL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSCL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGT: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGS: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGS: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFGL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamSGL: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamTRR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamHMR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamLMR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamBSR: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamDSC: vst_strncpy (text, "dB", kVstMaxParamStrLen); break;
case kParamPAN: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamFAD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

View file

@ -16,15 +16,44 @@
#include <math.h>
enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kParamE = 4,
kParamF = 5,
kParamG = 6,
kParamH = 7,
kNumParameters = 8
kParamHIP = 0,
kParamLOP = 1,
kParamAIR = 2,
kParamFIR = 3,
kParamSTO = 4,
kParamRNG = 5,
kParamFCT = 6,
kParamSCT = 7,
kParamFCR = 8,
kParamSCR = 9,
kParamFCA = 10,
kParamSCA = 11,
kParamFCL = 12,
kParamSCL = 13,
kParamFGT = 14,
kParamSGT = 15,
kParamFGR = 16,
kParamSGR = 17,
kParamFGS = 18,
kParamSGS = 19,
kParamFGL = 20,
kParamSGL = 21,
kParamTRF = 22,
kParamTRG = 23,
kParamTRR = 24,
kParamHMF = 25,
kParamHMG = 26,
kParamHMR = 27,
kParamLMF = 28,
kParamLMG = 29,
kParamLMR = 30,
kParamBSF = 31,
kParamBSG = 32,
kParamBSR = 33,
kParamDSC = 34,
kParamPAN = 35,
kParamFAD = 36,
kNumParameters = 37
}; //
const int dscBuf = 90;
@ -60,96 +89,112 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
enum {
biq_freq,
biq_reso,
biq_a0,
biq_a1,
biq_a2,
biq_b1,
biq_b2,
biq_sL1,
biq_sL2,
biq_sR1,
biq_sR2,
biq_total
};
double biquad[biq_total];
float HIP;
float LOP;
float AIR;
float FIR;
float STO;
float RNG;
float FCT;
float SCT;
float FCR;
float SCR;
float FCA;
float SCA;
float FCL;
float SCL;
float FGT;
float SGT;
float FGR;
float SGR;
float FGS;
float SGS;
float FGL;
float SGL;
float TRF;
float TRG;
float TRR;
float HMF;
float HMG;
float HMR;
float LMF;
float LMG;
float LMR;
float BSF;
float BSG;
float BSR;
float DSC;
float PAN;
float FAD;
enum {
pvAL1,
pvSL1,
accSL1,
acc2SL1,
pvAL2,
pvSL2,
accSL2,
acc2SL2,
pvAL3,
pvSL3,
accSL3,
pvAL4,
pvSL4,
gndavgL,
outAL,
gainAL,
pvAR1,
pvSR1,
accSR1,
acc2SR1,
pvAR2,
pvSR2,
accSR2,
acc2SR2,
pvAR3,
pvSR3,
accSR3,
pvAR4,
pvSR4,
gndavgR,
outAR,
gainAR,
hilp_freq, hilp_temp,
hilp_a0, hilp_a1, hilp_b1, hilp_b2,
hilp_c0, hilp_c1, hilp_d1, hilp_d2,
hilp_e0, hilp_e1, hilp_f1, hilp_f2,
hilp_aL1, hilp_aL2, hilp_aR1, hilp_aR2,
hilp_cL1, hilp_cL2, hilp_cR1, hilp_cR2,
hilp_eL1, hilp_eL2, hilp_eR1, hilp_eR2,
hilp_total
};
double highpass[hilp_total];
double lowpass[hilp_total];
enum {
pvAL1, pvSL1, accSL1, acc2SL1,
pvAL2, pvSL2, accSL2, acc2SL2,
pvAL3, pvSL3, accSL3,
pvAL4, pvSL4,
gndavgL, outAL, gainAL,
pvAR1, pvSR1, accSR1, acc2SR1,
pvAR2, pvSR2, accSR2, acc2SR2,
pvAR3, pvSR3, accSR3,
pvAR4, pvSR4,
gndavgR, outAR, gainAR,
air_total
};
double air[air_total];
enum {
prevSampL1,
prevSlewL1,
accSlewL1,
prevSampL2,
prevSlewL2,
accSlewL2,
prevSampL3,
prevSlewL3,
accSlewL3,
kalGainL,
kalOutL,
prevSampR1,
prevSlewR1,
accSlewR1,
prevSampR2,
prevSlewR2,
accSlewR2,
prevSampR3,
prevSlewR3,
accSlewR3,
kalGainR,
kalOutR,
prevSampL1, prevSlewL1, accSlewL1,
prevSampL2, prevSlewL2, accSlewL2,
prevSampL3, prevSlewL3, accSlewL3,
kalGainL, kalOutL,
prevSampR1, prevSlewR1, accSlewR1,
prevSampR2, prevSlewR2, accSlewR2,
prevSampR3, prevSlewR3, accSlewR3,
kalGainR, kalOutR,
kal_total
};
double kal[kal_total];
double fireCompL;
double fireCompR;
double fireGate;
double stoneCompL;
double stoneCompR;
double stoneGate;
double airGainA;
double airGainB;
double fireGainA;
double fireGainB;
double stoneGainA;
double stoneGainB;
double mpkL[2005];
double mpkR[2005];
double f[66];
double prevfreqMPeak;
double prevamountMPeak;
int mpc;
enum {
biqs_freq, biqs_reso, biqs_level,
biqs_nonlin, biqs_temp, biqs_dis,
biqs_a0, biqs_a1, biqs_b1, biqs_b2,
biqs_c0, biqs_c1, biqs_d1, biqs_d2,
biqs_e0, biqs_e1, biqs_f1, biqs_f2,
biqs_aL1, biqs_aL2, biqs_aR1, biqs_aR2,
biqs_cL1, biqs_cL2, biqs_cR1, biqs_cR2,
biqs_eL1, biqs_eL2, biqs_eR1, biqs_eR2,
biqs_outL, biqs_outR, biqs_total
};
double high[biqs_total];
double hmid[biqs_total];
double lmid[biqs_total];
double bass[biqs_total];
double dBaL[dscBuf+5];
double dBaR[dscBuf+5];
@ -158,27 +203,14 @@ private:
int dBaXL;
int dBaXR;
double trebleGainA;
double trebleGainB;
double midGainA;
double midGainB;
double mPeakA;
double mPeakB;
double bassGainA;
double bassGainB;
double panA;
double panB;
double inTrimA;
double inTrimB;
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -1,81 +0,0 @@
/* ========================================
* ConsoleXSubIn - ConsoleXSubIn.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubIn_H
#include "ConsoleXSubIn.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ConsoleXSubIn(audioMaster);}
ConsoleXSubIn::ConsoleXSubIn(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
for (int x = 0; x < biq_total; x++) {biquad[x] = 0.0;}
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
ConsoleXSubIn::~ConsoleXSubIn() {}
VstInt32 ConsoleXSubIn::getVendorVersion () {return 1000;}
void ConsoleXSubIn::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void ConsoleXSubIn::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);}
//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than
//trying to do versioning and preventing people from using older versions. Maybe they like the old one!
VstInt32 ConsoleXSubIn::getChunk (void** data, bool isPreset)
{
return kNumParameters * sizeof(float);
}
VstInt32 ConsoleXSubIn::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
return 0;
}
void ConsoleXSubIn::setParameter(VstInt32 index, float value) {
}
float ConsoleXSubIn::getParameter(VstInt32 index) {
return 0.0; //we only need to update the relevant name, this is simple to manage
}
void ConsoleXSubIn::getParameterName(VstInt32 index, char *text) {
}
void ConsoleXSubIn::getParameterDisplay(VstInt32 index, char *text) {
}
void ConsoleXSubIn::getParameterLabel(VstInt32 index, char *text) {
}
VstInt32 ConsoleXSubIn::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool ConsoleXSubIn::getEffectName(char* name) {
vst_strncpy(name, "ConsoleXSubIn", kVstMaxProductStrLen); return true;
}
VstPlugCategory ConsoleXSubIn::getPlugCategory() {return kPlugCategEffect;}
bool ConsoleXSubIn::getProductString(char* text) {
vst_strncpy (text, "airwindows ConsoleXSubIn", kVstMaxProductStrLen); return true;
}
bool ConsoleXSubIn::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -1,154 +0,0 @@
/* ========================================
* ConsoleXSubIn - ConsoleXSubIn.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubIn_H
#include "ConsoleXSubIn.h"
#endif
void ConsoleXSubIn::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
biquad[biq_freq] = 25000.0/getSampleRate();
biquad[biq_reso] = 0.60134489;
double K = tan(M_PI * biquad[biq_freq]);
double norm = 1.0 / (1.0 + K / biquad[biq_reso] + K * K);
biquad[biq_a0] = K * K * norm;
biquad[biq_a1] = 2.0 * biquad[biq_a0];
biquad[biq_a2] = biquad[biq_a0];
biquad[biq_b1] = 2.0 * (K * K - 1.0) * norm;
biquad[biq_b2] = (1.0 - K / biquad[biq_reso] + K * K) * norm;
//ultrasonic nonlinear filter
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (biquad[biq_freq] < 0.5) {
double nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleL*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
double tmp = (inputSampleL * nlBiq) + biquad[biq_sL1];
biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sL2];
biquad[biq_sL2] = (inputSampleL * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleL = tmp;
nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleR*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
tmp = (inputSampleR * nlBiq) + biquad[biq_sR1];
biquad[biq_sR1] = (inputSampleR * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sR2];
biquad[biq_sR2] = (inputSampleR * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleR = tmp;
//ultrasonic filter before anything else is done
}
if (inputSampleL > 1.0) inputSampleL = 1.0;
else if (inputSampleL > 0.0) inputSampleL = -expm1((log1p(-inputSampleL) * 0.6180339887498949));
if (inputSampleL < -1.0) inputSampleL = -1.0;
else if (inputSampleL < 0.0) inputSampleL = expm1((log1p(inputSampleL) * 0.6180339887498949));
inputSampleL *= 1.6180339887498949;
if (inputSampleR > 1.0) inputSampleR = 1.0;
else if (inputSampleR > 0.0) inputSampleR = -expm1((log1p(-inputSampleR) * 0.6180339887498949));
if (inputSampleR < -1.0) inputSampleR = -1.0;
else if (inputSampleR < 0.0) inputSampleR = expm1((log1p(inputSampleR) * 0.6180339887498949));
inputSampleR *= 1.6180339887498949;
//ConsoleXSubIn is purely a decode that is followed with encode on ConsoleXSubOut
//It allows for another filtering stage for steep distributed ultrasonic filtering
//but pointedly has no controls: it just has to be there, first on the submix
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void ConsoleXSubIn::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
biquad[biq_freq] = 25000.0/getSampleRate();
biquad[biq_reso] = 0.60134489;
double K = tan(M_PI * biquad[biq_freq]);
double norm = 1.0 / (1.0 + K / biquad[biq_reso] + K * K);
biquad[biq_a0] = K * K * norm;
biquad[biq_a1] = 2.0 * biquad[biq_a0];
biquad[biq_a2] = biquad[biq_a0];
biquad[biq_b1] = 2.0 * (K * K - 1.0) * norm;
biquad[biq_b2] = (1.0 - K / biquad[biq_reso] + K * K) * norm;
//ultrasonic nonlinear filter
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (biquad[biq_freq] < 0.5) {
double nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleL*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
double tmp = (inputSampleL * nlBiq) + biquad[biq_sL1];
biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sL2];
biquad[biq_sL2] = (inputSampleL * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleL = tmp;
nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleR*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
tmp = (inputSampleR * nlBiq) + biquad[biq_sR1];
biquad[biq_sR1] = (inputSampleR * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sR2];
biquad[biq_sR2] = (inputSampleR * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleR = tmp;
//ultrasonic filter before anything else is done
}
if (inputSampleL > 1.0) inputSampleL = 1.0;
else if (inputSampleL > 0.0) inputSampleL = -expm1((log1p(-inputSampleL) * 0.6180339887498949));
if (inputSampleL < -1.0) inputSampleL = -1.0;
else if (inputSampleL < 0.0) inputSampleL = expm1((log1p(inputSampleL) * 0.6180339887498949));
inputSampleL *= 1.6180339887498949;
if (inputSampleR > 1.0) inputSampleR = 1.0;
else if (inputSampleR > 0.0) inputSampleR = -expm1((log1p(-inputSampleR) * 0.6180339887498949));
if (inputSampleR < -1.0) inputSampleR = -1.0;
else if (inputSampleR < 0.0) inputSampleR = expm1((log1p(inputSampleR) * 0.6180339887498949));
inputSampleR *= 1.6180339887498949;
//ConsoleXSubIn is purely a decode that is followed with encode on ConsoleXSubOut
//It allows for another filtering stage for steep distributed ultrasonic filtering
//but pointedly has no controls: it just has to be there, first on the submix
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -1,577 +0,0 @@
/* ========================================
* ConsoleXSubOut - ConsoleXSubOut.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubOut_H
#include "ConsoleXSubOut.h"
#endif
void ConsoleXSubOut::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
int cycleEnd = floor(overallscale);
if (cycleEnd < 1) cycleEnd = 1;
if (cycleEnd > 3) cycleEnd = 3;
biquad[biq_freq] = 25000.0/getSampleRate();
biquad[biq_reso] = 0.89997622;
double K = tan(M_PI * biquad[biq_freq]);
double norm = 1.0 / (1.0 + K / biquad[biq_reso] + K * K);
biquad[biq_a0] = K * K * norm;
biquad[biq_a1] = 2.0 * biquad[biq_a0];
biquad[biq_a2] = biquad[biq_a0];
biquad[biq_b1] = 2.0 * (K * K - 1.0) * norm;
biquad[biq_b2] = (1.0 - K / biquad[biq_reso] + K * K) * norm;
//ultrasonic nonlinear filter
trebleGainA = trebleGainB; trebleGainB = A*2.0;
midGainA = midGainB; midGainB = B*2.0;
bassGainA = bassGainB; bassGainB = C*2.0;
//simple three band to adjust
//begin ResEQ2 Mid Boost
double freqMPeak = pow(D+0.16,3);
mPeakA = mPeakB; mPeakB = fabs(midGainB-1.0); //amount of mid peak leak through (or boost)
if (midGainB < 1.0) mPeakB *= 0.5;
int maxMPeak = (24.0*(2.0-freqMPeak))+16;
if ((freqMPeak != prevfreqMPeak)||(mPeakB != prevamountMPeak)) {
for (int x = 0; x < maxMPeak; x++) {
if (((double)x*freqMPeak) < M_PI_4) f[x] = sin(((double)x*freqMPeak)*4.0)*freqMPeak*sin(((double)(maxMPeak-x)/(double)maxMPeak)*M_PI_2);
else f[x] = cos((double)x*freqMPeak)*freqMPeak*sin(((double)(maxMPeak-x)/(double)maxMPeak)*M_PI_2);
}
prevfreqMPeak = freqMPeak; prevamountMPeak = mPeakB;
}//end ResEQ2 Mid Boost
//mid peak for either retaining during mid cut, or adding during mid boost
double kalman = 1.0-pow(E,2);
//crossover frequency between mid/bass
double refdB = (F*70.0)+70.0;
double topdB = 0.000000075 * pow(10.0,refdB/20.0) * overallscale;
panA = panB; panB = G*1.57079633;
inTrimA = inTrimB; inTrimB = H*2.0;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (biquad[biq_freq] < 0.5) {
double nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleL*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
double tmp = (inputSampleL * nlBiq) + biquad[biq_sL1];
biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sL2];
biquad[biq_sL2] = (inputSampleL * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleL = tmp;
nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleR*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
tmp = (inputSampleR * nlBiq) + biquad[biq_sR1];
biquad[biq_sR1] = (inputSampleR * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sR2];
biquad[biq_sR2] = (inputSampleR * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleR = tmp;
//ultrasonic filter before anything else is done
}
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
double temp = (double)sampleFrames/inFramesToProcess;
double trebleGain = (trebleGainA*temp)+(trebleGainB*(1.0-temp));
if (trebleGain > 1.0) trebleGain = pow(trebleGain,3.0+sqrt(overallscale));
if (trebleGain < 1.0) trebleGain = 1.0-pow(1.0-trebleGain,2);
double midGain = (midGainA*temp)+(midGainB*(1.0-temp));
if (midGain > 1.0) midGain = 1.0;
if (midGain < 1.0) midGain = 1.0-pow(1.0-midGain,2);
double mPeak = pow((mPeakA*temp)+(mPeakB*(1.0-temp)),2);
double bassGain = (bassGainA*temp)+(bassGainB*(1.0-temp));
if (bassGain > 1.0) bassGain *= bassGain;
if (bassGain < 1.0) bassGain = 1.0-pow(1.0-bassGain,2);
double gainR = (panA*temp)+(panB*(1.0-temp));
double gainL = 1.57079633-gainR;
gainR = sin(gainR); gainL = sin(gainL);
double gain = (inTrimA*temp)+(inTrimB*(1.0-temp));
if (gain > 1.0) gain *= gain;
if (gain < 1.0) gain = 1.0-pow(1.0-gain,2);
gain *= 1.527864045000421;
//begin Air3L
air[pvSL4] = air[pvAL4] - air[pvAL3]; air[pvSL3] = air[pvAL3] - air[pvAL2];
air[pvSL2] = air[pvAL2] - air[pvAL1]; air[pvSL1] = air[pvAL1] - inputSampleL;
air[accSL3] = air[pvSL4] - air[pvSL3]; air[accSL2] = air[pvSL3] - air[pvSL2];
air[accSL1] = air[pvSL2] - air[pvSL1];
air[acc2SL2] = air[accSL3] - air[accSL2]; air[acc2SL1] = air[accSL2] - air[accSL1];
air[outAL] = -(air[pvAL1] + air[pvSL3] + air[acc2SL2] - ((air[acc2SL2] + air[acc2SL1])*0.5));
air[gainAL] *= 0.5; air[gainAL] += fabs(drySampleL-air[outAL])*0.5;
if (air[gainAL] > 0.3*sqrt(overallscale)) air[gainAL] = 0.3*sqrt(overallscale);
air[pvAL4] = air[pvAL3]; air[pvAL3] = air[pvAL2];
air[pvAL2] = air[pvAL1]; air[pvAL1] = (air[gainAL] * air[outAL]) + drySampleL;
double midL = drySampleL - ((air[outAL]*0.5)+(drySampleL*(0.457-(0.017*overallscale))));
temp = (midL + air[gndavgL])*0.5; air[gndavgL] = midL; midL = temp;
double trebleL = drySampleL-midL;
inputSampleL = midL;
//end Air3L
//begin Air3R
air[pvSR4] = air[pvAR4] - air[pvAR3]; air[pvSR3] = air[pvAR3] - air[pvAR2];
air[pvSR2] = air[pvAR2] - air[pvAR1]; air[pvSR1] = air[pvAR1] - inputSampleR;
air[accSR3] = air[pvSR4] - air[pvSR3]; air[accSR2] = air[pvSR3] - air[pvSR2];
air[accSR1] = air[pvSR2] - air[pvSR1];
air[acc2SR2] = air[accSR3] - air[accSR2]; air[acc2SR1] = air[accSR2] - air[accSR1];
air[outAR] = -(air[pvAR1] + air[pvSR3] + air[acc2SR2] - ((air[acc2SR2] + air[acc2SR1])*0.5));
air[gainAR] *= 0.5; air[gainAR] += fabs(drySampleR-air[outAR])*0.5;
if (air[gainAR] > 0.3*sqrt(overallscale)) air[gainAR] = 0.3*sqrt(overallscale);
air[pvAR4] = air[pvAR3]; air[pvAR3] = air[pvAR2];
air[pvAR2] = air[pvAR1]; air[pvAR1] = (air[gainAR] * air[outAR]) + drySampleR;
double midR = drySampleR - ((air[outAR]*0.5)+(drySampleR*(0.457-(0.017*overallscale))));
temp = (midR + air[gndavgR])*0.5; air[gndavgR] = midR; midR = temp;
double trebleR = drySampleR-midR;
inputSampleR = midR;
//end Air3R
//begin KalmanL
temp = inputSampleL = inputSampleL*(1.0-kalman)*0.777;
inputSampleL *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewL3] += kal[prevSampL3] - kal[prevSampL2]; kal[prevSlewL3] *= 0.5;
kal[prevSlewL2] += kal[prevSampL2] - kal[prevSampL1]; kal[prevSlewL2] *= 0.5;
kal[prevSlewL1] += kal[prevSampL1] - inputSampleL; kal[prevSlewL1] *= 0.5;
//make slews from each set of samples used
kal[accSlewL2] += kal[prevSlewL3] - kal[prevSlewL2]; kal[accSlewL2] *= 0.5;
kal[accSlewL1] += kal[prevSlewL2] - kal[prevSlewL1]; kal[accSlewL1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewL3] += (kal[accSlewL2] - kal[accSlewL1]); kal[accSlewL3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutL] += kal[prevSampL1] + kal[prevSlewL2] + kal[accSlewL3]; kal[kalOutL] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainL] += fabs(temp-kal[kalOutL])*kalman*8.0; kal[kalGainL] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainL] > kalman*0.5) kal[kalGainL] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutL] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampL3] = kal[prevSampL2]; kal[prevSampL2] = kal[prevSampL1];
kal[prevSampL1] = (kal[kalGainL] * kal[kalOutL]) + ((1.0-kal[kalGainL])*temp);
//feed the chain of previous samples
if (kal[prevSampL1] > 1.0) kal[prevSampL1] = 1.0; if (kal[prevSampL1] < -1.0) kal[prevSampL1] = -1.0;
double bassL = kal[kalOutL]*0.777;
midL -= bassL;
//end KalmanL
//begin KalmanR
temp = inputSampleR = inputSampleR*(1.0-kalman)*0.777;
inputSampleR *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewR3] += kal[prevSampR3] - kal[prevSampR2]; kal[prevSlewR3] *= 0.5;
kal[prevSlewR2] += kal[prevSampR2] - kal[prevSampR1]; kal[prevSlewR2] *= 0.5;
kal[prevSlewR1] += kal[prevSampR1] - inputSampleR; kal[prevSlewR1] *= 0.5;
//make slews from each set of samples used
kal[accSlewR2] += kal[prevSlewR3] - kal[prevSlewR2]; kal[accSlewR2] *= 0.5;
kal[accSlewR1] += kal[prevSlewR2] - kal[prevSlewR1]; kal[accSlewR1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewR3] += (kal[accSlewR2] - kal[accSlewR1]); kal[accSlewR3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutR] += kal[prevSampR1] + kal[prevSlewR2] + kal[accSlewR3]; kal[kalOutR] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainR] += fabs(temp-kal[kalOutR])*kalman*8.0; kal[kalGainR] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainR] > kalman*0.5) kal[kalGainR] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutR] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampR3] = kal[prevSampR2]; kal[prevSampR2] = kal[prevSampR1];
kal[prevSampR1] = (kal[kalGainR] * kal[kalOutR]) + ((1.0-kal[kalGainR])*temp);
//feed the chain of previous samples
if (kal[prevSampR1] > 1.0) kal[prevSampR1] = 1.0; if (kal[prevSampR1] < -1.0) kal[prevSampR1] = -1.0;
double bassR = kal[kalOutR]*0.777;
midR -= bassR;
//end KalmanR
//begin ResEQ2 Mid Boost
mpc++; if (mpc < 1 || mpc > 2001) mpc = 1;
mpkL[mpc] = midL;
mpkR[mpc] = midR;
double midPeakL = 0.0;
double midPeakR = 0.0;
for (int x = 0; x < maxMPeak; x++) {
int y = x*cycleEnd;
switch (cycleEnd)
{
case 1:
midPeakL += (mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x]);
midPeakR += (mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x]); break;
case 2:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5); break;
case 3:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); break;
case 4:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); //break
}
}//end ResEQ2 Mid Boost creating
inputSampleL = ((bassL*bassGain) + (midL*midGain) + (midPeakL*mPeak) + (trebleL*trebleGain)) * gainL * gain;
inputSampleR = ((bassR*bassGain) + (midR*midGain) + (midPeakR*mPeak) + (trebleR*trebleGain)) * gainR * gain;
//applies BitShiftPan pan section, and smoothed fader gain
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
dBaL[dBaXL] = inputSampleL; dBaPosL *= 0.5; dBaPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
int dBdly = floor(dBaPosL*dscBuf);
double dBi = (dBaPosL*dscBuf)-dBdly;
inputSampleL = dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*dBi;
dBaXL++; if (dBaXL < 0 || dBaXL >= dscBuf) dBaXL = 0;
inputSampleL /= topdB;
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
dBaR[dBaXR] = inputSampleR; dBaPosR *= 0.5; dBaPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBaPosR*dscBuf);
dBi = (dBaPosR*dscBuf)-dBdly;
inputSampleR = dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*dBi;
dBaXR++; if (dBaXR < 0 || dBaXR >= dscBuf) dBaXR = 0;
inputSampleR /= topdB;
//top dB processing for distributed discontinuity modeling air nonlinearity
inputSampleL *= 0.618033988749895;
if (inputSampleL > 1.0) inputSampleL = 1.0;
else if (inputSampleL > 0.0) inputSampleL = -expm1((log1p(-inputSampleL) * 1.618033988749895));
if (inputSampleL < -1.0) inputSampleL = -1.0;
else if (inputSampleL < 0.0) inputSampleL = expm1((log1p(inputSampleL) * 1.618033988749895));
inputSampleR *= 0.618033988749895;
if (inputSampleR > 1.0) inputSampleR = 1.0;
else if (inputSampleR > 0.0) inputSampleR = -expm1((log1p(-inputSampleR) * 1.618033988749895));
if (inputSampleR < -1.0) inputSampleR = -1.0;
else if (inputSampleR < 0.0) inputSampleR = expm1((log1p(inputSampleR) * 1.618033988749895));
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void ConsoleXSubOut::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
VstInt32 inFramesToProcess = sampleFrames; //vst doesn't give us this as a separate variable so we'll make it
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
int cycleEnd = floor(overallscale);
if (cycleEnd < 1) cycleEnd = 1;
if (cycleEnd > 3) cycleEnd = 3;
biquad[biq_freq] = 25000.0/getSampleRate();
biquad[biq_reso] = 0.89997622;
double K = tan(M_PI * biquad[biq_freq]);
double norm = 1.0 / (1.0 + K / biquad[biq_reso] + K * K);
biquad[biq_a0] = K * K * norm;
biquad[biq_a1] = 2.0 * biquad[biq_a0];
biquad[biq_a2] = biquad[biq_a0];
biquad[biq_b1] = 2.0 * (K * K - 1.0) * norm;
biquad[biq_b2] = (1.0 - K / biquad[biq_reso] + K * K) * norm;
//ultrasonic nonlinear filter
trebleGainA = trebleGainB; trebleGainB = A*2.0;
midGainA = midGainB; midGainB = B*2.0;
bassGainA = bassGainB; bassGainB = C*2.0;
//simple three band to adjust
//begin ResEQ2 Mid Boost
double freqMPeak = pow(D+0.16,3);
mPeakA = mPeakB; mPeakB = fabs(midGainB-1.0); //amount of mid peak leak through (or boost)
if (midGainB < 1.0) mPeakB *= 0.5;
int maxMPeak = (24.0*(2.0-freqMPeak))+16;
if ((freqMPeak != prevfreqMPeak)||(mPeakB != prevamountMPeak)) {
for (int x = 0; x < maxMPeak; x++) {
if (((double)x*freqMPeak) < M_PI_4) f[x] = sin(((double)x*freqMPeak)*4.0)*freqMPeak*sin(((double)(maxMPeak-x)/(double)maxMPeak)*M_PI_2);
else f[x] = cos((double)x*freqMPeak)*freqMPeak*sin(((double)(maxMPeak-x)/(double)maxMPeak)*M_PI_2);
}
prevfreqMPeak = freqMPeak; prevamountMPeak = mPeakB;
}//end ResEQ2 Mid Boost
//mid peak for either retaining during mid cut, or adding during mid boost
double kalman = 1.0-pow(E,2);
//crossover frequency between mid/bass
double refdB = (F*70.0)+70.0;
double topdB = 0.000000075 * pow(10.0,refdB/20.0) * overallscale;
panA = panB; panB = G*1.57079633;
inTrimA = inTrimB; inTrimB = H*2.0;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (biquad[biq_freq] < 0.5) {
double nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleL*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
double tmp = (inputSampleL * nlBiq) + biquad[biq_sL1];
biquad[biq_sL1] = (inputSampleL * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sL2];
biquad[biq_sL2] = (inputSampleL * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleL = tmp;
nlBiq = fabs(biquad[biq_a0]*(1.0+(inputSampleR*0.25))); if (nlBiq > 1.0) nlBiq = 1.0;
tmp = (inputSampleR * nlBiq) + biquad[biq_sR1];
biquad[biq_sR1] = (inputSampleR * biquad[biq_a1]) - (tmp * biquad[biq_b1]) + biquad[biq_sR2];
biquad[biq_sR2] = (inputSampleR * nlBiq) - (tmp * biquad[biq_b2]);
inputSampleR = tmp;
//ultrasonic filter before anything else is done
}
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
double temp = (double)sampleFrames/inFramesToProcess;
double trebleGain = (trebleGainA*temp)+(trebleGainB*(1.0-temp));
if (trebleGain > 1.0) trebleGain = pow(trebleGain,3.0+sqrt(overallscale));
if (trebleGain < 1.0) trebleGain = 1.0-pow(1.0-trebleGain,2);
double midGain = (midGainA*temp)+(midGainB*(1.0-temp));
if (midGain > 1.0) midGain = 1.0;
if (midGain < 1.0) midGain = 1.0-pow(1.0-midGain,2);
double mPeak = pow((mPeakA*temp)+(mPeakB*(1.0-temp)),2);
double bassGain = (bassGainA*temp)+(bassGainB*(1.0-temp));
if (bassGain > 1.0) bassGain *= bassGain;
if (bassGain < 1.0) bassGain = 1.0-pow(1.0-bassGain,2);
double gainR = (panA*temp)+(panB*(1.0-temp));
double gainL = 1.57079633-gainR;
gainR = sin(gainR); gainL = sin(gainL);
double gain = (inTrimA*temp)+(inTrimB*(1.0-temp));
if (gain > 1.0) gain *= gain;
if (gain < 1.0) gain = 1.0-pow(1.0-gain,2);
gain *= 1.527864045000421;
//begin Air3L
air[pvSL4] = air[pvAL4] - air[pvAL3]; air[pvSL3] = air[pvAL3] - air[pvAL2];
air[pvSL2] = air[pvAL2] - air[pvAL1]; air[pvSL1] = air[pvAL1] - inputSampleL;
air[accSL3] = air[pvSL4] - air[pvSL3]; air[accSL2] = air[pvSL3] - air[pvSL2];
air[accSL1] = air[pvSL2] - air[pvSL1];
air[acc2SL2] = air[accSL3] - air[accSL2]; air[acc2SL1] = air[accSL2] - air[accSL1];
air[outAL] = -(air[pvAL1] + air[pvSL3] + air[acc2SL2] - ((air[acc2SL2] + air[acc2SL1])*0.5));
air[gainAL] *= 0.5; air[gainAL] += fabs(drySampleL-air[outAL])*0.5;
if (air[gainAL] > 0.3*sqrt(overallscale)) air[gainAL] = 0.3*sqrt(overallscale);
air[pvAL4] = air[pvAL3]; air[pvAL3] = air[pvAL2];
air[pvAL2] = air[pvAL1]; air[pvAL1] = (air[gainAL] * air[outAL]) + drySampleL;
double midL = drySampleL - ((air[outAL]*0.5)+(drySampleL*(0.457-(0.017*overallscale))));
temp = (midL + air[gndavgL])*0.5; air[gndavgL] = midL; midL = temp;
double trebleL = drySampleL-midL;
inputSampleL = midL;
//end Air3L
//begin Air3R
air[pvSR4] = air[pvAR4] - air[pvAR3]; air[pvSR3] = air[pvAR3] - air[pvAR2];
air[pvSR2] = air[pvAR2] - air[pvAR1]; air[pvSR1] = air[pvAR1] - inputSampleR;
air[accSR3] = air[pvSR4] - air[pvSR3]; air[accSR2] = air[pvSR3] - air[pvSR2];
air[accSR1] = air[pvSR2] - air[pvSR1];
air[acc2SR2] = air[accSR3] - air[accSR2]; air[acc2SR1] = air[accSR2] - air[accSR1];
air[outAR] = -(air[pvAR1] + air[pvSR3] + air[acc2SR2] - ((air[acc2SR2] + air[acc2SR1])*0.5));
air[gainAR] *= 0.5; air[gainAR] += fabs(drySampleR-air[outAR])*0.5;
if (air[gainAR] > 0.3*sqrt(overallscale)) air[gainAR] = 0.3*sqrt(overallscale);
air[pvAR4] = air[pvAR3]; air[pvAR3] = air[pvAR2];
air[pvAR2] = air[pvAR1]; air[pvAR1] = (air[gainAR] * air[outAR]) + drySampleR;
double midR = drySampleR - ((air[outAR]*0.5)+(drySampleR*(0.457-(0.017*overallscale))));
temp = (midR + air[gndavgR])*0.5; air[gndavgR] = midR; midR = temp;
double trebleR = drySampleR-midR;
inputSampleR = midR;
//end Air3R
//begin KalmanL
temp = inputSampleL = inputSampleL*(1.0-kalman)*0.777;
inputSampleL *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewL3] += kal[prevSampL3] - kal[prevSampL2]; kal[prevSlewL3] *= 0.5;
kal[prevSlewL2] += kal[prevSampL2] - kal[prevSampL1]; kal[prevSlewL2] *= 0.5;
kal[prevSlewL1] += kal[prevSampL1] - inputSampleL; kal[prevSlewL1] *= 0.5;
//make slews from each set of samples used
kal[accSlewL2] += kal[prevSlewL3] - kal[prevSlewL2]; kal[accSlewL2] *= 0.5;
kal[accSlewL1] += kal[prevSlewL2] - kal[prevSlewL1]; kal[accSlewL1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewL3] += (kal[accSlewL2] - kal[accSlewL1]); kal[accSlewL3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutL] += kal[prevSampL1] + kal[prevSlewL2] + kal[accSlewL3]; kal[kalOutL] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainL] += fabs(temp-kal[kalOutL])*kalman*8.0; kal[kalGainL] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainL] > kalman*0.5) kal[kalGainL] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutL] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampL3] = kal[prevSampL2]; kal[prevSampL2] = kal[prevSampL1];
kal[prevSampL1] = (kal[kalGainL] * kal[kalOutL]) + ((1.0-kal[kalGainL])*temp);
//feed the chain of previous samples
if (kal[prevSampL1] > 1.0) kal[prevSampL1] = 1.0; if (kal[prevSampL1] < -1.0) kal[prevSampL1] = -1.0;
double bassL = kal[kalOutL]*0.777;
midL -= bassL;
//end KalmanL
//begin KalmanR
temp = inputSampleR = inputSampleR*(1.0-kalman)*0.777;
inputSampleR *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewR3] += kal[prevSampR3] - kal[prevSampR2]; kal[prevSlewR3] *= 0.5;
kal[prevSlewR2] += kal[prevSampR2] - kal[prevSampR1]; kal[prevSlewR2] *= 0.5;
kal[prevSlewR1] += kal[prevSampR1] - inputSampleR; kal[prevSlewR1] *= 0.5;
//make slews from each set of samples used
kal[accSlewR2] += kal[prevSlewR3] - kal[prevSlewR2]; kal[accSlewR2] *= 0.5;
kal[accSlewR1] += kal[prevSlewR2] - kal[prevSlewR1]; kal[accSlewR1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewR3] += (kal[accSlewR2] - kal[accSlewR1]); kal[accSlewR3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutR] += kal[prevSampR1] + kal[prevSlewR2] + kal[accSlewR3]; kal[kalOutR] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainR] += fabs(temp-kal[kalOutR])*kalman*8.0; kal[kalGainR] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainR] > kalman*0.5) kal[kalGainR] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutR] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampR3] = kal[prevSampR2]; kal[prevSampR2] = kal[prevSampR1];
kal[prevSampR1] = (kal[kalGainR] * kal[kalOutR]) + ((1.0-kal[kalGainR])*temp);
//feed the chain of previous samples
if (kal[prevSampR1] > 1.0) kal[prevSampR1] = 1.0; if (kal[prevSampR1] < -1.0) kal[prevSampR1] = -1.0;
double bassR = kal[kalOutR]*0.777;
midR -= bassR;
//end KalmanR
//begin ResEQ2 Mid Boost
mpc++; if (mpc < 1 || mpc > 2001) mpc = 1;
mpkL[mpc] = midL;
mpkR[mpc] = midR;
double midPeakL = 0.0;
double midPeakR = 0.0;
for (int x = 0; x < maxMPeak; x++) {
int y = x*cycleEnd;
switch (cycleEnd)
{
case 1:
midPeakL += (mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x]);
midPeakR += (mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x]); break;
case 2:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.5); break;
case 3:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.333); break;
case 4:
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); y--;
midPeakL += ((mpkL[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25);
midPeakR += ((mpkR[(mpc-y)+((mpc-y < 1)?2001:0)] * f[x])*0.25); //break
}
}//end ResEQ2 Mid Boost creating
inputSampleL = ((bassL*bassGain) + (midL*midGain) + (midPeakL*mPeak) + (trebleL*trebleGain)) * gainL * gain;
inputSampleR = ((bassR*bassGain) + (midR*midGain) + (midPeakR*mPeak) + (trebleR*trebleGain)) * gainR * gain;
//applies BitShiftPan pan section, and smoothed fader gain
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
dBaL[dBaXL] = inputSampleL; dBaPosL *= 0.5; dBaPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
int dBdly = floor(dBaPosL*dscBuf);
double dBi = (dBaPosL*dscBuf)-dBdly;
inputSampleL = dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*dBi;
dBaXL++; if (dBaXL < 0 || dBaXL >= dscBuf) dBaXL = 0;
inputSampleL /= topdB;
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
dBaR[dBaXR] = inputSampleR; dBaPosR *= 0.5; dBaPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBaPosR*dscBuf);
dBi = (dBaPosR*dscBuf)-dBdly;
inputSampleR = dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*dBi;
dBaXR++; if (dBaXR < 0 || dBaXR >= dscBuf) dBaXR = 0;
inputSampleR /= topdB;
//top dB processing for distributed discontinuity modeling air nonlinearity
inputSampleL *= 0.618033988749895;
if (inputSampleL > 1.0) inputSampleL = 1.0;
else if (inputSampleL > 0.0) inputSampleL = -expm1((log1p(-inputSampleL) * 1.618033988749895));
if (inputSampleL < -1.0) inputSampleL = -1.0;
else if (inputSampleL < 0.0) inputSampleL = expm1((log1p(inputSampleL) * 1.618033988749895));
inputSampleR *= 0.618033988749895;
if (inputSampleR > 1.0) inputSampleR = 1.0;
else if (inputSampleR > 0.0) inputSampleR = -expm1((log1p(-inputSampleR) * 1.618033988749895));
if (inputSampleR < -1.0) inputSampleR = -1.0;
else if (inputSampleR < 0.0) inputSampleR = expm1((log1p(inputSampleR) * 1.618033988749895));
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

Binary file not shown.

View file

@ -0,0 +1,163 @@
/* ========================================
* Distance3 - Distance3.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Distance3_H
#include "Distance3.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Distance3(audioMaster);}
Distance3::Distance3(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 1.0;
prevresultAL = lastclampAL = clampAL = changeAL = lastAL = 0.0;
prevresultBL = lastclampBL = clampBL = changeBL = lastBL = 0.0;
prevresultCL = lastclampCL = clampCL = changeCL = lastCL = 0.0;
prevresultAR = lastclampAR = clampAR = changeAR = lastAR = 0.0;
prevresultBR = lastclampBR = clampBR = changeBR = lastBR = 0.0;
prevresultCR = lastclampCR = clampCR = changeCR = lastCR = 0.0;
for(int count = 0; count < dscBuf+2; count++) {
dBaL[count] = 0.0;
dBbL[count] = 0.0;
dBcL[count] = 0.0;
dBaR[count] = 0.0;
dBbR[count] = 0.0;
dBcR[count] = 0.0;
}
dBaPosL = 0.0;
dBbPosL = 0.0;
dBcPosL = 0.0;
dBaPosR = 0.0;
dBbPosR = 0.0;
dBcPosR = 0.0;
dBaXL = 1;
dBbXL = 1;
dBcXL = 1;
dBaXR = 1;
dBbXR = 1;
dBcXR = 1;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
Distance3::~Distance3() {}
VstInt32 Distance3::getVendorVersion () {return 1000;}
void Distance3::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void Distance3::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 Distance3::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */
*data = chunkData;
return kNumParameters * sizeof(float);
}
VstInt32 Distance3::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
/* We're ignoring byteSize as we found it to be a filthy liar */
/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}
void Distance3::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float Distance3::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void Distance3::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Distance", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void Distance3::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A*10.0, text, kVstMaxParamStrLen); break;
case kParamB: float2string ((B*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void Distance3::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "miles", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "dB", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 Distance3::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool Distance3::getEffectName(char* name) {
vst_strncpy(name, "Distance3", kVstMaxProductStrLen); return true;
}
VstPlugCategory Distance3::getPlugCategory() {return kPlugCategEffect;}
bool Distance3::getProductString(char* text) {
vst_strncpy (text, "airwindows Distance3", kVstMaxProductStrLen); return true;
}
bool Distance3::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -1,11 +1,11 @@
/* ========================================
* ConsoleXSubOut - ConsoleXSubOut.h
* Distance3 - Distance3.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubOut_H
#define __ConsoleXSubOut_H
#ifndef __Distance3_H
#define __Distance3_H
#ifndef __audioeffect__
#include "audioeffectx.h"
@ -16,29 +16,24 @@
#include <math.h>
enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kParamE = 4,
kParamF = 5,
kParamG = 6,
kParamH = 7,
kNumParameters = 8
kParamA =0,
kParamB =1,
kParamC =2,
kNumParameters = 3
}; //
const int dscBuf = 90;
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'cnxo'; //Change this to what the AU identity is!
const unsigned long kUniqueId = 'disv'; //Change this to what the AU identity is!
class ConsoleXSubOut :
class Distance3 :
public AudioEffectX
{
public:
ConsoleXSubOut(audioMasterCallback audioMaster);
~ConsoleXSubOut();
Distance3(audioMasterCallback audioMaster);
~Distance3();
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
@ -60,125 +55,74 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
enum {
biq_freq,
biq_reso,
biq_a0,
biq_a1,
biq_a2,
biq_b1,
biq_b2,
biq_sL1,
biq_sL2,
biq_sR1,
biq_sR2,
biq_total
};
double biquad[biq_total];
enum {
pvAL1,
pvSL1,
accSL1,
acc2SL1,
pvAL2,
pvSL2,
accSL2,
acc2SL2,
pvAL3,
pvSL3,
accSL3,
pvAL4,
pvSL4,
gndavgL,
outAL,
gainAL,
pvAR1,
pvSR1,
accSR1,
acc2SR1,
pvAR2,
pvSR2,
accSR2,
acc2SR2,
pvAR3,
pvSR3,
accSR3,
pvAR4,
pvSR4,
gndavgR,
outAR,
gainAR,
air_total
};
double air[air_total];
enum {
prevSampL1,
prevSlewL1,
accSlewL1,
prevSampL2,
prevSlewL2,
accSlewL2,
prevSampL3,
prevSlewL3,
accSlewL3,
kalGainL,
kalOutL,
prevSampR1,
prevSlewR1,
accSlewR1,
prevSampR2,
prevSlewR2,
accSlewR2,
prevSampR3,
prevSlewR3,
accSlewR3,
kalGainR,
kalOutR,
kal_total
};
double kal[kal_total];
double mpkL[2005];
double mpkR[2005];
double f[66];
double prevfreqMPeak;
double prevamountMPeak;
int mpc;
double dBaL[dscBuf+5];
double dBaR[dscBuf+5];
double dBaPosL;
double dBaPosR;
int dBaXL;
int dBaXR;
double trebleGainA;
double trebleGainB;
double midGainA;
double midGainB;
double mPeakA;
double mPeakB;
double bassGainA;
double bassGainB;
double panA;
double panB;
double inTrimA;
double inTrimB;
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
double lastclampAL;
double clampAL;
double changeAL;
double prevresultAL;
double lastAL;
double lastclampBL;
double clampBL;
double changeBL;
double prevresultBL;
double lastBL;
double lastclampCL;
double clampCL;
double changeCL;
double prevresultCL;
double lastCL;
double dBaL[dscBuf+5];
double dBaPosL;
int dBaXL;
double dBbL[dscBuf+5];
double dBbPosL;
int dBbXL;
double dBcL[dscBuf+5];
double dBcPosL;
int dBcXL;
double lastclampAR;
double clampAR;
double changeAR;
double prevresultAR;
double lastAR;
double lastclampBR;
double clampBR;
double changeBR;
double prevresultBR;
double lastBR;
double lastclampCR;
double clampCR;
double changeCR;
double prevresultCR;
double lastCR;
double dBaR[dscBuf+5];
double dBaPosR;
int dBaXR;
double dBbR[dscBuf+5];
double dBbPosR;
int dBbXR;
double dBcR[dscBuf+5];
double dBcPosR;
int dBcXR;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

View file

@ -0,0 +1,372 @@
/* ========================================
* Distance3 - Distance3.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Distance3_H
#include "Distance3.h"
#endif
void Distance3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double softslew = (A*100.0)+0.5;
softslew *= overallscale;
double outslew = softslew * (1.0-(A*0.333));
double refdB = (B*70.0)+70.0;
double topdB = 0.000000075 * pow(10.0,refdB/20.0) * overallscale;
double wet = C;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
inputSampleL *= softslew;
lastclampAL = clampAL; clampAL = inputSampleL - lastAL;
double postfilter = changeAL = fabs(clampAL - lastclampAL);
postfilter += (softslew / 2.0);
inputSampleL /= outslew;
inputSampleL += (prevresultAL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultAL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity A begin
dBaL[dBaXL] = inputSampleL; dBaPosL *= 0.5; dBaPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
int dBdly = floor(dBaPosL*dscBuf);
double dBi = (dBaPosL*dscBuf)-dBdly;
inputSampleL = dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*dBi;
dBaXL++; if (dBaXL < 0 || dBaXL >= dscBuf) dBaXL = 0;
//Air Discontinuity A end
inputSampleL /= topdB;
inputSampleL *= softslew;
lastclampBL = clampBL; clampBL = inputSampleL - lastBL;
postfilter = changeBL = fabs(clampBL - lastclampBL);
postfilter += (softslew / 2.0);
lastBL = inputSampleL;
inputSampleL /= outslew;
inputSampleL += (prevresultBL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultBL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity B begin
dBbL[dBbXL] = inputSampleL; dBbPosL *= 0.5; dBbPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
dBdly = floor(dBbPosL*dscBuf); dBi = (dBbPosL*dscBuf)-dBdly;
inputSampleL = dBbL[dBbXL-dBdly +((dBbXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBbL[dBbXL-dBdly +((dBbXL-dBdly < 0)?dscBuf:0)]*dBi;
dBbXL++; if (dBbXL < 0 || dBbXL >= dscBuf) dBbXL = 0;
//Air Discontinuity B end
inputSampleL /= topdB;
inputSampleL *= softslew;
lastclampCL = clampCL; clampCL = inputSampleL - lastCL;
postfilter = changeCL = fabs(clampCL - lastclampCL);
postfilter += (softslew / 2.0);
lastCL = inputSampleL;
inputSampleL /= softslew; //don't boost the final time!
inputSampleL += (prevresultCL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultCL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity C begin
dBcL[dBcXL] = inputSampleL; dBcPosL *= 0.5; dBcPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
dBdly = floor(dBcPosL*dscBuf); dBi = (dBcPosL*dscBuf)-dBdly;
inputSampleL = dBcL[dBcXL-dBdly +((dBcXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBcL[dBcXL-dBdly +((dBcXL-dBdly < 0)?dscBuf:0)]*dBi;
dBcXL++; if (dBcXL < 0 || dBcXL >= dscBuf) dBcXL = 0;
//Air Discontinuity C end
inputSampleL /= topdB;
if (wet < 1.0) inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL*wet);
inputSampleR *= softslew;
lastclampAR = clampAR; clampAR = inputSampleR - lastAR;
postfilter = changeAR = fabs(clampAR - lastclampAR);
postfilter += (softslew / 2.0);
inputSampleR /= outslew;
inputSampleR += (prevresultAR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultAR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity A begin
dBaR[dBaXR] = inputSampleR; dBaPosR *= 0.5; dBaPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBaPosR*dscBuf);
dBi = (dBaPosR*dscBuf)-dBdly;
inputSampleR = dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*dBi;
dBaXR++; if (dBaXR < 0 || dBaXR >= dscBuf) dBaXR = 0;
//Air Discontinuity A end
inputSampleR /= topdB;
inputSampleR *= softslew;
lastclampBR = clampBR; clampBR = inputSampleR - lastBR;
postfilter = changeBR = fabs(clampBR - lastclampBR);
postfilter += (softslew / 2.0);
lastBR = inputSampleR;
inputSampleR /= outslew;
inputSampleR += (prevresultBR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultBR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity B begin
dBbR[dBbXR] = inputSampleR; dBbPosR *= 0.5; dBbPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBbPosR*dscBuf); dBi = (dBbPosR*dscBuf)-dBdly;
inputSampleR = dBbR[dBbXR-dBdly +((dBbXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBbR[dBbXR-dBdly +((dBbXR-dBdly < 0)?dscBuf:0)]*dBi;
dBbXR++; if (dBbXR < 0 || dBbXR >= dscBuf) dBbXR = 0;
//Air Discontinuity B end
inputSampleR /= topdB;
inputSampleR *= softslew;
lastclampCR = clampCR; clampCR = inputSampleR - lastCR;
postfilter = changeCR = fabs(clampCR - lastclampCR);
postfilter += (softslew / 2.0);
lastCR = inputSampleR;
inputSampleR /= softslew; //don't boost the final time!
inputSampleR += (prevresultCR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultCR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity C begin
dBcR[dBcXR] = inputSampleR; dBcPosR *= 0.5; dBcPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBcPosR*dscBuf); dBi = (dBcPosR*dscBuf)-dBdly;
inputSampleR = dBcR[dBcXR-dBdly +((dBcXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBcR[dBcXR-dBdly +((dBcXR-dBdly < 0)?dscBuf:0)]*dBi;
dBcXR++; if (dBcXR < 0 || dBcXR >= dscBuf) dBcXR = 0;
//Air Discontinuity C end
inputSampleR /= topdB;
if (wet < 1.0) inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR*wet);
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void Distance3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double softslew = (A*100.0)+0.5;
softslew *= overallscale;
double outslew = softslew * (1.0-(A*0.333));
double refdB = (B*70.0)+70.0;
double topdB = 0.000000075 * pow(10.0,refdB/20.0) * overallscale;
double wet = C;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
double drySampleL = inputSampleL;
double drySampleR = inputSampleR;
inputSampleL *= softslew;
lastclampAL = clampAL; clampAL = inputSampleL - lastAL;
double postfilter = changeAL = fabs(clampAL - lastclampAL);
postfilter += (softslew / 2.0);
inputSampleL /= outslew;
inputSampleL += (prevresultAL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultAL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity A begin
dBaL[dBaXL] = inputSampleL; dBaPosL *= 0.5; dBaPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
int dBdly = floor(dBaPosL*dscBuf);
double dBi = (dBaPosL*dscBuf)-dBdly;
inputSampleL = dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBaL[dBaXL-dBdly +((dBaXL-dBdly < 0)?dscBuf:0)]*dBi;
dBaXL++; if (dBaXL < 0 || dBaXL >= dscBuf) dBaXL = 0;
//Air Discontinuity A end
inputSampleL /= topdB;
inputSampleL *= softslew;
lastclampBL = clampBL; clampBL = inputSampleL - lastBL;
postfilter = changeBL = fabs(clampBL - lastclampBL);
postfilter += (softslew / 2.0);
lastBL = inputSampleL;
inputSampleL /= outslew;
inputSampleL += (prevresultBL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultBL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity B begin
dBbL[dBbXL] = inputSampleL; dBbPosL *= 0.5; dBbPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
dBdly = floor(dBbPosL*dscBuf); dBi = (dBbPosL*dscBuf)-dBdly;
inputSampleL = dBbL[dBbXL-dBdly +((dBbXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBbL[dBbXL-dBdly +((dBbXL-dBdly < 0)?dscBuf:0)]*dBi;
dBbXL++; if (dBbXL < 0 || dBbXL >= dscBuf) dBbXL = 0;
//Air Discontinuity B end
inputSampleL /= topdB;
inputSampleL *= softslew;
lastclampCL = clampCL; clampCL = inputSampleL - lastCL;
postfilter = changeCL = fabs(clampCL - lastclampCL);
postfilter += (softslew / 2.0);
lastCL = inputSampleL;
inputSampleL /= softslew; //don't boost the final time!
inputSampleL += (prevresultCL * postfilter);
inputSampleL /= (postfilter + 1.0);
prevresultCL = inputSampleL;
//do an IIR like thing to further squish superdistant stuff
inputSampleL *= topdB;
if (inputSampleL < -0.222) inputSampleL = -0.222; if (inputSampleL > 0.222) inputSampleL = 0.222;
//Air Discontinuity C begin
dBcL[dBcXL] = inputSampleL; dBcPosL *= 0.5; dBcPosL += fabs((inputSampleL*((inputSampleL*0.25)-0.5))*0.5);
dBdly = floor(dBcPosL*dscBuf); dBi = (dBcPosL*dscBuf)-dBdly;
inputSampleL = dBcL[dBcXL-dBdly +((dBcXL-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleL += dBcL[dBcXL-dBdly +((dBcXL-dBdly < 0)?dscBuf:0)]*dBi;
dBcXL++; if (dBcXL < 0 || dBcXL >= dscBuf) dBcXL = 0;
//Air Discontinuity C end
inputSampleL /= topdB;
if (wet < 1.0) inputSampleL = (drySampleL * (1.0-wet))+(inputSampleL*wet);
inputSampleR *= softslew;
lastclampAR = clampAR; clampAR = inputSampleR - lastAR;
postfilter = changeAR = fabs(clampAR - lastclampAR);
postfilter += (softslew / 2.0);
inputSampleR /= outslew;
inputSampleR += (prevresultAR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultAR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity A begin
dBaR[dBaXR] = inputSampleR; dBaPosR *= 0.5; dBaPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBaPosR*dscBuf);
dBi = (dBaPosR*dscBuf)-dBdly;
inputSampleR = dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBaR[dBaXR-dBdly +((dBaXR-dBdly < 0)?dscBuf:0)]*dBi;
dBaXR++; if (dBaXR < 0 || dBaXR >= dscBuf) dBaXR = 0;
//Air Discontinuity A end
inputSampleR /= topdB;
inputSampleR *= softslew;
lastclampBR = clampBR; clampBR = inputSampleR - lastBR;
postfilter = changeBR = fabs(clampBR - lastclampBR);
postfilter += (softslew / 2.0);
lastBR = inputSampleR;
inputSampleR /= outslew;
inputSampleR += (prevresultBR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultBR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity B begin
dBbR[dBbXR] = inputSampleR; dBbPosR *= 0.5; dBbPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBbPosR*dscBuf); dBi = (dBbPosR*dscBuf)-dBdly;
inputSampleR = dBbR[dBbXR-dBdly +((dBbXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBbR[dBbXR-dBdly +((dBbXR-dBdly < 0)?dscBuf:0)]*dBi;
dBbXR++; if (dBbXR < 0 || dBbXR >= dscBuf) dBbXR = 0;
//Air Discontinuity B end
inputSampleR /= topdB;
inputSampleR *= softslew;
lastclampCR = clampCR; clampCR = inputSampleR - lastCR;
postfilter = changeCR = fabs(clampCR - lastclampCR);
postfilter += (softslew / 2.0);
lastCR = inputSampleR;
inputSampleR /= softslew; //don't boost the final time!
inputSampleR += (prevresultCR * postfilter);
inputSampleR /= (postfilter + 1.0);
prevresultCR = inputSampleR;
//do an IIR like thing to further squish superdistant stuff
inputSampleR *= topdB;
if (inputSampleR < -0.222) inputSampleR = -0.222; if (inputSampleR > 0.222) inputSampleR = 0.222;
//Air Discontinuity C begin
dBcR[dBcXR] = inputSampleR; dBcPosR *= 0.5; dBcPosR += fabs((inputSampleR*((inputSampleR*0.25)-0.5))*0.5);
dBdly = floor(dBcPosR*dscBuf); dBi = (dBcPosR*dscBuf)-dBdly;
inputSampleR = dBcR[dBcXR-dBdly +((dBcXR-dBdly < 0)?dscBuf:0)]*(1.0-dBi);
dBdly++; inputSampleR += dBcR[dBcXR-dBdly +((dBcXR-dBdly < 0)?dscBuf:0)]*dBi;
dBcXR++; if (dBcXR < 0 || dBcXR >= dscBuf) dBcXR = 0;
//Air Discontinuity C end
inputSampleR /= topdB;
if (wet < 1.0) inputSampleR = (drySampleR * (1.0-wet))+(inputSampleR*wet);
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -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

View file

@ -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="Distance3.cpp" />
<ClCompile Include="Distance3Proc.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="Distance3.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>Distance364</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>

View file

@ -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="Distance3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Distance3Proc.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="Distance3.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -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>

View file

@ -0,0 +1,3 @@
EXPORTS
VSTPluginMain
main=VSTPluginMain

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,198 @@
/* ========================================
* Parametric - Parametric.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Parametric_H
#include "Parametric.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Parametric(audioMaster);}
Parametric::Parametric(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 0.5;
D = 0.5;
E = 0.5;
F = 0.5;
G = 0.5;
H = 0.5;
I = 0.5;
J = 1.0;
for (int x = 0; x < biqs_total; x++) {
high[x] = 0.0;
hmid[x] = 0.0;
lmid[x] = 0.0;
}
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
Parametric::~Parametric() {}
VstInt32 Parametric::getVendorVersion () {return 1000;}
void Parametric::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void Parametric::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 Parametric::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
chunkData[4] = E;
chunkData[5] = F;
chunkData[6] = G;
chunkData[7] = H;
chunkData[8] = I;
chunkData[9] = J;
/* 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 Parametric::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
E = pinParameter(chunkData[4]);
F = pinParameter(chunkData[5]);
G = pinParameter(chunkData[6]);
H = pinParameter(chunkData[7]);
I = pinParameter(chunkData[8]);
J = pinParameter(chunkData[9]);
/* 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 Parametric::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
case kParamE: E = value; break;
case kParamF: F = value; break;
case kParamG: G = value; break;
case kParamH: H = value; break;
case kParamI: I = value; break;
case kParamJ: J = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float Parametric::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
case kParamE: return E; break;
case kParamF: return F; break;
case kParamG: return G; break;
case kParamH: return H; break;
case kParamI: return I; break;
case kParamJ: return J; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void Parametric::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Tr Freq", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Treble", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Tr Reso", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "HM Freq", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "HighMid", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "HM Reso", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "LM Freq", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "LowMid", kVstMaxParamStrLen); break;
case kParamI: vst_strncpy (text, "LM Reso", kVstMaxParamStrLen); break;
case kParamJ: 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 Parametric::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
case kParamF: float2string (F, text, kVstMaxParamStrLen); break;
case kParamG: float2string (G, text, kVstMaxParamStrLen); break;
case kParamH: float2string (H, text, kVstMaxParamStrLen); break;
case kParamI: float2string (I, text, kVstMaxParamStrLen); break;
case kParamJ: float2string (J, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void Parametric::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;
case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamI: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamJ: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 Parametric::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool Parametric::getEffectName(char* name) {
vst_strncpy(name, "Parametric", kVstMaxProductStrLen); return true;
}
VstPlugCategory Parametric::getPlugCategory() {return kPlugCategEffect;}
bool Parametric::getProductString(char* text) {
vst_strncpy (text, "airwindows Parametric", kVstMaxProductStrLen); return true;
}
bool Parametric::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -0,0 +1,95 @@
/* ========================================
* Parametric - Parametric.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Parametric_H
#define __Parametric_H
#ifndef __audioeffect__
#include "audioeffectx.h"
#endif
#include <set>
#include <string>
#include <math.h>
enum {
kParamA =0,
kParamB =1,
kParamC =2,
kParamD =3,
kParamE =4,
kParamF =5,
kParamG =6,
kParamH =7,
kParamI =8,
kParamJ =9,
kNumParameters = 10
}; //
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'para'; //Change this to what the AU identity is!
class Parametric :
public AudioEffectX
{
public:
Parametric(audioMasterCallback audioMaster);
~Parametric();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
float I;
float J;
enum {
biqs_freq, biqs_reso, biqs_level,
biqs_nonlin, biqs_temp, biqs_dis,
biqs_a0, biqs_a1, biqs_b1, biqs_b2,
biqs_c0, biqs_c1, biqs_d1, biqs_d2,
biqs_e0, biqs_e1, biqs_f1, biqs_f2,
biqs_aL1, biqs_aL2, biqs_aR1, biqs_aR2,
biqs_cL1, biqs_cL2, biqs_cR1, biqs_cR2,
biqs_eL1, biqs_eL2, biqs_eR1, biqs_eR2,
biqs_outL, biqs_outR, biqs_total
};
double high[biqs_total];
double hmid[biqs_total];
double lmid[biqs_total];
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

View file

@ -0,0 +1,498 @@
/* ========================================
* Parametric - Parametric.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Parametric_H
#include "Parametric.h"
#endif
void Parametric::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
high[biqs_freq] = (((pow(A,3)*14500.0)+1500.0)/getSampleRate());
if (high[biqs_freq] < 0.0001) high[biqs_freq] = 0.0001;
high[biqs_nonlin] = B;
high[biqs_level] = (high[biqs_nonlin]*2.0)-1.0;
if (high[biqs_level] > 0.0) high[biqs_level] *= 2.0;
high[biqs_reso] = ((0.5+(high[biqs_nonlin]*0.5)+sqrt(high[biqs_freq]))-(1.0-pow(1.0-C,2.0)))+0.5+(high[biqs_nonlin]*0.5);
double K = tan(M_PI * high[biqs_freq]);
double norm = 1.0 / (1.0 + K / (high[biqs_reso]*1.93185165) + K * K);
high[biqs_a0] = K / (high[biqs_reso]*1.93185165) * norm;
high[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_b2] = (1.0 - K / (high[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (high[biqs_reso]*0.70710678) + K * K);
high[biqs_c0] = K / (high[biqs_reso]*0.70710678) * norm;
high[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_d2] = (1.0 - K / (high[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (high[biqs_reso]*0.51763809) + K * K);
high[biqs_e0] = K / (high[biqs_reso]*0.51763809) * norm;
high[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_f2] = (1.0 - K / (high[biqs_reso]*0.51763809) + K * K) * norm;
//high
hmid[biqs_freq] = (((pow(D,3)*6400.0)+600.0)/getSampleRate());
if (hmid[biqs_freq] < 0.0001) hmid[biqs_freq] = 0.0001;
hmid[biqs_nonlin] = E;
hmid[biqs_level] = (hmid[biqs_nonlin]*2.0)-1.0;
if (hmid[biqs_level] > 0.0) hmid[biqs_level] *= 2.0;
hmid[biqs_reso] = ((0.5+(hmid[biqs_nonlin]*0.5)+sqrt(hmid[biqs_freq]))-(1.0-pow(1.0-F,2.0)))+0.5+(hmid[biqs_nonlin]*0.5);
K = tan(M_PI * hmid[biqs_freq]);
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*1.93185165) + K * K);
hmid[biqs_a0] = K / (hmid[biqs_reso]*1.93185165) * norm;
hmid[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_b2] = (1.0 - K / (hmid[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*0.70710678) + K * K);
hmid[biqs_c0] = K / (hmid[biqs_reso]*0.70710678) * norm;
hmid[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_d2] = (1.0 - K / (hmid[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*0.51763809) + K * K);
hmid[biqs_e0] = K / (hmid[biqs_reso]*0.51763809) * norm;
hmid[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_f2] = (1.0 - K / (hmid[biqs_reso]*0.51763809) + K * K) * norm;
//hmid
lmid[biqs_freq] = (((pow(G,3)*2200.0)+20.0)/getSampleRate());
if (lmid[biqs_freq] < 0.00001) lmid[biqs_freq] = 0.00001;
lmid[biqs_nonlin] = H;
lmid[biqs_level] = (lmid[biqs_nonlin]*2.0)-1.0;
if (lmid[biqs_level] > 0.0) lmid[biqs_level] *= 2.0;
lmid[biqs_reso] = ((0.5+(lmid[biqs_nonlin]*0.5)+sqrt(lmid[biqs_freq]))-(1.0-pow(1.0-I,2.0)))+0.5+(lmid[biqs_nonlin]*0.5);
K = tan(M_PI * lmid[biqs_freq]);
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*1.93185165) + K * K);
lmid[biqs_a0] = K / (lmid[biqs_reso]*1.93185165) * norm;
lmid[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_b2] = (1.0 - K / (lmid[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*0.70710678) + K * K);
lmid[biqs_c0] = K / (lmid[biqs_reso]*0.70710678) * norm;
lmid[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_d2] = (1.0 - K / (lmid[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*0.51763809) + K * K);
lmid[biqs_e0] = K / (lmid[biqs_reso]*0.51763809) * norm;
lmid[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_f2] = (1.0 - K / (lmid[biqs_reso]*0.51763809) + K * K) * norm;
//lmid
double wet = J;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//begin Stacked Biquad With Reversed Neutron Flow L
high[biqs_outL] = inputSampleL * fabs(high[biqs_level]);
high[biqs_dis] = fabs(high[biqs_a0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_aL1];
high[biqs_aL1] = high[biqs_aL2] - (high[biqs_temp]*high[biqs_b1]);
high[biqs_aL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_b2]);
high[biqs_outL] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_c0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_cL1];
high[biqs_cL1] = high[biqs_cL2] - (high[biqs_temp]*high[biqs_d1]);
high[biqs_cL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_d2]);
high[biqs_outL] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_e0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_eL1];
high[biqs_eL1] = high[biqs_eL2] - (high[biqs_temp]*high[biqs_f1]);
high[biqs_eL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_f2]);
high[biqs_outL] = high[biqs_temp]; high[biqs_outL] *= high[biqs_level];
if (high[biqs_level] > 1.0) high[biqs_outL] *= high[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow L
hmid[biqs_outL] = inputSampleL * fabs(hmid[biqs_level]);
hmid[biqs_dis] = fabs(hmid[biqs_a0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_aL1];
hmid[biqs_aL1] = hmid[biqs_aL2] - (hmid[biqs_temp]*hmid[biqs_b1]);
hmid[biqs_aL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_b2]);
hmid[biqs_outL] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_c0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_cL1];
hmid[biqs_cL1] = hmid[biqs_cL2] - (hmid[biqs_temp]*hmid[biqs_d1]);
hmid[biqs_cL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_d2]);
hmid[biqs_outL] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_e0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_eL1];
hmid[biqs_eL1] = hmid[biqs_eL2] - (hmid[biqs_temp]*hmid[biqs_f1]);
hmid[biqs_eL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_f2]);
hmid[biqs_outL] = hmid[biqs_temp]; hmid[biqs_outL] *= hmid[biqs_level];
if (hmid[biqs_level] > 1.0) hmid[biqs_outL] *= hmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow L
lmid[biqs_outL] = inputSampleL * fabs(lmid[biqs_level]);
lmid[biqs_dis] = fabs(lmid[biqs_a0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_aL1];
lmid[biqs_aL1] = lmid[biqs_aL2] - (lmid[biqs_temp]*lmid[biqs_b1]);
lmid[biqs_aL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_b2]);
lmid[biqs_outL] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_c0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_cL1];
lmid[biqs_cL1] = lmid[biqs_cL2] - (lmid[biqs_temp]*lmid[biqs_d1]);
lmid[biqs_cL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_d2]);
lmid[biqs_outL] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_e0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_eL1];
lmid[biqs_eL1] = lmid[biqs_eL2] - (lmid[biqs_temp]*lmid[biqs_f1]);
lmid[biqs_eL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_f2]);
lmid[biqs_outL] = lmid[biqs_temp]; lmid[biqs_outL] *= lmid[biqs_level];
if (lmid[biqs_level] > 1.0) lmid[biqs_outL] *= lmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow R
high[biqs_outR] = inputSampleR * fabs(high[biqs_level]);
high[biqs_dis] = fabs(high[biqs_a0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_aR1];
high[biqs_aR1] = high[biqs_aR2] - (high[biqs_temp]*high[biqs_b1]);
high[biqs_aR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_b2]);
high[biqs_outR] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_c0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_cR1];
high[biqs_cR1] = high[biqs_cR2] - (high[biqs_temp]*high[biqs_d1]);
high[biqs_cR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_d2]);
high[biqs_outR] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_e0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_eR1];
high[biqs_eR1] = high[biqs_eR2] - (high[biqs_temp]*high[biqs_f1]);
high[biqs_eR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_f2]);
high[biqs_outR] = high[biqs_temp]; high[biqs_outR] *= high[biqs_level];
if (high[biqs_level] > 1.0) high[biqs_outR] *= high[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
//begin Stacked Biquad With Reversed Neutron Flow R
hmid[biqs_outR] = inputSampleR * fabs(hmid[biqs_level]);
hmid[biqs_dis] = fabs(hmid[biqs_a0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_aR1];
hmid[biqs_aR1] = hmid[biqs_aR2] - (hmid[biqs_temp]*hmid[biqs_b1]);
hmid[biqs_aR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_b2]);
hmid[biqs_outR] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_c0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_cR1];
hmid[biqs_cR1] = hmid[biqs_cR2] - (hmid[biqs_temp]*hmid[biqs_d1]);
hmid[biqs_cR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_d2]);
hmid[biqs_outR] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_e0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_eR1];
hmid[biqs_eR1] = hmid[biqs_eR2] - (hmid[biqs_temp]*hmid[biqs_f1]);
hmid[biqs_eR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_f2]);
hmid[biqs_outR] = hmid[biqs_temp]; hmid[biqs_outR] *= hmid[biqs_level];
if (hmid[biqs_level] > 1.0) hmid[biqs_outR] *= hmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
//begin Stacked Biquad With Reversed Neutron Flow R
lmid[biqs_outR] = inputSampleR * fabs(lmid[biqs_level]);
lmid[biqs_dis] = fabs(lmid[biqs_a0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_aR1];
lmid[biqs_aR1] = lmid[biqs_aR2] - (lmid[biqs_temp]*lmid[biqs_b1]);
lmid[biqs_aR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_b2]);
lmid[biqs_outR] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_c0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_cR1];
lmid[biqs_cR1] = lmid[biqs_cR2] - (lmid[biqs_temp]*lmid[biqs_d1]);
lmid[biqs_cR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_d2]);
lmid[biqs_outR] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_e0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_eR1];
lmid[biqs_eR1] = lmid[biqs_eR2] - (lmid[biqs_temp]*lmid[biqs_f1]);
lmid[biqs_eR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_f2]);
lmid[biqs_outR] = lmid[biqs_temp]; lmid[biqs_outR] *= lmid[biqs_level];
if (lmid[biqs_level] > 1.0) lmid[biqs_outR] *= lmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
double parametric = high[biqs_outL] + hmid[biqs_outL] + lmid[biqs_outL];
inputSampleL += (parametric * wet); //purely a parallel filter stage here
parametric = high[biqs_outR] + hmid[biqs_outR] + lmid[biqs_outR];
inputSampleR += (parametric * wet); //purely a parallel filter stage here
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void Parametric::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
high[biqs_freq] = (((pow(A,3)*14500.0)+1500.0)/getSampleRate());
if (high[biqs_freq] < 0.0001) high[biqs_freq] = 0.0001;
high[biqs_nonlin] = B;
high[biqs_level] = (high[biqs_nonlin]*2.0)-1.0;
if (high[biqs_level] > 0.0) high[biqs_level] *= 2.0;
high[biqs_reso] = ((0.5+(high[biqs_nonlin]*0.5)+sqrt(high[biqs_freq]))-(1.0-pow(1.0-C,2.0)))+0.5+(high[biqs_nonlin]*0.5);
double K = tan(M_PI * high[biqs_freq]);
double norm = 1.0 / (1.0 + K / (high[biqs_reso]*1.93185165) + K * K);
high[biqs_a0] = K / (high[biqs_reso]*1.93185165) * norm;
high[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_b2] = (1.0 - K / (high[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (high[biqs_reso]*0.70710678) + K * K);
high[biqs_c0] = K / (high[biqs_reso]*0.70710678) * norm;
high[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_d2] = (1.0 - K / (high[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (high[biqs_reso]*0.51763809) + K * K);
high[biqs_e0] = K / (high[biqs_reso]*0.51763809) * norm;
high[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
high[biqs_f2] = (1.0 - K / (high[biqs_reso]*0.51763809) + K * K) * norm;
//high
hmid[biqs_freq] = (((pow(D,3)*6400.0)+600.0)/getSampleRate());
if (hmid[biqs_freq] < 0.0001) hmid[biqs_freq] = 0.0001;
hmid[biqs_nonlin] = E;
hmid[biqs_level] = (hmid[biqs_nonlin]*2.0)-1.0;
if (hmid[biqs_level] > 0.0) hmid[biqs_level] *= 2.0;
hmid[biqs_reso] = ((0.5+(hmid[biqs_nonlin]*0.5)+sqrt(hmid[biqs_freq]))-(1.0-pow(1.0-F,2.0)))+0.5+(hmid[biqs_nonlin]*0.5);
K = tan(M_PI * hmid[biqs_freq]);
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*1.93185165) + K * K);
hmid[biqs_a0] = K / (hmid[biqs_reso]*1.93185165) * norm;
hmid[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_b2] = (1.0 - K / (hmid[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*0.70710678) + K * K);
hmid[biqs_c0] = K / (hmid[biqs_reso]*0.70710678) * norm;
hmid[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_d2] = (1.0 - K / (hmid[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (hmid[biqs_reso]*0.51763809) + K * K);
hmid[biqs_e0] = K / (hmid[biqs_reso]*0.51763809) * norm;
hmid[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
hmid[biqs_f2] = (1.0 - K / (hmid[biqs_reso]*0.51763809) + K * K) * norm;
//hmid
lmid[biqs_freq] = (((pow(G,3)*2200.0)+20.0)/getSampleRate());
if (lmid[biqs_freq] < 0.00001) lmid[biqs_freq] = 0.00001;
lmid[biqs_nonlin] = H;
lmid[biqs_level] = (lmid[biqs_nonlin]*2.0)-1.0;
if (lmid[biqs_level] > 0.0) lmid[biqs_level] *= 2.0;
lmid[biqs_reso] = ((0.5+(lmid[biqs_nonlin]*0.5)+sqrt(lmid[biqs_freq]))-(1.0-pow(1.0-I,2.0)))+0.5+(lmid[biqs_nonlin]*0.5);
K = tan(M_PI * lmid[biqs_freq]);
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*1.93185165) + K * K);
lmid[biqs_a0] = K / (lmid[biqs_reso]*1.93185165) * norm;
lmid[biqs_b1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_b2] = (1.0 - K / (lmid[biqs_reso]*1.93185165) + K * K) * norm;
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*0.70710678) + K * K);
lmid[biqs_c0] = K / (lmid[biqs_reso]*0.70710678) * norm;
lmid[biqs_d1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_d2] = (1.0 - K / (lmid[biqs_reso]*0.70710678) + K * K) * norm;
norm = 1.0 / (1.0 + K / (lmid[biqs_reso]*0.51763809) + K * K);
lmid[biqs_e0] = K / (lmid[biqs_reso]*0.51763809) * norm;
lmid[biqs_f1] = 2.0 * (K * K - 1.0) * norm;
lmid[biqs_f2] = (1.0 - K / (lmid[biqs_reso]*0.51763809) + K * K) * norm;
//lmid
double wet = J;
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//begin Stacked Biquad With Reversed Neutron Flow L
high[biqs_outL] = inputSampleL * fabs(high[biqs_level]);
high[biqs_dis] = fabs(high[biqs_a0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_aL1];
high[biqs_aL1] = high[biqs_aL2] - (high[biqs_temp]*high[biqs_b1]);
high[biqs_aL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_b2]);
high[biqs_outL] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_c0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_cL1];
high[biqs_cL1] = high[biqs_cL2] - (high[biqs_temp]*high[biqs_d1]);
high[biqs_cL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_d2]);
high[biqs_outL] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_e0] * (1.0+(high[biqs_outL]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outL] * high[biqs_dis]) + high[biqs_eL1];
high[biqs_eL1] = high[biqs_eL2] - (high[biqs_temp]*high[biqs_f1]);
high[biqs_eL2] = (high[biqs_outL] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_f2]);
high[biqs_outL] = high[biqs_temp]; high[biqs_outL] *= high[biqs_level];
if (high[biqs_level] > 1.0) high[biqs_outL] *= high[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow L
hmid[biqs_outL] = inputSampleL * fabs(hmid[biqs_level]);
hmid[biqs_dis] = fabs(hmid[biqs_a0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_aL1];
hmid[biqs_aL1] = hmid[biqs_aL2] - (hmid[biqs_temp]*hmid[biqs_b1]);
hmid[biqs_aL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_b2]);
hmid[biqs_outL] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_c0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_cL1];
hmid[biqs_cL1] = hmid[biqs_cL2] - (hmid[biqs_temp]*hmid[biqs_d1]);
hmid[biqs_cL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_d2]);
hmid[biqs_outL] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_e0] * (1.0+(hmid[biqs_outL]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outL] * hmid[biqs_dis]) + hmid[biqs_eL1];
hmid[biqs_eL1] = hmid[biqs_eL2] - (hmid[biqs_temp]*hmid[biqs_f1]);
hmid[biqs_eL2] = (hmid[biqs_outL] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_f2]);
hmid[biqs_outL] = hmid[biqs_temp]; hmid[biqs_outL] *= hmid[biqs_level];
if (hmid[biqs_level] > 1.0) hmid[biqs_outL] *= hmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow L
lmid[biqs_outL] = inputSampleL * fabs(lmid[biqs_level]);
lmid[biqs_dis] = fabs(lmid[biqs_a0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_aL1];
lmid[biqs_aL1] = lmid[biqs_aL2] - (lmid[biqs_temp]*lmid[biqs_b1]);
lmid[biqs_aL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_b2]);
lmid[biqs_outL] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_c0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_cL1];
lmid[biqs_cL1] = lmid[biqs_cL2] - (lmid[biqs_temp]*lmid[biqs_d1]);
lmid[biqs_cL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_d2]);
lmid[biqs_outL] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_e0] * (1.0+(lmid[biqs_outL]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outL] * lmid[biqs_dis]) + lmid[biqs_eL1];
lmid[biqs_eL1] = lmid[biqs_eL2] - (lmid[biqs_temp]*lmid[biqs_f1]);
lmid[biqs_eL2] = (lmid[biqs_outL] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_f2]);
lmid[biqs_outL] = lmid[biqs_temp]; lmid[biqs_outL] *= lmid[biqs_level];
if (lmid[biqs_level] > 1.0) lmid[biqs_outL] *= lmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow L
//begin Stacked Biquad With Reversed Neutron Flow R
high[biqs_outR] = inputSampleR * fabs(high[biqs_level]);
high[biqs_dis] = fabs(high[biqs_a0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_aR1];
high[biqs_aR1] = high[biqs_aR2] - (high[biqs_temp]*high[biqs_b1]);
high[biqs_aR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_b2]);
high[biqs_outR] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_c0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_cR1];
high[biqs_cR1] = high[biqs_cR2] - (high[biqs_temp]*high[biqs_d1]);
high[biqs_cR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_d2]);
high[biqs_outR] = high[biqs_temp];
high[biqs_dis] = fabs(high[biqs_e0] * (1.0+(high[biqs_outR]*high[biqs_nonlin])));
if (high[biqs_dis] > 1.0) high[biqs_dis] = 1.0;
high[biqs_temp] = (high[biqs_outR] * high[biqs_dis]) + high[biqs_eR1];
high[biqs_eR1] = high[biqs_eR2] - (high[biqs_temp]*high[biqs_f1]);
high[biqs_eR2] = (high[biqs_outR] * -high[biqs_dis]) - (high[biqs_temp]*high[biqs_f2]);
high[biqs_outR] = high[biqs_temp]; high[biqs_outR] *= high[biqs_level];
if (high[biqs_level] > 1.0) high[biqs_outR] *= high[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
//begin Stacked Biquad With Reversed Neutron Flow R
hmid[biqs_outR] = inputSampleR * fabs(hmid[biqs_level]);
hmid[biqs_dis] = fabs(hmid[biqs_a0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_aR1];
hmid[biqs_aR1] = hmid[biqs_aR2] - (hmid[biqs_temp]*hmid[biqs_b1]);
hmid[biqs_aR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_b2]);
hmid[biqs_outR] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_c0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_cR1];
hmid[biqs_cR1] = hmid[biqs_cR2] - (hmid[biqs_temp]*hmid[biqs_d1]);
hmid[biqs_cR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_d2]);
hmid[biqs_outR] = hmid[biqs_temp];
hmid[biqs_dis] = fabs(hmid[biqs_e0] * (1.0+(hmid[biqs_outR]*hmid[biqs_nonlin])));
if (hmid[biqs_dis] > 1.0) hmid[biqs_dis] = 1.0;
hmid[biqs_temp] = (hmid[biqs_outR] * hmid[biqs_dis]) + hmid[biqs_eR1];
hmid[biqs_eR1] = hmid[biqs_eR2] - (hmid[biqs_temp]*hmid[biqs_f1]);
hmid[biqs_eR2] = (hmid[biqs_outR] * -hmid[biqs_dis]) - (hmid[biqs_temp]*hmid[biqs_f2]);
hmid[biqs_outR] = hmid[biqs_temp]; hmid[biqs_outR] *= hmid[biqs_level];
if (hmid[biqs_level] > 1.0) hmid[biqs_outR] *= hmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
//begin Stacked Biquad With Reversed Neutron Flow R
lmid[biqs_outR] = inputSampleR * fabs(lmid[biqs_level]);
lmid[biqs_dis] = fabs(lmid[biqs_a0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_aR1];
lmid[biqs_aR1] = lmid[biqs_aR2] - (lmid[biqs_temp]*lmid[biqs_b1]);
lmid[biqs_aR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_b2]);
lmid[biqs_outR] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_c0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_cR1];
lmid[biqs_cR1] = lmid[biqs_cR2] - (lmid[biqs_temp]*lmid[biqs_d1]);
lmid[biqs_cR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_d2]);
lmid[biqs_outR] = lmid[biqs_temp];
lmid[biqs_dis] = fabs(lmid[biqs_e0] * (1.0+(lmid[biqs_outR]*lmid[biqs_nonlin])));
if (lmid[biqs_dis] > 1.0) lmid[biqs_dis] = 1.0;
lmid[biqs_temp] = (lmid[biqs_outR] * lmid[biqs_dis]) + lmid[biqs_eR1];
lmid[biqs_eR1] = lmid[biqs_eR2] - (lmid[biqs_temp]*lmid[biqs_f1]);
lmid[biqs_eR2] = (lmid[biqs_outR] * -lmid[biqs_dis]) - (lmid[biqs_temp]*lmid[biqs_f2]);
lmid[biqs_outR] = lmid[biqs_temp]; lmid[biqs_outR] *= lmid[biqs_level];
if (lmid[biqs_level] > 1.0) lmid[biqs_outR] *= lmid[biqs_level];
//end Stacked Biquad With Reversed Neutron Flow R
double parametric = high[biqs_outL] + hmid[biqs_outL] + lmid[biqs_outL];
inputSampleL += (parametric * wet); //purely a parallel filter stage here
parametric = high[biqs_outR] + hmid[biqs_outR] + lmid[biqs_outR];
inputSampleR += (parametric * wet); //purely a parallel filter stage here
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -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

View file

@ -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="Parametric.cpp" />
<ClCompile Include="ParametricProc.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="Parametric.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>Parametric64</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>

View file

@ -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="Parametric.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ParametricProc.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="Parametric.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -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>

View file

@ -0,0 +1,3 @@
EXPORTS
VSTPluginMain
main=VSTPluginMain

Binary file not shown.

Binary file not shown.

View file

@ -1,51 +1,30 @@
/* ========================================
* ConsoleXSubOut - ConsoleXSubOut.h
* Pop3 - Pop3.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubOut_H
#include "ConsoleXSubOut.h"
#ifndef __Pop3_H
#include "Pop3.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ConsoleXSubOut(audioMaster);}
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Pop3(audioMaster);}
ConsoleXSubOut::ConsoleXSubOut(audioMasterCallback audioMaster) :
Pop3::Pop3(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
A = 1.0;
B = 0.5;
C = 0.5;
D = 0.5;
E = 0.5;
E = 0.0;
F = 0.5;
G = 0.5;
H = 0.5;
popCompL = 1.0;
popCompR = 1.0;
popGate = 1.0;
for (int x = 0; x < biq_total; x++) {biquad[x] = 0.0;}
for (int x = 0; x < air_total; x++) air[x] = 0.0;
for (int x = 0; x < kal_total; x++) kal[x] = 0.0;
for(int count = 0; count < 2004; count++) {mpkL[count] = 0.0; mpkR[count] = 0.0;}
for(int count = 0; count < 65; count++) {f[count] = 0.0;}
prevfreqMPeak = -1;
prevamountMPeak = -1;
mpc = 1;
for(int count = 0; count < dscBuf+2; count++) {
dBaL[count] = 0.0;
dBaR[count] = 0.0;
}
dBaPosL = 0.0;
dBaPosR = 0.0;
dBaXL = 1;
dBaXR = 1;
trebleGainA = 1.0; trebleGainB = 1.0;
midGainA = 1.0; midGainB = 1.0;
mPeakA = 1.0; mPeakB = 1.0;
bassGainA = 1.0; bassGainB = 1.0;
panA = 0.5; panB = 0.5;
inTrimA = 1.0; inTrimB = 1.0;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
@ -62,10 +41,10 @@ ConsoleXSubOut::ConsoleXSubOut(audioMasterCallback audioMaster) :
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}
ConsoleXSubOut::~ConsoleXSubOut() {}
VstInt32 ConsoleXSubOut::getVendorVersion () {return 1000;}
void ConsoleXSubOut::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void ConsoleXSubOut::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);}
Pop3::~Pop3() {}
VstInt32 Pop3::getVendorVersion () {return 1000;}
void Pop3::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void Pop3::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!
@ -76,7 +55,7 @@ static float pinParameter(float data)
return data;
}
VstInt32 ConsoleXSubOut::getChunk (void** data, bool isPreset)
VstInt32 Pop3::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
@ -95,7 +74,7 @@ VstInt32 ConsoleXSubOut::getChunk (void** data, bool isPreset)
return kNumParameters * sizeof(float);
}
VstInt32 ConsoleXSubOut::setChunk (void* data, VstInt32 byteSize, bool isPreset)
VstInt32 Pop3::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
@ -113,7 +92,7 @@ VstInt32 ConsoleXSubOut::setChunk (void* data, VstInt32 byteSize, bool isPreset)
return 0;
}
void ConsoleXSubOut::setParameter(VstInt32 index, float value) {
void Pop3::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
@ -127,7 +106,7 @@ void ConsoleXSubOut::setParameter(VstInt32 index, float value) {
}
}
float ConsoleXSubOut::getParameter(VstInt32 index) {
float Pop3::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
@ -141,61 +120,61 @@ float ConsoleXSubOut::getParameter(VstInt32 index) {
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void ConsoleXSubOut::getParameterName(VstInt32 index, char *text) {
void Pop3::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Air", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Reso", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "Top dB", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "Pan", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "Fader", kVstMaxParamStrLen); break;
case kParamA: vst_strncpy (text, "Thresld", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "C Ratio", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "C Atk", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "C Rls", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "Thresld", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "G Ratio", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "G Sust", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "G Rls", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void ConsoleXSubOut::getParameterDisplay(VstInt32 index, char *text) {
void Pop3::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
case kParamF: float2string ((F*70.0)+70.0, text, kVstMaxParamStrLen); break;
case kParamF: float2string (F, text, kVstMaxParamStrLen); break;
case kParamG: float2string (G, text, kVstMaxParamStrLen); break;
case kParamH: float2string (H, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void ConsoleXSubOut::getParameterLabel(VstInt32 index, char *text) {
void Pop3::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, "dB", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 ConsoleXSubOut::canDo(char *text)
VstInt32 Pop3::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool ConsoleXSubOut::getEffectName(char* name) {
vst_strncpy(name, "ConsoleXSubOut", kVstMaxProductStrLen); return true;
bool Pop3::getEffectName(char* name) {
vst_strncpy(name, "Pop3", kVstMaxProductStrLen); return true;
}
VstPlugCategory ConsoleXSubOut::getPlugCategory() {return kPlugCategEffect;}
VstPlugCategory Pop3::getPlugCategory() {return kPlugCategEffect;}
bool ConsoleXSubOut::getProductString(char* text) {
vst_strncpy (text, "airwindows ConsoleXSubOut", kVstMaxProductStrLen); return true;
bool Pop3::getProductString(char* text) {
vst_strncpy (text, "airwindows Pop3", kVstMaxProductStrLen); return true;
}
bool ConsoleXSubOut::getVendorString(char* text) {
bool Pop3::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -1,11 +1,11 @@
/* ========================================
* ConsoleXSubIn - ConsoleXSubIn.h
* Pop3 - Pop3.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __ConsoleXSubIn_H
#define __ConsoleXSubIn_H
#ifndef __Pop3_H
#define __Pop3_H
#ifndef __audioeffect__
#include "audioeffectx.h"
@ -16,20 +16,28 @@
#include <math.h>
enum {
kNumParameters = 0
kParamA =0,
kParamB =1,
kParamC =2,
kParamD =3,
kParamE =4,
kParamF =5,
kParamG =6,
kParamH =7,
kNumParameters = 8
}; //
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'cnxi'; //Change this to what the AU identity is!
const unsigned long kUniqueId = 'popf'; //Change this to what the AU identity is!
class ConsoleXSubIn :
class Pop3 :
public AudioEffectX
{
public:
ConsoleXSubIn(audioMasterCallback audioMaster);
~ConsoleXSubIn();
Pop3(audioMasterCallback audioMaster);
~Pop3();
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
@ -51,25 +59,22 @@ private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
enum {
biq_freq,
biq_reso,
biq_a0,
biq_a1,
biq_a2,
biq_b1,
biq_b2,
biq_sL1,
biq_sL2,
biq_sR1,
biq_sR2,
biq_total
};
double biquad[biq_total];
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
double popCompL;
double popCompR;
double popGate;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

148
plugins/WinVST/Pop3/Pop3Proc.cpp Executable file
View file

@ -0,0 +1,148 @@
/* ========================================
* Pop3 - Pop3.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Pop3_H
#include "Pop3.h"
#endif
void Pop3::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double compThresh = pow(A,4);
double compRatio = 1.0-pow(1.0-B,2);
double compAttack = 1.0/(((pow(C,3)*5000.0)+500.0)*overallscale);
double compRelease = 1.0/(((pow(D,5)*50000.0)+500.0)*overallscale);
double gateThresh = pow(E,4);
double gateRatio = 1.0-pow(1.0-F,2);
double gateSustain = M_PI_2 * pow(G+1.0,4.0);
double gateRelease = 1.0/(((pow(H,5)*500000.0)+500.0)*overallscale);
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (fabs(inputSampleL) > compThresh) { //compression L
popCompL -= (popCompL * compAttack);
popCompL += ((compThresh / fabs(inputSampleL))*compAttack);
} else popCompL = (popCompL*(1.0-compRelease))+compRelease;
if (popCompL < 0.0) popCompL = 0.0;
if (fabs(inputSampleR) > compThresh) { //compression R
popCompR -= (popCompR * compAttack);
popCompR += ((compThresh / fabs(inputSampleR))*compAttack);
} else popCompR = (popCompR*(1.0-compRelease))+compRelease;
if (popCompR < 0.0) popCompR = 0.0;
if (popCompL > popCompR) popCompL -= (popCompL * compAttack);
if (popCompR > popCompL) popCompR -= (popCompR * compAttack);
if (fabs(inputSampleL) > gateThresh) popGate = gateSustain;
else if (fabs(inputSampleR) > gateThresh) popGate = gateSustain;
else popGate *= (1.0-gateRelease);
if (popGate < 0.0) popGate = 0.0;
if (popCompL < 1.0) inputSampleL *= ((1.0-compRatio)+(popCompL*compRatio));
if (popCompR < 1.0) inputSampleR *= ((1.0-compRatio)+(popCompR*compRatio));
if (popGate < M_PI_2) {
inputSampleL *= ((1.0-gateRatio)+(sin(popGate)*gateRatio));
inputSampleR *= ((1.0-gateRatio)+(sin(popGate)*gateRatio));
}
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void Pop3::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double compThresh = pow(A,4);
double compRatio = 1.0-pow(1.0-B,2);
double compAttack = 1.0/(((pow(C,3)*5000.0)+500.0)*overallscale);
double compRelease = 1.0/(((pow(D,5)*50000.0)+500.0)*overallscale);
double gateThresh = pow(E,4);
double gateRatio = 1.0-pow(1.0-F,2);
double gateSustain = M_PI_2 * pow(G+1.0,4.0);
double gateRelease = 1.0/(((pow(H,5)*500000.0)+500.0)*overallscale);
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
if (fabs(inputSampleL) > compThresh) { //compression L
popCompL -= (popCompL * compAttack);
popCompL += ((compThresh / fabs(inputSampleL))*compAttack);
} else popCompL = (popCompL*(1.0-compRelease))+compRelease;
if (popCompL < 0.0) popCompL = 0.0;
if (fabs(inputSampleR) > compThresh) { //compression R
popCompR -= (popCompR * compAttack);
popCompR += ((compThresh / fabs(inputSampleR))*compAttack);
} else popCompR = (popCompR*(1.0-compRelease))+compRelease;
if (popCompR < 0.0) popCompR = 0.0;
if (popCompL > popCompR) popCompL -= (popCompL * compAttack);
if (popCompR > popCompL) popCompR -= (popCompR * compAttack);
if (fabs(inputSampleL) > gateThresh) popGate = gateSustain;
else if (fabs(inputSampleR) > gateThresh) popGate = gateSustain;
else popGate *= (1.0-gateRelease);
if (popGate < 0.0) popGate = 0.0;
if (popCompL < 1.0) inputSampleL *= ((1.0-compRatio)+(popCompL*compRatio));
if (popCompR < 1.0) inputSampleR *= ((1.0-compRatio)+(popCompR*compRatio));
if (popGate < M_PI_2) {
inputSampleL *= ((1.0-gateRatio)+(sin(popGate)*gateRatio));
inputSampleR *= ((1.0-gateRatio)+(sin(popGate)*gateRatio));
}
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -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

View file

@ -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="Pop3.cpp" />
<ClCompile Include="Pop3Proc.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="Pop3.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>Pop364</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>

View file

@ -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="Pop3.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Pop3Proc.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="Pop3.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -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>

View file

@ -0,0 +1,3 @@
EXPORTS
VSTPluginMain
main=VSTPluginMain

Binary file not shown.

View file

@ -0,0 +1,198 @@
/* ========================================
* StoneFireComp - StoneFireComp.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __StoneFireComp_H
#include "StoneFireComp.h"
#endif
AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new StoneFireComp(audioMaster);}
StoneFireComp::StoneFireComp(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 1.0;
B = 0.5;
C = 0.5;
D = 0.5;
E = 1.0;
F = 0.5;
G = 0.5;
H = 0.5;
I = 0.5;
J = 1.0;
for (int x = 0; x < kal_total; x++) kal[x] = 0.0;
fireCompL = 1.0;
fireCompR = 1.0;
stoneCompL = 1.0;
stoneCompR = 1.0;
fpdL = 1.0; while (fpdL < 16386) fpdL = rand()*UINT32_MAX;
fpdR = 1.0; while (fpdR < 16386) fpdR = rand()*UINT32_MAX;
//this is reset: values being initialized only once. Startup values, whatever they are.
_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_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
}
StoneFireComp::~StoneFireComp() {}
VstInt32 StoneFireComp::getVendorVersion () {return 1000;}
void StoneFireComp::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void StoneFireComp::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 StoneFireComp::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
chunkData[4] = E;
chunkData[5] = F;
chunkData[6] = G;
chunkData[7] = H;
chunkData[8] = I;
chunkData[9] = J;
/* 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 StoneFireComp::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
E = pinParameter(chunkData[4]);
F = pinParameter(chunkData[5]);
G = pinParameter(chunkData[6]);
H = pinParameter(chunkData[7]);
I = pinParameter(chunkData[8]);
J = pinParameter(chunkData[9]);
/* 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 StoneFireComp::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
case kParamE: E = value; break;
case kParamF: F = value; break;
case kParamG: G = value; break;
case kParamH: H = value; break;
case kParamI: I = value; break;
case kParamJ: J = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}
float StoneFireComp::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
case kParamE: return E; break;
case kParamF: return F; break;
case kParamG: return G; break;
case kParamH: return H; break;
case kParamI: return I; break;
case kParamJ: return J; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}
void StoneFireComp::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Fire Th", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Attack", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Release", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Fire", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "StoneTh", kVstMaxParamStrLen); break;
case kParamF: vst_strncpy (text, "Attack", kVstMaxParamStrLen); break;
case kParamG: vst_strncpy (text, "Release", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "Stone", kVstMaxParamStrLen); break;
case kParamI: vst_strncpy (text, "Range", kVstMaxParamStrLen); break;
case kParamJ: vst_strncpy (text, "Ratio", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}
void StoneFireComp::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
case kParamF: float2string (F, text, kVstMaxParamStrLen); break;
case kParamG: float2string (G, text, kVstMaxParamStrLen); break;
case kParamH: float2string (H, text, kVstMaxParamStrLen); break;
case kParamI: float2string (I, text, kVstMaxParamStrLen); break;
case kParamJ: float2string (J, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}
void StoneFireComp::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;
case kParamG: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamH: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamI: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamJ: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}
VstInt32 StoneFireComp::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know
bool StoneFireComp::getEffectName(char* name) {
vst_strncpy(name, "StoneFireComp", kVstMaxProductStrLen); return true;
}
VstPlugCategory StoneFireComp::getPlugCategory() {return kPlugCategEffect;}
bool StoneFireComp::getProductString(char* text) {
vst_strncpy (text, "airwindows StoneFireComp", kVstMaxProductStrLen); return true;
}
bool StoneFireComp::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}

View file

@ -0,0 +1,97 @@
/* ========================================
* StoneFireComp - StoneFireComp.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) Airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __StoneFireComp_H
#define __StoneFireComp_H
#ifndef __audioeffect__
#include "audioeffectx.h"
#endif
#include <set>
#include <string>
#include <math.h>
enum {
kParamA =0,
kParamB =1,
kParamC =2,
kParamD =3,
kParamE =4,
kParamF =5,
kParamG =6,
kParamH =7,
kParamI =8,
kParamJ =9,
kNumParameters = 10
}; //
const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'stfc'; //Change this to what the AU identity is!
class StoneFireComp :
public AudioEffectX
{
public:
StoneFireComp(audioMasterCallback audioMaster);
~StoneFireComp();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;
float A;
float B;
float C;
float D;
float E;
float F;
float G;
float H;
float I;
float J;
enum {
prevSampL1, prevSlewL1, accSlewL1,
prevSampL2, prevSlewL2, accSlewL2,
prevSampL3, prevSlewL3, accSlewL3,
kalGainL, kalOutL,
prevSampR1, prevSlewR1, accSlewR1,
prevSampR2, prevSlewR2, accSlewR2,
prevSampR3, prevSlewR3, accSlewR3,
kalGainR, kalOutR,
kal_total
};
double kal[kal_total];
double fireCompL;
double fireCompR;
double stoneCompL;
double stoneCompR;
uint32_t fpdL;
uint32_t fpdR;
//default stuff
};
#endif

View file

@ -0,0 +1,312 @@
/* ========================================
* StoneFireComp - StoneFireComp.h
* Copyright (c) airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __StoneFireComp_H
#include "StoneFireComp.h"
#endif
void StoneFireComp::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double compFThresh = pow(A,4);
double compFAttack = 1.0/(((pow(B,3)*5000.0)+500.0)*overallscale);
double compFRelease = 1.0/(((pow(C,5)*50000.0)+500.0)*overallscale);
double fireGain = D*2.0; fireGain = pow(fireGain,3);
double firePad = fireGain; if (firePad > 1.0) firePad = 1.0;
double compSThresh = pow(E,4);
double compSAttack = 1.0/(((pow(F,3)*5000.0)+500.0)*overallscale);
double compSRelease = 1.0/(((pow(G,5)*50000.0)+500.0)*overallscale);
double stoneGain = H*2.0; stoneGain = pow(stoneGain,3);
double stonePad = stoneGain; if (stonePad > 1.0) stonePad = 1.0;
double kalman = 1.0-pow(I,2);
//crossover frequency between mid/bass
double compRatio = 1.0-pow(1.0-J,2);
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//begin KalmanL
double fireL = inputSampleL;
double temp = inputSampleL = inputSampleL*(1.0-kalman)*0.777;
inputSampleL *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewL3] += kal[prevSampL3] - kal[prevSampL2]; kal[prevSlewL3] *= 0.5;
kal[prevSlewL2] += kal[prevSampL2] - kal[prevSampL1]; kal[prevSlewL2] *= 0.5;
kal[prevSlewL1] += kal[prevSampL1] - inputSampleL; kal[prevSlewL1] *= 0.5;
//make slews from each set of samples used
kal[accSlewL2] += kal[prevSlewL3] - kal[prevSlewL2]; kal[accSlewL2] *= 0.5;
kal[accSlewL1] += kal[prevSlewL2] - kal[prevSlewL1]; kal[accSlewL1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewL3] += (kal[accSlewL2] - kal[accSlewL1]); kal[accSlewL3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutL] += kal[prevSampL1] + kal[prevSlewL2] + kal[accSlewL3]; kal[kalOutL] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainL] += fabs(temp-kal[kalOutL])*kalman*8.0; kal[kalGainL] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainL] > kalman*0.5) kal[kalGainL] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutL] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampL3] = kal[prevSampL2]; kal[prevSampL2] = kal[prevSampL1];
kal[prevSampL1] = (kal[kalGainL] * kal[kalOutL]) + ((1.0-kal[kalGainL])*temp);
//feed the chain of previous samples
if (kal[prevSampL1] > 1.0) kal[prevSampL1] = 1.0; if (kal[prevSampL1] < -1.0) kal[prevSampL1] = -1.0;
double stoneL = kal[kalOutL]*0.777;
fireL -= stoneL;
//end KalmanL
//begin KalmanR
double fireR = inputSampleR;
temp = inputSampleR = inputSampleR*(1.0-kalman)*0.777;
inputSampleR *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewR3] += kal[prevSampR3] - kal[prevSampR2]; kal[prevSlewR3] *= 0.5;
kal[prevSlewR2] += kal[prevSampR2] - kal[prevSampR1]; kal[prevSlewR2] *= 0.5;
kal[prevSlewR1] += kal[prevSampR1] - inputSampleR; kal[prevSlewR1] *= 0.5;
//make slews from each set of samples used
kal[accSlewR2] += kal[prevSlewR3] - kal[prevSlewR2]; kal[accSlewR2] *= 0.5;
kal[accSlewR1] += kal[prevSlewR2] - kal[prevSlewR1]; kal[accSlewR1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewR3] += (kal[accSlewR2] - kal[accSlewR1]); kal[accSlewR3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutR] += kal[prevSampR1] + kal[prevSlewR2] + kal[accSlewR3]; kal[kalOutR] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainR] += fabs(temp-kal[kalOutR])*kalman*8.0; kal[kalGainR] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainR] > kalman*0.5) kal[kalGainR] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutR] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampR3] = kal[prevSampR2]; kal[prevSampR2] = kal[prevSampR1];
kal[prevSampR1] = (kal[kalGainR] * kal[kalOutR]) + ((1.0-kal[kalGainR])*temp);
//feed the chain of previous samples
if (kal[prevSampR1] > 1.0) kal[prevSampR1] = 1.0; if (kal[prevSampR1] < -1.0) kal[prevSampR1] = -1.0;
double stoneR = kal[kalOutR]*0.777;
fireR -= stoneR;
//end KalmanR
//fire dynamics
if (fabs(fireL) > compFThresh) { //compression L
fireCompL -= (fireCompL * compFAttack);
fireCompL += ((compFThresh / fabs(fireL))*compFAttack);
} else fireCompL = (fireCompL*(1.0-compFRelease))+compFRelease;
if (fireCompL < 0.0) fireCompL = 0.0;
if (fabs(fireR) > compFThresh) { //compression R
fireCompR -= (fireCompR * compFAttack);
fireCompR += ((compFThresh / fabs(fireR))*compFAttack);
} else fireCompR = (fireCompR*(1.0-compFRelease))+compFRelease;
if (fireCompR < 0.0) fireCompR = 0.0;
if (fireCompL > fireCompR) fireCompL -= (fireCompL * compFAttack);
if (fireCompR > fireCompL) fireCompR -= (fireCompR * compFAttack);
if (fireCompL < 1.0) fireL *= (((1.0-compRatio)*firePad)+(fireCompL*compRatio*fireGain));
else fireL *= firePad;
if (fireCompR < 1.0) fireR *= (((1.0-compRatio)*firePad)+(fireCompR*compRatio*fireGain));
else fireR *= firePad;
//stone dynamics
if (fabs(stoneL) > compSThresh) { //compression L
stoneCompL -= (stoneCompL * compSAttack);
stoneCompL += ((compSThresh / fabs(stoneL))*compSAttack);
} else stoneCompL = (stoneCompL*(1.0-compSRelease))+compSRelease;
if (stoneCompL < 0.0) stoneCompL = 0.0;
if (fabs(stoneR) > compSThresh) { //compression R
stoneCompR -= (stoneCompR * compSAttack);
stoneCompR += ((compSThresh / fabs(stoneR))*compSAttack);
} else stoneCompR = (stoneCompR*(1.0-compSRelease))+compSRelease;
if (stoneCompR < 0.0) stoneCompR = 0.0;
if (stoneCompL > stoneCompR) stoneCompL -= (stoneCompL * compSAttack);
if (stoneCompR > stoneCompL) stoneCompR -= (stoneCompR * compSAttack);
if (stoneCompL < 1.0) stoneL *= (((1.0-compRatio)*stonePad)+(stoneCompL*compRatio*stoneGain));
else stoneL *= stonePad;
if (stoneCompR < 1.0) stoneR *= (((1.0-compRatio)*stonePad)+(stoneCompR*compRatio*stoneGain));
else stoneR *= stonePad;
inputSampleL = stoneL+fireL;
inputSampleR = stoneR+fireR;
//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
//end 32 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}
void StoneFireComp::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];
double overallscale = 1.0;
overallscale /= 44100.0;
overallscale *= getSampleRate();
double compFThresh = pow(A,4);
double compFAttack = 1.0/(((pow(B,3)*5000.0)+500.0)*overallscale);
double compFRelease = 1.0/(((pow(C,5)*50000.0)+500.0)*overallscale);
double fireGain = D*2.0; fireGain = pow(fireGain,3);
double firePad = fireGain; if (firePad > 1.0) firePad = 1.0;
double compSThresh = pow(E,4);
double compSAttack = 1.0/(((pow(F,3)*5000.0)+500.0)*overallscale);
double compSRelease = 1.0/(((pow(G,5)*50000.0)+500.0)*overallscale);
double stoneGain = H*2.0; stoneGain = pow(stoneGain,3);
double stonePad = stoneGain; if (stonePad > 1.0) stonePad = 1.0;
double kalman = 1.0-pow(I,2);
//crossover frequency between mid/bass
double compRatio = 1.0-pow(1.0-J,2);
while (--sampleFrames >= 0)
{
double inputSampleL = *in1;
double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-23) inputSampleL = fpdL * 1.18e-17;
if (fabs(inputSampleR)<1.18e-23) inputSampleR = fpdR * 1.18e-17;
//begin KalmanL
double fireL = inputSampleL;
double temp = inputSampleL = inputSampleL*(1.0-kalman)*0.777;
inputSampleL *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewL3] += kal[prevSampL3] - kal[prevSampL2]; kal[prevSlewL3] *= 0.5;
kal[prevSlewL2] += kal[prevSampL2] - kal[prevSampL1]; kal[prevSlewL2] *= 0.5;
kal[prevSlewL1] += kal[prevSampL1] - inputSampleL; kal[prevSlewL1] *= 0.5;
//make slews from each set of samples used
kal[accSlewL2] += kal[prevSlewL3] - kal[prevSlewL2]; kal[accSlewL2] *= 0.5;
kal[accSlewL1] += kal[prevSlewL2] - kal[prevSlewL1]; kal[accSlewL1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewL3] += (kal[accSlewL2] - kal[accSlewL1]); kal[accSlewL3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutL] += kal[prevSampL1] + kal[prevSlewL2] + kal[accSlewL3]; kal[kalOutL] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainL] += fabs(temp-kal[kalOutL])*kalman*8.0; kal[kalGainL] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainL] > kalman*0.5) kal[kalGainL] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutL] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampL3] = kal[prevSampL2]; kal[prevSampL2] = kal[prevSampL1];
kal[prevSampL1] = (kal[kalGainL] * kal[kalOutL]) + ((1.0-kal[kalGainL])*temp);
//feed the chain of previous samples
if (kal[prevSampL1] > 1.0) kal[prevSampL1] = 1.0; if (kal[prevSampL1] < -1.0) kal[prevSampL1] = -1.0;
double stoneL = kal[kalOutL]*0.777;
fireL -= stoneL;
//end KalmanL
//begin KalmanR
double fireR = inputSampleR;
temp = inputSampleR = inputSampleR*(1.0-kalman)*0.777;
inputSampleR *= (1.0-kalman);
//set up gain levels to control the beast
kal[prevSlewR3] += kal[prevSampR3] - kal[prevSampR2]; kal[prevSlewR3] *= 0.5;
kal[prevSlewR2] += kal[prevSampR2] - kal[prevSampR1]; kal[prevSlewR2] *= 0.5;
kal[prevSlewR1] += kal[prevSampR1] - inputSampleR; kal[prevSlewR1] *= 0.5;
//make slews from each set of samples used
kal[accSlewR2] += kal[prevSlewR3] - kal[prevSlewR2]; kal[accSlewR2] *= 0.5;
kal[accSlewR1] += kal[prevSlewR2] - kal[prevSlewR1]; kal[accSlewR1] *= 0.5;
//differences between slews: rate of change of rate of change
kal[accSlewR3] += (kal[accSlewR2] - kal[accSlewR1]); kal[accSlewR3] *= 0.5;
//entering the abyss, what even is this
kal[kalOutR] += kal[prevSampR1] + kal[prevSlewR2] + kal[accSlewR3]; kal[kalOutR] *= 0.5;
//resynthesizing predicted result (all iir smoothed)
kal[kalGainR] += fabs(temp-kal[kalOutR])*kalman*8.0; kal[kalGainR] *= 0.5;
//madness takes its toll. Kalman Gain: how much dry to retain
if (kal[kalGainR] > kalman*0.5) kal[kalGainR] = kalman*0.5;
//attempts to avoid explosions
kal[kalOutR] += (temp*(1.0-(0.68+(kalman*0.157))));
//this is for tuning a really complete cancellation up around Nyquist
kal[prevSampR3] = kal[prevSampR2]; kal[prevSampR2] = kal[prevSampR1];
kal[prevSampR1] = (kal[kalGainR] * kal[kalOutR]) + ((1.0-kal[kalGainR])*temp);
//feed the chain of previous samples
if (kal[prevSampR1] > 1.0) kal[prevSampR1] = 1.0; if (kal[prevSampR1] < -1.0) kal[prevSampR1] = -1.0;
double stoneR = kal[kalOutR]*0.777;
fireR -= stoneR;
//end KalmanR
//fire dynamics
if (fabs(fireL) > compFThresh) { //compression L
fireCompL -= (fireCompL * compFAttack);
fireCompL += ((compFThresh / fabs(fireL))*compFAttack);
} else fireCompL = (fireCompL*(1.0-compFRelease))+compFRelease;
if (fireCompL < 0.0) fireCompL = 0.0;
if (fabs(fireR) > compFThresh) { //compression R
fireCompR -= (fireCompR * compFAttack);
fireCompR += ((compFThresh / fabs(fireR))*compFAttack);
} else fireCompR = (fireCompR*(1.0-compFRelease))+compFRelease;
if (fireCompR < 0.0) fireCompR = 0.0;
if (fireCompL > fireCompR) fireCompL -= (fireCompL * compFAttack);
if (fireCompR > fireCompL) fireCompR -= (fireCompR * compFAttack);
if (fireCompL < 1.0) fireL *= (((1.0-compRatio)*firePad)+(fireCompL*compRatio*fireGain));
else fireL *= firePad;
if (fireCompR < 1.0) fireR *= (((1.0-compRatio)*firePad)+(fireCompR*compRatio*fireGain));
else fireR *= firePad;
//stone dynamics
if (fabs(stoneL) > compSThresh) { //compression L
stoneCompL -= (stoneCompL * compSAttack);
stoneCompL += ((compSThresh / fabs(stoneL))*compSAttack);
} else stoneCompL = (stoneCompL*(1.0-compSRelease))+compSRelease;
if (stoneCompL < 0.0) stoneCompL = 0.0;
if (fabs(stoneR) > compSThresh) { //compression R
stoneCompR -= (stoneCompR * compSAttack);
stoneCompR += ((compSThresh / fabs(stoneR))*compSAttack);
} else stoneCompR = (stoneCompR*(1.0-compSRelease))+compSRelease;
if (stoneCompR < 0.0) stoneCompR = 0.0;
if (stoneCompL > stoneCompR) stoneCompL -= (stoneCompL * compSAttack);
if (stoneCompR > stoneCompL) stoneCompR -= (stoneCompR * compSAttack);
if (stoneCompL < 1.0) stoneL *= (((1.0-compRatio)*stonePad)+(stoneCompL*compRatio*stoneGain));
else stoneL *= stonePad;
if (stoneCompR < 1.0) stoneR *= (((1.0-compRatio)*stonePad)+(stoneCompR*compRatio*stoneGain));
else stoneR *= stonePad;
inputSampleL = stoneL+fireL;
inputSampleR = stoneR+fireR;
//begin 64 bit stereo floating point dither
//int expon; frexp((double)inputSampleL, &expon);
fpdL ^= fpdL << 13; fpdL ^= fpdL >> 17; fpdL ^= fpdL << 5;
//inputSampleL += ((double(fpdL)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//frexp((double)inputSampleR, &expon);
fpdR ^= fpdR << 13; fpdR ^= fpdR >> 17; fpdR ^= fpdR << 5;
//inputSampleR += ((double(fpdR)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
//end 64 bit stereo floating point dither
*out1 = inputSampleL;
*out2 = inputSampleR;
in1++;
in2++;
out1++;
out2++;
}
}

View file

@ -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

View file

@ -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="StoneFireComp.cpp" />
<ClCompile Include="StoneFireCompProc.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="StoneFireComp.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{16F7AB3C-1AE0-4574-B60C-7B4DED82938C}</ProjectGuid>
<RootNamespace>VSTProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>StoneFireComp64</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>

View file

@ -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="StoneFireComp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="StoneFireCompProc.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="StoneFireComp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View file

@ -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>

View file

@ -0,0 +1,3 @@
EXPORTS
VSTPluginMain
main=VSTPluginMain