diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2020-08-02 22:27:04 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2020-08-02 22:27:04 +0200 |
commit | c19599e7009afc1d6e859a0129ae9fc22427fb98 (patch) | |
tree | f8545423b50714fbf7b5765b9072bfbd74c45333 /plugins | |
parent | 3338e9d4c7816ee3281c304c5dae6ade5dca6a41 (diff) | |
download | airwindows-lv2-port-c19599e7009afc1d6e859a0129ae9fc22427fb98.tar.gz airwindows-lv2-port-c19599e7009afc1d6e859a0129ae9fc22427fb98.tar.bz2 airwindows-lv2-port-c19599e7009afc1d6e859a0129ae9fc22427fb98.zip |
LV2: Port BassKit plugin.
There's an issue, where it seems the plugin will only produce noise if
it's active when starting playback. Enabling it after playback has
started seems to work fine. This is puzzling and will have to be
investigated further at some time.
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/LV2/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/LV2/src/BassKit/BassKit.cpp | 28 | ||||
-rw-r--r-- | plugins/LV2/src/BassKit/BassKit.h | 85 | ||||
-rw-r--r-- | plugins/LV2/src/BassKit/BassKit.ttl | 68 | ||||
-rw-r--r-- | plugins/LV2/src/BassKit/manifest.ttl.in | 12 |
5 files changed, 194 insertions, 1 deletions
diff --git a/plugins/LV2/CMakeLists.txt b/plugins/LV2/CMakeLists.txt index 3993e3b..cfc15da 100755 --- a/plugins/LV2/CMakeLists.txt +++ b/plugins/LV2/CMakeLists.txt @@ -22,7 +22,7 @@ add_airwindows_plugin(Aura) add_airwindows_plugin(Average) add_airwindows_plugin(AverMatrix) add_airwindows_plugin(BassDrive) -# add_airwindows_plugin(BassKit) +add_airwindows_plugin(BassKit) # add_airwindows_plugin(Baxandall) # add_airwindows_plugin(Beam) # add_airwindows_plugin(Biquad) diff --git a/plugins/LV2/src/BassKit/BassKit.cpp b/plugins/LV2/src/BassKit/BassKit.cpp new file mode 100644 index 0000000..d3a2896 --- /dev/null +++ b/plugins/LV2/src/BassKit/BassKit.cpp @@ -0,0 +1,28 @@ +#include "BassKit.h" +#include <iostream> +#include <lv2wrapper.h> + +BassKit::BassKit(double rate) + : LV2Plugin(rate) + , oscGate(1.0) +{ +} + +void BassKit::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/BassKit/BassKitProc.cpp" + +// Create the LV2Wrapper and register the plugin +LV2Wrapper<BassKit> plugin; diff --git a/plugins/LV2/src/BassKit/BassKit.h b/plugins/LV2/src/BassKit/BassKit.h new file mode 100644 index 0000000..a5d5d12 --- /dev/null +++ b/plugins/LV2/src/BassKit/BassKit.h @@ -0,0 +1,85 @@ +#ifndef __BassKit_H +#define __BassKit_H + +#include <lv2plugin.h> + +class BassKit : public LV2Plugin<4> { +public: + BassKit(double rate); + + void run(uint32_t num_samples); + + static constexpr const char * URI = "https://www.airwindows.com/basskit"; + +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 iirDriveSampleA; + double iirDriveSampleB; + double iirDriveSampleC; + double iirDriveSampleD; + double iirDriveSampleE; + double iirDriveSampleF; + bool flip; //drive things + + int bflip; + bool WasNegative; + bool SubOctave; + double iirHeadBumpA; + double iirHeadBumpB; + double iirHeadBumpC; + + double iirSubBumpA; + double iirSubBumpB; + double iirSubBumpC; + + double lastHeadBump; + double lastSubBump; + + double iirSampleA; + double iirSampleB; + double iirSampleC; + double iirSampleD; + double iirSampleE; + double iirSampleF; + double iirSampleG; + double iirSampleH; + double iirSampleI; + double iirSampleJ; + double iirSampleK; + double iirSampleL; + double iirSampleM; + double iirSampleN; + double iirSampleO; + double iirSampleP; + double iirSampleQ; + double iirSampleR; + double iirSampleS; + double iirSampleT; + double iirSampleU; + double iirSampleV; + double iirSampleW; + double iirSampleX; + double iirSampleY; + double iirSampleZ; + double oscGate; + + long double fpNShapeL; + long double fpNShapeR; + //default stuff + + float A; + float B; + float C; + float D; +}; + +#endif diff --git a/plugins/LV2/src/BassKit/BassKit.ttl b/plugins/LV2/src/BassKit/BassKit.ttl new file mode 100644 index 0000000..3a0c62f --- /dev/null +++ b/plugins/LV2/src/BassKit/BassKit.ttl @@ -0,0 +1,68 @@ +# Airwindows BassKit 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/basskit> + a lv2:Plugin , + lv2:EffectsPlugin ; + 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 "Drive" ; + 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 "Voicing" ; + 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 "Bass Inv/Out" ; + 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 "Sub Inv/Out" ; + 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/BassKit/manifest.ttl.in b/plugins/LV2/src/BassKit/manifest.ttl.in new file mode 100644 index 0000000..752eef7 --- /dev/null +++ b/plugins/LV2/src/BassKit/manifest.ttl.in @@ -0,0 +1,12 @@ +# LV2 Plugin manifest for Airwindows BassKit 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/basskit> + a lv2:Plugin ; + doap:name "Airwindows BassKit" ; + doap:license <http://opensource.org/licenses/mit> ; + lv2:binary <BassKit@CMAKE_SHARED_LIBRARY_SUFFIX@> ; + rdfs:seeAlso <BassKit.ttl> . |