169 changes: 169 additions & 0 deletions libs/airwindows/src/ADClip7.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/* ========================================
* ADClip7 - ADClip7.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __ADClip7_H
#include "ADClip7.h"
#endif

namespace ADClip7 {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ADClip7(audioMaster);}

ADClip7::ADClip7(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.0;
B = 0.5;
C = 0.5;
D = 0.0;

lastSampleL = 0.0;
lastSampleR = 0.0;
for(int count = 0; count < 22199; count++) {bL[count] = 0; bR[count] = 0;}
gcount = 0;
lowsL = 0;
lowsR = 0;
refclipL = 0.99;
refclipR = 0.99;
iirLowsAL = 0.0;
iirLowsAR = 0.0;
iirLowsBL = 0.0;
iirLowsBR = 0.0;

fpNShapeL = 0.0;
fpNShapeR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.

_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
_canDo.insert("x2in2out");
setNumInputs(kNumInputs);
setNumOutputs(kNumOutputs);
setUniqueID(kUniqueId);
canProcessReplacing(); // supports output replacing
canDoubleReplacing(); // supports double precision processing
programsAreChunks(true);
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}

ADClip7::~ADClip7() {}
VstInt32 ADClip7::getVendorVersion () {return 1000;}
void ADClip7::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void ADClip7::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);}
//airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than
//trying to do versioning and preventing people from using older versions. Maybe they like the old one!

static float pinParameter(float data)
{
if (data < 0.0f) return 0.0f;
if (data > 1.0f) return 1.0f;
return data;
}

VstInt32 ADClip7::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */

*data = chunkData;
return kNumParameters * sizeof(float);
}

VstInt32 ADClip7::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
/* We're ignoring byteSize as we found it to be a filthy liar */

/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}

void ADClip7::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}

float ADClip7::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}

void ADClip7::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Boost", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Soften", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Enhance", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Mode", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void ADClip7::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A*18.0, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: switch((VstInt32)( D * 2.999 )) //0 to almost edge of # of params
{case 0: vst_strncpy (text, "Normal", kVstMaxParamStrLen); break;
case 1: vst_strncpy (text, "Atten", kVstMaxParamStrLen); break;
case 2: vst_strncpy (text, "Clips", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}

void ADClip7::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "dB", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

VstInt32 ADClip7::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool ADClip7::getEffectName(char* name) {
vst_strncpy(name, "ADClip7", kVstMaxProductStrLen); return true;
}

VstPlugCategory ADClip7::getPlugCategory() {return kPlugCategEffect;}

bool ADClip7::getProductString(char* text) {
vst_strncpy (text, "airwindows ADClip7", kVstMaxProductStrLen); return true;
}

bool ADClip7::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace ADClip7

86 changes: 86 additions & 0 deletions libs/airwindows/src/ADClip7.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/* ========================================
* ADClip7 - ADClip7.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __ADClip7_H
#define __ADClip7_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace ADClip7 {

enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kNumParameters = 4
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'adcr'; //Change this to what the AU identity is!

class ADClip7 :
public AudioEffectX
{
public:
ADClip7(audioMasterCallback audioMaster);
~ADClip7();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;

long double fpNShapeL;
long double fpNShapeR;
//default stuff
long double lastSampleL;
long double lastSampleR;
float bL[22200];
float bR[22200];
int gcount;
double lowsL;
double lowsR;
double iirLowsAL;
double iirLowsAR;
double iirLowsBL;
double iirLowsBR;
long double refclipL;
long double refclipR;

float A;
float B;
float C;
float D;

};

} // end namespace ADClip7

#endif
935 changes: 935 additions & 0 deletions libs/airwindows/src/ADClip7Proc.cpp

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions libs/airwindows/src/Apicolypse.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/* ========================================
* Apicolypse - Apicolypse.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __Apicolypse_H
#include "Apicolypse.h"
#endif

namespace Apicolypse {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Apicolypse(audioMaster);}

Apicolypse::Apicolypse(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.70;
B = 0.3333333;
C = 0.3333333;
D = 1.0;
for(int count = 0; count < 34; count++) {bR[count] = 0;bL[count] = 0;}
lastSampleR = 0.0;lastSampleL = 0.0;

fpd = 17;
//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
}

Apicolypse::~Apicolypse() {}
VstInt32 Apicolypse::getVendorVersion () {return 1000;}
void Apicolypse::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void Apicolypse::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 Apicolypse::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */

*data = chunkData;
return kNumParameters * sizeof(float);
}

VstInt32 Apicolypse::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
/* We're ignoring byteSize as we found it to be a filthy liar */

/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}

void Apicolypse::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}

float Apicolypse::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}

void Apicolypse::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Hardns", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Persnlty", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Output", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void Apicolypse::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B*3.0, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C*3.0, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}

void Apicolypse::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

VstInt32 Apicolypse::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool Apicolypse::getEffectName(char* name) {
vst_strncpy(name, "Apicolypse", kVstMaxProductStrLen); return true;
}

VstPlugCategory Apicolypse::getPlugCategory() {return kPlugCategEffect;}

bool Apicolypse::getProductString(char* text) {
vst_strncpy (text, "airwindows Apicolypse", kVstMaxProductStrLen); return true;
}

bool Apicolypse::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace Apicolypse

76 changes: 76 additions & 0 deletions libs/airwindows/src/Apicolypse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* ========================================
* Apicolypse - Apicolypse.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __Apicolypse_H
#define __Apicolypse_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace Apicolypse {

enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kNumParameters = 4
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'apic'; //Change this to what the AU identity is!

class Apicolypse :
public AudioEffectX
{
public:
Apicolypse(audioMasterCallback audioMaster);
~Apicolypse();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;

double bR[35];
double lastSampleR;
double bL[35];
double lastSampleL;
uint32_t fpd;
//default stuff

float A;
float B;
float C;
float D;

};

} // end namespace Apicolypse

#endif
367 changes: 367 additions & 0 deletions libs/airwindows/src/ApicolypseProc.cpp

Large diffs are not rendered by default.

196 changes: 196 additions & 0 deletions libs/airwindows/src/BassDrive.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
/* ========================================
* BassDrive - BassDrive.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BassDrive_H
#include "BassDrive.h"
#endif

namespace BassDrive {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BassDrive(audioMaster);}

BassDrive::BassDrive(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.5;
C = 0.5;
D = 0.5;
E = 0.5;
for (int fcount = 0; fcount < 7; fcount++)
{
presenceInAL[fcount] = 0.0;
presenceOutAL[fcount] = 0.0;
highInAL[fcount] = 0.0;
highOutAL[fcount] = 0.0;
midInAL[fcount] = 0.0;
midOutAL[fcount] = 0.0;
lowInAL[fcount] = 0.0;
lowOutAL[fcount] = 0.0;
presenceInBL[fcount] = 0.0;
presenceOutBL[fcount] = 0.0;
highInBL[fcount] = 0.0;
highOutBL[fcount] = 0.0;
midInBL[fcount] = 0.0;
midOutBL[fcount] = 0.0;
lowInBL[fcount] = 0.0;
lowOutBL[fcount] = 0.0;

presenceInAR[fcount] = 0.0;
presenceOutAR[fcount] = 0.0;
highInAR[fcount] = 0.0;
highOutAR[fcount] = 0.0;
midInAR[fcount] = 0.0;
midOutAR[fcount] = 0.0;
lowInAR[fcount] = 0.0;
lowOutAR[fcount] = 0.0;
presenceInBR[fcount] = 0.0;
presenceOutBR[fcount] = 0.0;
highInBR[fcount] = 0.0;
highOutBR[fcount] = 0.0;
midInBR[fcount] = 0.0;
midOutBR[fcount] = 0.0;
lowInBR[fcount] = 0.0;
lowOutBR[fcount] = 0.0;
}
flip = false;


fpd = 17;
//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
}

BassDrive::~BassDrive() {}
VstInt32 BassDrive::getVendorVersion () {return 1000;}
void BassDrive::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BassDrive::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 BassDrive::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
chunkData[4] = E;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */

*data = chunkData;
return kNumParameters * sizeof(float);
}

VstInt32 BassDrive::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
E = pinParameter(chunkData[4]);
/* We're ignoring byteSize as we found it to be a filthy liar */

/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}

void BassDrive::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
case kParamE: E = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}

float BassDrive::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
case kParamE: return E; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}

void BassDrive::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Presnce", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "High", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Mid", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Low", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "Drive", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void BassDrive::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
case kParamE: float2string (E, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}

void BassDrive::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamE: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

VstInt32 BassDrive::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool BassDrive::getEffectName(char* name) {
vst_strncpy(name, "BassDrive", kVstMaxProductStrLen); return true;
}

VstPlugCategory BassDrive::getPlugCategory() {return kPlugCategEffect;}

bool BassDrive::getProductString(char* text) {
vst_strncpy (text, "airwindows BassDrive", kVstMaxProductStrLen); return true;
}

bool BassDrive::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace BassDrive

109 changes: 109 additions & 0 deletions libs/airwindows/src/BassDrive.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/* ========================================
* BassDrive - BassDrive.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __BassDrive_H
#define __BassDrive_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace BassDrive {

enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kParamE = 4,
kNumParameters = 5
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'bsdr'; //Change this to what the AU identity is!

class BassDrive :
public AudioEffectX
{
public:
BassDrive(audioMasterCallback audioMaster);
~BassDrive();
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;

uint32_t fpd;
//default stuff
double presenceInAL[7];
double presenceOutAL[7];
double highInAL[7];
double highOutAL[7];
double midInAL[7];
double midOutAL[7];
double lowInAL[7];
double lowOutAL[7];
double presenceInBL[7];
double presenceOutBL[7];
double highInBL[7];
double highOutBL[7];
double midInBL[7];
double midOutBL[7];
double lowInBL[7];
double lowOutBL[7];

double presenceInAR[7];
double presenceOutAR[7];
double highInAR[7];
double highOutAR[7];
double midInAR[7];
double midOutAR[7];
double lowInAR[7];
double lowOutAR[7];
double presenceInBR[7];
double presenceOutBR[7];
double highInBR[7];
double highOutBR[7];
double midInBR[7];
double midOutBR[7];
double lowInBR[7];
double lowOutBR[7];

bool flip;

float A;
float B;
float C;
float D;
float E; //parameters. Always 0-1, and we scale/alter them elsewhere.

};

} // end namespace BassDrive

#endif
663 changes: 663 additions & 0 deletions libs/airwindows/src/BassDriveProc.cpp

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions libs/airwindows/src/BitGlitter.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/* ========================================
* BitGlitter - BitGlitter.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BitGlitter_H
#include "BitGlitter.h"
#endif

namespace BitGlitter {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BitGlitter(audioMaster);}

BitGlitter::BitGlitter(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.5;
B = 0.0;
C = 0.5;
D = 1.0;

fpNShapeL = 0.0;
fpNShapeR = 0.0;

ataLastSampleL = 0.0;
ataHalfwaySampleL = 0.0;
lastSampleL = 0.0;
heldSampleAL = 0.0;
positionAL = 0.0;
heldSampleBL = 0.0;
positionBL = 0.0;
lastOutputSampleL = 0.0;

ataLastSampleR = 0.0;
ataHalfwaySampleR = 0.0;
lastSampleR = 0.0;
heldSampleAR = 0.0;
positionAR = 0.0;
heldSampleBR = 0.0;
positionBR = 0.0;
lastOutputSampleR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.

_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
_canDo.insert("x2in2out");
setNumInputs(kNumInputs);
setNumOutputs(kNumOutputs);
setUniqueID(kUniqueId);
canProcessReplacing(); // supports output replacing
canDoubleReplacing(); // supports double precision processing
programsAreChunks(true);
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}

BitGlitter::~BitGlitter() {}
VstInt32 BitGlitter::getVendorVersion () {return 1000;}
void BitGlitter::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BitGlitter::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 BitGlitter::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */

*data = chunkData;
return kNumParameters * sizeof(float);
}

VstInt32 BitGlitter::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
/* We're ignoring byteSize as we found it to be a filthy liar */

/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}

void BitGlitter::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}

float BitGlitter::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}

void BitGlitter::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Input", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Glitter", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Output", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void BitGlitter::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string ((A * 36.0)-18.0, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string ((C * 36.0)-18.0, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}

void BitGlitter::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

VstInt32 BitGlitter::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool BitGlitter::getEffectName(char* name) {
vst_strncpy(name, "BitGlitter", kVstMaxProductStrLen); return true;
}

VstPlugCategory BitGlitter::getPlugCategory() {return kPlugCategEffect;}

bool BitGlitter::getProductString(char* text) {
vst_strncpy (text, "airwindows BitGlitter", kVstMaxProductStrLen); return true;
}

bool BitGlitter::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace BitGlitter

92 changes: 92 additions & 0 deletions libs/airwindows/src/BitGlitter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* ========================================
* BitGlitter - BitGlitter.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __BitGlitter_H
#define __BitGlitter_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace BitGlitter {

enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kNumParameters = 4
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'btgt'; //Change this to what the AU identity is!

class BitGlitter :
public AudioEffectX
{
public:
BitGlitter(audioMasterCallback audioMaster);
~BitGlitter();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;

long double fpNShapeL;
long double fpNShapeR;

double ataLastSampleL;
double ataHalfwaySampleL;
double ataDrySampleL;
double lastSampleL;
double heldSampleAL;
double heldSampleBL;
double positionAL;
double positionBL;
double lastOutputSampleL;

double ataLastSampleR;
double ataHalfwaySampleR;
double ataDrySampleR;
double lastSampleR;
double heldSampleAR;
double heldSampleBR;
double positionAR;
double positionBR;
double lastOutputSampleR;
//there is no noise shaping on this one, it uses all sorts of quantization to get its sound

float A;
float B;
float C;
float D;
};

} // end namespace BitGlitter

#endif
445 changes: 445 additions & 0 deletions libs/airwindows/src/BitGlitterProc.cpp

Large diffs are not rendered by default.

175 changes: 175 additions & 0 deletions libs/airwindows/src/BlockParty.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
/* ========================================
* BlockParty - BlockParty.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BlockParty_H
#include "BlockParty.h"
#endif

namespace BlockParty {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BlockParty(audioMaster);}

BlockParty::BlockParty(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.0;
B = 1.0;
fpd = 17;

muSpeedAL = 10000;
muSpeedBL = 10000;
muSpeedCL = 10000;
muSpeedDL = 10000;
muSpeedEL = 10000;
muCoefficientAL = 1;
muCoefficientBL = 1;
muCoefficientCL = 1;
muCoefficientDL = 1;
muCoefficientEL = 1;
lastCoefficientAL = 1;
lastCoefficientBL = 1;
lastCoefficientCL = 1;
lastCoefficientDL = 1;
mergedCoefficientsL = 1;
thresholdL = 1.0;
thresholdBL = 1.0;
muVaryL = 1;

muSpeedAR = 10000;
muSpeedBR = 10000;
muSpeedCR = 10000;
muSpeedDR = 10000;
muSpeedER = 10000;
muCoefficientAR = 1;
muCoefficientBR = 1;
muCoefficientCR = 1;
muCoefficientDR = 1;
muCoefficientER = 1;
lastCoefficientAR = 1;
lastCoefficientBR = 1;
lastCoefficientCR = 1;
lastCoefficientDR = 1;
mergedCoefficientsR = 1;
thresholdR = 1.0;
thresholdBR = 1.0;
muVaryR = 1;

count = 1;
fpFlip = true;

//this is reset: values being initialized only once. Startup values, whatever they are.

_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
_canDo.insert("x2in2out");
setNumInputs(kNumInputs);
setNumOutputs(kNumOutputs);
setUniqueID(kUniqueId);
canProcessReplacing(); // supports output replacing
canDoubleReplacing(); // supports double precision processing
programsAreChunks(true);
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}

BlockParty::~BlockParty() {}
VstInt32 BlockParty::getVendorVersion () {return 1000;}
void BlockParty::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BlockParty::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 BlockParty::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 BlockParty::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 BlockParty::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 BlockParty::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 BlockParty::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Pound", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void BlockParty::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 BlockParty::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 BlockParty::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool BlockParty::getEffectName(char* name) {
vst_strncpy(name, "BlockParty", kVstMaxProductStrLen); return true;
}

VstPlugCategory BlockParty::getPlugCategory() {return kPlugCategEffect;}

bool BlockParty::getProductString(char* text) {
vst_strncpy (text, "airwindows BlockParty", kVstMaxProductStrLen); return true;
}

bool BlockParty::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace BlockParty

112 changes: 112 additions & 0 deletions libs/airwindows/src/BlockParty.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/* ========================================
* BlockParty - BlockParty.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __BlockParty_H
#define __BlockParty_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace BlockParty {

enum {
kParamA = 0,
kParamB = 1,
kNumParameters = 2
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'blok'; //Change this to what the AU identity is!

class BlockParty :
public AudioEffectX
{
public:
BlockParty(audioMasterCallback audioMaster);
~BlockParty();
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;

uint32_t fpd;
//default stuff

float A;
float B;

double muVaryL;
double muAttackL;
double muNewSpeedL;
double muSpeedAL;
double muSpeedBL;
double muSpeedCL;
double muSpeedDL;
double muSpeedEL;
double muCoefficientAL;
double muCoefficientBL;
double muCoefficientCL;
double muCoefficientDL;
double muCoefficientEL;
double lastCoefficientAL;
double lastCoefficientBL;
double lastCoefficientCL;
double lastCoefficientDL;
double mergedCoefficientsL;
double thresholdL;
double thresholdBL;

double muVaryR;
double muAttackR;
double muNewSpeedR;
double muSpeedAR;
double muSpeedBR;
double muSpeedCR;
double muSpeedDR;
double muSpeedER;
double muCoefficientAR;
double muCoefficientBR;
double muCoefficientCR;
double muCoefficientDR;
double muCoefficientER;
double lastCoefficientAR;
double lastCoefficientBR;
double lastCoefficientCR;
double lastCoefficientDR;
double mergedCoefficientsR;
double thresholdR;
double thresholdBR;

int count;
bool fpFlip;
};

} // end namespace BlockParty

#endif
1,137 changes: 1,137 additions & 0 deletions libs/airwindows/src/BlockPartyProc.cpp

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions libs/airwindows/src/BrassRider.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/* ========================================
* BrassRider - BrassRider.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BrassRider_H
#include "BrassRider.h"
#endif

namespace BrassRider {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BrassRider(audioMaster);}

BrassRider::BrassRider(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
A = 0.0;
B = 0.0;
for(int count = 0; count < 80001; count++) {d[count] = 0.0; e[count] = 0.0;}
control = 0.0;
clamp = 0.0;
highIIRL = 0.0;
slewIIRL = 0.0;
highIIR2L = 0.0;
slewIIR2L = 0.0;
lastSampleL = 0.0;
lastSlewL = 0.0;
highIIRR = 0.0;
slewIIRR = 0.0;
highIIR2R = 0.0;
slewIIR2R = 0.0;
lastSampleR = 0.0;
lastSlewR = 0.0;
gcount = 0;
fpd = 17;
//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
}

BrassRider::~BrassRider() {}
VstInt32 BrassRider::getVendorVersion () {return 1000;}
void BrassRider::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BrassRider::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 BrassRider::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 BrassRider::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 BrassRider::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 BrassRider::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 BrassRider::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Thresh", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void BrassRider::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 BrassRider::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 BrassRider::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool BrassRider::getEffectName(char* name) {
vst_strncpy(name, "BrassRider", kVstMaxProductStrLen); return true;
}

VstPlugCategory BrassRider::getPlugCategory() {return kPlugCategEffect;}

bool BrassRider::getProductString(char* text) {
vst_strncpy (text, "airwindows BrassRider", kVstMaxProductStrLen); return true;
}

bool BrassRider::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace BrassRider

84 changes: 84 additions & 0 deletions libs/airwindows/src/BrassRider.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* ========================================
* BrassRider - BrassRider.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __BrassRider_H
#define __BrassRider_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace BrassRider {

enum {
kParamA = 0,
kParamB = 1,
kNumParameters = 2
}; //

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'brsr'; //Change this to what the AU identity is!

class BrassRider :
public AudioEffectX
{
public:
BrassRider(audioMasterCallback audioMaster);
~BrassRider();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;

double d[80002];
double e[80002];
double highIIRL;
double slewIIRL;
double highIIR2L;
double slewIIR2L;
double highIIRR;
double slewIIRR;
double highIIR2R;
double slewIIR2R;
double control;
double clamp;
double lastSampleL;
double lastSlewL;
double lastSampleR;
double lastSlewR;
int gcount;
uint32_t fpd;
//default stuff

float A;
float B;
};

} // end namespace BrassRider

#endif
299 changes: 299 additions & 0 deletions libs/airwindows/src/BrassRiderProc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
/* ========================================
* BrassRider - BrassRider.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BrassRider_H
#include "BrassRider.h"
#endif

namespace BrassRider {


void BrassRider::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];

double limitOut = A*16;
int offsetA = 13500;
int offsetB = 16700;
double wet = B;

while (--sampleFrames >= 0)
{
long double inputSampleL = *in1;
long double inputSampleR = *in2;

static int noisesourceL = 0;
static int noisesourceR = 850010;
int residue;
double applyresidue;

noisesourceL = noisesourceL % 1700021; noisesourceL++;
residue = noisesourceL * noisesourceL;
residue = residue % 170003; residue *= residue;
residue = residue % 17011; residue *= residue;
residue = residue % 1709; residue *= residue;
residue = residue % 173; residue *= residue;
residue = residue % 17;
applyresidue = residue;
applyresidue *= 0.00000001;
applyresidue *= 0.00000001;
inputSampleL += applyresidue;
if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) {
inputSampleL -= applyresidue;
}

noisesourceR = noisesourceR % 1700021; noisesourceR++;
residue = noisesourceR * noisesourceR;
residue = residue % 170003; residue *= residue;
residue = residue % 17011; residue *= residue;
residue = residue % 1709; residue *= residue;
residue = residue % 173; residue *= residue;
residue = residue % 17;
applyresidue = residue;
applyresidue *= 0.00000001;
applyresidue *= 0.00000001;
inputSampleR += applyresidue;
if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) {
inputSampleR -= applyresidue;
}
//for live air, we always apply the dither noise. Then, if our result is
//effectively digital black, we'll subtract it again. We want a 'air' hiss
long double drySampleL = inputSampleL;
long double drySampleR = inputSampleR;

inputSampleL *= limitOut;
highIIRL = (highIIRL*0.5);
highIIRL += (inputSampleL*0.5);
inputSampleL -= highIIRL;
highIIR2L = (highIIR2L*0.5);
highIIR2L += (inputSampleL*0.5);
inputSampleL -= highIIR2L;
long double slewSampleL = fabs(inputSampleL - lastSampleL);
lastSampleL = inputSampleL;
slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2;
slewIIRL = (slewIIRL*0.5);
slewIIRL += (slewSampleL*0.5);
slewSampleL = fabs(slewSampleL - slewIIRL);
slewIIR2L = (slewIIR2L*0.5);
slewIIR2L += (slewSampleL*0.5);
slewSampleL = fabs(slewSampleL - slewIIR2L);
long double bridgerectifier = slewSampleL;
//there's the left channel, now to feed it to overall clamp

if (bridgerectifier > 3.1415) bridgerectifier = 0.0;
bridgerectifier = sin(bridgerectifier);
if (gcount < 0 || gcount > 40000) {gcount = 40000;}
d[gcount+40000] = d[gcount] = bridgerectifier;
control += (d[gcount] / (offsetA+1));
control -= (d[gcount+offsetA] / offsetA);
double ramp = (control*control) * 16.0;
e[gcount+40000] = e[gcount] = ramp;
clamp += (e[gcount] / (offsetB+1));
clamp -= (e[gcount+offsetB] / offsetB);
if (clamp > wet*8) clamp = wet*8;
gcount--;

inputSampleR *= limitOut;
highIIRR = (highIIRR*0.5);
highIIRR += (inputSampleR*0.5);
inputSampleR -= highIIRR;
highIIR2R = (highIIR2R*0.5);
highIIR2R += (inputSampleR*0.5);
inputSampleR -= highIIR2R;
long double slewSampleR = fabs(inputSampleR - lastSampleR);
lastSampleR = inputSampleR;
slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2;
slewIIRR = (slewIIRR*0.5);
slewIIRR += (slewSampleR*0.5);
slewSampleR = fabs(slewSampleR - slewIIRR);
slewIIR2R = (slewIIR2R*0.5);
slewIIR2R += (slewSampleR*0.5);
slewSampleR = fabs(slewSampleR - slewIIR2R);
bridgerectifier = slewSampleR;
//there's the right channel, now to feed it to overall clamp

if (bridgerectifier > 3.1415) bridgerectifier = 0.0;
bridgerectifier = sin(bridgerectifier);
if (gcount < 0 || gcount > 40000) {gcount = 40000;}
d[gcount+40000] = d[gcount] = bridgerectifier;
control += (d[gcount] / (offsetA+1));
control -= (d[gcount+offsetA] / offsetA);
ramp = (control*control) * 16.0;
e[gcount+40000] = e[gcount] = ramp;
clamp += (e[gcount] / (offsetB+1));
clamp -= (e[gcount+offsetB] / offsetB);
if (clamp > wet*8) clamp = wet*8;
gcount--;

inputSampleL = (drySampleL * (1.0-wet)) + (drySampleL * clamp * wet * 16.0);
inputSampleR = (drySampleR * (1.0-wet)) + (drySampleR * clamp * wet * 16.0);

//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleR += ((double(fpd)-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 BrassRider::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];

double limitOut = A*16;
int offsetA = 13500;
int offsetB = 16700;
double wet = B;

while (--sampleFrames >= 0)
{
long double inputSampleL = *in1;
long double inputSampleR = *in2;

static int noisesourceL = 0;
static int noisesourceR = 850010;
int residue;
double applyresidue;

noisesourceL = noisesourceL % 1700021; noisesourceL++;
residue = noisesourceL * noisesourceL;
residue = residue % 170003; residue *= residue;
residue = residue % 17011; residue *= residue;
residue = residue % 1709; residue *= residue;
residue = residue % 173; residue *= residue;
residue = residue % 17;
applyresidue = residue;
applyresidue *= 0.00000001;
applyresidue *= 0.00000001;
inputSampleL += applyresidue;
if (inputSampleL<1.2e-38 && -inputSampleL<1.2e-38) {
inputSampleL -= applyresidue;
}

noisesourceR = noisesourceR % 1700021; noisesourceR++;
residue = noisesourceR * noisesourceR;
residue = residue % 170003; residue *= residue;
residue = residue % 17011; residue *= residue;
residue = residue % 1709; residue *= residue;
residue = residue % 173; residue *= residue;
residue = residue % 17;
applyresidue = residue;
applyresidue *= 0.00000001;
applyresidue *= 0.00000001;
inputSampleR += applyresidue;
if (inputSampleR<1.2e-38 && -inputSampleR<1.2e-38) {
inputSampleR -= applyresidue;
}
//for live air, we always apply the dither noise. Then, if our result is
//effectively digital black, we'll subtract it again. We want a 'air' hiss
long double drySampleL = inputSampleL;
long double drySampleR = inputSampleR;

inputSampleL *= limitOut;
highIIRL = (highIIRL*0.5);
highIIRL += (inputSampleL*0.5);
inputSampleL -= highIIRL;
highIIR2L = (highIIR2L*0.5);
highIIR2L += (inputSampleL*0.5);
inputSampleL -= highIIR2L;
long double slewSampleL = fabs(inputSampleL - lastSampleL);
lastSampleL = inputSampleL;
slewSampleL /= fabs(inputSampleL * lastSampleL)+0.2;
slewIIRL = (slewIIRL*0.5);
slewIIRL += (slewSampleL*0.5);
slewSampleL = fabs(slewSampleL - slewIIRL);
slewIIR2L = (slewIIR2L*0.5);
slewIIR2L += (slewSampleL*0.5);
slewSampleL = fabs(slewSampleL - slewIIR2L);
long double bridgerectifier = slewSampleL;
//there's the left channel, now to feed it to overall clamp

if (bridgerectifier > 3.1415) bridgerectifier = 0.0;
bridgerectifier = sin(bridgerectifier);
if (gcount < 0 || gcount > 40000) {gcount = 40000;}
d[gcount+40000] = d[gcount] = bridgerectifier;
control += (d[gcount] / (offsetA+1));
control -= (d[gcount+offsetA] / offsetA);
double ramp = (control*control) * 16.0;
e[gcount+40000] = e[gcount] = ramp;
clamp += (e[gcount] / (offsetB+1));
clamp -= (e[gcount+offsetB] / offsetB);
if (clamp > wet*8) clamp = wet*8;
gcount--;

inputSampleR *= limitOut;
highIIRR = (highIIRR*0.5);
highIIRR += (inputSampleR*0.5);
inputSampleR -= highIIRR;
highIIR2R = (highIIR2R*0.5);
highIIR2R += (inputSampleR*0.5);
inputSampleR -= highIIR2R;
long double slewSampleR = fabs(inputSampleR - lastSampleR);
lastSampleR = inputSampleR;
slewSampleR /= fabs(inputSampleR * lastSampleR)+0.2;
slewIIRR = (slewIIRR*0.5);
slewIIRR += (slewSampleR*0.5);
slewSampleR = fabs(slewSampleR - slewIIRR);
slewIIR2R = (slewIIR2R*0.5);
slewIIR2R += (slewSampleR*0.5);
slewSampleR = fabs(slewSampleR - slewIIR2R);
bridgerectifier = slewSampleR;
//there's the right channel, now to feed it to overall clamp

if (bridgerectifier > 3.1415) bridgerectifier = 0.0;
bridgerectifier = sin(bridgerectifier);
if (gcount < 0 || gcount > 40000) {gcount = 40000;}
d[gcount+40000] = d[gcount] = bridgerectifier;
control += (d[gcount] / (offsetA+1));
control -= (d[gcount+offsetA] / offsetA);
ramp = (control*control) * 16.0;
e[gcount+40000] = e[gcount] = ramp;
clamp += (e[gcount] / (offsetB+1));
clamp -= (e[gcount+offsetB] / offsetB);
if (clamp > wet*8) clamp = wet*8;
gcount--;

inputSampleL = (drySampleL * (1.0-wet)) + (drySampleL * clamp * wet * 16.0);
inputSampleR = (drySampleR * (1.0-wet)) + (drySampleR * clamp * wet * 16.0);

//begin 64 bit stereo floating point dither
int expon; frexp((double)inputSampleL, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
frexp((double)inputSampleR, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleR += ((double(fpd)-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++;
}
}


} // end namespace BrassRider

152 changes: 152 additions & 0 deletions libs/airwindows/src/BrightAmbience2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/* ========================================
* BrightAmbience2 - BrightAmbience2.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BrightAmbience2_H
#include "BrightAmbience2.h"
#endif

namespace BrightAmbience2 {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new BrightAmbience2(audioMaster);}

BrightAmbience2::BrightAmbience2(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
for(int count = 0; count < 32767; count++) {pL[count] = 0.0; pR[count] = 0.0;}
feedbackA = feedbackB = feedbackC = 0.0;
gcount = 0;
A = 0.2;
B = 0.2;
C = 0.0;
D = 0.5;
fpd = 17;
//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
}

BrightAmbience2::~BrightAmbience2() {}
VstInt32 BrightAmbience2::getVendorVersion () {return 1000;}
void BrightAmbience2::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void BrightAmbience2::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 BrightAmbience2::getChunk (void** data, bool isPreset)
{
float *chunkData = (float *)calloc(kNumParameters, sizeof(float));
chunkData[0] = A;
chunkData[1] = B;
chunkData[2] = C;
chunkData[3] = D;
/* Note: The way this is set up, it will break if you manage to save settings on an Intel
machine and load them on a PPC Mac. However, it's fine if you stick to the machine you
started with. */

*data = chunkData;
return kNumParameters * sizeof(float);
}

VstInt32 BrightAmbience2::setChunk (void* data, VstInt32 byteSize, bool isPreset)
{
float *chunkData = (float *)data;
A = pinParameter(chunkData[0]);
B = pinParameter(chunkData[1]);
C = pinParameter(chunkData[2]);
D = pinParameter(chunkData[3]);
/* We're ignoring byteSize as we found it to be a filthy liar */

/* calculate any other fields you need here - you could copy in
code from setParameter() here. */
return 0;
}

void BrightAmbience2::setParameter(VstInt32 index, float value) {
switch (index) {
case kParamA: A = value; break;
case kParamB: B = value; break;
case kParamC: C = value; break;
case kParamD: D = value; break;
default: throw; // unknown parameter, shouldn't happen!
}
}

float BrightAmbience2::getParameter(VstInt32 index) {
switch (index) {
case kParamA: return A; break;
case kParamB: return B; break;
case kParamC: return C; break;
case kParamD: return D; break;
default: break; // unknown parameter, shouldn't happen!
} return 0.0; //we only need to update the relevant name, this is simple to manage
}

void BrightAmbience2::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Start", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Length", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "Feedbck", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "Dry/Wet", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this is our labels for displaying in the VST host
}

void BrightAmbience2::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B, text, kVstMaxParamStrLen); break;
case kParamC: float2string (C, text, kVstMaxParamStrLen); break;
case kParamD: float2string (D, text, kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
} //this displays the values and handles 'popups' where it's discrete choices
}

void BrightAmbience2::getParameterLabel(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamC: vst_strncpy (text, "", kVstMaxParamStrLen); break;
case kParamD: vst_strncpy (text, "", kVstMaxParamStrLen); break;
default: break; // unknown parameter, shouldn't happen!
}
}

VstInt32 BrightAmbience2::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool BrightAmbience2::getEffectName(char* name) {
vst_strncpy(name, "BrightAmbience2", kVstMaxProductStrLen); return true;
}

VstPlugCategory BrightAmbience2::getPlugCategory() {return kPlugCategEffect;}

bool BrightAmbience2::getProductString(char* text) {
vst_strncpy (text, "airwindows BrightAmbience2", kVstMaxProductStrLen); return true;
}

bool BrightAmbience2::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace BrightAmbience2

81 changes: 81 additions & 0 deletions libs/airwindows/src/BrightAmbience2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* ========================================
* BrightAmbience2 - BrightAmbience2.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __BrightAmbience2_H
#define __BrightAmbience2_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace BrightAmbience2 {

enum {
kParamA = 0,
kParamB = 1,
kParamC = 2,
kParamD = 3,
kNumParameters = 4
};

static int primeL[] = {5, 5, 13, 17, 37, 41, 61, 67, 89, 109, 131, 157, 181, 191, 223, 241, 281, 283, 337, 353, 373, 401, 433, 461, 521, 547, 569, 587, 601, 617, 719, 739, 787, 797, 863, 877, 929, 967, 997, 1031, 1069, 1087, 1163, 1171, 1213, 1217, 1301, 1409, 1439, 1447, 1481, 1499, 1531, 1597, 1627, 1669, 1733, 1741, 1789, 1823, 1861, 1913, 2029, 2063, 2083, 2099, 2237, 2269, 2347, 2351, 2383, 2417, 2503, 2549, 2617, 2647, 2687, 2719, 2753, 2803, 2903, 2909, 3011, 3019, 3079, 3109, 3181, 3229, 3271, 3299, 3323, 3407, 3491, 3517, 3571, 3593, 3643, 3733, 3767, 3911, 3947, 4027, 4093, 4133, 4157, 4217, 4283, 4339, 4409, 4421, 4481, 4517, 4561, 4567, 4673, 4759, 4789, 4801, 4889, 4933, 4951, 5021, 5077, 5107, 5197, 5281, 5387, 5441, 5507, 5557, 5639, 5651, 5711, 5749, 5807, 5851, 5879, 6037, 6121, 6217, 6247, 6311, 6329, 6353, 6367, 6469, 6607, 6653, 6673, 6691, 6827, 6841, 6869, 6899, 7069, 7109, 7207, 7283, 7369, 7417, 7487, 7523, 7621, 7649, 7703, 7753, 7853, 7883, 8017, 8059, 8111, 8117, 8231, 8233, 8291, 8377, 8419, 8513, 8537, 8581, 8731, 8747, 8779, 8807, 8861, 8923, 9001, 9041, 9109, 9293, 9323, 9403, 9463, 9539, 9623, 9661, 9743, 9833, 9871, 9923,10007, 10009, 10091, 10169, 10271, 10433, 10459, 10487, 10567, 10589, 10639, 10663, 10691, 10723, 10859, 10861, 10937, 11257, 11317, 11369, 11467, 11633, 11777, 11867, 11923, 11927, 11959, 12007, 12101, 12113, 12149, 12203, 12323, 12409, 12433, 12457, 12487, 12503, 12553, 12647, 12781, 12841, 12967, 13003, 13043, 13103, 13177, 13217, 13307, 13331, 13477, 13513, 13597, 13613, 13669, 13693, 13711, 13757, 13873, 14051, 14143, 14159, 14197, 14437, 14489, 14503, 14593, 14713, 14731, 14783, 14869, 14923, 14983, 15061, 15233, 15271, 15307, 15313, 15427, 15511, 15643, 15683, 15859, 15973, 16063, 16073, 16097, 16127, 16183, 16253, 16417, 16451, 16529, 16693, 16729, 16901, 16927, 17117, 17191, 17291, 17341, 17377, 17389, 17417, 17489, 17539, 17657, 17659, 17783, 17911, 17989, 18049, 18169, 18181, 18223, 18229, 18313, 18433, 18451, 18617, 18671, 18719, 18773, 18787, 18919, 19013, 19219, 19433, 19469, 19501, 19583, 19759, 19793, 19819, 19919, 20047, 20071, 20107, 20173, 20231, 20323, 20341, 20443, 20477, 20731, 20759, 20789, 20873, 20903, 20959, 21101, 21149, 21187, 21191, 21277, 21317, 21383, 21493, 21557, 21587, 21737, 21757, 21821, 21937, 22031, 22067, 22109, 22367, 22567, 22651, 22727, 22751, 22817, 22853, 22921, 23087, 23227, 23251, 23447, 23539, 23567, 23669, 23813, 23887, 23909, 23929, 24023, 24071, 24109, 24137, 24151, 24203, 24251, 24391, 24419, 24443, 24509, 24659, 24671, 24793, 24859, 24919, 25057, 25169, 25301, 25309, 25357, 25411, 25423, 25603, 25733, 25771, 25841, 25931, 25969, 26017, 26189, 26267, 26371, 26431, 26489, 26597, 26693, 26801, 26921, 26959, 27017, 27077, 27091, 27449, 27457, 27583, 27689, 27737, 27809, 27851, 27943, 28069, 28109, 28283, 28307, 28403, 28573, 28649, 28657, 28813, 29101, 29147, 29153, 29287, 29333, 29387, 29483, 29573, 29641, 29717, 29803, 30089, 30091, 30119, 30133, 30259, 30557, 30593, 30661, 30713, 30781, 30839, 30869, 30893, 31033, 31079, 31181, 31193, 31267, 31307, 31489, 31517, 31667, 31741, 32003, 32159, 32233, 32297, 32299, 32327, 32341, 32537, 32603, 32749};
static int primeR[] = {3, 7, 11, 19, 31, 43, 59, 71, 83, 113, 127, 163, 179, 193, 211, 251, 277, 293, 331, 359, 367, 409, 431, 463, 509, 557, 563, 593, 599, 619, 709, 743, 773, 809, 859, 881, 919, 971, 991, 1033, 1063, 1091, 1153, 1181, 1201, 1223, 1297, 1423, 1433, 1451, 1471, 1511, 1523, 1601, 1621, 1693, 1723, 1747, 1787, 1831, 1847, 1931, 2027, 2069, 2081, 2111, 2221, 2273, 2341, 2357, 2381, 2423, 2477, 2551, 2609, 2657, 2683, 2729, 2749, 2819, 2897, 2917, 3001, 3023, 3067, 3119, 3169, 3251, 3259, 3301, 3319, 3413, 3469, 3527, 3559, 3607, 3637, 3739, 3761, 3917, 3943, 4049, 4091, 4139, 4153, 4219, 4273, 4349, 4397, 4423, 4463, 4519, 4549, 4583, 4663, 4783, 4787, 4813, 4877, 4937, 4943, 5023, 5059, 5113, 5189, 5297, 5381, 5443, 5503, 5563, 5623, 5653, 5701, 5779, 5801, 5857, 5869, 6043, 6113, 6221, 6229, 6317, 6323, 6359, 6361, 6473, 6599, 6659, 6661, 6701, 6823, 6857, 6863, 6907, 7057, 7121, 7193, 7297, 7351, 7433, 7481, 7529, 7607, 7669, 7699, 7757, 7841, 7901, 8011, 8069, 8101, 8123, 8221, 8237, 8287, 8387, 8389, 8521, 8527, 8597, 8719, 8753, 8761, 8819, 8849, 8929, 8999, 9043, 9103, 9311, 9319, 9413, 9461, 9547, 9619, 9677, 9739, 9839, 9859, 9929, 9973, 10037, 10079, 10177, 10267, 10453, 10457, 10499, 10559, 10597, 10631, 10667, 10687, 10729, 10853, 10867, 10909, 11261, 11311, 11383, 11447, 11657, 11743, 11887, 11909, 11933, 11953, 12011, 12097, 12119, 12143, 12211, 12301, 12413, 12421, 12473, 12479, 12511, 12547, 12653, 12763, 12853, 12959, 13007, 13037, 13109, 13171, 13219, 13297, 13337, 13469, 13523, 13591, 13619, 13649, 13697, 13709, 13759, 13859, 14057, 14107, 14173, 14177, 14447, 14479, 14519, 14591, 14717, 14723, 14797, 14867, 14929, 14969, 15073, 15227, 15277, 15299, 15319, 15413, 15527, 15641, 15727, 15823, 15991, 16061, 16087, 16091, 16139, 16141, 16267, 16411, 16453, 16519, 16699, 16703, 16903, 16921, 17123, 17189, 17293, 17333, 17383, 17387, 17419, 17483, 17551, 17627, 17669, 17761, 17921, 17987, 18059, 18149, 18191, 18217, 18233, 18311, 18439, 18443, 18637, 18661, 18731, 18757, 18793, 18917, 19031, 19213, 19441, 19463, 19507, 19577, 19763, 19777, 19841, 19913, 20051, 20063, 20113, 20161, 20233, 20297, 20347, 20441, 20479, 20719, 20771, 20773, 20879, 20899, 20963, 21089, 21157, 21179, 21193, 21269, 21319, 21379, 21499, 21529, 21589, 21727, 21767, 21817, 21943, 22027, 22073, 22093, 22369, 22549, 22669, 22721, 22769, 22811, 22859, 22907, 23099, 23209, 23269, 23431, 23549, 23563, 23671, 23801, 23893, 23899, 23957, 24019, 24077, 24107, 24133, 24169, 24197, 24281, 24379, 24421, 24439, 24517, 24631, 24677, 24781, 24877, 24917, 25073, 25163, 25303, 25307, 25367, 25409, 25439, 25601, 25741, 25763, 25847, 25919, 25981, 26003, 26203, 26263, 26387, 26423, 26497, 26591, 26699, 26783, 26927, 26953, 27031, 27073, 27103, 27437, 27479, 27581, 27691, 27733, 27817, 27847, 27947, 28057, 28111, 28279, 28309, 28393, 28579, 28643, 28661, 28807, 29123, 29137, 29167, 29269, 29339, 29383, 29501, 29569, 29663, 29683, 29819, 30071, 30097, 30113, 30137, 30253, 30559, 30577, 30671, 30707, 30803, 30829, 30871, 30881, 31039, 31069, 31183, 31189, 31271, 31277, 31511, 31513, 31687, 31729, 32009, 32143, 32237, 32261, 32303, 32323, 32353, 32533, 32609, 32719};
//these arrays go from 0 to primeL[489] = 32719 which is almost 32767

const int kNumPrograms = 0;
const int kNumInputs = 2;
const int kNumOutputs = 2;
const unsigned long kUniqueId = 'brac'; //Change this to what the AU identity is!

class BrightAmbience2 :
public AudioEffectX
{
public:
BrightAmbience2(audioMasterCallback audioMaster);
~BrightAmbience2();
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;

uint32_t fpd;
//default stuff
int gcount;
float pL[32768];
float pR[32768];
long double feedbackA;
long double feedbackB;
long double feedbackC;

float A;
float B;
float C;
float D;
};

} // end namespace BrightAmbience2

#endif
151 changes: 151 additions & 0 deletions libs/airwindows/src/BrightAmbience2Proc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/* ========================================
* BrightAmbience2 - BrightAmbience2.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __BrightAmbience2_H
#include "BrightAmbience2.h"
#endif

namespace BrightAmbience2 {


void BrightAmbience2::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
{
float* in1 = inputs[0];
float* in2 = inputs[1];
float* out1 = outputs[0];
float* out2 = outputs[1];

int start = (int)(pow(A,2) * 480)+1;
int length = (int)(pow(B,2) * 480)+1;
if (start + length > 488) start = 488-length;
double feedbackAmount = 1.0-(pow(1.0-C,2));
double wet = D;

while (--sampleFrames >= 0)
{
long double inputSampleL = *in1;
long double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-37) inputSampleL = fpd * 1.18e-37;
if (fabs(inputSampleR)<1.18e-37) inputSampleR = fpd * 1.18e-37;
long double drySampleL = inputSampleL;
long double drySampleR = inputSampleR;
long double tempL = 0.0;
long double tempR = 0.0;

if (gcount < 0 || gcount > 32767) gcount = 32767;
int count = gcount;

pL[count] = inputSampleL + ((sin(feedbackA)/sqrt(length+1))*feedbackAmount);
pR[count] = inputSampleR + ((sin(feedbackB)/sqrt(length+1))*feedbackAmount);

for(int offset = start; offset < start+length; offset++) {
tempL += pL[count+primeL[offset] - ((count+primeL[offset] > 32767)?32768:0)];
tempR += pR[count+primeR[offset] - ((count+primeR[offset] > 32767)?32768:0)];
}

inputSampleL = tempL/sqrt(length);
inputSampleR = tempR/sqrt(length);

feedbackA = (feedbackA * (1.0-feedbackAmount)) + (inputSampleR * feedbackAmount);
feedbackB = (feedbackB * (1.0-feedbackAmount)) + (inputSampleL * feedbackAmount);

gcount--;

if (wet != 1.0) {
inputSampleL = (inputSampleL * wet) + (drySampleL * (1.0-wet));
inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet));
}
//Dry/Wet control, defaults to the last slider

//begin 32 bit stereo floating point dither
int expon; frexpf((float)inputSampleL, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 5.5e-36l * pow(2,expon+62));
frexpf((float)inputSampleR, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleR += ((double(fpd)-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 BrightAmbience2::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames)
{
double* in1 = inputs[0];
double* in2 = inputs[1];
double* out1 = outputs[0];
double* out2 = outputs[1];

int start = (int)(pow(A,2) * 480)+1;
int length = (int)(pow(B,2) * 480)+1;
if (start + length > 488) start = 488-length;
double feedbackAmount = 1.0-(pow(1.0-C,2));
double wet = D;

while (--sampleFrames >= 0)
{
long double inputSampleL = *in1;
long double inputSampleR = *in2;
if (fabs(inputSampleL)<1.18e-43) inputSampleL = fpd * 1.18e-43;
if (fabs(inputSampleR)<1.18e-43) inputSampleR = fpd * 1.18e-43;
long double drySampleL = inputSampleL;
long double drySampleR = inputSampleR;
long double tempL = 0.0;
long double tempR = 0.0;

if (gcount < 0 || gcount > 32767) gcount = 32767;
int count = gcount;

pL[count] = inputSampleL + ((sin(feedbackA)/sqrt(length+1))*feedbackAmount);
pR[count] = inputSampleR + ((sin(feedbackB)/sqrt(length+1))*feedbackAmount);

for(int offset = start; offset < start+length; offset++) {
tempL += pL[count+primeL[offset] - ((count+primeL[offset] > 32767)?32768:0)];
tempR += pR[count+primeR[offset] - ((count+primeR[offset] > 32767)?32768:0)];
}

inputSampleL = tempL/sqrt(length);
inputSampleR = tempR/sqrt(length);

feedbackA = (feedbackA * (1.0-feedbackAmount)) + (inputSampleR * feedbackAmount);
feedbackB = (feedbackB * (1.0-feedbackAmount)) + (inputSampleL * feedbackAmount);

gcount--;

if (wet != 1.0) {
inputSampleL = (inputSampleL * wet) + (drySampleL * (1.0-wet));
inputSampleR = (inputSampleR * wet) + (drySampleR * (1.0-wet));
}
//Dry/Wet control, defaults to the last slider

//begin 64 bit stereo floating point dither
int expon; frexp((double)inputSampleL, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleL += ((double(fpd)-uint32_t(0x7fffffff)) * 1.1e-44l * pow(2,expon+62));
frexp((double)inputSampleR, &expon);
fpd ^= fpd << 13; fpd ^= fpd >> 17; fpd ^= fpd << 5;
inputSampleR += ((double(fpd)-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++;
}
}


} // end namespace BrightAmbience2

159 changes: 159 additions & 0 deletions libs/airwindows/src/ButterComp2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/* ========================================
* ButterComp2 - ButterComp2.h
* Copyright (c) 2016 airwindows, All rights reserved
* ======================================== */

#ifndef __ButterComp2_H
#include "ButterComp2.h"
#endif

namespace ButterComp2 {


// AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new ButterComp2(audioMaster);}

ButterComp2::ButterComp2(audioMasterCallback audioMaster) :
AudioEffectX(audioMaster, kNumPrograms, kNumParameters)
{
controlAposL = 1.0;
controlAnegL = 1.0;
controlBposL = 1.0;
controlBnegL = 1.0;
targetposL = 1.0;
targetnegL = 1.0;
lastOutputL = 0.0;

controlAposR = 1.0;
controlAnegR = 1.0;
controlBposR = 1.0;
controlBnegR = 1.0;
targetposR = 1.0;
targetnegR = 1.0;
lastOutputR = 0.0;

flip = false;
A = 0.0;
B = 0.5;
C = 1.0;
fpNShapeL = 0.0;
fpNShapeR = 0.0;
//this is reset: values being initialized only once. Startup values, whatever they are.

_canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect.
_canDo.insert("plugAsSend"); // plug-in can be used as a send effect.
_canDo.insert("x2in2out");
setNumInputs(kNumInputs);
setNumOutputs(kNumOutputs);
setUniqueID(kUniqueId);
canProcessReplacing(); // supports output replacing
canDoubleReplacing(); // supports double precision processing
programsAreChunks(true);
vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name
}

ButterComp2::~ButterComp2() {}
VstInt32 ButterComp2::getVendorVersion () {return 1000;}
void ButterComp2::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);}
void ButterComp2::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 ButterComp2::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 ButterComp2::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 ButterComp2::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 ButterComp2::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 ButterComp2::getParameterName(VstInt32 index, char *text) {
switch (index) {
case kParamA: vst_strncpy (text, "Compress", kVstMaxParamStrLen); break;
case kParamB: vst_strncpy (text, "Output", 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 ButterComp2::getParameterDisplay(VstInt32 index, char *text) {
switch (index) {
case kParamA: float2string (A, text, kVstMaxParamStrLen); break;
case kParamB: float2string (B*2.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 ButterComp2::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 ButterComp2::canDo(char *text)
{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know

bool ButterComp2::getEffectName(char* name) {
vst_strncpy(name, "ButterComp2", kVstMaxProductStrLen); return true;
}

VstPlugCategory ButterComp2::getPlugCategory() {return kPlugCategEffect;}

bool ButterComp2::getProductString(char* text) {
vst_strncpy (text, "airwindows ButterComp2", kVstMaxProductStrLen); return true;
}

bool ButterComp2::getVendorString(char* text) {
vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true;
}


} // end namespace ButterComp2

86 changes: 86 additions & 0 deletions libs/airwindows/src/ButterComp2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/* ========================================
* ButterComp2 - ButterComp2.h
* Created 8/12/11 by SPIAdmin
* Copyright (c) 2011 __MyCompanyName__, All rights reserved
* ======================================== */

#ifndef __ButterComp2_H
#define __ButterComp2_H

#ifndef __audioeffect__
#include "audioeffect_airwinstub.h"
#endif

#include <set>
#include <string>
#include <math.h>

namespace ButterComp2 {

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 = 'btcq'; //Change this to what the AU identity is!

class ButterComp2 :
public AudioEffectX
{
public:
ButterComp2(audioMasterCallback audioMaster);
~ButterComp2();
virtual bool getEffectName(char* name); // The plug-in name
virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in
virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg
virtual bool getVendorString(char* text); // Vendor info
virtual VstInt32 getVendorVersion(); // Version number
virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames);
virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames);
virtual void getProgramName(char *name); // read the name from the host
virtual void setProgramName(char *name); // changes the name of the preset displayed in the host
virtual VstInt32 getChunk (void** data, bool isPreset);
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset);
virtual float getParameter(VstInt32 index); // get the parameter value at the specified index
virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value
virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB)
virtual void getParameterName(VstInt32 index, char *text); // name of the parameter
virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value
virtual VstInt32 canDo(char *text);
private:
char _programName[kVstMaxProgNameLen + 1];
std::set< std::string > _canDo;

long double controlAposL;
long double controlAnegL;
long double controlBposL;
long double controlBnegL;
long double targetposL;
long double targetnegL;
long double lastOutputL;
long double controlAposR;
long double controlAnegR;
long double controlBposR;
long double controlBnegR;
long double targetposR;
long double targetnegR;
long double lastOutputR;
bool flip;
long double fpNShapeL;
long double fpNShapeR;
//default stuff

float A;
float B;
float C;

};

} // end namespace ButterComp2

#endif
Loading