aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LV2/src/StarChild
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-07-31 21:34:28 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-07-31 21:34:28 +0200
commit1bd34fa795d0eac15d0dc9d4c756f19fc6624872 (patch)
treefdb9bb2e5e20a0adb2953597beafd66aa7c924fc /plugins/LV2/src/StarChild
parent94a6cc3d6c70883e08fd7be16e9405d44bfb94e5 (diff)
downloadairwindows-lv2-port-1bd34fa795d0eac15d0dc9d4c756f19fc6624872.tar.gz
airwindows-lv2-port-1bd34fa795d0eac15d0dc9d4c756f19fc6624872.tar.bz2
airwindows-lv2-port-1bd34fa795d0eac15d0dc9d4c756f19fc6624872.zip
LV2: Port another batch of plugins, EQ - SurgeTide
Some plugins won't compile for various reasons, these have been left out for now. One plugin failed autoporting, so that one's left out too. I have not tested these plugins yet, so no guarantees that they work, or that they work right. Please report any problems or if there's missing control info to the mailing list.
Diffstat (limited to 'plugins/LV2/src/StarChild')
-rw-r--r--plugins/LV2/src/StarChild/StarChild.cpp87
-rw-r--r--plugins/LV2/src/StarChild/StarChild.h54
-rw-r--r--plugins/LV2/src/StarChild/StarChild.ttl60
-rw-r--r--plugins/LV2/src/StarChild/manifest.ttl.in6
4 files changed, 207 insertions, 0 deletions
diff --git a/plugins/LV2/src/StarChild/StarChild.cpp b/plugins/LV2/src/StarChild/StarChild.cpp
new file mode 100644
index 0000000..11b0bf7
--- /dev/null
+++ b/plugins/LV2/src/StarChild/StarChild.cpp
@@ -0,0 +1,87 @@
+#include "StarChild.h"
+#include <iostream>
+#include <lv2wrapper.h>
+
+StarChild::StarChild(double rate)
+ : LV2Plugin(rate)
+{
+}
+
+void StarChild::activate()
+{
+ A = 1.0;
+ B = 0.7;
+ C = 0.2;
+
+ int count;
+
+ for(count = 0; count < 44101; count++) {d[count] = 0.0;}
+
+ for(count = 0; count < 11; count++) {wearL[count] = 0.0; wearR[count] = 0.0; factor[count] = 0.0;}
+
+ wearLPrev = 0.0; wearRPrev = 0.0;
+
+ p[1] = 11; p[2] = 13; p[3] = 17; p[4] = 19; p[5] = 23; p[6] = 29; p[7] = 31; p[8] = 37; p[9] = 41;
+ p[10] = 43; p[11] = 47; p[12] = 53; p[13] = 59; p[14] = 61; p[15] = 67; p[16] = 71; p[17] = 73; p[18] = 79; p[19] = 83; p[20] = 89;
+ p[21] = 97; p[22] = 101; p[23] = 103; p[24] = 107; p[25] = 109; p[26] = 113; p[27] = 127; p[28] = 131; p[29] = 137; p[30] = 139;
+ p[31] = 149; p[32] = 151; p[33] = 157; p[34] = 163; p[35] = 167; p[36] = 173; p[37] = 179; p[38] = 181; p[39] = 191; p[40] = 193;
+ p[41] = 197; p[42] = 199; p[43] = 211; p[44] = 223; p[45] = 227; p[46] = 229; p[47] = 233; p[48] = 239; p[49] = 241; p[50] = 251;
+ p[51] = 257; p[52] = 263; p[53] = 269; p[54] = 271; p[55] = 277; p[56] = 281; p[57] = 283; p[58] = 293; p[59] = 307; p[60] = 311;
+ p[61] = 313; p[62] = 317; p[63] = 331; p[64] = 337; p[65] = 347; p[66] = 349; p[67] = 353; p[68] = 359; p[69] = 367; p[70] = 373;
+ p[71] = 379; p[72] = 383; p[73] = 389; p[74] = 397; p[75] = 401; p[76] = 409; p[77] = 419; p[78] = 421; p[79] = 431; p[80] = 433;
+ p[81] = 439; p[82] = 443; p[83] = 449; p[84] = 457; p[85] = 461; p[86] = 463; p[87] = 467; p[88] = 479; p[89] = 487; p[90] = 491;
+ p[91] = 499; p[92] = 503; p[93] = 509; p[94] = 521; p[95] = 523; p[96] = 541; p[97] = 547; p[98] = 557; p[99] = 563; p[100] = 569;
+ p[101] = 571; p[102] = 577; p[103] = 587; p[104] = 593; p[105] = 599; p[106] = 601; p[107] = 607; p[108] = 613; p[109] = 617; p[110] = 619;
+ p[111] = 631; p[112] = 641; p[113] = 643; p[114] = 647; p[115] = 653; p[116] = 659; p[117] = 661; p[118] = 673; p[119] = 677; p[120] = 683;
+ p[121] = 691; p[122] = 701; p[123] = 709; p[124] = 719; p[125] = 727; p[126] = 733; p[127] = 739; p[128] = 743; p[129] = 751; p[130] = 757;
+ p[131] = 761; p[132] = 769; p[133] = 773; p[134] = 787; p[135] = 797; p[136] = 809; p[137] = 811; p[138] = 821; p[139] = 823; p[140] = 827;
+ p[141] = 829; p[142] = 839; p[143] = 853; p[144] = 857; p[145] = 859; p[146] = 863; p[147] = 877; p[148] = 881; p[149] = 883; p[150] = 887;
+ p[151] = 907; p[152] = 911; p[153] = 919; p[154] = 929; p[155] = 937; p[156] = 941; p[157] = 947; p[158] = 953; p[159] = 967; p[160] = 971;
+ p[161] = 977; p[162] = 983; p[163] = 991; p[164] = 997; p[165] = 998; p[166] = 999;
+
+ int assign;
+ for(count = 0; count < 165; count++)
+ {
+ t[count] = p[count];
+ //these get assigned again but we'll give them real values in case of trouble. They are 32 bit unsigned ints
+ assign = p[count] % 10;
+ //give us the 1, 3, 7 or 9 on the end
+
+ switch (assign){
+ case 1: outL[count] = 0.0; outR[count] = p[count]; break;
+ case 3: outL[count] = p[count] * 0.25; outR[count] = p[count] * 0.75; break;
+ case 7: outL[count] = p[count] * 0.75; outR[count] = p[count] * 0.25; break;
+ case 9: outL[count] = p[count]; outR[count] = 0.0; break;
+ }
+ //this gives us a set of stereo offsets that are always the same. When building our delay outputs,
+ //we multiply our -1 to 1 float values by this and add the result to a simple signed int.
+ //The result gives us a coarser and coarser output the fewer taps we have,
+ //and we divide the result by count*count to drop the volume down again.
+ }
+ pitchCounter = 2;
+ increment = 1;
+ dutyCycle = 1;
+
+ fpNShapeL = 0.0;
+ fpNShapeR = 0.0;
+ //this is reset: values being initialized only once. Startup values, whatever they are.
+
+}
+
+void StarChild::run(uint32_t num_samples)
+{
+ A = *params[0];
+ B = *params[1];
+ C = *params[2];
+
+ processReplacing(const_cast<float **>(in), out, num_samples);
+}
+
+//
+// Include the processing code from the VST version.
+//
+#include <cmath>
+#include "../../../LinuxVST/src/StarChild/StarChildProc.cpp"
+
+// Create the LV2Wrapper and register the plugin
+LV2Wrapper<StarChild> plugin;
diff --git a/plugins/LV2/src/StarChild/StarChild.h b/plugins/LV2/src/StarChild/StarChild.h
new file mode 100644
index 0000000..ee4d949
--- /dev/null
+++ b/plugins/LV2/src/StarChild/StarChild.h
@@ -0,0 +1,54 @@
+#ifndef __StarChild_H
+#define __StarChild_H
+
+#include <lv2plugin.h>
+
+class StarChild : public LV2Plugin<3> {
+public:
+ StarChild(double rate);
+
+ void activate();
+ void run(uint32_t num_samples);
+
+ static constexpr const char * URI = "https://www.airwindows.com/starchild";
+
+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.
+ */
+
+ long double fpNShapeL;
+ long double fpNShapeR;
+ //default stuff
+
+ double d[45102];
+ int dCount;
+
+ int p[171];
+ int t[171];
+ double outL[171];
+ double outR[171];
+ int pitchCounter;
+ int increment;
+ int dutyCycle;
+
+ double wearL[11];
+ double wearR[11];
+ double factor[11];
+ double wearLPrev;
+ double wearRPrev;
+
+ float A;
+ float B;
+ float C;
+
+};
+
+#endif
diff --git a/plugins/LV2/src/StarChild/StarChild.ttl b/plugins/LV2/src/StarChild/StarChild.ttl
new file mode 100644
index 0000000..cd1d082
--- /dev/null
+++ b/plugins/LV2/src/StarChild/StarChild.ttl
@@ -0,0 +1,60 @@
+# Airwindows StarChild 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/starchild>
+ 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 "Sustain" ;
+ 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 "Grain" ;
+ 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 "Dry/Wet" ;
+ lv2:default 0.5 ;
+ lv2:minimum 0.0 ;
+ lv2:maximum 1.0 ;
+ ] , [
+ a lv2:InputPort , lv2:AudioPort ;
+ lv2:index 3 ;
+ lv2:symbol "in_l" ;
+ lv2:name "In left" ;
+ ] , [
+ a lv2:InputPort , lv2:AudioPort ;
+ lv2:index 4 ;
+ lv2:symbol "in_r" ;
+ lv2:name "In right" ;
+ ] , [
+ a lv2:OutputPort , lv2:AudioPort ;
+ lv2:index 5 ;
+ lv2:symbol "out_l" ;
+ lv2:name "Out left" ;
+ ] , [
+ a lv2:OutputPort , lv2:AudioPort ;
+ lv2:index 6 ;
+ lv2:symbol "out_r" ;
+ lv2:name "Out right" ;
+ ] .
diff --git a/plugins/LV2/src/StarChild/manifest.ttl.in b/plugins/LV2/src/StarChild/manifest.ttl.in
new file mode 100644
index 0000000..4cd0a97
--- /dev/null
+++ b/plugins/LV2/src/StarChild/manifest.ttl.in
@@ -0,0 +1,6 @@
+airwindows:starchild
+ a lv2:Plugin ;
+ doap:name "Airwindows StarChild" ;
+ doap:license <http://opensource.org/licenses/mit> ;
+ lv2:binary <StarChild@CMAKE_SHARED_LIBRARY_SUFFIX@> ;
+ rdfs:seeAlso <StarChild.ttl> .