diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-07-21 22:46:15 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-07-21 22:46:15 +0200 |
commit | 77101140984ec2a9b2547987ceb01ba1f98bd544 (patch) | |
tree | 807cf7250383d9d287c1003d64fa2b2f4291316b | |
parent | 87e60a7db4d81c8548a753e7c9c7c0d6eec2065b (diff) | |
download | airwindows-lv2-port-77101140984ec2a9b2547987ceb01ba1f98bd544.tar.gz airwindows-lv2-port-77101140984ec2a9b2547987ceb01ba1f98bd544.tar.bz2 airwindows-lv2-port-77101140984ec2a9b2547987ceb01ba1f98bd544.zip |
LV2: Add Atmosphere plugins (buss and channel.)
-rwxr-xr-x | plugins/LV2/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.cpp | 40 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.h | 77 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.ttl | 44 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereBuss/manifest.ttl.in | 12 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.cpp | 40 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.h | 76 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.ttl | 44 | ||||
-rw-r--r-- | plugins/LV2/src/AtmosphereChannel/manifest.ttl.in | 12 |
9 files changed, 347 insertions, 2 deletions
diff --git a/plugins/LV2/CMakeLists.txt b/plugins/LV2/CMakeLists.txt index f2c86e4..69b2091 100755 --- a/plugins/LV2/CMakeLists.txt +++ b/plugins/LV2/CMakeLists.txt @@ -16,8 +16,8 @@ add_airwindows_plugin(ADT) add_airwindows_plugin(Air) add_airwindows_plugin(Apicolypse) add_airwindows_plugin(AQuickVoiceClip) -# add_airwindows_plugin(AtmosphereBuss) -# add_airwindows_plugin(AtmosphereChannel) +add_airwindows_plugin(AtmosphereBuss) +add_airwindows_plugin(AtmosphereChannel) # add_airwindows_plugin(Aura) # add_airwindows_plugin(Average) # add_airwindows_plugin(AverMatrix) diff --git a/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.cpp b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.cpp new file mode 100644 index 0000000..c6465fe --- /dev/null +++ b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.cpp @@ -0,0 +1,40 @@ +#include "AtmosphereBuss.h" +#include <iostream> +#include <lv2wrapper.h> + +AtmosphereBuss::AtmosphereBuss(double rate) + : LV2Plugin(rate) + , gainchase(-90.0) + , settingchase(-90.0) + , chasespeed(350.0) + , thresholdA(0.618033988749894) + , thresholdB(0.679837387624884) + , thresholdC(0.747821126387373) + , thresholdD(0.82260323902611) + , thresholdE(0.904863562928721) + , thresholdF(0.995349919221593) + , thresholdG(1.094884911143752) + , thresholdH(1.204373402258128) + , thresholdI(1.32481074248394) + , thresholdJ(1.457291816732335) + , thresholdK(1.603020998405568) + , thresholdL(1.763323098246125) + , thresholdM(1.939655408070737) +{ +} + +void AtmosphereBuss::run(uint32_t num_samples) +{ + A = *params[0]; + + processReplacing(const_cast<float **>(in), out, num_samples); +} + +// +// Include the processing code from the VST version. +// +#include <cmath> +#include "../../../LinuxVST/src/AtmosphereBuss/AtmosphereBussProc.cpp" + +// Create the LV2Wrapper and register the plugin +LV2Wrapper<AtmosphereBuss> plugin; diff --git a/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.h b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.h new file mode 100644 index 0000000..52dd36e --- /dev/null +++ b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.h @@ -0,0 +1,77 @@ +#ifndef __AtmosphereBuss_H +#define __AtmosphereBuss_H + +#include <lv2plugin.h> + +class AtmosphereBuss : public LV2Plugin<1> { +public: + AtmosphereBuss(double rate); + + void run(uint32_t num_samples); + + static constexpr const char * URI = "https://www.airwindows.com/atmospherebuss"; + +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 gainchase; + double settingchase; + double chasespeed; + + long double fpNShapeL; + long double lastSampleAL; + long double lastSampleBL; + long double lastSampleCL; + long double lastSampleDL; + long double lastSampleEL; + long double lastSampleFL; + long double lastSampleGL; + long double lastSampleHL; + long double lastSampleIL; + long double lastSampleJL; + long double lastSampleKL; + long double lastSampleLL; + long double lastSampleML; + + long double fpNShapeR; + long double lastSampleAR; + long double lastSampleBR; + long double lastSampleCR; + long double lastSampleDR; + long double lastSampleER; + long double lastSampleFR; + long double lastSampleGR; + long double lastSampleHR; + long double lastSampleIR; + long double lastSampleJR; + long double lastSampleKR; + long double lastSampleLR; + long double lastSampleMR; + + long double thresholdA; + long double thresholdB; + long double thresholdC; + long double thresholdD; + long double thresholdE; + long double thresholdF; + long double thresholdG; + long double thresholdH; + long double thresholdI; + long double thresholdJ; + long double thresholdK; + long double thresholdL; + long double thresholdM; + + float A; +}; + + +#endif diff --git a/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.ttl b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.ttl new file mode 100644 index 0000000..8660845 --- /dev/null +++ b/plugins/LV2/src/AtmosphereBuss/AtmosphereBuss.ttl @@ -0,0 +1,44 @@ +# Airwindows AtmosphereBuss 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/atmospherebuss> + a lv2:Plugin , + lv2:EffectPlugin ; + 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 "Input" ; + lv2:default 1.0 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "in_l" ; + lv2:name "In left" ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "in_r" ; + lv2:name "In right" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "out_l" ; + lv2:name "Out left" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "out_r" ; + lv2:name "Out right" ; + ] . diff --git a/plugins/LV2/src/AtmosphereBuss/manifest.ttl.in b/plugins/LV2/src/AtmosphereBuss/manifest.ttl.in new file mode 100644 index 0000000..f8b7755 --- /dev/null +++ b/plugins/LV2/src/AtmosphereBuss/manifest.ttl.in @@ -0,0 +1,12 @@ +# LV2 Plugin manifest for Airwindows AtmosphereBuss plugin + +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<https://www.airwindows.com/atmospherebuss> + a lv2:Plugin ; + doap:name "Airwindows AtmosphereBuss" ; + doap:license <http://opensource.org/licenses/mit> ; + lv2:binary <AtmosphereBuss@CMAKE_SHARED_LIBRARY_SUFFIX@> ; + rdfs:seeAlso <AtmosphereBuss.ttl> . diff --git a/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.cpp b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.cpp new file mode 100644 index 0000000..81709e7 --- /dev/null +++ b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.cpp @@ -0,0 +1,40 @@ +#include "AtmosphereChannel.h" +#include <iostream> +#include <lv2wrapper.h> + +AtmosphereChannel::AtmosphereChannel(double rate) + : LV2Plugin(rate) + , gainchase(-90.0) + , settingchase(-90.0) + , chasespeed(350.0) + , thresholdA(0.618033988749894) + , thresholdB(0.679837387624884) + , thresholdC(0.747821126387373) + , thresholdD(0.82260323902611) + , thresholdE(0.904863562928721) + , thresholdF(0.995349919221593) + , thresholdG(1.094884911143752) + , thresholdH(1.204373402258128) + , thresholdI(1.32481074248394) + , thresholdJ(1.457291816732335) + , thresholdK(1.603020998405568) + , thresholdL(1.763323098246125) + , thresholdM(1.939655408070737) +{ +} + +void AtmosphereChannel::run(uint32_t num_samples) +{ + A = *params[0]; + + processReplacing(const_cast<float **>(in), out, num_samples); +} + +// +// Include the processing code from the VST version. +// +#include <cmath> +#include "../../../LinuxVST/src/AtmosphereChannel/AtmosphereChannelProc.cpp" + +// Create the LV2Wrapper and register the plugin +LV2Wrapper<AtmosphereChannel> plugin; diff --git a/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.h b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.h new file mode 100644 index 0000000..2d24a6e --- /dev/null +++ b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.h @@ -0,0 +1,76 @@ +#ifndef __AtmosphereChannel_H +#define __AtmosphereChannel_H + +#include <lv2plugin.h> + +class AtmosphereChannel : public LV2Plugin<1> { +public: + AtmosphereChannel(double rate); + + void run(uint32_t num_samples); + + static constexpr const char * URI = "https://www.airwindows.com/atmospherechannel"; + +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 gainchase; + double settingchase; + double chasespeed; + + long double fpNShapeL; + long double lastSampleAL; + long double lastSampleBL; + long double lastSampleCL; + long double lastSampleDL; + long double lastSampleEL; + long double lastSampleFL; + long double lastSampleGL; + long double lastSampleHL; + long double lastSampleIL; + long double lastSampleJL; + long double lastSampleKL; + long double lastSampleLL; + long double lastSampleML; + + long double fpNShapeR; + long double lastSampleAR; + long double lastSampleBR; + long double lastSampleCR; + long double lastSampleDR; + long double lastSampleER; + long double lastSampleFR; + long double lastSampleGR; + long double lastSampleHR; + long double lastSampleIR; + long double lastSampleJR; + long double lastSampleKR; + long double lastSampleLR; + long double lastSampleMR; + + long double thresholdA; + long double thresholdB; + long double thresholdC; + long double thresholdD; + long double thresholdE; + long double thresholdF; + long double thresholdG; + long double thresholdH; + long double thresholdI; + long double thresholdJ; + long double thresholdK; + long double thresholdL; + long double thresholdM; + + float A; +}; + +#endif diff --git a/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.ttl b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.ttl new file mode 100644 index 0000000..415fba0 --- /dev/null +++ b/plugins/LV2/src/AtmosphereChannel/AtmosphereChannel.ttl @@ -0,0 +1,44 @@ +# Airwindows AtmosphereChannel 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/atmospherechannel> + a lv2:Plugin , + lv2:EffectPlugin ; + 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 "Input" ; + lv2:default 1.0 ; + lv2:minimum 0.0 ; + lv2:maximum 1.0 ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 1 ; + lv2:symbol "in_l" ; + lv2:name "In left" ; + ] , [ + a lv2:InputPort , lv2:AudioPort ; + lv2:index 2 ; + lv2:symbol "in_r" ; + lv2:name "In right" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 3 ; + lv2:symbol "out_l" ; + lv2:name "Out left" ; + ] , [ + a lv2:OutputPort , lv2:AudioPort ; + lv2:index 4 ; + lv2:symbol "out_r" ; + lv2:name "Out right" ; + ] . diff --git a/plugins/LV2/src/AtmosphereChannel/manifest.ttl.in b/plugins/LV2/src/AtmosphereChannel/manifest.ttl.in new file mode 100644 index 0000000..7a617e9 --- /dev/null +++ b/plugins/LV2/src/AtmosphereChannel/manifest.ttl.in @@ -0,0 +1,12 @@ +# LV2 Plugin manifest for Airwindows AtmosphereChannel plugin + +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix lv2: <http://lv2plug.in/ns/lv2core#> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . + +<https://www.airwindows.com/atmospherechannel> + a lv2:Plugin ; + doap:name "Airwindows AtmosphereChannel" ; + doap:license <http://opensource.org/licenses/mit> ; + lv2:binary <AtmosphereChannel@CMAKE_SHARED_LIBRARY_SUFFIX@> ; + rdfs:seeAlso <AtmosphereChannel.ttl> . |