diff options
Diffstat (limited to 'plugins/LV2/src/BussColors4')
-rw-r--r-- | plugins/LV2/src/BussColors4/BussColors4.cpp | 68 | ||||
-rw-r--r-- | plugins/LV2/src/BussColors4/BussColors4.h | 51 | ||||
-rw-r--r-- | plugins/LV2/src/BussColors4/BussColors4.ttl | 68 | ||||
-rw-r--r-- | plugins/LV2/src/BussColors4/manifest.ttl.in | 6 |
4 files changed, 193 insertions, 0 deletions
diff --git a/plugins/LV2/src/BussColors4/BussColors4.cpp b/plugins/LV2/src/BussColors4/BussColors4.cpp new file mode 100644 index 0000000..1bcb13a --- /dev/null +++ b/plugins/LV2/src/BussColors4/BussColors4.cpp @@ -0,0 +1,68 @@ +#include "BussColors4.h" +#include <iostream> +#include <lv2wrapper.h> +#include <cmath> + +BussColors4::BussColors4(double rate) + : LV2Plugin(rate) +{ +} + +void BussColors4::activate() +{ + A = 0.0; + B = 0.5; + C = 0.5; + D = 1.0; + + for (int count = 0; count < 174; count++) {bL[count] = 0; bR[count] = 0;} + for (int count = 0; count < 99; count++) {dL[count] = 0; dR[count] = 0;} + for (int count = 0; count < 34; count++) c[count] = count; //initial setup for 44.1K + g[1] = pow(10.0, -5.2 / 14.0); //dark + g[2] = pow(10.0, -6.2 / 14.0); //rock + g[3] = pow(10.0, -2.9 / 14.0); //lush + g[4] = pow(10.0, -1.1 / 14.0); //vibe + g[5] = pow(10.0, -5.1 / 14.0); //holo + g[6] = pow(10.0, -3.6 / 14.0); //punch + g[7] = pow(10.0, -2.3 / 14.0); //steel + g[8] = pow(10.0, -2.9 / 14.0); //tube + //preset gains for models + outg[1] = pow(10.0, -0.3 / 14.0); //dark + outg[2] = pow(10.0, 0.5 / 14.0); //rock + outg[3] = pow(10.0, -0.7 / 14.0); //lush + outg[4] = pow(10.0, -0.6 / 14.0); //vibe + outg[5] = pow(10.0, -0.2 / 14.0); //holo + outg[6] = pow(10.0, 0.3 / 14.0); //punch + outg[7] = pow(10.0, 0.1 / 14.0); //steel + outg[8] = pow(10.0, 0.9 / 14.0); //tube + //preset gains for models + controlL = 0; + controlR = 0; + slowdynL = 0; + slowdynR = 0; + gcount = 0; + + fpNShapeL = 0.0; + fpNShapeR = 0.0; + //this is reset: values being initialized only once. Startup values, whatever they are. + +} + +void BussColors4::run(uint32_t num_samples) +{ + A = *params[0]; + B = *params[1]; + C = *params[2]; + D = *params[3]; + + processReplacing(const_cast<float **>(in), out, num_samples); +} + +// +// Include the processing code from the VST version. +// +#include <cmath> +#include "../../../LinuxVST/src/BussColors4/BussColors4Proc.cpp" + +// Create the LV2Wrapper and register the plugin +LV2Wrapper<BussColors4> plugin; diff --git a/plugins/LV2/src/BussColors4/BussColors4.h b/plugins/LV2/src/BussColors4/BussColors4.h new file mode 100644 index 0000000..ceec6e6 --- /dev/null +++ b/plugins/LV2/src/BussColors4/BussColors4.h @@ -0,0 +1,51 @@ +#ifndef __BussColors4_H +#define __BussColors4_H + +#include <lv2plugin.h> + +class BussColors4 : public LV2Plugin<4> { +public: + BussColors4(double rate); + + void activate(); + void run(uint32_t num_samples); + + static constexpr const char * URI = "https://www.airwindows.com/busscolors4"; + +private: + /* + * These are the original DSP functions from the VST plugin. + * They need to be called from the LV2 plugins `run` function. + */ + void processReplacing(float **in, float **out, VstInt32 samples); + void processDoubleReplacing(double **in, double **out, VstInt32 samples); + + /* + * Members needed by the processing functions. + */ + + double bL[175]; //full buffer for high sample rates. Scales to 192K + double bR[175]; //full buffer for high sample rates. Scales to 192K + double dL[100]; //buffer for calculating sag as it relates to the dynamic impulse synthesis. To 192K. + double dR[100]; //buffer for calculating sag as it relates to the dynamic impulse synthesis. To 192K. + int c[35]; //just the number of taps we use, doesn't have to scale + double g[9]; //console model + double outg[9]; //console model + double controlL; + double controlR; + double slowdynL; + double slowdynR; + int gcount; + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; + float D; //parameters. Always 0-1, and we scale/alter them elsewhere. + +}; + +#endif diff --git a/plugins/LV2/src/BussColors4/BussColors4.ttl b/plugins/LV2/src/BussColors4/BussColors4.ttl new file mode 100644 index 0000000..6728240 --- /dev/null +++ b/plugins/LV2/src/BussColors4/BussColors4.ttl @@ -0,0 +1,68 @@ +# Airwindows BussColors4 plugin description + +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix units: <http://lv2plug.in/ns/extensions/units#> . + +<https://www.airwindows.com/busscolors4> + a lv2:Plugin , + lv2:DistortionPlugin ; + lv2:project <https://www.airwindows.com> ; + + lv2:optionalFeature lv2:hardRTCapable ; + + # Define the ports for this plugin. + lv2:port [ + a lv2:InputPort , lv2:ControlPort ; + lv2:index 0 ; + lv2:symbol "A" ; + lv2:name "Color" ; + lv2:default 0.5 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:ControlPort ; + lv2:index 1 ; + lv2:symbol "B" ; + lv2:name "Input Trim" ; + lv2:default 0.5 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:ControlPort ; + lv2:index 2 ; + lv2:symbol "C" ; + lv2:name "Output Trim" ; + lv2:default 0.5 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:ControlPort ; + lv2:index 3 ; + lv2:symbol "D" ; + lv2:name "Dry/Wet" ; + lv2:default 0.5 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "in_l" ; + lv2:name "In left" ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 5 ; + lv2:symbol "in_r" ; + lv2:name "In right" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 6 ; + lv2:symbol "out_l" ; + lv2:name "Out left" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 7 ; + lv2:symbol "out_r" ; + lv2:name "Out right" ; + ] . diff --git a/plugins/LV2/src/BussColors4/manifest.ttl.in b/plugins/LV2/src/BussColors4/manifest.ttl.in new file mode 100644 index 0000000..b1bb555 --- /dev/null +++ b/plugins/LV2/src/BussColors4/manifest.ttl.in @@ -0,0 +1,6 @@ +airwindows:busscolors4 + a lv2:Plugin ; + doap:name "Airwindows BussColors4" ; + doap:license <http://opensource.org/licenses/mit> ; + lv2:binary <BussColors4@CMAKE_SHARED_LIBRARY_SUFFIX@> ; + rdfs:seeAlso <BussColors4.ttl> . |