diff options
Diffstat (limited to 'plugins/LinuxVST/src')
-rwxr-xr-x | plugins/LinuxVST/src/RawGlitters/RawGlitters.cpp | 83 | ||||
-rwxr-xr-x | plugins/LinuxVST/src/RawGlitters/RawGlitters.h | 60 | ||||
-rwxr-xr-x | plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp | 86 | ||||
-rwxr-xr-x | plugins/LinuxVST/src/RawTimbers/RawTimbers.cpp | 83 | ||||
-rwxr-xr-x | plugins/LinuxVST/src/RawTimbers/RawTimbers.h | 60 | ||||
-rwxr-xr-x | plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp | 86 |
6 files changed, 458 insertions, 0 deletions
diff --git a/plugins/LinuxVST/src/RawGlitters/RawGlitters.cpp b/plugins/LinuxVST/src/RawGlitters/RawGlitters.cpp new file mode 100755 index 0000000..0429460 --- /dev/null +++ b/plugins/LinuxVST/src/RawGlitters/RawGlitters.cpp @@ -0,0 +1,83 @@ +/* ======================================== + * RawGlitters - RawGlitters.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __RawGlitters_H +#include "RawGlitters.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new RawGlitters(audioMaster);} + +RawGlitters::RawGlitters(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + lastSampleL = 0.0; + lastSample2L = 0.0; + lastSampleR = 0.0; + lastSample2R = 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 +} + +RawGlitters::~RawGlitters() {} +VstInt32 RawGlitters::getVendorVersion () {return 1000;} +void RawGlitters::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void RawGlitters::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 RawGlitters::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + *data = chunkData; + return kNumParameters * sizeof(float); +} + +VstInt32 RawGlitters::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + return 0; +} + +void RawGlitters::setParameter(VstInt32 index, float value) { +} + +float RawGlitters::getParameter(VstInt32 index) { + return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void RawGlitters::getParameterName(VstInt32 index, char *text) { +} + +void RawGlitters::getParameterDisplay(VstInt32 index, char *text) { +} + +void RawGlitters::getParameterLabel(VstInt32 index, char *text) { +} + +VstInt32 RawGlitters::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool RawGlitters::getEffectName(char* name) { + vst_strncpy(name, "RawGlitters", kVstMaxProductStrLen); return true; +} + +VstPlugCategory RawGlitters::getPlugCategory() {return kPlugCategEffect;} + +bool RawGlitters::getProductString(char* text) { + vst_strncpy (text, "airwindows RawGlitters", kVstMaxProductStrLen); return true; +} + +bool RawGlitters::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/LinuxVST/src/RawGlitters/RawGlitters.h b/plugins/LinuxVST/src/RawGlitters/RawGlitters.h new file mode 100755 index 0000000..1a8752d --- /dev/null +++ b/plugins/LinuxVST/src/RawGlitters/RawGlitters.h @@ -0,0 +1,60 @@ +/* ======================================== + * RawGlitters - RawGlitters.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __RawGlitters_H +#define __RawGlitters_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'ragt'; //Change this to what the AU identity is! + +class RawGlitters : + public AudioEffectX +{ +public: + RawGlitters(audioMasterCallback audioMaster); + ~RawGlitters(); + virtual bool getEffectName(char* name); // The plug-in name + virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in + virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + virtual void getProgramName(char *name); // read the name from the host + virtual void setProgramName(char *name); // changes the name of the preset displayed in the host + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + virtual float getParameter(VstInt32 index); // get the parameter value at the specified index + virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value + virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) + virtual void getParameterName(VstInt32 index, char *text); // name of the parameter + virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + double lastSampleL; + double lastSample2L; + double lastSampleR; + double lastSample2R; +}; + +#endif diff --git a/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp b/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp new file mode 100755 index 0000000..41d2bf7 --- /dev/null +++ b/plugins/LinuxVST/src/RawGlitters/RawGlittersProc.cpp @@ -0,0 +1,86 @@ +/* ======================================== + * RawGlitters - RawGlitters.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __RawGlitters_H +#include "RawGlitters.h" +#endif + +void RawGlitters::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1 * 8388608.0; + double inputSampleR = *in2 * 8388608.0; + double outputSampleL; + double outputSampleR; + + inputSampleL += 0.381966011250105; + inputSampleR += 0.381966011250105; + + if ((lastSampleL+lastSampleL) <= (inputSampleL+lastSample2L)) outputSampleL = floor(lastSampleL); + else outputSampleL = floor(lastSampleL+1.0); //round down or up based on whether it softens treble angles + + if ((lastSampleR+lastSampleR) <= (inputSampleR+lastSample2R)) outputSampleR = floor(lastSampleR); + else outputSampleR = floor(lastSampleR+1.0); //round down or up based on whether it softens treble angles + + lastSample2L = lastSampleL; + lastSampleL = inputSampleL; //we retain three samples in a row + + lastSample2R = lastSampleR; + lastSampleR = inputSampleR; //we retain three samples in a row + + *out1 = outputSampleL / 8388608.0; + *out2 = outputSampleR / 8388608.0; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void RawGlitters::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1 * 8388608.0; + double inputSampleR = *in2 * 8388608.0; + double outputSampleL; + double outputSampleR; + + inputSampleL += 0.381966011250105; + inputSampleR += 0.381966011250105; + + if ((lastSampleL+lastSampleL) <= (inputSampleL+lastSample2L)) outputSampleL = floor(lastSampleL); + else outputSampleL = floor(lastSampleL+1.0); //round down or up based on whether it softens treble angles + + if ((lastSampleR+lastSampleR) <= (inputSampleR+lastSample2R)) outputSampleR = floor(lastSampleR); + else outputSampleR = floor(lastSampleR+1.0); //round down or up based on whether it softens treble angles + + lastSample2L = lastSampleL; + lastSampleL = inputSampleL; //we retain three samples in a row + + lastSample2R = lastSampleR; + lastSampleR = inputSampleR; //we retain three samples in a row + + *out1 = outputSampleL / 8388608.0; + *out2 = outputSampleR / 8388608.0; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} diff --git a/plugins/LinuxVST/src/RawTimbers/RawTimbers.cpp b/plugins/LinuxVST/src/RawTimbers/RawTimbers.cpp new file mode 100755 index 0000000..d1fde12 --- /dev/null +++ b/plugins/LinuxVST/src/RawTimbers/RawTimbers.cpp @@ -0,0 +1,83 @@ +/* ======================================== + * RawTimbers - RawTimbers.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __RawTimbers_H +#include "RawTimbers.h" +#endif + +AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new RawTimbers(audioMaster);} + +RawTimbers::RawTimbers(audioMasterCallback audioMaster) : + AudioEffectX(audioMaster, kNumPrograms, kNumParameters) +{ + lastSampleL = 0.0; + lastSample2L = 0.0; + lastSampleR = 0.0; + lastSample2R = 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 +} + +RawTimbers::~RawTimbers() {} +VstInt32 RawTimbers::getVendorVersion () {return 1000;} +void RawTimbers::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} +void RawTimbers::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 RawTimbers::getChunk (void** data, bool isPreset) +{ + float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); + *data = chunkData; + return kNumParameters * sizeof(float); +} + +VstInt32 RawTimbers::setChunk (void* data, VstInt32 byteSize, bool isPreset) +{ + return 0; +} + +void RawTimbers::setParameter(VstInt32 index, float value) { +} + +float RawTimbers::getParameter(VstInt32 index) { + return 0.0; //we only need to update the relevant name, this is simple to manage +} + +void RawTimbers::getParameterName(VstInt32 index, char *text) { +} + +void RawTimbers::getParameterDisplay(VstInt32 index, char *text) { +} + +void RawTimbers::getParameterLabel(VstInt32 index, char *text) { +} + +VstInt32 RawTimbers::canDo(char *text) +{ return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know + +bool RawTimbers::getEffectName(char* name) { + vst_strncpy(name, "RawTimbers", kVstMaxProductStrLen); return true; +} + +VstPlugCategory RawTimbers::getPlugCategory() {return kPlugCategEffect;} + +bool RawTimbers::getProductString(char* text) { + vst_strncpy (text, "airwindows RawTimbers", kVstMaxProductStrLen); return true; +} + +bool RawTimbers::getVendorString(char* text) { + vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; +} diff --git a/plugins/LinuxVST/src/RawTimbers/RawTimbers.h b/plugins/LinuxVST/src/RawTimbers/RawTimbers.h new file mode 100755 index 0000000..6d9f646 --- /dev/null +++ b/plugins/LinuxVST/src/RawTimbers/RawTimbers.h @@ -0,0 +1,60 @@ +/* ======================================== + * RawTimbers - RawTimbers.h + * Created 8/12/11 by SPIAdmin + * Copyright (c) 2011 __MyCompanyName__, All rights reserved + * ======================================== */ + +#ifndef __RawTimbers_H +#define __RawTimbers_H + +#ifndef __audioeffect__ +#include "audioeffectx.h" +#endif + +#include <set> +#include <string> +#include <math.h> + +enum { + kNumParameters = 0 +}; // + +const int kNumPrograms = 0; +const int kNumInputs = 2; +const int kNumOutputs = 2; +const unsigned long kUniqueId = 'ratb'; //Change this to what the AU identity is! + +class RawTimbers : + public AudioEffectX +{ +public: + RawTimbers(audioMasterCallback audioMaster); + ~RawTimbers(); + virtual bool getEffectName(char* name); // The plug-in name + virtual VstPlugCategory getPlugCategory(); // The general category for the plug-in + virtual bool getProductString(char* text); // This is a unique plug-in string provided by Steinberg + virtual bool getVendorString(char* text); // Vendor info + virtual VstInt32 getVendorVersion(); // Version number + virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); + virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); + virtual void getProgramName(char *name); // read the name from the host + virtual void setProgramName(char *name); // changes the name of the preset displayed in the host + virtual VstInt32 getChunk (void** data, bool isPreset); + virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset); + virtual float getParameter(VstInt32 index); // get the parameter value at the specified index + virtual void setParameter(VstInt32 index, float value); // set the parameter at index to value + virtual void getParameterLabel(VstInt32 index, char *text); // label for the parameter (eg dB) + virtual void getParameterName(VstInt32 index, char *text); // name of the parameter + virtual void getParameterDisplay(VstInt32 index, char *text); // text description of the current value + virtual VstInt32 canDo(char *text); +private: + char _programName[kVstMaxProgNameLen + 1]; + std::set< std::string > _canDo; + + double lastSampleL; + double lastSample2L; + double lastSampleR; + double lastSample2R; +}; + +#endif diff --git a/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp b/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp new file mode 100755 index 0000000..5647259 --- /dev/null +++ b/plugins/LinuxVST/src/RawTimbers/RawTimbersProc.cpp @@ -0,0 +1,86 @@ +/* ======================================== + * RawTimbers - RawTimbers.h + * Copyright (c) 2016 airwindows, All rights reserved + * ======================================== */ + +#ifndef __RawTimbers_H +#include "RawTimbers.h" +#endif + +void RawTimbers::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames) +{ + float* in1 = inputs[0]; + float* in2 = inputs[1]; + float* out1 = outputs[0]; + float* out2 = outputs[1]; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1 * 8388608.0; + double inputSampleR = *in2 * 8388608.0; + double outputSampleL; + double outputSampleR; + + inputSampleL += 0.381966011250105; + inputSampleR += 0.381966011250105; + + if ((lastSampleL+lastSampleL) >= (inputSampleL+lastSample2L)) outputSampleL = floor(lastSampleL); + else outputSampleL = floor(lastSampleL+1.0); //round down or up based on whether it softens treble angles + + if ((lastSampleR+lastSampleR) >= (inputSampleR+lastSample2R)) outputSampleR = floor(lastSampleR); + else outputSampleR = floor(lastSampleR+1.0); //round down or up based on whether it softens treble angles + + lastSample2L = lastSampleL; + lastSampleL = inputSampleL; //we retain three samples in a row + + lastSample2R = lastSampleR; + lastSampleR = inputSampleR; //we retain three samples in a row + + *out1 = outputSampleL / 8388608.0; + *out2 = outputSampleR / 8388608.0; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} + +void RawTimbers::processDoubleReplacing(double **inputs, double **outputs, VstInt32 sampleFrames) +{ + double* in1 = inputs[0]; + double* in2 = inputs[1]; + double* out1 = outputs[0]; + double* out2 = outputs[1]; + + while (--sampleFrames >= 0) + { + double inputSampleL = *in1 * 8388608.0; + double inputSampleR = *in2 * 8388608.0; + double outputSampleL; + double outputSampleR; + + inputSampleL += 0.381966011250105; + inputSampleR += 0.381966011250105; + + if ((lastSampleL+lastSampleL) >= (inputSampleL+lastSample2L)) outputSampleL = floor(lastSampleL); + else outputSampleL = floor(lastSampleL+1.0); //round down or up based on whether it softens treble angles + + if ((lastSampleR+lastSampleR) >= (inputSampleR+lastSample2R)) outputSampleR = floor(lastSampleR); + else outputSampleR = floor(lastSampleR+1.0); //round down or up based on whether it softens treble angles + + lastSample2L = lastSampleL; + lastSampleL = inputSampleL; //we retain three samples in a row + + lastSample2R = lastSampleR; + lastSampleR = inputSampleR; //we retain three samples in a row + + *out1 = outputSampleL / 8388608.0; + *out2 = outputSampleR / 8388608.0; + + *in1++; + *in2++; + *out1++; + *out2++; + } +} |