aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp')
-rw-r--r--plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp b/plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp
new file mode 100644
index 0000000..b0c9224
--- /dev/null
+++ b/plugins/LV2/src/NotJustAnotherDither/NotJustAnotherDither.cpp
@@ -0,0 +1,59 @@
+#include "NotJustAnotherDither.h"
+#include <iostream>
+#include <lv2wrapper.h>
+
+NotJustAnotherDither::NotJustAnotherDither(double rate)
+ : LV2Plugin(rate)
+{
+}
+
+void NotJustAnotherDither::activate()
+{
+ A = 1.0;
+ B = 0.0;
+ fpd = 17;
+ bynL[0] = 1000;
+ bynL[1] = 301;
+ bynL[2] = 176;
+ bynL[3] = 125;
+ bynL[4] = 97;
+ bynL[5] = 79;
+ bynL[6] = 67;
+ bynL[7] = 58;
+ bynL[8] = 51;
+ bynL[9] = 46;
+ bynL[10] = 1000;
+ noiseShapingL = 0.0;
+
+ bynR[0] = 1000;
+ bynR[1] = 301;
+ bynR[2] = 176;
+ bynR[3] = 125;
+ bynR[4] = 97;
+ bynR[5] = 79;
+ bynR[6] = 67;
+ bynR[7] = 58;
+ bynR[8] = 51;
+ bynR[9] = 46;
+ bynR[10] = 1000;
+ noiseShapingR = 0.0;
+ //this is reset: values being initialized only once. Startup values, whatever they are.
+
+}
+
+void NotJustAnotherDither::run(uint32_t num_samples)
+{
+ A = *params[0];
+ B = *params[1];
+
+ processReplacing(const_cast<float **>(in), out, num_samples);
+}
+
+//
+// Include the processing code from the VST version.
+//
+#include <cmath>
+#include "../../../LinuxVST/src/NotJustAnotherDither/NotJustAnotherDitherProc.cpp"
+
+// Create the LV2Wrapper and register the plugin
+LV2Wrapper<NotJustAnotherDither> plugin;