commit 0973fc4eebeb8f4ef74bf885b2b251ff1259178c Author: Gordon JC Pearce Date: Mon Jan 6 21:33:28 2025 +0000 initial skeleton of plugin diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9eca9b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +bin diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..924d963 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "dpf"] + path = dpf + url = https://github.com/DISTRHO/DPF diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..538859e --- /dev/null +++ b/LICENCE @@ -0,0 +1,7 @@ +ISC License + +Copyright 2024 Gordon JC Pearce + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c8dcd92 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +############################### +# +# Makefile for Alpha Juno Osc +# based on the work of falkTX +# +# for full licence, see LICENCE in the root of the project +# +############################### + +include dpf/Makefile.base.mk + +all: plugins gen + +plugins: + $(MAKE) all -C plugin + +ifneq ($(CROSS_COMPILING),true) +gen: plugins dpf/utils/lv2_ttl_generator + @$(CURDIR)/dpf/utils/generate-ttl.sh +ifeq ($(MACOS),true) + @$(CURDIR)/dpf/utils/generate-vst-bundles.sh +endif + +dpf/utils/lv2_ttl_generator: + $(MAKE) -C dpf/utils/lv2-ttl-generator +else +gen: +endif + +clean: + $(MAKE) clean -C dpf/utils/lv2-ttl-generator + $(MAKE) clean -C plugin + rm -rf bin build + +.PHONY: plugins diff --git a/dpf b/dpf new file mode 160000 index 0000000..f581516 --- /dev/null +++ b/dpf @@ -0,0 +1 @@ +Subproject commit f5815166356e85a5fe244f6024c2e401f04b10fa diff --git a/plugin/DistrhoPluginInfo.h b/plugin/DistrhoPluginInfo.h new file mode 100644 index 0000000..75ced88 --- /dev/null +++ b/plugin/DistrhoPluginInfo.h @@ -0,0 +1,33 @@ +/* + Alpha Oscillator POC + + Copyright 2024 Gordon JC Pearce + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef DISTRHO_PLUGIN_INFO_H +#define DISTRHO_PLUGIN_INFO_H + +#define DISTRHO_PLUGIN_NAME "alphaosc" +#define DISTRHO_PLUGIN_URI "https://gjcp.net/plugins/alphaosc" + +#define DISTRHO_PLUGIN_NUM_INPUTS 0 +#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 +#define DISTRHO_PLUGIN_IS_SYNTH 1 +#define DISTRHO_PLUGIN_IS_RT_SAFE 1 + +#define DISTRHO_PLUGIN_WANT_PROGRAMS 0 +#define DISTRHO_PLUGIN_HAS_UI 0 + +#endif diff --git a/plugin/Makefile b/plugin/Makefile new file mode 100644 index 0000000..17b0913 --- /dev/null +++ b/plugin/Makefile @@ -0,0 +1,29 @@ +############################### +# +# Makefile for Alpha Juno Osc +# based on the work of falkTX, in the DPF example plugins +# +# for full licence, see LICENCE in the root of the project +# +############################### + +NAME = alphaosc + +FILES_DSP = \ + alphaosc.cpp + + +#FILES_UI = \ +# slider.cpp \ +# peacock.cpp \ +# ui.cpp + +#UI_TYPE = generic +#USE_FILE_BROWSER = false +SKIP_NATIVE_AUDIO_FALLBACK = true + +include ../dpf/Makefile.plugins.mk + +TARGETS += jack lv2 + +all: $(TARGETS) diff --git a/plugin/alphaosc.cpp b/plugin/alphaosc.cpp new file mode 100644 index 0000000..dc9b1d4 --- /dev/null +++ b/plugin/alphaosc.cpp @@ -0,0 +1,58 @@ +/* + Alpha Juno Oscillator POC + + Copyright 2024 Gordon JC Pearce + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#include "alphaosc.hpp" + +START_NAMESPACE_DISTRHO + +AlphaOsc::AlphaOsc() : Plugin(parameterCount, 0, 0), sampleRate(getSampleRate()) { + // initial code here +} + +// Initialisation functions + +void AlphaOsc::initAudioPort(bool input, uint32_t index, AudioPort &port) { + // port.groupId = kPortGroupStereo; + Plugin::initAudioPort(input, index, port); + + if (!input && index == 0) port.name = "Osc Out"; +} + +// Processing functions + +void AlphaOsc::activate() { + // calculate filter coefficients and stuff + printf("called activate()\n"); +} + +void AlphaOsc::deactivate() { + printf("called deactivate()\n"); +} + +void AlphaOsc::run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) { + bzero(outputs[0], sizeof(float) * frames); + + // cast unused parameters to void for now to stop the compiler complaining + (void) midiEventCount; + (void) midiEvents; +} + +// create the plugin +Plugin *createPlugin() { return new AlphaOsc(); } + +END_NAMESPACE_DISTRHO diff --git a/plugin/alphaosc.hpp b/plugin/alphaosc.hpp new file mode 100644 index 0000000..951397c --- /dev/null +++ b/plugin/alphaosc.hpp @@ -0,0 +1,68 @@ +/* + Alpha Juno Oscillator POC + + Copyright 2024 Gordon JC Pearce + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma once + +#include "DistrhoPlugin.hpp" + +START_NAMESPACE_DISTRHO + +class AlphaOsc : public Plugin { + public: + enum Parameters { + paramLFORate, + paramLFODelay, + + parameterCount + }; + + AlphaOsc(); + + protected: + const char *getLabel() const override { return "AlphaOsc"; } + const char *getDescription() const override { + return "Alpha Juno Oscillator Proof of Concept"; + } + const char *getMaker() const override { return "Gordonjcp"; } + const char *getLicense() const override { return "ISC"; } + uint32_t getVersion() const override { return d_version(1, 0, 0); } + int64_t getUniqueId() const override { return d_cconst('A', 'O', 's', 'c'); } + + // Initialisation + void initAudioPort(bool input, uint32_t index, AudioPort &port) override; + //void initParameter(uint32_t index, Parameter ¶meter) override; + + //void setParameterValue(uint32_t index, float value) override; + //float getParameterValue(uint32_t index) const override; + + // Processing + void activate() override; + void deactivate() override; + void run(const float **, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount) override; + + + private: + double sampleRate; + uint32_t omega; + uint32_t phase; + + DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AlphaOsc); +}; + +END_NAMESPACE_DISTRHO +