From dd661db6b8c3c13d1fdea9eb8c8821840fee9aec Mon Sep 17 00:00:00 2001 From: FergusL Date: Tue, 22 Feb 2022 21:13:34 +0100 Subject: [PATCH] Add substation-opensource (#163) * WIP: Add Substation Open Source release (broken) * Update upstream Co-authored-by: Simon-L --- .gitmodules | 3 ++ plugins/Makefile | 20 +++++++++++++ plugins/plugins.cpp | 55 +++++++++++++++++++++++++++++++++++ plugins/substation-opensource | 1 + 4 files changed, 79 insertions(+) create mode 160000 plugins/substation-opensource diff --git a/.gitmodules b/.gitmodules index a337261..e66e81c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -130,3 +130,6 @@ [submodule "plugins/Autinn"] path = plugins/Autinn url = https://github.com/NikolaiVChr/Autinn.git +[submodule "plugins/substation-opensource"] + path = plugins/substation-opensource + url = https://gitlab.com/slimechild/substation-opensource.git diff --git a/plugins/Makefile b/plugins/Makefile index 3fcb4e3..2832e4c 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -622,6 +622,16 @@ REPELZEN_CUSTOM = Blank Mixer Werner tanh_pade PLUGIN_FILES += $(filter-out sonusmodular/src/sonusmodular,$(wildcard sonusmodular/src/*.cpp)) +# -------------------------------------------------------------- +# Substation (Open source release) + +PLUGIN_FILES += $(wildcard substation-opensource/dep/slime4rack/src/slime/*.cpp) +PLUGIN_FILES += $(wildcard substation-opensource/dep/slime4rack/src/slime/**/*.cpp) +PLUGIN_FILES += $(filter-out substation-opensource/src/_plugin.cpp,$(wildcard substation-opensource/src/*.cpp)) + +# modules/types which are present in other plugins +SUBSTATION_CUSTOM = Clock Mixer Quantizer VCA init + # -------------------------------------------------------------- # ValleyAudio @@ -1400,6 +1410,16 @@ $(BUILD_DIR)/sonusmodular/%.cpp.o: sonusmodular/%.cpp $(foreach m,$(SONUSMODULAR_CUSTOM),$(call custom_module_names,$(m),sonusmodular)) \ -DpluginInstance=pluginInstance__sonusmodular +$(BUILD_DIR)/substation-opensource/%.cpp.o: substation-opensource/%.cpp + -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" + @echo "Compiling $<" + $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ \ + $(foreach m,$(SUBSTATION_CUSTOM),$(call custom_module_names,$(m),substation)) \ + -DpluginInstance=pluginInstance__substation \ + -D'PRIVATE=__attribute__((error("Using internal Rack function or symbol")))' \ + -Werror \ + -Isubstation-opensource/dep/slime4rack/include + $(BUILD_DIR)/ValleyAudio/%.cpp.o: ValleyAudio/%.cpp -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" @echo "Compiling $<" diff --git a/plugins/plugins.cpp b/plugins/plugins.cpp index e490033..2faa0a5 100644 --- a/plugins/plugins.cpp +++ b/plugins/plugins.cpp @@ -497,6 +497,29 @@ extern Model* modelMaude_221; // sonusmodular #include "sonusmodular/src/sonusmodular.hpp" +//substation +// NOTE too much noise in original include, do this a different way +// "substation-opensource/src/_plugin.hpp" +#define modelClock modelsubstationClock +#define modelMixer modelsubstationMixer +#define modelQuantizer modelsubstationQuantizer +#define modelVCA modelsubstationVCA +extern Model* modelClock; +extern Model* modelPolySequencer; +extern Model* modelSubOscillator; +extern Model* modelMixer; +extern Model* modelFilter; +extern Model* modelEnvelopes; +extern Model* modelQuantizer; +extern Model* modelVCA; +extern Model* modelBlank4; +extern Model* modelBlank7; +extern Model* modelFilterPlus; +#undef modelClock +#undef modelMixer +#undef modelQuantizer +#undef modelVCA + // ValleyAudio #include "ValleyAudio/src/Valley.hpp" @@ -564,6 +587,7 @@ Plugin* pluginInstance__Prism; Plugin* pluginInstance__rackwindows; Plugin* pluginInstance__repelzen; Plugin* pluginInstance__sonusmodular; +Plugin* pluginInstance__substation; Plugin* pluginInstance__ValleyAudio; Plugin* pluginInstance__ZetaCarinaeModules; Plugin* pluginInstance__ZZC; @@ -1822,6 +1846,36 @@ static void initStatic__sonusmodular() } } +static void initStatic__substation() +{ + Plugin* const p = new Plugin; + pluginInstance__substation = p; + + const StaticPluginLoader spl(p, "substation-opensource"); + if (spl.ok()) + { +#define modelClock modelsubstationClock +#define modelMixer modelsubstationMixer +#define modelQuantizer modelsubstationQuantizer +#define modelVCA modelsubstationVCA + p->addModel(modelClock); + p->addModel(modelEnvelopes); + p->addModel(modelFilter); + p->addModel(modelMixer); + p->addModel(modelQuantizer); + p->addModel(modelPolySequencer); + p->addModel(modelVCA); + p->addModel(modelSubOscillator); + p->addModel(modelBlank4); + p->addModel(modelBlank7); + p->addModel(modelFilterPlus); +#undef modelClock +#undef modelMixer +#undef modelQuantizer +#undef modelVCA + } +} + static void initStatic__ValleyAudio() { Plugin* const p = new Plugin; @@ -1924,6 +1978,7 @@ void initStaticPlugins() initStatic__rackwindows(); initStatic__repelzen(); initStatic__sonusmodular(); + initStatic__substation(); initStatic__ValleyAudio(); initStatic__ZetaCarinaeModules(); initStatic__ZZC(); diff --git a/plugins/substation-opensource b/plugins/substation-opensource new file mode 160000 index 0000000..f71030d --- /dev/null +++ b/plugins/substation-opensource @@ -0,0 +1 @@ +Subproject commit f71030d598923be76a0d7f05af5be949500c17b5