From 1c7e2f4386bfb177dbf928bf73ea9234bad269c2 Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Sat, 26 Feb 2022 02:10:26 +0100 Subject: [PATCH] Feature/add aaron static (#179) * preliminary Aaron Static work * build fix (override, needs work); color invert * put color exception somewhere else --- .gitmodules | 3 +++ README.md | 1 + docs/LICENSES.md | 3 +++ plugins/AaronStatic | 1 + plugins/Makefile | 13 +++++++++++++ plugins/plugins.cpp | 24 ++++++++++++++++++++++++ src/custom/dep.cpp | 6 ++++++ 7 files changed, 51 insertions(+) create mode 160000 plugins/AaronStatic diff --git a/.gitmodules b/.gitmodules index 65161a7..8b62825 100644 --- a/.gitmodules +++ b/.gitmodules @@ -175,3 +175,6 @@ [submodule "plugins/Algoritmarte"] path = plugins/Algoritmarte url = https://github.com/algoritmarte/AlgoritmarteVCVPlugin.git +[submodule "plugins/AaronStatic"] + path = plugins/AaronStatic + url = https://github.com/aaronstatic/AaronStatic_modules.git diff --git a/README.md b/README.md index 2774c5d..279f6a6 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ At the moment the following 3rd-party modules are provided: - 21kHz - 8Mode +- Aaron Static - AlgoritmArte - Amalgamated Harmonics - Animated Circuits diff --git a/docs/LICENSES.md b/docs/LICENSES.md index 204a41a..18577b0 100644 --- a/docs/LICENSES.md +++ b/docs/LICENSES.md @@ -15,6 +15,7 @@ Bellow follows a list of all code licenses used in Cardinal and linked submodule | Rack | GPL-3.0-or-later | The actual Rack code, internal dependencies are compatible with GPLv3+ | | 21kHz | MIT | | | 8Mode | BSD-3-Clause | | +| Aaron Static | MIT | | | AlgoritmArte | GPL-3.0-or-later | | | Amalgamated Harmonics | BSD-3-Clause | | | Animated Circuits | GPL-3.0-or-later | | @@ -84,6 +85,8 @@ Below is a list of artwork licenses from plugins |-----------------------------------------|------------------|------------------| | 21kHz | MIT | No artwork specific license provided | | 8Mode | BSD-3-Clause | No artwork specific license provided | +| AaronStatic/* | MIT | No artwork specific license provided | +| AaronStatic/fonts/PixelOperator.ttf | CC0-1.0 | | | Algoritmarte/* | GPL-3.0-or-later | No artwork specific license provided | | Algoritmarte/LEDSliderGreenHandle.svg | CC-BY-NC-4.0 | | | AmalgamatedHarmonics/* | BSD-3-Clause | No artwork specific license provided | diff --git a/plugins/AaronStatic b/plugins/AaronStatic new file mode 160000 index 0000000..4ace0a1 --- /dev/null +++ b/plugins/AaronStatic @@ -0,0 +1 @@ +Subproject commit 4ace0a1789c577ee4eb12dc03da5271f80598d62 diff --git a/plugins/Makefile b/plugins/Makefile index 25f1358..4b6fe07 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -238,6 +238,11 @@ PLUGIN_FILES += $(filter-out 8Mode/src/plugin.cpp,$(wildcard 8Mode/src/*.cpp)) PLUGIN_FILES += $(filter-out Algoritmarte/src/plugin.cpp,$(wildcard Algoritmarte/src/*.cpp)) +# -------------------------------------------------------------- +# Aaron Static + +PLUGIN_FILES += $(wildcard AaronStatic/src/*.cpp) + # -------------------------------------------------------------- # AmalgamatedHarmonics @@ -1151,6 +1156,14 @@ $(BUILD_DIR)/8Mode/%.cpp.o: 8Mode/%.cpp $(foreach m,$(8MODE_CUSTOM),$(call custom_module_names,$(m),8Mode)) \ -DpluginInstance=pluginInstance__8Mode +$(BUILD_DIR)/AaronStatic/%.cpp.o: AaronStatic/%.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ + $(foreach m,$(AARONSTATIC_CUSTOM),$(call custom_module_names,$(m),AaronStatic)) \ + -DpluginInstance=pluginInstance__AaronStatic \ + -Dinit=init__AaronStatic + $(BUILD_DIR)/Algoritmarte/%.cpp.o: Algoritmarte/%.cpp -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" @echo "Compiling $<" diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index 9bf05d6..ca70481 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -30,6 +30,13 @@ // 8Mode #include "8Mode/src/8mode.hpp" +// Aaron Static +#include "AaronStatic/src/plugin.hpp" +// Nasty override of this required function for now: +NVGcolor prepareDisplay(NVGcontext *vg, Rect *box, int fontSize) { + return nvgRGB(0xaf, 0xd2, 0x2c); +} + // Algoritmarte #include "Algoritmarte/src/plugin.hpp" @@ -646,6 +653,7 @@ Plugin* pluginInstance__Cardinal; #ifndef NOPLUGINS Plugin* pluginInstance__21kHz; Plugin* pluginInstance__8Mode; +Plugin* pluginInstance__AaronStatic; Plugin* pluginInstance__Algoritmarte; Plugin* pluginInstance__AmalgamatedHarmonics; Plugin* pluginInstance__AnimatedCircuits; @@ -867,6 +875,21 @@ static void initStatic__8Mode() } } +static void initStatic__AaronStatic() +{ + Plugin* const p = new Plugin; + pluginInstance__AaronStatic = p; + + const StaticPluginLoader spl(p, "AaronStatic"); + if (spl.ok()) + { + p->addModel(modelChordCV); + p->addModel(modelScaleCV); + p->addModel(modelRandomNoteCV); + p->addModel(modelDiatonicCV); + } +} + static void initStatic__Algoritmarte() { Plugin* const p = new Plugin; @@ -2340,6 +2363,7 @@ void initStaticPlugins() #ifndef NOPLUGINS initStatic__21kHz(); initStatic__8Mode(); + initStatic__AaronStatic(); initStatic__Algoritmarte(); initStatic__AmalgamatedHarmonics(); initStatic__AnimatedCircuits(); diff --git a/src/custom/dep.cpp b/src/custom/dep.cpp index 8b612ac..5070a68 100644 --- a/src/custom/dep.cpp +++ b/src/custom/dep.cpp @@ -56,6 +56,11 @@ static const struct { { "/21kHz/res/Panels/D_Inf.svg", {}, -1 }, { "/21kHz/res/Panels/PalmLoop.svg", {}, -1 }, { "/21kHz/res/Panels/TachyonEntangler.svg", {}, -1 }, + // MIT + {"/AaronStatic/res/ChordCV.svg", {}, -1 }, + {"/AaronStatic/res/DiatonicCV.svg", {}, -1 }, + {"/AaronStatic/res/RandomNoteCV.svg", {}, -1 }, + {"/AaronStatic/res/ScaleCV.svg", {}, -1 }, // GPL3.0-or-later { "/Algoritmarte/res/Clockkky.svg", {}, -1 }, { "/Algoritmarte/res/CyclicCA.svg", {}, -1 }, @@ -442,6 +447,7 @@ static inline bool invertPaint(NSVGshape* const shape, NSVGpaint& paint, const c case 0xff0095fe: case 0xff4d9a4d: case 0xff4d4d9a: + case 0xff0187fc: return false; // pure black (convert to not quite pure white) case 0xff000000: