├── .gitignore ├── .gitmodules ├── Makefile ├── README.md └── source ├── mod-audio-to-cv ├── Makefile ├── Makefile.mk ├── mod-audio-to-cv.c ├── mod-audio-to-cv.lv2 │ ├── manifest.ttl │ └── mod-audio-to-cv.ttl └── mod-audio-to-cv.mk ├── mod-button-to-cv ├── Makefile ├── Makefile.mk ├── lv2-hmi.h ├── mod-button-to-cv.c ├── mod-button-to-cv.lv2 │ ├── manifest.ttl │ └── mod-button-to-cv.ttl └── state_map.h ├── mod-cv-abs ├── Makefile ├── Makefile.mk ├── mod-cv-abs.c └── mod-cv-abs.lv2 │ ├── manifest.ttl │ └── mod-cv-abs.ttl ├── mod-cv-attenuverter ├── Makefile ├── Makefile.mk ├── mod-cv-attenuverter.c ├── mod-cv-attenuverter.lv2 │ ├── manifest.ttl │ └── mod-cv-attenuverter.ttl └── mod-cv-attenuverter.mk ├── mod-cv-clock ├── Makefile ├── Makefile.mk ├── mod-cv-clock.c └── mod-cv-clock.lv2 │ ├── manifest.ttl │ └── mod-cv-clock.ttl ├── mod-cv-control ├── Makefile ├── Makefile.mk ├── mod-cv-control.c └── mod-cv-control.lv2 │ ├── manifest.ttl │ └── mod-cv-control.ttl ├── mod-cv-gate ├── Makefile ├── Makefile.mk ├── mod-cv-gate.c └── mod-cv-gate.lv2 │ ├── manifest.ttl │ └── mod-cv-gate.ttl ├── mod-cv-meter ├── Makefile ├── Makefile.mk ├── mod-cv-meter.c ├── mod-cv-meter.lv2 │ ├── manifest.ttl │ └── mod-cv-meter.ttl └── mod-cv-meter.mk ├── mod-cv-parameter-modulation ├── Makefile ├── Makefile.mk ├── mod-cv-parameter-modulation.c └── mod-cv-parameter-modulation.lv2 │ ├── manifest.ttl │ └── mod-cv-parameter-modulation.ttl ├── mod-cv-random ├── Makefile ├── Makefile.mk ├── mod-cv-random.c └── mod-cv-random.lv2 │ ├── manifest.ttl │ └── mod-cv-random.ttl ├── mod-cv-range ├── Makefile ├── Makefile.mk ├── mod-cv-range.c └── mod-cv-range.lv2 │ ├── manifest.ttl │ └── mod-cv-range.ttl ├── mod-cv-round ├── Makefile ├── Makefile.mk ├── mod-cv-round.c └── mod-cv-round.lv2 │ ├── manifest.ttl │ └── mod-cv-round.ttl ├── mod-cv-slew ├── Makefile ├── Makefile.mk ├── mod-cv-slew.c ├── mod-cv-slew.lv2 │ ├── manifest.ttl │ └── mod-cv-slew.ttl └── mod-cv-slew.mk ├── mod-cv-switch1 ├── Makefile ├── Makefile.mk ├── mod-cv-switch1.c ├── mod-cv-switch1.lv2 │ ├── manifest.ttl │ └── mod-cv-switch1.ttl └── mod-cv-switch1.mk ├── mod-cv-switch2 ├── Makefile ├── Makefile.mk ├── mod-cv-switch2.c ├── mod-cv-switch2.lv2 │ ├── manifest.ttl │ └── mod-cv-switch2.ttl └── mod-cv-switch2.mk ├── mod-cv-switch3 ├── Makefile ├── Makefile.mk ├── mod-cv-switch3.c ├── mod-cv-switch3.lv2 │ ├── manifest.ttl │ └── mod-cv-switch3.ttl └── mod-cv-switch3.mk ├── mod-cv-switch4 ├── Makefile ├── Makefile.mk ├── mod-cv-switch4.c ├── mod-cv-switch4.lv2 │ ├── manifest.ttl │ └── mod-cv-switch4.ttl └── mod-cv-switch4.mk ├── mod-cv-to-audio ├── Makefile ├── Makefile.mk ├── mod-cv-to-audio.c └── mod-cv-to-audio.lv2 │ ├── manifest.ttl │ └── mod-cv-to-audio.ttl ├── mod-cv-transport ├── Makefile ├── Makefile.mk ├── mod-cv-transport.c └── mod-cv-transport.lv2 │ ├── manifest.ttl │ └── mod-cv-transport.ttl ├── mod-logic-operators ├── .gitignore ├── .gitmodules ├── Makefile └── plugins │ └── logic-operators │ ├── DistrhoPluginInfo.h │ ├── Makefile │ ├── logic-operators.cpp │ ├── logic-operators.hpp │ ├── lv2-data │ ├── logic-operators_dsp.ttl │ └── manifest.ttl │ └── operators │ ├── AND.hpp │ ├── INV.hpp │ ├── NAND.hpp │ ├── NOR.hpp │ ├── OR.hpp │ ├── XNOR.hpp │ ├── XOR.hpp │ ├── operator.cpp │ └── operator.hpp ├── mod-midi-to-cv-mono ├── Makefile ├── Makefile.mk ├── mod-midi-to-cv-mono.c ├── mod-midi-to-cv-mono.lv2 │ ├── manifest.ttl │ └── mod-midi-to-cv-mono.ttl └── mod-midi-to-cv-mono.mk └── mod-midi-to-cv-poly ├── Makefile ├── Makefile.mk ├── mod-midi-to-cv-poly.c ├── mod-midi-to-cv-poly.lv2 ├── manifest.ttl └── mod-midi-to-cv-poly.ttl └── mod-midi-to-cv-poly.mk /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.DS_Store 3 | *.sh 4 | *.so 5 | *.xcf 6 | bundles 7 | mod-phase-oscillator 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "source/mod-logic-operators/dpf"] 2 | path = source/mod-logic-operators/dpf 3 | url = https://github.com/DISTRHO/DPF.git 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | LV2_DESTDIR=$(DESTDIR)/usr/lib/lv2 2 | 3 | all: 4 | $(MAKE) -C source/mod-audio-to-cv 5 | $(MAKE) -C source/mod-cv-transport 6 | $(MAKE) -C source/mod-cv-to-audio 7 | $(MAKE) -C source/mod-cv-abs 8 | $(MAKE) -C source/mod-cv-attenuverter 9 | $(MAKE) -C source/mod-cv-clock 10 | $(MAKE) -C source/mod-cv-control 11 | $(MAKE) -C source/mod-cv-gate 12 | $(MAKE) -C source/mod-cv-meter 13 | $(MAKE) -C source/mod-cv-parameter-modulation 14 | $(MAKE) -C source/mod-cv-random 15 | $(MAKE) -C source/mod-cv-range 16 | $(MAKE) -C source/mod-cv-round 17 | $(MAKE) -C source/mod-cv-slew 18 | $(MAKE) -C source/mod-cv-switch1 19 | $(MAKE) -C source/mod-cv-switch2 20 | $(MAKE) -C source/mod-cv-switch3 21 | $(MAKE) -C source/mod-cv-switch4 22 | $(MAKE) -C source/mod-midi-to-cv-mono 23 | $(MAKE) -C source/mod-midi-to-cv-poly 24 | $(MAKE) -C source/mod-logic-operators 25 | $(MAKE) -C source/mod-button-to-cv 26 | 27 | install: all 28 | install -d $(LV2_DESTDIR) 29 | cp -r source/mod-audio-to-cv/mod-audio-to-cv.lv2 $(LV2_DESTDIR) 30 | cp -r source/mod-cv-abs/mod-cv-abs.lv2 $(LV2_DESTDIR) 31 | cp -r source/mod-cv-attenuverter/mod-cv-attenuverter.lv2 $(LV2_DESTDIR) 32 | cp -r source/mod-cv-clock/mod-cv-clock.lv2 $(LV2_DESTDIR) 33 | cp -r source/mod-cv-control/mod-cv-control.lv2 $(LV2_DESTDIR) 34 | cp -r source/mod-cv-gate/mod-cv-gate.lv2 $(LV2_DESTDIR) 35 | cp -r source/mod-cv-meter/mod-cv-meter.lv2 $(LV2_DESTDIR) 36 | cp -r source/mod-cv-parameter-modulation/mod-cv-parameter-modulation.lv2 $(LV2_DESTDIR) 37 | cp -r source/mod-cv-random/mod-cv-random.lv2 $(LV2_DESTDIR) 38 | cp -r source/mod-cv-range/mod-cv-range.lv2 $(LV2_DESTDIR) 39 | cp -r source/mod-cv-round/mod-cv-round.lv2 $(LV2_DESTDIR) 40 | cp -r source/mod-cv-slew/mod-cv-slew.lv2 $(LV2_DESTDIR) 41 | cp -r source/mod-cv-switch1/mod-cv-switch1.lv2 $(LV2_DESTDIR) 42 | cp -r source/mod-cv-switch2/mod-cv-switch2.lv2 $(LV2_DESTDIR) 43 | cp -r source/mod-cv-switch3/mod-cv-switch3.lv2 $(LV2_DESTDIR) 44 | cp -r source/mod-cv-switch4/mod-cv-switch4.lv2 $(LV2_DESTDIR) 45 | cp -r source/mod-cv-to-audio/mod-cv-to-audio.lv2 $(LV2_DESTDIR) 46 | cp -r source/mod-cv-transport/mod-cv-transport.lv2 $(LV2_DESTDIR) 47 | cp -r source/mod-logic-operators/bin/logic-operators.lv2 $(LV2_DESTDIR) 48 | cp -r source/mod-midi-to-cv-mono/mod-midi-to-cv-mono.lv2 $(LV2_DESTDIR) 49 | cp -r source/mod-midi-to-cv-poly/mod-midi-to-cv-poly.lv2 $(LV2_DESTDIR) 50 | cp -r source/mod-button-to-cv/mod-button-to-cv.lv2 $(LV2_DESTDIR) 51 | 52 | clean: 53 | $(MAKE) clean -C source/mod-audio-to-cv 54 | $(MAKE) clean -C source/mod-cv-abs 55 | $(MAKE) clean -C source/mod-cv-attenuverter 56 | $(MAKE) clean -C source/mod-cv-clock 57 | $(MAKE) clean -C source/mod-cv-control 58 | $(MAKE) clean -C source/mod-cv-gate 59 | $(MAKE) clean -C source/mod-cv-meter 60 | $(MAKE) clean -C source/mod-cv-parameter-modulation 61 | $(MAKE) clean -C source/mod-cv-random 62 | $(MAKE) clean -C source/mod-cv-range 63 | $(MAKE) clean -C source/mod-cv-round 64 | $(MAKE) clean -C source/mod-cv-slew 65 | $(MAKE) clean -C source/mod-cv-switch1 66 | $(MAKE) clean -C source/mod-cv-switch2 67 | $(MAKE) clean -C source/mod-cv-switch3 68 | $(MAKE) clean -C source/mod-cv-switch4 69 | $(MAKE) clean -C source/mod-cv-to-audio 70 | $(MAKE) clean -C source/mod-cv-transport 71 | $(MAKE) clean -C source/mod-logic-operators 72 | $(MAKE) clean -C source/mod-midi-to-cv-mono 73 | $(MAKE) clean -C source/mod-midi-to-cv-poly 74 | $(MAKE) clean -C source/mod-button-to-cv 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MOD-CV-Plugins 2 | 3 | This repository contains the source code for the `mod-cv-plugins` 4 | 5 | ##### MOD-CV-Plugins: 6 | * mod-cv-attenuverter 7 | * mod-cv-clock 8 | * mod-cv-control 9 | * mod-cv-meter 10 | * mod-cv-switch1 11 | * mod-cv-switch2 12 | * mod-cv-switch3 13 | * mod-cv-switch4 14 | * mod-cv-to-audio 15 | * mod-midi-to-cv-mono 16 | * mod-midi-to-cv-poly 17 | * mod-cv-abs 18 | * mod-cv-gate 19 | * mod-cv-random 20 | * mod-cv-range 21 | * mod-cv-round 22 | * mod-cv-slew 23 | * mod-logic-operators 24 | * mod-audio-to-cv(beta) 25 | * mod-cv-change(beta) 26 | 27 | ### Building and installation 28 | 29 | The logic operators plugin uses [DPF](https://github.com/DISTRHO/DPF). 30 | This is included in a submodule, therefore this needs to be enabled before this plugin can be build. To enabled this, run: 31 | ``` 32 | $ git submodule init 33 | $ git submodule update 34 | ``` 35 | 36 | Then all plugins can be build by running: 37 | ``` 38 | $ make 39 | ``` 40 | 41 | To install all plugins run: 42 | ``` 43 | $ make install 44 | ``` 45 | 46 | To build an individual plugin, do: 47 | ``` 48 | $ cd source/ 49 | $ make 50 | ``` 51 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-audio-to-cvs.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-audio-to-cv 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-audio-to-cv.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/mod-audio-to-cv.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 6 | 7 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-audio-to-cv" 8 | 9 | #ifndef DEBUG 10 | #define DEBUG 0 11 | #endif 12 | #define debug_print(...) \ 13 | ((void)((DEBUG) ? fprintf(stderr, __VA_ARGS__) : 0)) 14 | 15 | typedef enum { 16 | AUDIO_IN = 0, 17 | CV_OUT = 1, 18 | P_LEVEL = 2, 19 | P_OFFSET = 3, 20 | P_ENABLE = 4 21 | } PortIndex; 22 | 23 | typedef struct { 24 | float* input; 25 | float* output; 26 | float* level; 27 | float* offset; 28 | float* plugin_enabled; 29 | } Convert; 30 | 31 | static LV2_Handle 32 | instantiate(const LV2_Descriptor* descriptor, 33 | double rate, 34 | const char* bundle_path, 35 | const LV2_Feature* const* features) 36 | { 37 | Convert* self = (Convert*)malloc(sizeof(Convert)); 38 | 39 | return (LV2_Handle)self; 40 | } 41 | 42 | static void 43 | connect_port(LV2_Handle instance, 44 | uint32_t port, 45 | void* data) 46 | { 47 | Convert* self = (Convert*)instance; 48 | 49 | switch ((PortIndex)port) { 50 | case AUDIO_IN: 51 | self->input = (float*)data; 52 | break; 53 | case CV_OUT: 54 | self->output = (float*)data; 55 | break; 56 | case P_LEVEL: 57 | self->level = (float*)data; 58 | break; 59 | case P_OFFSET: 60 | self->offset = (float*)data; 61 | break; 62 | case P_ENABLE: 63 | self->plugin_enabled = (float*)data; 64 | break; 65 | } 66 | } 67 | 68 | static void 69 | activate(LV2_Handle instance) 70 | { 71 | } 72 | 73 | static void 74 | run(LV2_Handle instance, uint32_t n_samples) 75 | { 76 | Convert* self = (Convert*)instance; 77 | float lC = *self->level; 78 | float oC = *self->offset; 79 | for ( uint32_t i = 0; i < n_samples; i++) 80 | { 81 | if(*self->plugin_enabled == 1.0) { 82 | self->output[i] = ((self->input[i] * lC) + oC); 83 | } else { 84 | self->output[i] = 0.0f; 85 | } 86 | } 87 | } 88 | 89 | static void 90 | deactivate(LV2_Handle instance) 91 | { 92 | } 93 | 94 | static void 95 | cleanup(LV2_Handle instance) 96 | { 97 | free(instance); 98 | } 99 | 100 | static const void* 101 | extension_data(const char* uri) 102 | { 103 | return NULL; 104 | } 105 | 106 | static const LV2_Descriptor descriptor = { 107 | PLUGIN_URI, 108 | instantiate, 109 | connect_port, 110 | activate, 111 | run, 112 | deactivate, 113 | cleanup, 114 | extension_data 115 | }; 116 | 117 | LV2_SYMBOL_EXPORT 118 | const LV2_Descriptor* 119 | lv2_descriptor(uint32_t index) 120 | { 121 | switch (index) { 122 | case 0: return &descriptor; 123 | default: return NULL; 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/mod-audio-to-cv.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/mod-audio-to-cv.lv2/mod-audio-to-cv.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "Audio to CV"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen & Jarno Verheesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 3; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | Audio to CV converts an audio signal to a control voltage signal. 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort, lv2:AudioPort; 41 | lv2:index 0; 42 | lv2:symbol "AudioIn"; 43 | lv2:name "Audio Input"; 44 | ], 45 | [ 46 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 47 | lv2:index 1; 48 | lv2:symbol "CVout"; 49 | lv2:name "CV Output"; 50 | ] 51 | , 52 | [ 53 | a lv2:InputPort , 54 | lv2:ControlPort ; 55 | lv2:index 2 ; 56 | lv2:symbol "Level" ; 57 | lv2:name "Level"; 58 | lv2:default 1.0 ; 59 | lv2:minimum 0.0 ; 60 | lv2:maximum 10.0 ; 61 | ] 62 | , 63 | [ 64 | a lv2:InputPort , 65 | lv2:ControlPort ; 66 | lv2:index 3 ; 67 | lv2:symbol "Offset" ; 68 | lv2:name "Offset"; 69 | lv2:default 0.0 ; 70 | lv2:minimum -10.0 ; 71 | lv2:maximum 10.0 ; 72 | units:unit mod:volts ; 73 | ] 74 | , 75 | [ 76 | a lv2:InputPort , 77 | lv2:ControlPort ; 78 | lv2:index 4 ; 79 | lv2:symbol "BYPASS" ; 80 | lv2:name "BYPASS" ; 81 | lv2:default 1.0 ; 82 | lv2:minimum 0.0 ; 83 | lv2:maximum 1.0 ; 84 | lv2:designation lv2:enabled; 85 | lv2:portProperty lv2:toggled; 86 | ] 87 | . 88 | -------------------------------------------------------------------------------- /source/mod-audio-to-cv/mod-audio-to-cv.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-audio-to-cv 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_AUDIO_TO_CV_SITE_METHOD = local 9 | MOD_AUDIO_TO_CV_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_AUDIO_TO_CV_VERSION = 3 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_AUDIO_TO_CV_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_AUDIO_TO_CV_BUNDLES = mod-audio-to-cv.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_AUDIO_TO_CV_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_AUDIO_TO_CV_BUILD_CMDS 27 | $(MOD_AUDIO_TO_CV_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_AUDIO_TO_CV_INSTALL_TARGET_CMDS 32 | $(MOD_AUDIO_TO_CV_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-button-to-cv/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-button-to-cv.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-button-to-cv 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-button-to-cv/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-button-to-cv.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-button-to-cv/mod-button-to-cv.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-button-to-cv/state_map.h: -------------------------------------------------------------------------------- 1 | /* 2 | LV2 State Map 3 | Copyright 2016 David Robillard 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted, provided that the above 6 | copyright notice and this permission notice appear in all copies. 7 | THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | */ 15 | 16 | #include "lv2/atom/atom.h" 17 | #include "lv2/urid/urid.h" 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | /** Entry in an array that serves as a dictionary of properties. */ 24 | typedef struct { 25 | const char* uri; 26 | LV2_URID urid; 27 | LV2_Atom* value; 28 | } StateMapItem; 29 | 30 | /** Comparator for StateMapItems sorted by URID. */ 31 | static int 32 | state_map_cmp(const void* a, const void* b) 33 | { 34 | const StateMapItem* ka = (const StateMapItem*)a; 35 | const StateMapItem* kb = (const StateMapItem*)b; 36 | if (ka->urid < kb->urid) { 37 | return -1; 38 | } 39 | 40 | if (kb->urid < ka->urid) { 41 | return 1; 42 | } 43 | 44 | return 0; 45 | } 46 | 47 | /** Helper macro for terse state map initialisation. */ 48 | #define STATE_MAP_INIT(type, ptr) \ 49 | (LV2_ATOM__##type), (sizeof(*(ptr)) - sizeof(LV2_Atom)), (ptr) 50 | 51 | /** 52 | Initialise a state map. 53 | The variable parameters list must be NULL terminated, and is a sequence of 54 | const char* uri, const char* type, uint32_t size, LV2_Atom* value. The 55 | value must point to a valid atom that resides elsewhere, the state map is 56 | only an index and does not contain actual state values. The macro 57 | STATE_MAP_INIT can be used to make simpler code when state is composed of 58 | standard atom types, for example: 59 | struct Plugin { 60 | LV2_URID_Map* map; 61 | StateMapItem props[3]; 62 | // ... 63 | }; 64 | state_map_init( 65 | self->props, self->map, self->map->handle, 66 | PLUG_URI "#gain", STATE_MAP_INIT(Float, &state->gain), 67 | PLUG_URI "#offset", STATE_MAP_INIT(Int, &state->offset), 68 | PLUG_URI "#file", STATE_MAP_INIT(Path, &state->file), 69 | NULL); 70 | */ 71 | static void 72 | state_map_init( 73 | StateMapItem dict[], 74 | LV2_URID_Map* map, 75 | LV2_URID_Map_Handle handle, 76 | /* const char* uri, const char* type, uint32_t size, LV2_Atom* value */...) 77 | { 78 | // Set dict entries from parameters 79 | unsigned i = 0; 80 | va_list args; 81 | va_start(args, handle); 82 | for (const char* uri = NULL; (uri = va_arg(args, const char*)); ++i) { 83 | const char* type = va_arg(args, const char*); 84 | const uint32_t size = va_arg(args, uint32_t); 85 | LV2_Atom* const value = va_arg(args, LV2_Atom*); 86 | dict[i].uri = uri; 87 | dict[i].urid = map->map(map->handle, uri); 88 | dict[i].value = value; 89 | dict[i].value->size = size; 90 | dict[i].value->type = map->map(map->handle, type); 91 | } 92 | va_end(args); 93 | 94 | // Sort for fast lookup by URID by state_map_find() 95 | qsort(dict, i, sizeof(StateMapItem), state_map_cmp); 96 | } 97 | 98 | /** 99 | Retrieve an item from a state map by URID. 100 | This takes O(lg(n)) time, and is useful for implementing generic property 101 | access with little code, for example to respond to patch:Get messages for a 102 | specific property. 103 | */ 104 | static StateMapItem* 105 | state_map_find(StateMapItem dict[], uint32_t n_entries, LV2_URID urid) 106 | { 107 | const StateMapItem key = {NULL, urid, NULL}; 108 | return (StateMapItem*)bsearch( 109 | &key, dict, n_entries, sizeof(StateMapItem), state_map_cmp); 110 | } -------------------------------------------------------------------------------- /source/mod-cv-abs/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-abs 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-abs/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-abs/mod-cv-abs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 6 | 7 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-abs" 8 | 9 | 10 | typedef enum { 11 | L_INPUT = 0, 12 | L_OUTPUT = 1, 13 | L_ENABLE = 2 14 | } PortIndex; 15 | 16 | 17 | typedef struct { 18 | float* input; 19 | float* output; 20 | float* plugin_enabled; 21 | } CvAbs; 22 | 23 | 24 | static LV2_Handle 25 | instantiate(const LV2_Descriptor* descriptor, 26 | double rate, 27 | const char* bundle_path, 28 | const LV2_Feature* const* features) 29 | { 30 | CvAbs* self = (CvAbs*)malloc(sizeof(CvAbs)); 31 | 32 | return (LV2_Handle)self; 33 | } 34 | 35 | 36 | static void 37 | connect_port(LV2_Handle instance, 38 | uint32_t port, 39 | void* data) 40 | { 41 | CvAbs* self = (CvAbs*)instance; 42 | 43 | switch ((PortIndex)port) { 44 | case L_INPUT: 45 | self->input = (float*)data; 46 | break; 47 | case L_OUTPUT: 48 | self->output = (float*)data; 49 | break; 50 | case L_ENABLE: 51 | self->plugin_enabled = (float*)data; 52 | break; 53 | } 54 | } 55 | 56 | 57 | static void 58 | activate(LV2_Handle instance) 59 | { 60 | } 61 | 62 | 63 | static void 64 | run(LV2_Handle instance, uint32_t n_samples) 65 | { 66 | CvAbs* self = (CvAbs*) instance; 67 | 68 | for ( uint32_t i = 0; i < n_samples; i++) 69 | { 70 | if ((int)*self->plugin_enabled == 1) { 71 | self->output[i] = fabs(self->input[i]); 72 | } else { 73 | self->output[i] = self->input[i]; 74 | } 75 | } 76 | } 77 | 78 | 79 | static void 80 | deactivate(LV2_Handle instance) 81 | { 82 | } 83 | 84 | 85 | static void 86 | cleanup(LV2_Handle instance) 87 | { 88 | free(instance); 89 | } 90 | 91 | 92 | static const void* 93 | extension_data(const char* uri) 94 | { 95 | return NULL; 96 | } 97 | 98 | 99 | static const LV2_Descriptor descriptor = { 100 | PLUGIN_URI, 101 | instantiate, 102 | connect_port, 103 | activate, 104 | run, 105 | deactivate, 106 | cleanup, 107 | extension_data 108 | }; 109 | 110 | 111 | LV2_SYMBOL_EXPORT 112 | const LV2_Descriptor* 113 | lv2_descriptor(uint32_t index) 114 | { 115 | switch (index) { 116 | case 0: return &descriptor; 117 | default: return NULL; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /source/mod-cv-abs/mod-cv-abs.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-abs/mod-cv-abs.lv2/mod-cv-abs.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix modgui: . 6 | @prefix mod: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV ABS"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 18 | doap:developer [ 19 | foaf:name "Bram Giesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | Plugin that converts the incoming signal to an absolute value. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:symbol "CVin"; 42 | lv2:name "CV Input"; 43 | ], 44 | [ 45 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 46 | lv2:index 1; 47 | lv2:symbol "CVout1"; 48 | lv2:name "CV Output"; 49 | ], 50 | [ 51 | a lv2:InputPort , 52 | lv2:ControlPort ; 53 | lv2:index 2 ; 54 | lv2:symbol "PluginEnabled" ; 55 | lv2:name "PluginEnabled" ; 56 | lv2:default 1.0 ; 57 | lv2:minimum 0.0 ; 58 | lv2:maximum 1.0 ; 59 | lv2:designation lv2:enabled; 60 | lv2:portProperty lv2:toggled; 61 | ] 62 | . 63 | -------------------------------------------------------------------------------- /source/mod-cv-attenuverter/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-attenuverter 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-attenuverter/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-attenuverter/mod-cv-attenuverter.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-attenuverter/mod-cv-attenuverter.lv2/mod-cv-attenuverter.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix modgui: . 6 | @prefix mod: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "Attenuverter Booster"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Jarno Verheesen & Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 3; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | Attenuverter Booster multiplies the CV signal by any given value between -10 and +10 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:symbol "CVin"; 43 | lv2:name "CV Input"; 44 | ], 45 | [ 46 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 47 | lv2:index 1; 48 | lv2:symbol "CVout1"; 49 | lv2:name "CV Output"; 50 | ], 51 | [ 52 | a lv2:InputPort , 53 | lv2:ControlPort ; 54 | lv2:index 2 ; 55 | lv2:symbol "Multiplier" ; 56 | lv2:name "Multiplier"; 57 | lv2:default 0.0 ; 58 | lv2:minimum -10.0 ; 59 | lv2:maximum 10.0 ; 60 | ], 61 | [ 62 | a lv2:InputPort , 63 | lv2:ControlPort ; 64 | lv2:index 3 ; 65 | lv2:symbol "Offset" ; 66 | lv2:name "Offset"; 67 | lv2:default 0.0 ; 68 | lv2:minimum -10.0 ; 69 | lv2:maximum 10.0 ; 70 | units:unit mod:volts ; 71 | ], 72 | [ 73 | a lv2:InputPort ,lv2:ControlPort ; 74 | lv2:index 4; 75 | lv2:symbol "Mode" ; 76 | lv2:name "Mode"; 77 | lv2:default 1 ; 78 | lv2:minimum 0 ; 79 | lv2:maximum 1 ; 80 | lv2:scalePoint [ rdfs:label "Linear"; rdf:value 0; ] ; 81 | lv2:scalePoint [ rdfs:label "Logarithmic"; rdf:value 1; ] ; 82 | lv2:portProperty lv2:enumeration; 83 | ], 84 | [ 85 | a lv2:InputPort, lv2:ControlPort ; 86 | lv2:index 5; 87 | lv2:symbol "Smoothing" ; 88 | lv2:name "Smoothing" ; 89 | lv2:default 1.0 ; 90 | lv2:minimum 0.0 ; 91 | lv2:maximum 1 ; 92 | lv2:portProperty lv2:toggled; 93 | ], 94 | [ 95 | a lv2:InputPort , 96 | lv2:ControlPort ; 97 | lv2:index 6 ; 98 | lv2:symbol "PluginEnabled" ; 99 | lv2:name "PluginEnabled" ; 100 | lv2:default 1.0 ; 101 | lv2:minimum 0.0 ; 102 | lv2:maximum 1.0 ; 103 | lv2:designation lv2:enabled; 104 | lv2:portProperty lv2:toggled; 105 | ] 106 | . 107 | -------------------------------------------------------------------------------- /source/mod-cv-attenuverter/mod-cv-attenuverter.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-attenuverter 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_ATTENUVERTER_SITE_METHOD = local 9 | MOD_CV_ATTENUVERTER_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_ATTENUVERTER_VERSION = 3 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_ATTENUVERTER_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_ATTENUVERTER_BUNDLES = mod-cv-attenuverter.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_ATTENUVERTER_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_ATTENUVERTER_BUILD_CMDS 27 | $(MOD_CV_ATTENUVERTER_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_ATTENUVERTER_INSTALL_TARGET_CMDS 32 | $(MOD_CV_ATTENUVERTER_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-clock/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-clock.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-clock 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-clock/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-clock/mod-cv-clock.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-clock/mod-cv-clock.lv2/mod-cv-clock.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix time: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "CV Clock"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen & Jarno Verheesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 3; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | CV Clock generates CV clock pulses or square waves in multiple divisions. The clock can run in free mode or be signed with the host tempo. 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:symbol "CVout1"; 43 | lv2:name "pulse"; 44 | lv2:minimum 0.0 ; 45 | lv2:maximum 10.0 ; 46 | ], 47 | [ 48 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 49 | lv2:index 1; 50 | lv2:symbol "CVout2"; 51 | lv2:name "square"; 52 | lv2:minimum 0.0 ; 53 | lv2:maximum 10.0 ; 54 | ], 55 | [ 56 | a lv2:InputPort ,lv2:ControlPort ; 57 | lv2:index 2 ; 58 | lv2:symbol "Bpm" ; 59 | lv2:name "Bpm"; 60 | lv2:default 120.0 ; 61 | lv2:minimum 20.0 ; 62 | lv2:maximum 280.0 ; 63 | lv2:portProperty lv2:integer ; 64 | ], 65 | [ 66 | a lv2:InputPort ,lv2:ControlPort ; 67 | lv2:index 3 ; 68 | lv2:symbol "Divisions" ; 69 | lv2:name "Divisions"; 70 | lv2:default 4 ; 71 | lv2:minimum 0.05 ; 72 | lv2:maximum 16 ; 73 | lv2:scalePoint [ rdfs:label "10 Notes"; rdf:value 0.05; ] ; 74 | lv2:scalePoint [ rdfs:label "8 Notes"; rdf:value 0.0625; ] ; 75 | lv2:scalePoint [ rdfs:label "6 Notes"; rdf:value 0.0937; ] ; 76 | lv2:scalePoint [ rdfs:label "4 Notes"; rdf:value 0.125; ] ; 77 | lv2:scalePoint [ rdfs:label "3 Notes"; rdf:value 0.1875 ; ] ; 78 | lv2:scalePoint [ rdfs:label "2 Notes"; rdf:value 0.25 ; ] ; 79 | lv2:scalePoint [ rdfs:label "Whole Note"; rdf:value 0.5 ; ] ; 80 | lv2:scalePoint [ rdfs:label "Half Note"; rdf:value 1 ; ] ; 81 | lv2:scalePoint [ rdfs:label "third Note"; rdf:value 1.5; ] ; 82 | lv2:scalePoint [ rdfs:label "Quarter"; rdf:value 2 ; ] ; 83 | lv2:scalePoint [ rdfs:label "Dotted 4th"; rdf:value 2.66666 ; ] ; 84 | lv2:scalePoint [ rdfs:label "Triplet 4th"; rdf:value 3; ] ; 85 | lv2:scalePoint [ rdfs:label "8th"; rdf:value 4 ; ] ; 86 | lv2:scalePoint [ rdfs:label "Dotted 8th"; rdf:value 5.33333; ] ; 87 | lv2:scalePoint [ rdfs:label "Triplet 8th"; rdf:value 6; ] ; 88 | lv2:scalePoint [ rdfs:label "16th"; rdf:value 8 ; ] ; 89 | lv2:scalePoint [ rdfs:label "Dotted 16th"; rdf:value 10.66666; ] ; 90 | lv2:scalePoint [ rdfs:label "Triplet 16th"; rdf:value 12; ] ; 91 | lv2:scalePoint [ rdfs:label "32th"; rdf:value 16 ; ] ; 92 | lv2:portProperty lv2:enumeration; 93 | ] 94 | , 95 | [ 96 | a lv2:InputPort, lv2:ControlPort; 97 | lv2:index 4; 98 | lv2:symbol "sync"; 99 | lv2:name "Sync"; 100 | lv2:minimum 0; 101 | lv2:default 0; 102 | lv2:maximum 1; 103 | lv2:portProperty lv2:integer, lv2:enumeration, lv2:toggled; 104 | lv2:scalePoint [ rdfs:label "Free Running"; rdf:value 0 ; ] ; 105 | lv2:scalePoint [ rdfs:label "Host Sync (if available)"; rdf:value 1 ; ] ; 106 | ] 107 | , 108 | [ 109 | a lv2:InputPort, atom:AtomPort ; 110 | atom:bufferType atom:Sequence ; 111 | atom:supports time:Position ; 112 | lv2:index 5 ; 113 | lv2:symbol "control" ; 114 | lv2:name "Control" ; 115 | ] 116 | . 117 | -------------------------------------------------------------------------------- /source/mod-cv-control/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-control 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-control/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-control/mod-cv-control.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-control" 7 | 8 | typedef enum { 9 | L_OUTPUT = 0, 10 | L_LEVEL = 1, 11 | L_SMOOTHING = 2 12 | } PortIndex; 13 | 14 | typedef struct { 15 | float* output; 16 | float* level; 17 | float* smoothing; 18 | double a0; 19 | double b1; 20 | double z1; 21 | } Control; 22 | 23 | static LV2_Handle 24 | instantiate(const LV2_Descriptor* descriptor, 25 | double rate, 26 | const char* bundle_path, 27 | const LV2_Feature* const* features) 28 | { 29 | Control* self = (Control*)malloc(sizeof(Control)); 30 | 31 | self->z1 = 0.0; 32 | double frequency = 550.0 / rate; 33 | self->b1 = exp(-2.0 * M_PI * frequency); 34 | self->a0 = 1.0 - self->b1; 35 | 36 | return (LV2_Handle)self; 37 | } 38 | 39 | static void 40 | connect_port(LV2_Handle instance, 41 | uint32_t port, 42 | void* data) 43 | { 44 | Control* self = (Control*)instance; 45 | 46 | switch ((PortIndex)port) { 47 | case L_OUTPUT: 48 | self->output = (float*)data; 49 | break; 50 | case L_LEVEL: 51 | self->level = (float*)data; 52 | break; 53 | case L_SMOOTHING: 54 | self->smoothing = (float*)data; 55 | break; 56 | } 57 | } 58 | 59 | static void 60 | activate(LV2_Handle instance) 61 | { 62 | } 63 | 64 | static double 65 | lowPassProcess(Control* self, float input) 66 | { 67 | return self->z1 = input * self->a0 + self->z1 * self->b1; 68 | } 69 | 70 | static void 71 | run(LV2_Handle instance, uint32_t n_samples) 72 | { 73 | Control* self = (Control*) instance; 74 | float coef = *self->level; 75 | 76 | for ( uint32_t i = 0; i < n_samples; i++) 77 | { 78 | float smooth = lowPassProcess(self, coef); 79 | 80 | if ((int)*self->smoothing == 1) { 81 | coef = smooth; 82 | } 83 | 84 | self->output[i] = coef; 85 | } 86 | } 87 | 88 | static void 89 | deactivate(LV2_Handle instance) 90 | { 91 | } 92 | 93 | static void 94 | cleanup(LV2_Handle instance) 95 | { 96 | free(instance); 97 | } 98 | 99 | static const void* 100 | extension_data(const char* uri) 101 | { 102 | return NULL; 103 | } 104 | 105 | static const LV2_Descriptor descriptor = { 106 | PLUGIN_URI, 107 | instantiate, 108 | connect_port, 109 | activate, 110 | run, 111 | deactivate, 112 | cleanup, 113 | extension_data 114 | }; 115 | 116 | LV2_SYMBOL_EXPORT 117 | const LV2_Descriptor* 118 | lv2_descriptor(uint32_t index) 119 | { 120 | switch (index) { 121 | case 0: return &descriptor; 122 | default: return NULL; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /source/mod-cv-control/mod-cv-control.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-control/mod-cv-control.lv2/mod-cv-control.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "Control to CV"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen & Jarno Verheesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 3; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | Control to CV enables you to generate a control voltage signal from a control value. 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:symbol "Cvoutput"; 43 | lv2:name "CV Output"; 44 | ], 45 | [ 46 | a lv2:InputPort , 47 | lv2:ControlPort ; 48 | lv2:index 1 ; 49 | lv2:symbol "Control" ; 50 | lv2:name "Control"; 51 | lv2:default 1.0 ; 52 | lv2:minimum 0.0 ; 53 | lv2:maximum 10.0 ; 54 | units:unit mod:volts ; 55 | ], 56 | [ 57 | a lv2:InputPort, lv2:ControlPort ; 58 | lv2:index 2; 59 | lv2:symbol "Smoothing" ; 60 | lv2:name "Smoothing" ; 61 | lv2:default 1.0 ; 62 | lv2:minimum 0.0 ; 63 | lv2:maximum 1 ; 64 | lv2:portProperty lv2:toggled; 65 | ] 66 | . 67 | -------------------------------------------------------------------------------- /source/mod-cv-gate/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-gate.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-gate 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-gate/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-gate/mod-cv-gate.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 7 | 8 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-gate" 9 | 10 | 11 | typedef enum { 12 | L_GATE = 0, 13 | L_INPUT = 1, 14 | L_OUTPUT = 2, 15 | L_OPENING_THRESHOLD = 3, 16 | L_CLOSING_THRESHOLD = 4, 17 | L_ENABLE = 5 18 | } PortIndex; 19 | 20 | 21 | typedef struct { 22 | float* gate; 23 | float* input; 24 | float* output; 25 | float* opening_threshold; 26 | float* closing_threshold; 27 | float* plugin_enabled; 28 | 29 | bool gate_open; 30 | } Gate; 31 | 32 | 33 | static LV2_Handle 34 | instantiate(const LV2_Descriptor* descriptor, 35 | double rate, 36 | const char* bundle_path, 37 | const LV2_Feature* const* features) 38 | { 39 | Gate* self = (Gate*)malloc(sizeof(Gate)); 40 | 41 | self->gate_open = false; 42 | 43 | return (LV2_Handle)self; 44 | } 45 | 46 | 47 | static void 48 | connect_port(LV2_Handle instance, 49 | uint32_t port, 50 | void* data) 51 | { 52 | Gate* self = (Gate*)instance; 53 | 54 | switch ((PortIndex)port) { 55 | case L_GATE: 56 | self->gate = (float*)data; 57 | break; 58 | case L_INPUT: 59 | self->input = (float*)data; 60 | break; 61 | case L_OUTPUT: 62 | self->output = (float*)data; 63 | break; 64 | case L_OPENING_THRESHOLD: 65 | self->opening_threshold = (float*)data; 66 | break; 67 | case L_CLOSING_THRESHOLD: 68 | self->closing_threshold = (float*)data; 69 | break; 70 | case L_ENABLE: 71 | self->plugin_enabled = (float*)data; 72 | break; 73 | } 74 | } 75 | 76 | 77 | static void 78 | activate(LV2_Handle instance) 79 | { 80 | } 81 | 82 | 83 | static void 84 | run(LV2_Handle instance, uint32_t n_samples) 85 | { 86 | Gate* self = (Gate*) instance; 87 | 88 | for ( uint32_t i = 0; i < n_samples; i++) 89 | { 90 | if ((int)*self->plugin_enabled == 1) { 91 | if (*self->gate >= *self->opening_threshold) { 92 | self->gate_open = true; 93 | } 94 | if (*self->gate <= *self->closing_threshold) { 95 | self->gate_open = false; 96 | } 97 | 98 | if (self->gate_open) { 99 | self->output[i] = self->input[i]; 100 | } else { 101 | self->output[i] = 0.0; 102 | } 103 | } else { 104 | self->output[i] = self->input[i]; 105 | } 106 | } 107 | } 108 | 109 | 110 | static void 111 | deactivate(LV2_Handle instance) 112 | { 113 | } 114 | 115 | 116 | static void 117 | cleanup(LV2_Handle instance) 118 | { 119 | free(instance); 120 | } 121 | 122 | 123 | static const void* 124 | extension_data(const char* uri) 125 | { 126 | return NULL; 127 | } 128 | 129 | 130 | static const LV2_Descriptor descriptor = { 131 | PLUGIN_URI, 132 | instantiate, 133 | connect_port, 134 | activate, 135 | run, 136 | deactivate, 137 | cleanup, 138 | extension_data 139 | }; 140 | 141 | 142 | LV2_SYMBOL_EXPORT 143 | const LV2_Descriptor* 144 | lv2_descriptor(uint32_t index) 145 | { 146 | switch (index) { 147 | case 0: return &descriptor; 148 | default: return NULL; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /source/mod-cv-gate/mod-cv-gate.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-gate/mod-cv-gate.lv2/mod-cv-gate.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix modgui: . 6 | @prefix mod: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "CV Gate"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 1; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | CV Gate Plugin - if the incoming signal on input on is equal or higher then 1 it will pass the incoming signal of input two pass through the output, otherwise it will output 0.0 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:minimum 0.0 ; 43 | lv2:maximum 10.0 ; 44 | lv2:symbol "Gate"; 45 | lv2:name "Gate"; 46 | units:unit mod:volts ; 47 | ], 48 | [ 49 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 50 | lv2:index 1; 51 | lv2:minimum -5.0 ; 52 | lv2:maximum 5.0 ; 53 | lv2:symbol "CVin"; 54 | lv2:name "CV Input"; 55 | ], 56 | [ 57 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 58 | lv2:index 2; 59 | lv2:minimum -5.0 ; 60 | lv2:maximum 5.0 ; 61 | lv2:symbol "CVout"; 62 | lv2:name "CV Output"; 63 | ], 64 | [ 65 | a lv2:InputPort , 66 | lv2:ControlPort ; 67 | lv2:index 3 ; 68 | lv2:symbol "OpeningThreshold" ; 69 | lv2:name "OpeningThreshold"; 70 | lv2:default 1.0 ; 71 | lv2:minimum -10.0 ; 72 | lv2:maximum 10.0 ; 73 | units:unit mod:volts ; 74 | ], 75 | [ 76 | a lv2:InputPort , 77 | lv2:ControlPort ; 78 | lv2:index 4 ; 79 | lv2:symbol "ClosingThreshold" ; 80 | lv2:name "ClosingThreshold"; 81 | lv2:default 0.9 ; 82 | lv2:minimum -10.0 ; 83 | lv2:maximum 10.0 ; 84 | units:unit mod:volts ; 85 | ], 86 | [ 87 | a lv2:InputPort , 88 | lv2:ControlPort ; 89 | lv2:index 5 ; 90 | lv2:symbol "PluginEnabled" ; 91 | lv2:name "PluginEnabled" ; 92 | lv2:default 1.0 ; 93 | lv2:minimum 0.0 ; 94 | lv2:maximum 1.0 ; 95 | lv2:designation lv2:enabled; 96 | lv2:portProperty lv2:toggled; 97 | ] 98 | . 99 | -------------------------------------------------------------------------------- /source/mod-cv-meter/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-meter 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-meter/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-meter/mod-cv-meter.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-meter/mod-cv-meter.lv2/mod-cv-meter.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdfs: . 8 | @prefix atom: . 9 | @prefix midi: . 10 | @prefix urid: . 11 | 12 | 13 | a lv2:Plugin, mod:ControlVoltagePlugin; 14 | 15 | doap:name "CV meter"; 16 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html ; 17 | 18 | doap:developer [ 19 | foaf:name "Bram Giesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | ]; 28 | 29 | lv2:minorVersion 1; 30 | lv2:microVersion 0; 31 | 32 | rdfs:comment """ 33 | The CV Meter displays the value of the current incoming CV signal and the lowest and highest measured value over time. 34 | 35 | Features: 36 | Plugin by MOD Devices 37 | """; 38 | 39 | lv2:port 40 | [ 41 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 42 | lv2:index 0; 43 | lv2:minimum -5.0 ; 44 | lv2:maximum 5.0 ; 45 | lv2:symbol "CvInput"; 46 | lv2:name "CV input"; 47 | ], 48 | [ 49 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 50 | lv2:index 1; 51 | lv2:minimum -5.0 ; 52 | lv2:maximum 5.0 ; 53 | lv2:symbol "CvOutput"; 54 | lv2:name "CV Output"; 55 | ], 56 | [ 57 | a lv2:ControlPort, lv2:OutputPort ; 58 | lv2:index 2 ; 59 | lv2:symbol "min_level" ; 60 | lv2:name "Min Level" ; 61 | lv2:default 0.0 ; 62 | lv2:minimum -100.0 ; 63 | lv2:maximum 100.0 ; 64 | ], 65 | [ 66 | a lv2:ControlPort, lv2:OutputPort ; 67 | lv2:index 3 ; 68 | lv2:symbol "max_level" ; 69 | lv2:name "Max Level" ; 70 | lv2:default 0.0 ; 71 | lv2:minimum -100.0 ; 72 | lv2:maximum 100.0 ; 73 | ], 74 | [ 75 | a lv2:ControlPort, lv2:OutputPort ; 76 | lv2:index 4 ; 77 | lv2:symbol "level" ; 78 | lv2:name "Level" ; 79 | lv2:default 0.0 ; 80 | lv2:minimum -100.0 ; 81 | lv2:maximum 100.0 ; 82 | ], 83 | [ 84 | a lv2:InputPort ; 85 | a lv2:ControlPort ; 86 | lv2:index 5; 87 | lv2:symbol "Reset" ; 88 | lv2:name "Reset" ; 89 | lv2:portProperty epp:trigger ; 90 | lv2:portProperty epp:hasStrictBounds ; 91 | lv2:portProperty lv2:toggled ; 92 | lv2:default 0.00000 ; 93 | lv2:minimum 0.00000 ; 94 | lv2:maximum 1.00000 ; 95 | ], 96 | [ 97 | a lv2:InputPort , 98 | lv2:ControlPort ; 99 | lv2:index 6 ; 100 | lv2:symbol "PluginEnabled" ; 101 | lv2:name "PluginEnabled" ; 102 | lv2:default 1.0 ; 103 | lv2:minimum 0.0 ; 104 | lv2:maximum 1.0 ; 105 | lv2:designation lv2:enabled; 106 | lv2:portProperty lv2:toggled; 107 | ] 108 | . 109 | -------------------------------------------------------------------------------- /source/mod-cv-meter/mod-cv-meter.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-meter 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_METER_SITE_METHOD = local 9 | MOD_CV_METER_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_METER_VERSION = 3 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_METER_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_METER_BUNDLES = mod-cv-meter.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_METER_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_METER_BUILD_CMDS 27 | $(MOD_CV_METER_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_METER_INSTALL_TARGET_CMDS 32 | $(MOD_CV_METER_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-parameter-modulation/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-audio-to-cvs.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-parameter-modulation 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-parameter-modulation/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-audio-to-cv.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-parameter-modulation/mod-cv-parameter-modulation.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 6 | 7 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-parameter-modulation" 8 | 9 | #ifndef DEBUG 10 | #define DEBUG 0 11 | #endif 12 | #define debug_print(...) \ 13 | ((void)((DEBUG) ? fprintf(stderr, __VA_ARGS__) : 0)) 14 | 15 | typedef enum { 16 | AUDIO_IN = 0, 17 | CV_OUT = 1, 18 | P_OFFSET = 2, 19 | P_MODULATION = 3, 20 | P_ENABLE = 4 21 | } PortIndex; 22 | 23 | typedef struct { 24 | float* input; 25 | float* output; 26 | float* offset; 27 | float* modulation; 28 | float* plugin_enabled; 29 | } Convert; 30 | 31 | static LV2_Handle 32 | instantiate(const LV2_Descriptor* descriptor, 33 | double rate, 34 | const char* bundle_path, 35 | const LV2_Feature* const* features) 36 | { 37 | Convert* self = (Convert*)malloc(sizeof(Convert)); 38 | 39 | return (LV2_Handle)self; 40 | } 41 | 42 | static void 43 | connect_port(LV2_Handle instance, 44 | uint32_t port, 45 | void* data) 46 | { 47 | Convert* self = (Convert*)instance; 48 | 49 | switch ((PortIndex)port) { 50 | case AUDIO_IN: 51 | self->input = (float*)data; 52 | break; 53 | case CV_OUT: 54 | self->output = (float*)data; 55 | break; 56 | case P_OFFSET: 57 | self->offset = (float*)data; 58 | break; 59 | case P_MODULATION: 60 | self->modulation = (float*)data; 61 | break; 62 | case P_ENABLE: 63 | self->plugin_enabled = (float*)data; 64 | break; 65 | } 66 | } 67 | 68 | static void 69 | activate(LV2_Handle instance) 70 | { 71 | } 72 | 73 | static void 74 | run(LV2_Handle instance, uint32_t n_samples) 75 | { 76 | Convert* self = (Convert*)instance; 77 | float offset_param = *self->offset; 78 | float mod_param = *self->modulation; 79 | float out; 80 | for ( uint32_t i = 0; i < n_samples; i++) 81 | { 82 | if((int)*self->plugin_enabled == 1) { 83 | out = ((self->input[i] * (mod_param * 0.01)) + (offset_param * 0.1)); 84 | out = (out > 10.0) ? 10.0 : out; 85 | out = (out < 0.0) ? 0.0 : out; 86 | self->output[i] = out; 87 | } else { 88 | self->output[i] = 0.0f; 89 | } 90 | } 91 | } 92 | 93 | static void 94 | deactivate(LV2_Handle instance) 95 | { 96 | } 97 | 98 | static void 99 | cleanup(LV2_Handle instance) 100 | { 101 | free(instance); 102 | } 103 | 104 | static const void* 105 | extension_data(const char* uri) 106 | { 107 | return NULL; 108 | } 109 | 110 | static const LV2_Descriptor descriptor = { 111 | PLUGIN_URI, 112 | instantiate, 113 | connect_port, 114 | activate, 115 | run, 116 | deactivate, 117 | cleanup, 118 | extension_data 119 | }; 120 | 121 | LV2_SYMBOL_EXPORT 122 | const LV2_Descriptor* 123 | lv2_descriptor(uint32_t index) 124 | { 125 | switch (index) { 126 | case 0: return &descriptor; 127 | default: return NULL; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /source/mod-cv-parameter-modulation/mod-cv-parameter-modulation.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-parameter-modulation/mod-cv-parameter-modulation.lv2/mod-cv-parameter-modulation.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix foaf: . 4 | @prefix mod: . 5 | @prefix modgui: . 6 | @prefix rdf: . 7 | @prefix rdfs: . 8 | @prefix urid: . 9 | @prefix units: . 10 | 11 | 12 | a lv2:Plugin, mod:ControlVoltagePlugin; 13 | 14 | doap:name "CV Parameter Modulation"; 15 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 16 | doap:developer [ 17 | foaf:name "Bram Giesen"; 18 | foaf:homepage <>; 19 | foaf:mbox ; 20 | ]; 21 | 22 | doap:maintainer [ 23 | foaf:name "MOD"; 24 | foaf:homepage ; 25 | foaf:mbox ; 26 | ]; 27 | 28 | lv2:minorVersion 1; 29 | lv2:microVersion 0; 30 | 31 | rdfs:comment """ 32 | """; 33 | 34 | lv2:port 35 | [ 36 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 37 | lv2:index 0; 38 | lv2:symbol "CVin"; 39 | lv2:name "CV Input"; 40 | ], 41 | [ 42 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 43 | lv2:index 1; 44 | lv2:minimum 0.0 ; 45 | lv2:maximum 10.0 ; 46 | lv2:symbol "CVout"; 47 | lv2:name "CV Output"; 48 | ] 49 | , 50 | [ 51 | a lv2:InputPort , 52 | lv2:ControlPort ; 53 | lv2:index 2 ; 54 | lv2:symbol "ParameterValue" ; 55 | lv2:name "Parameter Value" ; 56 | lv2:default 0.0 ; 57 | lv2:minimum 0.0 ; 58 | lv2:maximum 100.0 ; 59 | units:unit units:pc ; 60 | ] 61 | , 62 | [ 63 | a lv2:InputPort , 64 | lv2:ControlPort ; 65 | lv2:index 3 ; 66 | lv2:symbol "ModulationDepth" ; 67 | lv2:name "Modulation Depth" ; 68 | lv2:default 0.0 ; 69 | lv2:minimum -200.0 ; 70 | lv2:maximum 200.0 ; 71 | units:unit units:pc ; 72 | ] 73 | , 74 | [ 75 | a lv2:InputPort , 76 | lv2:ControlPort ; 77 | lv2:index 4 ; 78 | lv2:symbol "BYPASS" ; 79 | lv2:name "BYPASS" ; 80 | lv2:default 1.0 ; 81 | lv2:minimum 0.0 ; 82 | lv2:maximum 1.0 ; 83 | lv2:designation lv2:enabled; 84 | lv2:portProperty lv2:toggled; 85 | ] 86 | . 87 | -------------------------------------------------------------------------------- /source/mod-cv-random/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-randoms.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-random 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-random/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-random.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-random/mod-cv-random.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 8 | 9 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-random" 10 | 11 | #ifndef DEBUG 12 | #define DEBUG 0 13 | #endif 14 | #define debug_print(...) \ 15 | ((void)((DEBUG) ? fprintf(stderr, __VA_ARGS__) : 0)) 16 | 17 | typedef enum { 18 | GATE_IN = 0, 19 | CV_OUT = 1, 20 | P_MIN = 2, 21 | P_MAX = 3, 22 | P_TRIGGER = 4, 23 | P_ENABLE = 5 24 | } PortIndex; 25 | 26 | typedef struct { 27 | bool cv_triggered; 28 | bool p_triggered; 29 | float rand_value; 30 | float* cv_trigger; 31 | float* output; 32 | float* max; 33 | float* min; 34 | float* p_trigger; 35 | float* plugin_enabled; 36 | } Convert; 37 | 38 | static LV2_Handle 39 | instantiate(const LV2_Descriptor* descriptor, 40 | double rate, 41 | const char* bundle_path, 42 | const LV2_Feature* const* features) 43 | { 44 | Convert* self = (Convert*)malloc(sizeof(Convert)); 45 | 46 | self->cv_triggered = false; 47 | self->p_triggered = false; 48 | self->rand_value = 0.0f; 49 | 50 | return (LV2_Handle)self; 51 | } 52 | 53 | static void 54 | connect_port(LV2_Handle instance, 55 | uint32_t port, 56 | void* data) 57 | { 58 | Convert* self = (Convert*)instance; 59 | 60 | switch ((PortIndex)port) { 61 | case GATE_IN: 62 | self->cv_trigger = (float*)data; 63 | break; 64 | case CV_OUT: 65 | self->output = (float*)data; 66 | break; 67 | case P_MIN: 68 | self->min = (float*)data; 69 | break; 70 | case P_MAX: 71 | self->max = (float*)data; 72 | break; 73 | case P_TRIGGER: 74 | self->p_trigger = (float*)data; 75 | break; 76 | case P_ENABLE: 77 | self->plugin_enabled = (float*)data; 78 | break; 79 | } 80 | } 81 | 82 | 83 | static void 84 | activate(LV2_Handle instance) 85 | { 86 | srand((unsigned int)time(NULL)); 87 | } 88 | 89 | 90 | static float 91 | random_number(float min, float max) 92 | { 93 | float scale = ((float)rand()/(float)(RAND_MAX)); 94 | float rand = min + scale * ( max - min ); 95 | 96 | return rand; 97 | } 98 | 99 | 100 | static void 101 | run(LV2_Handle instance, uint32_t n_samples) 102 | { 103 | Convert* self = (Convert*)instance; 104 | 105 | for ( uint32_t i = 0; i < n_samples; i++) 106 | { 107 | if((int)*self->plugin_enabled == 1.0) { 108 | if (self->cv_trigger[i] >= 1.0 && !self->cv_triggered) { 109 | self->rand_value = random_number(*self->min, *self->max); 110 | self->cv_triggered = true; 111 | } 112 | else if (self->cv_trigger[i] < 1.0 && self->cv_triggered) { 113 | self->cv_triggered = false; 114 | } 115 | if (*self->p_trigger >= 1.0 && !self->p_triggered) { 116 | self->rand_value = random_number(*self->min, *self->max); 117 | self->p_triggered = true; 118 | } 119 | else if (*self->p_trigger == 0.0 && self->p_triggered) { 120 | self->p_triggered = false; 121 | } 122 | self->output[i] = self->rand_value; 123 | } else { 124 | self->output[i] = 0.0f; 125 | } 126 | } 127 | } 128 | 129 | static void 130 | deactivate(LV2_Handle instance) 131 | { 132 | } 133 | 134 | static void 135 | cleanup(LV2_Handle instance) 136 | { 137 | free(instance); 138 | } 139 | 140 | static const void* 141 | extension_data(const char* uri) 142 | { 143 | return NULL; 144 | } 145 | 146 | static const LV2_Descriptor descriptor = { 147 | PLUGIN_URI, 148 | instantiate, 149 | connect_port, 150 | activate, 151 | run, 152 | deactivate, 153 | cleanup, 154 | extension_data 155 | }; 156 | 157 | LV2_SYMBOL_EXPORT 158 | const LV2_Descriptor* 159 | lv2_descriptor(uint32_t index) 160 | { 161 | switch (index) { 162 | case 0: return &descriptor; 163 | default: return NULL; 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /source/mod-cv-random/mod-cv-random.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-random/mod-cv-random.lv2/mod-cv-random.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "Random Generator"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 1; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | Random CV generator. It uses a gate input to trigger the next random value 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:minimum 0.0 ; 43 | lv2:maximum 10.0 ; 44 | lv2:symbol "GateIn"; 45 | lv2:name "Gate In"; 46 | ], 47 | [ 48 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 49 | lv2:index 1; 50 | lv2:minimum -5.0 ; 51 | lv2:maximum 5.0 ; 52 | lv2:symbol "CVout"; 53 | lv2:name "CV Output"; 54 | ] 55 | , 56 | [ 57 | a lv2:InputPort , 58 | lv2:ControlPort ; 59 | lv2:index 2 ; 60 | lv2:symbol "MinValue" ; 61 | lv2:name "MinValue"; 62 | lv2:default 0.0 ; 63 | lv2:minimum -10.0 ; 64 | lv2:maximum 10.0 ; 65 | units:unit mod:volts ; 66 | ] 67 | , 68 | [ 69 | a lv2:InputPort , 70 | lv2:ControlPort ; 71 | lv2:index 3 ; 72 | lv2:symbol "MaxValue" ; 73 | lv2:name "MaxValue"; 74 | lv2:default 1.0 ; 75 | lv2:minimum -10.0 ; 76 | lv2:maximum 10.0 ; 77 | units:unit mod:volts ; 78 | ] 79 | , 80 | [ 81 | a lv2:InputPort, 82 | lv2:ControlPort ; 83 | lv2:index 4; 84 | lv2:symbol "Trigger"; 85 | lv2:name "New Random Value"; 86 | lv2:default 0; 87 | lv2:minimum 0; 88 | lv2:maximum 1; 89 | lv2:portProperty lv2:integer, lv2:toggled, epp:trigger ; 90 | ] , 91 | [ 92 | a lv2:InputPort , 93 | lv2:ControlPort ; 94 | lv2:index 5 ; 95 | lv2:symbol "Enabled" ; 96 | lv2:name "Enabled" ; 97 | lv2:default 1.0 ; 98 | lv2:minimum 0.0 ; 99 | lv2:maximum 1.0 ; 100 | lv2:designation lv2:enabled; 101 | lv2:portProperty lv2:toggled; 102 | ] 103 | . 104 | -------------------------------------------------------------------------------- /source/mod-cv-range/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-range 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-range/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-range/mod-cv-range.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-range" 7 | 8 | typedef enum { 9 | P_INPUT = 0, 10 | P_OUTPUT_1 = 1, 11 | P_OUTPUT_2 = 2, 12 | P_MIN_RANGE = 3, 13 | P_MAX_RANGE = 4, 14 | P_MODE_ZERO = 5, 15 | } PortIndex; 16 | 17 | typedef struct { 18 | float* input; 19 | float* output_1; 20 | float* output_2; 21 | float* min_range; 22 | float* max_range; 23 | float* mode_zero; 24 | float output_value_1; 25 | float output_value_2; 26 | } Control; 27 | 28 | static LV2_Handle 29 | instantiate(const LV2_Descriptor* descriptor, 30 | double rate, 31 | const char* bundle_path, 32 | const LV2_Feature* const* features) 33 | { 34 | Control* self = (Control*)malloc(sizeof(Control)); 35 | 36 | self->output_value_1 = 0.0; 37 | self->output_value_2 = 0.0; 38 | return (LV2_Handle)self; 39 | } 40 | 41 | static void 42 | connect_port(LV2_Handle instance, 43 | uint32_t port, 44 | void* data) 45 | { 46 | Control* self = (Control*)instance; 47 | 48 | switch ((PortIndex)port) { 49 | case P_INPUT: 50 | self->input = (float*)data; 51 | break; 52 | case P_OUTPUT_1: 53 | self->output_1 = (float*)data; 54 | break; 55 | case P_OUTPUT_2: 56 | self->output_2 = (float*)data; 57 | break; 58 | case P_MIN_RANGE: 59 | self->min_range = (float*)data; 60 | break; 61 | case P_MAX_RANGE: 62 | self->max_range = (float*)data; 63 | break; 64 | case P_MODE_ZERO: 65 | self->mode_zero = (float*)data; 66 | break; 67 | } 68 | } 69 | 70 | static void 71 | activate(LV2_Handle instance) 72 | { 73 | } 74 | 75 | 76 | static void 77 | run(LV2_Handle instance, uint32_t n_samples) 78 | { 79 | Control* self = (Control*) instance; 80 | 81 | for ( uint32_t i = 0; i < n_samples; i++) 82 | { 83 | if ((int)*self->mode_zero == 1) { 84 | self->output_value_1 = 0.0; 85 | self->output_value_2 = 0.0; 86 | } 87 | 88 | if (*self->input >= *self->min_range && *self->input <= *self->max_range) { 89 | self->output_value_1 = *self->input; 90 | } else { 91 | self->output_value_2 = *self->input; 92 | } 93 | self->output_1[i] = self->output_value_1; 94 | self->output_2[i] = self->output_value_2; 95 | } 96 | } 97 | 98 | static void 99 | deactivate(LV2_Handle instance) 100 | { 101 | } 102 | 103 | static void 104 | cleanup(LV2_Handle instance) 105 | { 106 | free(instance); 107 | } 108 | 109 | static const void* 110 | extension_data(const char* uri) 111 | { 112 | return NULL; 113 | } 114 | 115 | static const LV2_Descriptor descriptor = { 116 | PLUGIN_URI, 117 | instantiate, 118 | connect_port, 119 | activate, 120 | run, 121 | deactivate, 122 | cleanup, 123 | extension_data 124 | }; 125 | 126 | LV2_SYMBOL_EXPORT 127 | const LV2_Descriptor* 128 | lv2_descriptor(uint32_t index) 129 | { 130 | switch (index) { 131 | case 0: return &descriptor; 132 | default: return NULL; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /source/mod-cv-range/mod-cv-range.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-range/mod-cv-range.lv2/mod-cv-range.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "CV Range Divider"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 3; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | The MIN and MAX controls on this plugin will determine the range of the first output. 36 | When the input signal goes out of that range it will be routed to the second output. 37 | """; 38 | 39 | lv2:port 40 | [ 41 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 42 | lv2:index 0; 43 | lv2:minimum -5.0 ; 44 | lv2:maximum 5.0 ; 45 | lv2:symbol "CvInput"; 46 | lv2:name "CV Input"; 47 | ], 48 | [ 49 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 50 | lv2:index 1; 51 | lv2:minimum -5.0 ; 52 | lv2:maximum 5.0 ; 53 | lv2:symbol "Cvoutput1"; 54 | lv2:name "CV Output1"; 55 | ], 56 | [ 57 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 58 | lv2:index 2; 59 | lv2:minimum -5.0 ; 60 | lv2:maximum 5.0 ; 61 | lv2:symbol "Cvoutput2"; 62 | lv2:name "CV Output2"; 63 | ], 64 | [ 65 | a lv2:InputPort , 66 | lv2:ControlPort ; 67 | lv2:index 3 ; 68 | lv2:symbol "MinRange" ; 69 | lv2:name "MinRange"; 70 | lv2:default 0.0 ; 71 | lv2:minimum -10.0 ; 72 | lv2:maximum 10.0 ; 73 | units:unit mod:volts ; 74 | ], 75 | [ 76 | a lv2:InputPort , 77 | lv2:ControlPort ; 78 | lv2:index 4 ; 79 | lv2:symbol "MaxRange" ; 80 | lv2:name "MaxRange"; 81 | lv2:default 10.0 ; 82 | lv2:minimum -10.0 ; 83 | lv2:maximum 10.0 ; 84 | units:unit mod:volts ; 85 | ], 86 | [ 87 | a lv2:InputPort , 88 | lv2:ControlPort ; 89 | lv2:index 5 ; 90 | lv2:symbol "Mode" ; 91 | lv2:name "Mode"; 92 | lv2:default 1 ; 93 | lv2:minimum 0 ; 94 | lv2:maximum 1 ; 95 | lv2:scalePoint [ rdfs:label "Sample and hold"; rdf:value 0; ] ; 96 | lv2:scalePoint [ rdfs:label "Reset to zero"; rdf:value 1; ] ; 97 | lv2:portProperty lv2:enumeration; 98 | ] 99 | . 100 | -------------------------------------------------------------------------------- /source/mod-cv-round/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-round.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-round 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-round/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-round/mod-cv-round.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-round" 7 | 8 | 9 | typedef enum { 10 | L_INPUT = 0, 11 | L_ROUND = 1, 12 | L_CEIL = 2, 13 | L_FLOOR = 3, 14 | L_FRACTION = 4, 15 | L_ENABLE = 5 16 | } PortIndex; 17 | 18 | 19 | typedef struct { 20 | float* input; 21 | float* round; 22 | float* ceil; 23 | float* floor; 24 | float* fraction; 25 | float* mode; 26 | float* plugin_enabled; 27 | } CvRound; 28 | 29 | 30 | static LV2_Handle 31 | instantiate(const LV2_Descriptor* descriptor, 32 | double rate, 33 | const char* bundle_path, 34 | const LV2_Feature* const* features) 35 | { 36 | CvRound* self = (CvRound*)malloc(sizeof(CvRound)); 37 | 38 | return (LV2_Handle)self; 39 | } 40 | 41 | 42 | static void 43 | connect_port(LV2_Handle instance, 44 | uint32_t port, 45 | void* data) 46 | { 47 | CvRound* self = (CvRound*)instance; 48 | 49 | switch ((PortIndex)port) { 50 | case L_INPUT: 51 | self->input = (float*)data; 52 | break; 53 | case L_ROUND: 54 | self->round = (float*)data; 55 | break; 56 | case L_CEIL: 57 | self->ceil = (float*)data; 58 | break; 59 | case L_FLOOR: 60 | self->floor = (float*)data; 61 | break; 62 | case L_FRACTION: 63 | self->fraction = (float*)data; 64 | break; 65 | case L_ENABLE: 66 | self->plugin_enabled = (float*)data; 67 | break; 68 | } 69 | } 70 | 71 | 72 | static void 73 | activate(LV2_Handle instance) 74 | { 75 | } 76 | 77 | 78 | static void 79 | run(LV2_Handle instance, uint32_t n_samples) 80 | { 81 | CvRound* self = (CvRound*) instance; 82 | 83 | for ( uint32_t i = 0; i < n_samples; i++) 84 | { 85 | if ((int)*self->plugin_enabled == 1) { 86 | float input_sample = self->input[i]; 87 | self->round[i] = floor(input_sample + 0.5); 88 | self->ceil[i] = ceil(input_sample); 89 | self->floor[i] = floor(input_sample); 90 | self->fraction[i] = self->input[i] - (int)input_sample; 91 | } else { 92 | self->round[i] = 0.0; 93 | self->ceil[i] = 0.0; 94 | self->floor[i] = 0.0; 95 | self->fraction[i] = 0.0; 96 | } 97 | } 98 | } 99 | 100 | 101 | static void 102 | deactivate(LV2_Handle instance) 103 | { 104 | } 105 | 106 | 107 | static void 108 | cleanup(LV2_Handle instance) 109 | { 110 | free(instance); 111 | } 112 | 113 | 114 | static const void* 115 | extension_data(const char* uri) 116 | { 117 | return NULL; 118 | } 119 | 120 | 121 | static const LV2_Descriptor descriptor = { 122 | PLUGIN_URI, 123 | instantiate, 124 | connect_port, 125 | activate, 126 | run, 127 | deactivate, 128 | cleanup, 129 | extension_data 130 | }; 131 | 132 | 133 | LV2_SYMBOL_EXPORT 134 | const LV2_Descriptor* 135 | lv2_descriptor(uint32_t index) 136 | { 137 | switch (index) { 138 | case 0: return &descriptor; 139 | default: return NULL; 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /source/mod-cv-round/mod-cv-round.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-round/mod-cv-round.lv2/mod-cv-round.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix modgui: . 6 | @prefix mod: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV Round"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 18 | doap:developer [ 19 | foaf:name "Bram Giesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | Plugin that can either return the integer value of the incoming signal or the decimal value only. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0 ; 42 | lv2:maximum 5.0 ; 43 | lv2:symbol "CVin"; 44 | lv2:name "CV Input"; 45 | ], 46 | [ 47 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 1; 49 | lv2:minimum -5.0 ; 50 | lv2:maximum 5.0 ; 51 | lv2:symbol "Round"; 52 | lv2:name "Round"; 53 | ], 54 | [ 55 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 56 | lv2:index 2; 57 | lv2:minimum -5.0 ; 58 | lv2:maximum 5.0 ; 59 | lv2:symbol "Ceil"; 60 | lv2:name "Ceil"; 61 | ], 62 | [ 63 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 64 | lv2:index 3; 65 | lv2:minimum -5.0 ; 66 | lv2:maximum 5.0 ; 67 | lv2:symbol "Floor"; 68 | lv2:name "Floor"; 69 | ], 70 | [ 71 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 72 | lv2:index 4; 73 | lv2:minimum -5.0 ; 74 | lv2:maximum 5.0 ; 75 | lv2:symbol "Fraction"; 76 | lv2:name "Fraction"; 77 | ], 78 | [ 79 | a lv2:InputPort , 80 | lv2:ControlPort ; 81 | lv2:index 5 ; 82 | lv2:symbol "PluginEnabled" ; 83 | lv2:name "PluginEnabled" ; 84 | lv2:default 1.0 ; 85 | lv2:minimum 0.0 ; 86 | lv2:maximum 1.0 ; 87 | lv2:designation lv2:enabled; 88 | lv2:portProperty lv2:toggled; 89 | ] 90 | . 91 | -------------------------------------------------------------------------------- /source/mod-cv-slew/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-slew.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-slew 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-slew/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-slew.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-slew/mod-cv-slew.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 6 | 7 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-slew" 8 | 9 | #ifndef DEBUG 10 | #define DEBUG 0 11 | #endif 12 | #define debug_print(...) \ 13 | ((void)((DEBUG) ? fprintf(stderr, __VA_ARGS__) : 0)) 14 | 15 | typedef enum { 16 | AUDIO_IN = 0, 17 | CV_OUT = 1, 18 | P_RISE = 2, 19 | P_FALL = 3, 20 | ENABLED = 4 21 | } PortIndex; 22 | 23 | typedef struct { 24 | float* input; 25 | float* output; 26 | float* rise_time; 27 | float* fall_time; 28 | float* plugin_enabled; 29 | float sample_rate; 30 | float out; 31 | } Convert; 32 | 33 | static LV2_Handle 34 | instantiate(const LV2_Descriptor* descriptor, 35 | double rate, 36 | const char* bundle_path, 37 | const LV2_Feature* const* features) 38 | { 39 | Convert* self = (Convert*)malloc(sizeof(Convert)); 40 | 41 | self->out = 0.0; 42 | self->sample_rate = rate; 43 | 44 | return (LV2_Handle)self; 45 | } 46 | 47 | static void 48 | connect_port(LV2_Handle instance, 49 | uint32_t port, 50 | void* data) 51 | { 52 | Convert* self = (Convert*)instance; 53 | 54 | switch ((PortIndex)port) { 55 | case AUDIO_IN: 56 | self->input = (float*)data; 57 | break; 58 | case CV_OUT: 59 | self->output = (float*)data; 60 | break; 61 | case P_RISE: 62 | self->rise_time = (float*)data; 63 | break; 64 | case P_FALL: 65 | self->fall_time = (float*)data; 66 | break; 67 | case ENABLED: 68 | self->plugin_enabled = (float*)data; 69 | break; 70 | } 71 | } 72 | 73 | 74 | static void 75 | activate(LV2_Handle instance) 76 | { 77 | } 78 | 79 | 80 | static float 81 | slider(float in, float out, float rise_time, float fall_time, float sample_rate) 82 | { 83 | if (in > out && rise_time != 0.0) 84 | { 85 | out += (in - out) / ((rise_time / 1000) * sample_rate); 86 | } 87 | else if (in < out && fall_time != 0.0) 88 | { 89 | out += (in - out) / ((fall_time / 1000) * sample_rate); 90 | } 91 | 92 | return out; 93 | } 94 | 95 | 96 | static void 97 | run(LV2_Handle instance, uint32_t n_samples) 98 | { 99 | Convert* self = (Convert*)instance; 100 | 101 | for ( uint32_t i = 0; i < n_samples; i++) 102 | { 103 | if (*self->plugin_enabled == 1.0) { 104 | self->out = slider(self->input[i], self->out, *self->rise_time, *self->fall_time, self->sample_rate); 105 | self->output[i] = self->out; 106 | } else { 107 | self->output[i] = self->input[i]; 108 | 109 | } 110 | } 111 | } 112 | 113 | 114 | static void 115 | deactivate(LV2_Handle instance) 116 | { 117 | } 118 | 119 | static void 120 | cleanup(LV2_Handle instance) 121 | { 122 | free(instance); 123 | } 124 | 125 | static const void* 126 | extension_data(const char* uri) 127 | { 128 | return NULL; 129 | } 130 | 131 | static const LV2_Descriptor descriptor = { 132 | PLUGIN_URI, 133 | instantiate, 134 | connect_port, 135 | activate, 136 | run, 137 | deactivate, 138 | cleanup, 139 | extension_data 140 | }; 141 | 142 | LV2_SYMBOL_EXPORT 143 | const LV2_Descriptor* 144 | lv2_descriptor(uint32_t index) 145 | { 146 | switch (index) { 147 | case 0: return &descriptor; 148 | default: return NULL; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /source/mod-cv-slew/mod-cv-slew.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-slew/mod-cv-slew.lv2/mod-cv-slew.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | @prefix units: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "Slew Rate Limiter"; 18 | 19 | doap:developer [ 20 | foaf:name "Ward Slager, Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 1; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | Plugin to limit the speed of the rise and fall times of a CV signal. 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 41 | lv2:index 0; 42 | lv2:minimum -5.0; 43 | lv2:maximum 5.0 ; 44 | lv2:symbol "CVIn"; 45 | lv2:name "CV Input"; 46 | ], 47 | [ 48 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 49 | lv2:index 1; 50 | lv2:minimum -5.0; 51 | lv2:maximum 5.0 ; 52 | lv2:symbol "CVout"; 53 | lv2:name "CV Output"; 54 | ] 55 | , 56 | [ 57 | a lv2:InputPort , 58 | lv2:ControlPort ; 59 | lv2:index 2 ; 60 | lv2:symbol "RiseTime" ; 61 | lv2:name "Rise Time"; 62 | lv2:default 0.0 ; 63 | lv2:minimum 0.0 ; 64 | lv2:maximum 1000.0 ; 65 | units:unit units:ms ; 66 | lv2:portProperty mod:tapTempo , mod:tempoRelatedDynamicScalePoints; 67 | ] 68 | , 69 | [ 70 | a lv2:InputPort , 71 | lv2:ControlPort ; 72 | lv2:index 3 ; 73 | lv2:symbol "FallTime" ; 74 | lv2:name "Fall Time"; 75 | lv2:default 0.1 ; 76 | lv2:minimum 0.0 ; 77 | lv2:maximum 1000.0 ; 78 | units:unit units:ms ; 79 | lv2:portProperty mod:tapTempo , mod:tempoRelatedDynamicScalePoints; 80 | ] 81 | , 82 | [ 83 | a lv2:InputPort , 84 | lv2:ControlPort ; 85 | lv2:index 4 ; 86 | lv2:symbol "BYPASS" ; 87 | lv2:name "BYPASS" ; 88 | lv2:default 1.0 ; 89 | lv2:minimum 0.0 ; 90 | lv2:maximum 1.0 ; 91 | lv2:designation lv2:enabled; 92 | lv2:portProperty lv2:toggled; 93 | ] 94 | . 95 | -------------------------------------------------------------------------------- /source/mod-cv-slew/mod-cv-slew.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-slew 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_SLEW_SITE_METHOD = local 9 | MOD_CV_SLEW_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_SLEW_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_SLEW_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_SLEW_BUNDLES = mod-cv-slew.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_SLEW_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_SLEW_BUILD_CMDS 27 | $(MOD_CV_SLEW_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_SLEW_INSTALL_TARGET_CMDS 32 | $(MOD_CV_SLEW_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-switch1 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/mod-cv-switch1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-switch1" 7 | 8 | typedef enum { 9 | SWITCH_IN = 0, 10 | SWITCH_OUT1 = 1, 11 | SWITCH_OUT2 = 2, 12 | SWITCH_SEL = 3 13 | } PortIndex; 14 | 15 | typedef struct { 16 | const float* select; 17 | float* input; 18 | float* output1; 19 | float* output2; 20 | } Switch; 21 | 22 | static LV2_Handle 23 | instantiate(const LV2_Descriptor* descriptor, 24 | double rate, 25 | const char* bundle_path, 26 | const LV2_Feature* const* features) 27 | { 28 | Switch* self = (Switch*)malloc(sizeof(Switch)); 29 | 30 | return (LV2_Handle)self; 31 | } 32 | 33 | static void 34 | connect_port(LV2_Handle instance, 35 | uint32_t port, 36 | void* data) 37 | { 38 | Switch* self = (Switch*)instance; 39 | 40 | switch ((PortIndex)port) { 41 | case SWITCH_IN: 42 | self->input = (float*)data; 43 | break; 44 | case SWITCH_OUT1: 45 | self->output1 = (float*)data; 46 | break; 47 | case SWITCH_OUT2: 48 | self->output2 = (float*)data; 49 | break; 50 | case SWITCH_SEL: 51 | self->select = (float*)data; 52 | break; 53 | } 54 | } 55 | 56 | static void 57 | activate(LV2_Handle instance) 58 | { 59 | } 60 | 61 | static void 62 | run(LV2_Handle instance, uint32_t n_samples) 63 | { 64 | int sel; 65 | Switch* self = (Switch*) instance; 66 | sel = (int)(*(self->select)); 67 | float *input = self->input; 68 | float *output1 = self->output1; 69 | float *output2 = self->output2; 70 | 71 | switch (sel) 72 | { 73 | case 0: 74 | for ( uint32_t i = 0; i < n_samples; i++) 75 | { 76 | *output1 = *input; 77 | *output2=0.0f; 78 | input++; 79 | output1++; 80 | output2++; 81 | } 82 | break; 83 | case 1: 84 | for (uint32_t i = 0; i < n_samples; i++) 85 | { 86 | *output2 = *input; 87 | *output1=0.0f; 88 | input++; 89 | output1++; 90 | output2++; 91 | } 92 | break; 93 | default: 94 | break; 95 | } 96 | } 97 | 98 | static void 99 | deactivate(LV2_Handle instance) 100 | { 101 | } 102 | 103 | static void 104 | cleanup(LV2_Handle instance) 105 | { 106 | free(instance); 107 | } 108 | 109 | static const void* 110 | extension_data(const char* uri) 111 | { 112 | return NULL; 113 | } 114 | 115 | static const LV2_Descriptor descriptor = { 116 | PLUGIN_URI, 117 | instantiate, 118 | connect_port, 119 | activate, 120 | run, 121 | deactivate, 122 | cleanup, 123 | extension_data 124 | }; 125 | 126 | LV2_SYMBOL_EXPORT 127 | const LV2_Descriptor* 128 | lv2_descriptor(uint32_t index) 129 | { 130 | switch (index) { 131 | case 0: return &descriptor; 132 | default: return NULL; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/mod-cv-switch1.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/mod-cv-switch1.lv2/mod-cv-switch1.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV Switchbox 1-2"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 18 | doap:developer [ 19 | foaf:name "Jarno Verheesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | CV Switchbox 1-2 routes one cv input to either one of the two outputs. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0; 42 | lv2:maximum 5.0; 43 | lv2:symbol "CVin"; 44 | lv2:name "CV in"; 45 | ], 46 | [ 47 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 1; 49 | lv2:minimum -5.0; 50 | lv2:maximum 5.0; 51 | lv2:symbol "CVout1"; 52 | lv2:name "CV out1"; 53 | ], 54 | [ 55 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 56 | lv2:index 2; 57 | lv2:minimum -5.0; 58 | lv2:maximum 5.0; 59 | lv2:symbol "CVout2"; 60 | lv2:name "CV out2"; 61 | ], 62 | [ 63 | a lv2:ControlPort, lv2:InputPort; 64 | lv2:index 3; 65 | lv2:symbol "Switch"; 66 | lv2:name "Channel"; 67 | lv2:portProperty lv2:integer; 68 | lv2:portProperty lv2:enumeration ; 69 | lv2:scalePoint [rdfs:label "1"; rdf:value 0]; 70 | lv2:scalePoint [rdfs:label "2"; rdf:value 1]; 71 | lv2:default 0; 72 | lv2:minimum 0; 73 | lv2:maximum 1; 74 | ] 75 | . 76 | -------------------------------------------------------------------------------- /source/mod-cv-switch1/mod-cv-switch1.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-switch1 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_SWITCH1_SITE_METHOD = local 9 | MOD_CV_SWITCH1_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_SWITCH1_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_SWITCH1_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_SWITCH1_BUNDLES = mod-cv-switch1.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_SWITCH1_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_SWITCH1_BUILD_CMDS 27 | $(MOD_CV_SWITCH1_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_SWITCH1_INSTALL_TARGET_CMDS 32 | $(MOD_CV_SWITCH1_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch2.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-switch2 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch2.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/mod-cv-switch2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-switch2" 7 | 8 | typedef enum { 9 | SWITCH_IN1 = 0, 10 | SWITCH_IN2 = 1, 11 | SWITCH_OUT = 2, 12 | SWITCH_SEL = 3 13 | } PortIndex; 14 | 15 | typedef struct { 16 | const float* select; 17 | float* input1; 18 | float* input2; 19 | float* output; 20 | } Switch; 21 | 22 | static LV2_Handle 23 | instantiate(const LV2_Descriptor* descriptor, 24 | double rate, 25 | const char* bundle_path, 26 | const LV2_Feature* const* features) 27 | { 28 | Switch* self = (Switch*)malloc(sizeof(Switch)); 29 | 30 | return (LV2_Handle)self; 31 | } 32 | 33 | static void 34 | connect_port(LV2_Handle instance, 35 | uint32_t port, 36 | void* data) 37 | { 38 | Switch* self = (Switch*)instance; 39 | 40 | switch ((PortIndex)port) { 41 | case SWITCH_IN1: 42 | self->input1 = (float*)data; 43 | break; 44 | case SWITCH_IN2: 45 | self->input2 = (float*)data; 46 | break; 47 | case SWITCH_OUT: 48 | self->output = (float*)data; 49 | break; 50 | case SWITCH_SEL: 51 | self->select = (float*)data; 52 | break; 53 | } 54 | } 55 | 56 | static void 57 | activate(LV2_Handle instance) 58 | { 59 | } 60 | 61 | static void 62 | run(LV2_Handle instance, uint32_t n_samples) 63 | { 64 | int sel; 65 | Switch* self = (Switch*) instance; 66 | sel = (int)(*(self->select)); 67 | float *input1 = self->input1; 68 | float *input2 = self->input2; 69 | float *output = self->output; 70 | 71 | switch (sel) 72 | { 73 | case 0: 74 | for ( uint32_t i = 0; i < n_samples; i++) 75 | { 76 | *output = *input1; 77 | input1++; 78 | input2++; 79 | output++; 80 | } 81 | break; 82 | case 1: 83 | for (uint32_t i = 0; i < n_samples; i++) 84 | { 85 | *output = *input2; 86 | input1++; 87 | input2++; 88 | output++; 89 | } 90 | break; 91 | default: 92 | break; 93 | } 94 | } 95 | 96 | static void 97 | deactivate(LV2_Handle instance) 98 | { 99 | } 100 | 101 | static void 102 | cleanup(LV2_Handle instance) 103 | { 104 | free(instance); 105 | } 106 | 107 | static const void* 108 | extension_data(const char* uri) 109 | { 110 | return NULL; 111 | } 112 | 113 | static const LV2_Descriptor descriptor = { 114 | PLUGIN_URI, 115 | instantiate, 116 | connect_port, 117 | activate, 118 | run, 119 | deactivate, 120 | cleanup, 121 | extension_data 122 | }; 123 | 124 | LV2_SYMBOL_EXPORT 125 | const LV2_Descriptor* 126 | lv2_descriptor(uint32_t index) 127 | { 128 | switch (index) { 129 | case 0: return &descriptor; 130 | default: return NULL; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/mod-cv-switch2.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/mod-cv-switch2.lv2/mod-cv-switch2.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV Switchbox 2-1"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 18 | doap:developer [ 19 | foaf:name "Jarno Verheesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | CV Switchbox 2-1 routes either one of the two cv inputs to one cv output. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0; 42 | lv2:maximum 5.0; 43 | lv2:symbol "CVin1"; 44 | lv2:name "CV in1"; 45 | ], 46 | [ 47 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 1; 49 | lv2:minimum -5.0; 50 | lv2:maximum 5.0; 51 | lv2:symbol "CVin2"; 52 | lv2:name "CV in2"; 53 | ], 54 | [ 55 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 56 | lv2:index 2; 57 | lv2:minimum -5.0; 58 | lv2:maximum 5.0; 59 | lv2:symbol "CVout"; 60 | lv2:name "CV out"; 61 | ], 62 | [ 63 | a lv2:ControlPort, lv2:InputPort; 64 | lv2:index 3; 65 | lv2:symbol "Switch"; 66 | lv2:name "Channel"; 67 | lv2:portProperty lv2:integer; 68 | lv2:portProperty lv2:enumeration ; 69 | lv2:scalePoint [rdfs:label "1"; rdf:value 0]; 70 | lv2:scalePoint [rdfs:label "2"; rdf:value 1]; 71 | lv2:default 0; 72 | lv2:minimum 0; 73 | lv2:maximum 1; 74 | ] 75 | . 76 | -------------------------------------------------------------------------------- /source/mod-cv-switch2/mod-cv-switch2.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-switch2 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_SWITCH2_SITE_METHOD = local 9 | MOD_CV_SWITCH2_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_SWITCH2_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_SWITCH2_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_SWITCH2_BUNDLES = mod-cv-switch2.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_SWITCH2_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_SWITCH2_BUILD_CMDS 27 | $(MOD_CV_SWITCH2_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_SWITCH2_INSTALL_TARGET_CMDS 32 | $(MOD_CV_SWITCH2_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch3.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-switch3 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/mod-cv-switch3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-switch3" 7 | 8 | typedef enum { 9 | SWITCH_IN = 0, 10 | SWITCH_OUT1 = 1, 11 | SWITCH_OUT2 = 2, 12 | SWITCH_OUT3 = 3, 13 | SWITCH_SEL = 4 14 | } PortIndex; 15 | 16 | typedef struct { 17 | const float* select; 18 | float* input; 19 | float* output1; 20 | float* output2; 21 | float* output3; 22 | } Switch; 23 | 24 | static LV2_Handle 25 | instantiate(const LV2_Descriptor* descriptor, 26 | double rate, 27 | const char* bundle_path, 28 | const LV2_Feature* const* features) 29 | { 30 | Switch* self = (Switch*)malloc(sizeof(Switch)); 31 | 32 | return (LV2_Handle)self; 33 | } 34 | 35 | static void 36 | connect_port(LV2_Handle instance, 37 | uint32_t port, 38 | void* data) 39 | { 40 | Switch* self = (Switch*)instance; 41 | 42 | switch ((PortIndex)port) { 43 | case SWITCH_IN: 44 | self->input = (float*)data; 45 | break; 46 | case SWITCH_OUT1: 47 | self->output1 = (float*)data; 48 | break; 49 | case SWITCH_OUT2: 50 | self->output2 = (float*)data; 51 | break; 52 | case SWITCH_OUT3: 53 | self->output3 = (float*)data; 54 | break; 55 | case SWITCH_SEL: 56 | self->select = (float*)data; 57 | break; 58 | } 59 | } 60 | 61 | static void 62 | activate(LV2_Handle instance) 63 | { 64 | } 65 | 66 | static void 67 | run(LV2_Handle instance, uint32_t n_samples) 68 | { 69 | int sel; 70 | Switch* self = (Switch*) instance; 71 | sel = (int)(*(self->select)); 72 | float *input = self->input; 73 | float *output1 = self->output1; 74 | float *output2 = self->output2; 75 | float *output3 = self->output3; 76 | 77 | switch (sel) 78 | { 79 | case 0: 80 | for ( uint32_t i = 0; i < n_samples; i++) 81 | { 82 | *output1 = *input; 83 | *output2 = 0.0f; 84 | *output3 = 0.0f; 85 | input++; 86 | output1++; 87 | output2++; 88 | output3++; 89 | } 90 | break; 91 | case 1: 92 | for (uint32_t i = 0; i < n_samples; i++) 93 | { 94 | *output1 = 0.0f; 95 | *output2 = *input; 96 | *output3 = 0.0f; 97 | input++; 98 | output1++; 99 | output2++; 100 | output3++; 101 | } 102 | break; 103 | case 2: 104 | for (uint32_t i = 0; i < n_samples; i++) 105 | { 106 | *output1 = 0.0f; 107 | *output2 = 0.0f; 108 | *output3 = *input; 109 | input++; 110 | output1++; 111 | output2++; 112 | output3++; 113 | } 114 | default: 115 | break; 116 | } 117 | } 118 | 119 | static void 120 | deactivate(LV2_Handle instance) 121 | { 122 | } 123 | 124 | static void 125 | cleanup(LV2_Handle instance) 126 | { 127 | free(instance); 128 | } 129 | 130 | static const void* 131 | extension_data(const char* uri) 132 | { 133 | return NULL; 134 | } 135 | 136 | static const LV2_Descriptor descriptor = { 137 | PLUGIN_URI, 138 | instantiate, 139 | connect_port, 140 | activate, 141 | run, 142 | deactivate, 143 | cleanup, 144 | extension_data 145 | }; 146 | 147 | LV2_SYMBOL_EXPORT 148 | const LV2_Descriptor* 149 | lv2_descriptor(uint32_t index) 150 | { 151 | switch (index) { 152 | case 0: return &descriptor; 153 | default: return NULL; 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/mod-cv-switch3.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/mod-cv-switch3.lv2/mod-cv-switch3.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV Switchbox 1-3"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 18 | doap:developer [ 19 | foaf:name "Jarno Verheesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | CV Switchbox 1-3 routes one cv input to either one of the three outputs. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0; 42 | lv2:maximum 5.0; 43 | lv2:symbol "CVin"; 44 | lv2:name "CV in"; 45 | ], 46 | [ 47 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 1; 49 | lv2:minimum -5.0; 50 | lv2:maximum 5.0; 51 | lv2:symbol "CVout1"; 52 | lv2:name "CV out1"; 53 | ], 54 | [ 55 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 56 | lv2:index 2; 57 | lv2:minimum -5.0; 58 | lv2:maximum 5.0; 59 | lv2:symbol "CVout2"; 60 | lv2:name "CV out2"; 61 | ], 62 | [ 63 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 64 | lv2:index 3; 65 | lv2:minimum -5.0; 66 | lv2:maximum 5.0; 67 | lv2:symbol "CVout3"; 68 | lv2:name "CV out3"; 69 | ], 70 | [ 71 | a lv2:ControlPort, lv2:InputPort; 72 | lv2:index 4; 73 | lv2:symbol "Switch"; 74 | lv2:name "Channel"; 75 | lv2:portProperty lv2:integer; 76 | lv2:portProperty lv2:enumeration ; 77 | lv2:scalePoint [rdfs:label "1"; rdf:value 0]; 78 | lv2:scalePoint [rdfs:label "2"; rdf:value 1]; 79 | lv2:scalePoint [rdfs:label "3"; rdf:value 2]; 80 | lv2:default 0; 81 | lv2:minimum 0; 82 | lv2:maximum 2; 83 | ] 84 | . 85 | -------------------------------------------------------------------------------- /source/mod-cv-switch3/mod-cv-switch3.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-switch1 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_SWITCH3_SITE_METHOD = local 9 | MOD_CV_SWITCH3_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_SWITCH3_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_SWITCH3_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_SWITCH3_BUNDLES = mod-cv-switch3.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_SWITCH3_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_SWITCH3_BUILD_CMDS 27 | $(MOD_CV_SWITCH3_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_SWITCH3_INSTALL_TARGET_CMDS 32 | $(MOD_CV_SWITCH3_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch2.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-switch4 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch2.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/mod-cv-switch4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 5 | 6 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-switch4" 7 | 8 | typedef enum { 9 | SWITCH_IN1 = 0, 10 | SWITCH_IN2 = 1, 11 | SWITCH_IN3 = 2, 12 | SWITCH_OUT = 3, 13 | SWITCH_SEL = 4 14 | } PortIndex; 15 | 16 | typedef struct { 17 | const float* select; 18 | float* input1; 19 | float* input2; 20 | float* input3; 21 | float* output; 22 | } Switch; 23 | 24 | static LV2_Handle 25 | instantiate(const LV2_Descriptor* descriptor, 26 | double rate, 27 | const char* bundle_path, 28 | const LV2_Feature* const* features) 29 | { 30 | Switch* self = (Switch*)malloc(sizeof(Switch)); 31 | 32 | return (LV2_Handle)self; 33 | } 34 | 35 | static void 36 | connect_port(LV2_Handle instance, 37 | uint32_t port, 38 | void* data) 39 | { 40 | Switch* self = (Switch*)instance; 41 | 42 | switch ((PortIndex)port) { 43 | case SWITCH_IN1: 44 | self->input1 = (float*)data; 45 | break; 46 | case SWITCH_IN2: 47 | self->input2 = (float*)data; 48 | break; 49 | case SWITCH_IN3: 50 | self->input3 = (float*)data; 51 | break; 52 | case SWITCH_OUT: 53 | self->output = (float*)data; 54 | break; 55 | case SWITCH_SEL: 56 | self->select = (float*)data; 57 | break; 58 | } 59 | } 60 | 61 | static void 62 | activate(LV2_Handle instance) 63 | { 64 | } 65 | 66 | static void 67 | run(LV2_Handle instance, uint32_t n_samples) 68 | { 69 | int sel; 70 | Switch* self = (Switch*) instance; 71 | sel = (int)(*(self->select)); 72 | float *input1 = self->input1; 73 | float *input2 = self->input2; 74 | float *input3 = self->input3; 75 | float *output = self->output; 76 | 77 | switch (sel) 78 | { 79 | case 0: 80 | for ( uint32_t i = 0; i < n_samples; i++) 81 | { 82 | *output = *input1; 83 | input1++; 84 | input2++; 85 | input3++; 86 | output++; 87 | } 88 | break; 89 | case 1: 90 | for (uint32_t i = 0; i < n_samples; i++) 91 | { 92 | *output = *input2; 93 | input1++; 94 | input2++; 95 | input3++; 96 | output++; 97 | } 98 | break; 99 | case 2: 100 | for (uint32_t i = 0; i < n_samples; i++) 101 | { 102 | *output = *input3; 103 | input1++; 104 | input2++; 105 | input3++; 106 | output++; 107 | } 108 | break; 109 | default: 110 | break; 111 | } 112 | } 113 | 114 | static void 115 | deactivate(LV2_Handle instance) 116 | { 117 | } 118 | 119 | static void 120 | cleanup(LV2_Handle instance) 121 | { 122 | free(instance); 123 | } 124 | 125 | static const void* 126 | extension_data(const char* uri) 127 | { 128 | return NULL; 129 | } 130 | 131 | static const LV2_Descriptor descriptor = { 132 | PLUGIN_URI, 133 | instantiate, 134 | connect_port, 135 | activate, 136 | run, 137 | deactivate, 138 | cleanup, 139 | extension_data 140 | }; 141 | 142 | LV2_SYMBOL_EXPORT 143 | const LV2_Descriptor* 144 | lv2_descriptor(uint32_t index) 145 | { 146 | switch (index) { 147 | case 0: return &descriptor; 148 | default: return NULL; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/mod-cv-switch4.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/mod-cv-switch4.lv2/mod-cv-switch4.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix atom: . 10 | @prefix midi: . 11 | @prefix urid: . 12 | 13 | 14 | a lv2:Plugin, mod:ControlVoltagePlugin; 15 | 16 | doap:name "CV Switchbox 3-1"; 17 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 18 | doap:developer [ 19 | foaf:name "Jarno Verheesen"; 20 | foaf:homepage <>; 21 | foaf:mbox ; 22 | ]; 23 | 24 | doap:maintainer [ 25 | foaf:name "MOD"; 26 | foaf:homepage ; 27 | foaf:mbox ; 28 | ]; 29 | 30 | lv2:minorVersion 1; 31 | lv2:microVersion 0; 32 | 33 | rdfs:comment """ 34 | CV Switchbox 3-1 routes either one of the three cv inputs to one cv output. 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0; 42 | lv2:maximum 5.0; 43 | lv2:symbol "CVin1"; 44 | lv2:name "CV in1"; 45 | ], 46 | [ 47 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 1; 49 | lv2:minimum -5.0; 50 | lv2:maximum 5.0; 51 | lv2:symbol "CVin2"; 52 | lv2:name "CV in2"; 53 | ], 54 | [ 55 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 56 | lv2:index 2; 57 | lv2:minimum -5.0; 58 | lv2:maximum 5.0; 59 | lv2:symbol "CVin3"; 60 | lv2:name "CV in3"; 61 | ], 62 | [ 63 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 64 | lv2:index 3; 65 | lv2:minimum -5.0; 66 | lv2:maximum 5.0; 67 | lv2:symbol "CVout"; 68 | lv2:name "CV out"; 69 | ], 70 | [ 71 | a lv2:ControlPort, lv2:InputPort; 72 | lv2:index 4; 73 | lv2:symbol "Switch"; 74 | lv2:name "Channel"; 75 | lv2:portProperty lv2:integer; 76 | lv2:portProperty lv2:enumeration ; 77 | lv2:scalePoint [rdfs:label "1"; rdf:value 0]; 78 | lv2:scalePoint [rdfs:label "2"; rdf:value 1]; 79 | lv2:scalePoint [rdfs:label "3"; rdf:value 2]; 80 | lv2:default 0; 81 | lv2:minimum 0; 82 | lv2:maximum 2; 83 | ] 84 | . 85 | -------------------------------------------------------------------------------- /source/mod-cv-switch4/mod-cv-switch4.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # mod-cv-switch4 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_CV_SWITCH4_SITE_METHOD = local 9 | MOD_CV_SWITCH4_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_CV_SWITCH4_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_CV_SWITCH4_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_CV_SWITCH4_BUNDLES = mod-cv-switch4.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_CV_SWITCH4_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_CV_SWITCH4_BUILD_CMDS 27 | $(MOD_CV_SWITCH4_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_CV_SWITCH4_INSTALL_TARGET_CMDS 32 | $(MOD_CV_SWITCH4_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-cv-to-audio/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-to-audio.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-to-audio 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-to-audio/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cv-to-audio.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-to-audio/mod-cv-to-audio.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "lv2/lv2plug.in/ns/lv2core/lv2.h" 6 | 7 | #define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/mod-cv-to-audio" 8 | 9 | typedef enum { 10 | CV_IN = 0, 11 | AUDIO_OUT = 1, 12 | LEVEL = 2, 13 | DC_BLOCK = 3, 14 | ENABLED = 4 15 | } PortIndex; 16 | 17 | typedef struct { 18 | float* input; 19 | float* output; 20 | float* level; 21 | float* dc_block; 22 | float* plugin_enabled; 23 | 24 | float xn1; 25 | float yn1; 26 | double a0; 27 | double b1; 28 | double z1; 29 | 30 | } Convert; 31 | 32 | static LV2_Handle 33 | instantiate(const LV2_Descriptor* descriptor, 34 | double rate, 35 | const char* bundle_path, 36 | const LV2_Feature* const* features) 37 | { 38 | Convert* self = (Convert*)malloc(sizeof(Convert)); 39 | 40 | self->xn1 = 0.0; 41 | self->yn1 = 0.0; 42 | 43 | self->z1 = 0.0; 44 | double frequency = 20.0 / rate; 45 | self->b1 = exp(-2.0 * M_PI * frequency); 46 | self->a0 = 1.0 - self->b1; 47 | 48 | return (LV2_Handle)self; 49 | } 50 | 51 | static void 52 | connect_port(LV2_Handle instance, 53 | uint32_t port, 54 | void* data) 55 | { 56 | Convert* self = (Convert*)instance; 57 | 58 | switch ((PortIndex)port) { 59 | case CV_IN: 60 | self->input = (float*)data; 61 | break; 62 | case AUDIO_OUT: 63 | self->output = (float*)data; 64 | break; 65 | case LEVEL: 66 | self->level = (float*)data; 67 | break; 68 | case DC_BLOCK: 69 | self->dc_block = (float*)data; 70 | break; 71 | case ENABLED: 72 | self->plugin_enabled = (float*)data; 73 | break; 74 | } 75 | } 76 | 77 | static void 78 | activate(LV2_Handle instance) 79 | { 80 | } 81 | 82 | 83 | static double 84 | lowPassProcess(Convert* self, float input) 85 | { 86 | return self->z1 = input * self->a0 + self->z1 * self->b1; 87 | } 88 | 89 | 90 | static void 91 | run(LV2_Handle instance, uint32_t n_samples) 92 | { 93 | Convert* self = (Convert*)instance; 94 | 95 | const bool plugin_enabled = (int)*self->plugin_enabled == 1; 96 | const bool dc_block = (int)*self->dc_block == 1; 97 | 98 | for ( uint32_t i = 0; i < n_samples; i++) 99 | { 100 | float x = self->input[i] * 0.2f; 101 | float y = x - self->xn1 + 0.995f * self->yn1; 102 | self->xn1 = x; 103 | self->yn1 = y; 104 | 105 | float smooth_level = lowPassProcess(self, *self->level); 106 | 107 | if (plugin_enabled) { 108 | if (dc_block) { 109 | self->output[i] = y * smooth_level; 110 | } else { 111 | self->output[i] = self->input[i] * smooth_level; 112 | } 113 | } else { 114 | self->output[i] = 0.0f; 115 | } 116 | } 117 | } 118 | 119 | 120 | static void 121 | deactivate(LV2_Handle instance) 122 | { 123 | } 124 | 125 | static void 126 | cleanup(LV2_Handle instance) 127 | { 128 | free(instance); 129 | } 130 | 131 | static const void* 132 | extension_data(const char* uri) 133 | { 134 | return NULL; 135 | } 136 | 137 | static const LV2_Descriptor descriptor = { 138 | PLUGIN_URI, 139 | instantiate, 140 | connect_port, 141 | activate, 142 | run, 143 | deactivate, 144 | cleanup, 145 | extension_data 146 | }; 147 | 148 | LV2_SYMBOL_EXPORT 149 | const LV2_Descriptor* 150 | lv2_descriptor(uint32_t index) 151 | { 152 | switch (index) { 153 | case 0: return &descriptor; 154 | default: return NULL; 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /source/mod-cv-to-audio/mod-cv-to-audio.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-to-audio/mod-cv-to-audio.lv2/mod-cv-to-audio.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix mod: . 6 | @prefix modgui: . 7 | @prefix rdf: . 8 | @prefix rdfs: . 9 | @prefix urid: . 10 | 11 | 12 | a lv2:Plugin, mod:ControlVoltagePlugin; 13 | 14 | doap:name "CV to Audio"; 15 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 16 | doap:developer [ 17 | foaf:name "Bram Giesen & Jarno Verheesen"; 18 | foaf:homepage <>; 19 | foaf:mbox ; 20 | ]; 21 | 22 | doap:maintainer [ 23 | foaf:name "MOD"; 24 | foaf:homepage ; 25 | foaf:mbox ; 26 | ]; 27 | 28 | lv2:minorVersion 1; 29 | lv2:microVersion 0; 30 | 31 | rdfs:comment """ 32 | CV to audio converts an control voltage signal to an audio signal with DC Blocker. 33 | This blocker can be turned of if needed. 34 | This is NOT recommended when the plugin is connected to any kind of audio output! 35 | """; 36 | 37 | lv2:port 38 | [ 39 | a lv2:InputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 0; 41 | lv2:minimum -5.0 ; 42 | lv2:maximum 5.0 ; 43 | lv2:symbol "cv_in"; 44 | lv2:name "CV Input"; 45 | ], 46 | [ 47 | a lv2:OutputPort, lv2:AudioPort; 48 | lv2:index 1; 49 | lv2:symbol "audio_out"; 50 | lv2:name "Audio Output"; 51 | ] 52 | , 53 | [ 54 | a lv2:InputPort , 55 | lv2:ControlPort ; 56 | lv2:index 2 ; 57 | lv2:symbol "level" ; 58 | lv2:name "Level"; 59 | lv2:default 1.0 ; 60 | lv2:minimum 0.0 ; 61 | lv2:maximum 2.0 ; 62 | ] 63 | , 64 | [ 65 | a lv2:InputPort , 66 | lv2:ControlPort ; 67 | lv2:index 3 ; 68 | lv2:symbol "dc_block" ; 69 | lv2:name "DC Blocker"; 70 | lv2:default 1.0 ; 71 | lv2:minimum 0.0 ; 72 | lv2:maximum 1.0 ; 73 | lv2:portProperty lv2:toggled; 74 | ] 75 | , 76 | [ 77 | a lv2:InputPort , 78 | lv2:ControlPort ; 79 | lv2:index 4 ; 80 | lv2:symbol "enabled" ; 81 | lv2:name "Enabled" ; 82 | lv2:default 1.0 ; 83 | lv2:minimum 0.0 ; 84 | lv2:maximum 1.0 ; 85 | lv2:designation lv2:enabled; 86 | lv2:portProperty lv2:toggled; 87 | ] 88 | . 89 | 90 | -------------------------------------------------------------------------------- /source/mod-cv-transport/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-transport.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-cv-transport 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-cv-transport/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-cd-switch1.lv2 # 3 | # ----------------------- # 4 | # 5 | 6 | AR ?= ar 7 | CC ?= gcc 8 | CXX ?= g++ 9 | 10 | # -------------------------------------------------------------- 11 | # Fallback to Linux if no other OS defined 12 | 13 | ifneq ($(MACOS),true) 14 | ifneq ($(WIN32),true) 15 | LINUX=true 16 | endif 17 | endif 18 | 19 | # -------------------------------------------------------------- 20 | # Set build and link flags 21 | 22 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 23 | BASE_OPTS = -O3 -ffast-math 24 | 25 | ifeq ($(MACOS),true) 26 | # MacOS linker flags 27 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 28 | else 29 | # Common linker flags 30 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 31 | endif 32 | 33 | ifneq ($(WIN32),true) 34 | # not needed for Windows 35 | BASE_FLAGS += -fPIC -DPIC 36 | endif 37 | 38 | ifeq ($(DEBUG),true) 39 | BASE_FLAGS += -DDEBUG -O0 -g 40 | LINK_OPTS = 41 | else 42 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 43 | CXXFLAGS += -fvisibility-inlines-hidden 44 | endif 45 | 46 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 47 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 48 | 49 | ifeq ($(MACOS),true) 50 | # 'no-undefined' is always enabled on MacOS 51 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 52 | else 53 | # add 'no-undefined' 54 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 55 | endif 56 | 57 | # -------------------------------------------------------------- 58 | # Set shared lib extension 59 | 60 | LIB_EXT = .so 61 | 62 | ifeq ($(MACOS),true) 63 | LIB_EXT = .dylib 64 | endif 65 | 66 | ifeq ($(WIN32),true) 67 | LIB_EXT = .dll 68 | endif 69 | 70 | # -------------------------------------------------------------- 71 | # Set shared library CLI arg 72 | 73 | SHARED = -shared 74 | 75 | ifeq ($(MACOS),true) 76 | SHARED = -dynamiclib 77 | endif 78 | 79 | # -------------------------------------------------------------- 80 | -------------------------------------------------------------------------------- /source/mod-cv-transport/mod-cv-transport.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso , ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-cv-transport/mod-cv-transport.lv2/mod-cv-transport.ttl: -------------------------------------------------------------------------------- 1 | @prefix atom: . 2 | @prefix doap: . 3 | @prefix epp: . 4 | @prefix foaf: . 5 | @prefix log: . 6 | @prefix lv2: . 7 | @prefix mod: . 8 | @prefix modgui: . 9 | @prefix rdf: . 10 | @prefix rdfs: . 11 | @prefix time: . 12 | @prefix urid: . 13 | 14 | 15 | a lv2:Plugin, mod:ControlVoltagePlugin; 16 | 17 | doap:name "CV Transport"; 18 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html"; 19 | doap:developer [ 20 | foaf:name "Bram Giesen"; 21 | foaf:homepage <>; 22 | foaf:mbox ; 23 | ]; 24 | 25 | doap:maintainer [ 26 | foaf:name "MOD"; 27 | foaf:homepage ; 28 | foaf:mbox ; 29 | ]; 30 | 31 | lv2:minorVersion 1; 32 | lv2:microVersion 0; 33 | 34 | rdfs:comment """ 35 | 36 | """; 37 | 38 | lv2:port 39 | [ 40 | a lv2:InputPort , atom:AtomPort ; 41 | atom:bufferType atom:Sequence ; 42 | atom:supports time:Position ; 43 | lv2:index 0; 44 | lv2:symbol "EventsIn" ; 45 | lv2:name "Events In" ; 46 | ], 47 | [ 48 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 49 | lv2:index 1; 50 | lv2:symbol "TransportStatusCV"; 51 | lv2:name "Transport status CV"; 52 | lv2:minimum 0.0 ; 53 | lv2:maximum 10.0 ; 54 | ], 55 | [ 56 | a lv2:ControlPort, lv2:OutputPort ; 57 | lv2:index 2 ; 58 | lv2:symbol "TransportStatus" ; 59 | lv2:name "Transport status" ; 60 | lv2:default 0.0 ; 61 | lv2:minimum 0.0 ; 62 | lv2:maximum 1.0 ; 63 | ], 64 | [ 65 | a lv2:InputPort , lv2:ControlPort ; 66 | lv2:index 3 ; 67 | lv2:symbol "pluginEnabled" ; 68 | lv2:name "Plugin Enabled" ; 69 | lv2:default 1.0 ; 70 | lv2:minimum 0.0 ; 71 | lv2:maximum 1.0 ; 72 | lv2:designation lv2:enabled; 73 | lv2:portProperty lv2:toggled; 74 | ] 75 | . 76 | -------------------------------------------------------------------------------- /source/mod-logic-operators/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | bin 4 | build 5 | *.o 6 | *.d 7 | -------------------------------------------------------------------------------- /source/mod-logic-operators/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "dpf"] 2 | path = dpf 3 | url = git@github.com:DISTRHO/DPF.git 4 | -------------------------------------------------------------------------------- /source/mod-logic-operators/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for DISTRHO Plugins # 3 | # ---------------------------- # 4 | # Created by falkTX 5 | # 6 | 7 | include dpf/Makefile.base.mk 8 | 9 | all: plugins gen 10 | 11 | # -------------------------------------------------------------- 12 | 13 | libs: 14 | $(MAKE) -C common 15 | 16 | dgl: 17 | ifeq ($(HAVE_DGL),true) 18 | $(MAKE) -C dpf/dgl 19 | endif 20 | 21 | plugins: 22 | $(MAKE) all -C plugins/logic-operators 23 | 24 | ifneq ($(CROSS_COMPILING),true) 25 | gen: plugins dpf/utils/lv2_ttl_generator 26 | #@$(CURDIR)/dpf/utils/generate-ttl.sh 27 | cp -r plugins/logic-operators/lv2-data/* bin/logic-operators.lv2/ 28 | ifeq ($(MACOS),true) 29 | @$(CURDIR)/dpf/utils/generate-vst-bundles.sh 30 | endif 31 | 32 | dpf/utils/lv2_ttl_generator: 33 | $(MAKE) -C dpf/utils/lv2-ttl-generator 34 | else 35 | gen: 36 | endif 37 | 38 | # -------------------------------------------------------------- 39 | install: 40 | cp -r bin/*.lv2/ /usr/lib/lv2 41 | cp bin/*.so /usr/lib/vst 42 | 43 | clean: 44 | #$(MAKE) clean -C dpf/dgl 45 | $(MAKE) clean -C dpf/utils/lv2-ttl-generator 46 | $(MAKE) clean -C plugins/logic-operators 47 | rm -rf bin build 48 | 49 | # -------------------------------------------------------------- 50 | 51 | .PHONY: plugins 52 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/DistrhoPluginInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // DistrhoPluginInfo.h 3 | 4 | 5 | #ifndef DISTRHO_PLUGIN_INFO_H_INCLUDED 6 | #define DISTRHO_PLUGIN_INFO_H_INCLUDED 7 | 8 | #define DISTRHO_PLUGIN_BRAND "MOD" 9 | #define DISTRHO_PLUGIN_NAME "Logic Operators" 10 | #define DISTRHO_PLUGIN_URI "http://moddevices.com/plugins/mod-devel/logic-operators" 11 | 12 | #define DISTRHO_PLUGIN_HAS_UI 0 13 | #define DISTRHO_PLUGIN_IS_RT_SAFE 1 14 | 15 | #define DISTRHO_PLUGIN_NUM_INPUTS 2 16 | #define DISTRHO_PLUGIN_NUM_OUTPUTS 1 17 | 18 | #define DISTRHO_PLUGIN_WANT_TIMEPOS 0 19 | #define DISTRHO_PLUGIN_WANT_PROGRAMS 0 20 | 21 | //#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:Plugin" 22 | 23 | #endif // DISTRHO_PLUGIN_INFO_H_INCLUDED 24 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/Makefile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------- 2 | #!/usr/bin/make -f 3 | # Makefile for DISTRHO Plugins # 4 | # ---------------------------- # 5 | # Created by falkTX 6 | # 7 | 8 | # -------------------------------------------------------------- 9 | # Project name, used for binaries 10 | 11 | NAME = logic-operators 12 | 13 | # -------------------------------------------------------------- 14 | # Files to build 15 | 16 | FILES_DSP = \ 17 | logic-operators.cpp \ 18 | operators/operator.cpp 19 | 20 | # -------------------------------------------------------------- 21 | # Do some magic 22 | 23 | include ../../dpf/Makefile.plugins.mk 24 | 25 | # -------------------------------------------------------------- 26 | # Enable only LV2 27 | 28 | all: lv2_sep 29 | 30 | # -------------------------------------------------------------- 31 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/logic-operators.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DISTRHO_PLUGIN_SLPLUGIN_HPP_INCLUDED 2 | #define DISTRHO_PLUGIN_SLPLUGIN_HPP_INCLUDED 3 | 4 | #include "DistrhoPlugin.hpp" 5 | 6 | #include "logic-operators.hpp" 7 | #include "operators/operator.hpp" 8 | #include "operators/AND.hpp" 9 | #include "operators/INV.hpp" 10 | #include "operators/NAND.hpp" 11 | #include "operators/NOR.hpp" 12 | #include "operators/OR.hpp" 13 | #include "operators/XNOR.hpp" 14 | #include "operators/XOR.hpp" 15 | 16 | START_NAMESPACE_DISTRHO 17 | 18 | #define NUM_OPERATORS 7 19 | 20 | class LogicOperators : public Plugin 21 | { 22 | public: 23 | enum Parameters 24 | { 25 | paramSelectOperator = 0, 26 | paramSetSwitchPoint, 27 | paramSetHysteresis, 28 | paramCount 29 | }; 30 | 31 | LogicOperators(); 32 | ~LogicOperators(); 33 | 34 | protected: 35 | // ------------------------------------------------------------------- 36 | // Information 37 | 38 | const char* getLabel() const noexcept override 39 | { 40 | return "LogicOperators"; 41 | } 42 | 43 | const char* getDescription() const override 44 | { 45 | return "Logic operators"; 46 | } 47 | 48 | const char* getMaker() const noexcept override 49 | { 50 | return "MOD"; 51 | } 52 | 53 | const char* getHomePage() const override 54 | { 55 | return "http://moddevices.com"; 56 | } 57 | 58 | const char* getLicense() const noexcept override 59 | { 60 | return "GPLv2+"; 61 | } 62 | 63 | uint32_t getVersion() const noexcept override 64 | { 65 | return d_version(1, 0, 0); 66 | } 67 | 68 | int64_t getUniqueId() const noexcept override 69 | { 70 | return d_cconst('M', 'D', 'L', 'O'); 71 | } 72 | 73 | // ------------------------------------------------------------------- 74 | // Init 75 | 76 | void initParameter(uint32_t index, Parameter& parameter) override; 77 | 78 | // ------------------------------------------------------------------- 79 | // Internal data 80 | 81 | float getParameterValue(uint32_t index) const override; 82 | void setParameterValue(uint32_t index, float value) override; 83 | 84 | // ------------------------------------------------------------------- 85 | // Process 86 | void activate() override; 87 | void deactivate() override; 88 | void run(const float** inputs, float** outputs, uint32_t frames) override; 89 | 90 | private: 91 | 92 | void reset(); 93 | 94 | float sampleRate; 95 | int selectOperator; 96 | float paramSwitchPoint; 97 | float paramHysteresis; 98 | float logic1; 99 | float logic2; 100 | float logicOut; 101 | 102 | Operator **logicOperators; 103 | 104 | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(LogicOperators) 105 | }; 106 | 107 | // ----------------------------------------------------------------------- 108 | 109 | END_NAMESPACE_DISTRHO 110 | 111 | #endif // DISTRHO_PLUGIN_SLPLUGIN_HPP_INCLUDED 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/lv2-data/logic-operators_dsp.ttl: -------------------------------------------------------------------------------- 1 | @prefix doap: . 2 | @prefix foaf: . 3 | @prefix lv2: . 4 | @prefix mod: . 5 | @prefix opts: . 6 | @prefix rdf: . 7 | @prefix rdfs: . 8 | @prefix rsz: . 9 | @prefix units: . 10 | 11 | 12 | a lv2:Plugin, mod:ControlVoltagePlugin ; 13 | 14 | lv2:extensionData , 15 | ; 16 | 17 | lv2:optionalFeature , 18 | ; 19 | 20 | lv2:requiredFeature , 21 | ; 22 | 23 | opts:supportedOption , 24 | , 25 | ; 26 | 27 | lv2:port [ 28 | a lv2:InputPort, lv2:CVPort, mod:CVPort ; 29 | lv2:index 0 ; 30 | lv2:minimum 0.0 ; 31 | lv2:maximum 10.0 ; 32 | lv2:symbol "CV_in_1" ; 33 | lv2:name "CV_in_1" ; 34 | ] , 35 | [ 36 | a lv2:InputPort, lv2:CVPort, mod:CVPort ; 37 | lv2:index 1 ; 38 | lv2:minimum 0.0 ; 39 | lv2:maximum 10.0 ; 40 | lv2:symbol "CV_in_2" ; 41 | lv2:name "CV_in_2" ; 42 | ] ; 43 | 44 | lv2:port [ 45 | a lv2:OutputPort, lv2:CVPort, mod:CVPort ; 46 | lv2:index 2 ; 47 | lv2:symbol "CV_out" ; 48 | lv2:name "CV_out" ; 49 | lv2:minimum 0.0 ; 50 | lv2:maximum 10.0 ; 51 | ] ; 52 | 53 | lv2:port [ 54 | a lv2:InputPort, lv2:ControlPort ; 55 | lv2:index 3 ; 56 | lv2:name "Logic Operator" ; 57 | lv2:symbol "LogicOperator" ; 58 | lv2:default 0.000000 ; 59 | lv2:minimum 0.000000 ; 60 | lv2:maximum 6.000000 ; 61 | lv2:scalePoint [ rdfs:label "INV"; rdf:value 0; ] ; 62 | lv2:scalePoint [ rdfs:label "NAND"; rdf:value 1; ] ; 63 | lv2:scalePoint [ rdfs:label "AND"; rdf:value 2; ] ; 64 | lv2:scalePoint [ rdfs:label "OR"; rdf:value 3; ] ; 65 | lv2:scalePoint [ rdfs:label "NOR"; rdf:value 4; ] ; 66 | lv2:scalePoint [ rdfs:label "XOR"; rdf:value 5; ] ; 67 | lv2:scalePoint [ rdfs:label "XNOR"; rdf:value 6; ] ; 68 | lv2:portProperty lv2:enumeration; 69 | ] , 70 | [ 71 | a lv2:InputPort, lv2:ControlPort ; 72 | lv2:index 4 ; 73 | lv2:name "Switch Point" ; 74 | lv2:symbol "SwitchPoint" ; 75 | lv2:default 5.0; 76 | lv2:minimum -10.0; 77 | lv2:maximum 10.0; 78 | units:unit mod:volts ; 79 | ] , 80 | [ 81 | a lv2:InputPort, lv2:ControlPort ; 82 | lv2:index 5 ; 83 | lv2:name """Hysteresis""" ; 84 | lv2:symbol "Hysteresis" ; 85 | lv2:default 0.0; 86 | lv2:minimum 0.0; 87 | lv2:maximum 5.0; 88 | lv2:scalePoint [ rdfs:label "off"; rdf:value 0.0; ] ; 89 | units:unit mod:volts ; 90 | ] ; 91 | 92 | rdfs:comment """ 93 | Logic operators 94 | """ ; 95 | 96 | mod:brand "MOD" ; 97 | mod:label "Logic Operators" ; 98 | 99 | doap:name """Logic Operators""" ; 100 | doap:license """GPLv2+""" ; 101 | 102 | doap:maintainer [ 103 | foaf:name """MOD""" ; 104 | foaf:homepage ; 105 | ] ; 106 | 107 | lv2:microVersion 0 ; 108 | lv2:minorVersion 2 . 109 | 110 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/lv2-data/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | @prefix pset: . 4 | 5 | 6 | a lv2:Plugin ; 7 | lv2:binary ; 8 | rdfs:seeAlso . 9 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/AND.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_AND_ 2 | #define _H_AND_ 3 | #include "operator.hpp" 4 | 5 | class AND_Operator : public Operator 6 | { 7 | public: 8 | AND_Operator(): Operator() {}; 9 | ~AND_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float AND_Operator::process(float A, float B) 16 | { 17 | return (A == high && B == high) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/INV.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_INV_ 2 | #define _H_INV_ 3 | #include "operator.hpp" 4 | 5 | class INV_Operator : public Operator 6 | { 7 | public: 8 | INV_Operator(): Operator() {}; 9 | ~INV_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float INV_Operator::process(float A, float) 16 | { 17 | return (A == high) ? false_value : true_value; 18 | } 19 | 20 | 21 | #endif //_H_INV_ 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/NAND.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_NAND_ 2 | #define _H_NAND_ 3 | #include "operator.hpp" 4 | 5 | class NAND_Operator : public Operator 6 | { 7 | public: 8 | NAND_Operator(): Operator() {}; 9 | ~NAND_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float NAND_Operator::process(float A, float B) 16 | { 17 | return (A == low || B == low) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/NOR.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_NOR_ 2 | #define _H_NOR_ 3 | #include "operator.hpp" 4 | 5 | class NOR_Operator : public Operator 6 | { 7 | public: 8 | NOR_Operator(): Operator() {}; 9 | ~NOR_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float NOR_Operator::process(float A, float B) 16 | { 17 | return (A == low && B == low) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/OR.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_OR_ 2 | #define _H_OR_ 3 | #include "operator.hpp" 4 | 5 | class OR_Operator : public Operator 6 | { 7 | public: 8 | OR_Operator(): Operator() {}; 9 | ~OR_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float OR_Operator::process(float A, float B) 16 | { 17 | return (A == high || B == high) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/XNOR.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_XNOR_ 2 | #define _H_XNOR_ 3 | #include "operator.hpp" 4 | 5 | class XNOR_Operator : public Operator 6 | { 7 | public: 8 | XNOR_Operator(): Operator() {}; 9 | ~XNOR_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float XNOR_Operator::process(float A, float B) 16 | { 17 | return ((A == low && B == low) || (A == high && B == high)) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/XOR.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_XOR_ 2 | #define _H_XOR_ 3 | #include "operator.hpp" 4 | 5 | class XOR_Operator : public Operator 6 | { 7 | public: 8 | XOR_Operator(): Operator() {}; 9 | ~XOR_Operator(){}; 10 | 11 | float process(float A, float B) override; 12 | }; 13 | 14 | 15 | inline float XOR_Operator::process(float A, float B) 16 | { 17 | return ((A == high || B == high) && !(A == high && B == high)) ? true_value : false_value; 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/operator.cpp: -------------------------------------------------------------------------------- 1 | #include "operator.hpp" 2 | 3 | Operator::Operator() 4 | { 5 | } 6 | 7 | Operator::~Operator() 8 | { 9 | } 10 | 11 | void Operator::setHigh(float high) 12 | { 13 | this->high = high; 14 | } 15 | 16 | void Operator::setLow(float low) 17 | { 18 | this->low = low; 19 | } 20 | 21 | float Operator::getHigh() 22 | { 23 | return high; 24 | } 25 | 26 | float Operator::getLow() 27 | { 28 | return low; 29 | } 30 | -------------------------------------------------------------------------------- /source/mod-logic-operators/plugins/logic-operators/operators/operator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _H_OPERATOR_ 2 | #define _H_OPERATOR_ 3 | 4 | class Operator { 5 | public: 6 | Operator(); 7 | ~Operator(); 8 | void setHigh(float high); 9 | void setLow(float low); 10 | float getHigh(); 11 | float getLow(); 12 | virtual float process(float A, float B) = 0; 13 | protected: 14 | float high = 5.0; 15 | float low = 0.0; 16 | float true_value = 10.0; 17 | float false_value = 0.0; 18 | private: 19 | }; 20 | 21 | 22 | #endif //_H_OPERATOR_ 23 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-mono/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-midi-to-cv-mono.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-midi-to-cv-mono 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-mono/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-midi-to-cv.lv2 # 3 | # ----------------------- # 4 | 5 | AR ?= ar 6 | CC ?= gcc 7 | CXX ?= g++ 8 | 9 | # -------------------------------------------------------------- 10 | # Fallback to Linux if no other OS defined 11 | 12 | ifneq ($(MACOS),true) 13 | ifneq ($(WIN32),true) 14 | LINUX=true 15 | endif 16 | endif 17 | 18 | # -------------------------------------------------------------- 19 | # Set build and link flags 20 | 21 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 22 | BASE_OPTS = -O3 -ffast-math 23 | 24 | ifeq ($(MACOS),true) 25 | # MacOS linker flags 26 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 27 | else 28 | # Common linker flags 29 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 30 | endif 31 | 32 | ifneq ($(WIN32),true) 33 | # not needed for Windows 34 | BASE_FLAGS += -fPIC -DPIC 35 | endif 36 | 37 | ifeq ($(DEBUG),true) 38 | BASE_FLAGS += -DDEBUG -O0 -g 39 | LINK_OPTS = 40 | else 41 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 42 | CXXFLAGS += -fvisibility-inlines-hidden 43 | endif 44 | 45 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 46 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 47 | 48 | ifeq ($(MACOS),true) 49 | # 'no-undefined' is always enabled on MacOS 50 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 51 | else 52 | # add 'no-undefined' 53 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 54 | endif 55 | 56 | # -------------------------------------------------------------- 57 | # Set shared lib extension 58 | 59 | LIB_EXT = .so 60 | 61 | ifeq ($(MACOS),true) 62 | LIB_EXT = .dylib 63 | endif 64 | 65 | ifeq ($(WIN32),true) 66 | LIB_EXT = .dll 67 | endif 68 | 69 | # -------------------------------------------------------------- 70 | # Set shared library CLI arg 71 | 72 | SHARED = -shared 73 | 74 | ifeq ($(MACOS),true) 75 | SHARED = -dynamiclib 76 | endif 77 | 78 | # -------------------------------------------------------------- 79 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-mono/mod-midi-to-cv-mono.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-mono/mod-midi-to-cv-mono.lv2/mod-midi-to-cv-mono.ttl: -------------------------------------------------------------------------------- 1 | @prefix atom: . 2 | @prefix doap: . 3 | @prefix foaf: . 4 | @prefix lv2: . 5 | @prefix midi: . 6 | @prefix mod: . 7 | @prefix modgui: . 8 | @prefix rdf: . 9 | @prefix rdfs: . 10 | @prefix epp: . 11 | 12 | 13 | a lv2:Plugin, mod:ControlVoltagePlugin; 14 | doap:name "MIDI to CV mono" ; 15 | rdfs:comment """ 16 | MIDI to CV mono converts a midi message to monophonic control voltage, 1/12 volt per note. It also features a retrigger knob, which retriggers the gate when it switches back to a previous voice that is still active. This is particularly useful when combined with short envelopes. 17 | """ ; 18 | lv2:minorVersion 3 ; 19 | lv2:microVersion 1 ; 20 | lv2:optionalFeature lv2:hardRTCapable ; 21 | lv2:port [ 22 | a lv2:InputPort , 23 | atom:AtomPort ; 24 | atom:bufferType atom:Sequence ; 25 | atom:supports midi:MidiEvent ; 26 | lv2:index 0 ; 27 | lv2:symbol "in" ; 28 | lv2:name "In" ; 29 | ] , 30 | [ 31 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 32 | lv2:index 1; 33 | lv2:symbol "Pitch"; 34 | lv2:name "Pitch"; 35 | lv2:minimum 0.0; 36 | lv2:maximum 10.0; 37 | ] , 38 | [ 39 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 40 | lv2:index 2; 41 | lv2:symbol "Velocity"; 42 | lv2:name "Velocity"; 43 | lv2:minimum 0.0; 44 | lv2:maximum 10.0; 45 | ] , 46 | [ 47 | a lv2:OutputPort, lv2:CVPort, mod:CVPort; 48 | lv2:index 3; 49 | lv2:symbol "Gate"; 50 | lv2:name "Gate"; 51 | lv2:minimum 0.0; 52 | lv2:maximum 10.0; 53 | ] , 54 | [ 55 | a lv2:InputPort, lv2:ControlPort; 56 | lv2:index 4; 57 | lv2:symbol "Octave"; 58 | lv2:name "Octave"; 59 | lv2:minimum -3; 60 | lv2:default 0; 61 | lv2:maximum 3; 62 | lv2:portProperty lv2:integer; 63 | ] , 64 | [ 65 | a lv2:InputPort, lv2:ControlPort; 66 | lv2:index 5; 67 | lv2:symbol "Semitone"; 68 | lv2:name "Semitone"; 69 | lv2:minimum -12; 70 | lv2:default 0; 71 | lv2:maximum 12; 72 | lv2:portProperty lv2:integer; 73 | ] , 74 | [ 75 | a lv2:InputPort, lv2:ControlPort; 76 | lv2:index 6; 77 | lv2:symbol "Cent"; 78 | lv2:name "Cent"; 79 | lv2:minimum -100; 80 | lv2:default 0; 81 | lv2:maximum 100; 82 | lv2:portProperty lv2:integer; 83 | ] , 84 | [ 85 | a lv2:InputPort , 86 | lv2:ControlPort ; 87 | lv2:index 7 ; 88 | lv2:symbol "Retrigger" ; 89 | lv2:name "Retrigger" ; 90 | lv2:default 0.0 ; 91 | lv2:minimum 0.0 ; 92 | lv2:maximum 1.0 ; 93 | lv2:portProperty lv2:toggled; 94 | ] , 95 | [ a lv2:InputPort, 96 | lv2:ControlPort ; 97 | lv2:index 8; 98 | lv2:symbol "Panic"; 99 | lv2:name "Panic"; 100 | lv2:default 0; 101 | lv2:minimum 0; 102 | lv2:maximum 1; 103 | lv2:portProperty lv2:integer, lv2:toggled, epp:trigger ; 104 | ] ; 105 | 106 | doap:license "http://spdx.org/licenses/GPL-2.0-or-later.html" ; 107 | doap:developer [ 108 | foaf:name "Bram Giesen & Jarno Verheesen" ; 109 | foaf:homepage <> ; 110 | foaf:mbox ; 111 | ] ; 112 | 113 | doap:maintainer [ 114 | foaf:name "MOD Team" ; 115 | foaf:homepage ; 116 | foaf:mbox ; 117 | ] ; 118 | 119 | mod:brand "MOD" ; 120 | mod:label "MIDI to CV mono" . 121 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-mono/mod-midi-to-cv-mono.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # Makefile for mod-midi-to-cv 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_MIDI_TO_CV_MONO_SITE_METHOD = local 9 | MOD_MIDI_TO_CV_MONO_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_MIDI_TO_CV_MONO_VERSION = 3 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_MIDI_TO_CV_MONO_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_MIDI_TO_CV_MONO_BUNDLES = mod-midi-to-cv-mono.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_MIDI_TO_CV_MONO_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_MIDI_TO_CV_MONO_BUILD_CMDS 27 | $(MOD_MIDI_TO_CV_MONO_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_MIDI_TO_CV_MONO_INSTALL_TARGET_CMDS 32 | $(MOD_MIDI_TO_CV_MONO_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-poly/Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-midi-to-cv-poly.lv2 # 3 | # --------------------------------- # 4 | 5 | include Makefile.mk 6 | 7 | NAME = mod-midi-to-cv-poly 8 | 9 | # -------------------------------------------------------------- 10 | # Installation path 11 | 12 | INSTALL_PATH = /usr/local/lib/lv2 13 | COMPLETE_INSTALL_PATH = $(DESTDIR)$(INSTALL_PATH)/$(NAME).lv2 14 | 15 | # -------------------------------------------------------------- 16 | # Default target is to build all plugins 17 | 18 | all: build 19 | build: $(NAME)-build 20 | 21 | # -------------------------------------------------------------- 22 | # Build rules 23 | 24 | $(NAME)-build: $(NAME).lv2/$(NAME)$(LIB_EXT) 25 | 26 | $(NAME).lv2/$(NAME)$(LIB_EXT): $(NAME).c 27 | $(CC) $^ $(BUILD_C_FLAGS) $(LINK_FLAGS) -lm $(SHARED) -o $@ 28 | 29 | # -------------------------------------------------------------- 30 | 31 | clean: 32 | rm -f $(NAME).lv2/$(NAME)$(LIB_EXT) 33 | 34 | # -------------------------------------------------------------- 35 | 36 | install: build 37 | install -d $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2 38 | 39 | install -m 644 $(NAME).lv2/*.so $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 40 | install -m 644 $(NAME).lv2/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/$(NAME).lv2/ 41 | 42 | # -------------------------------------------------------------- 43 | 44 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-poly/Makefile.mk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # Makefile for mod-midi-to-cv.lv2 # 3 | # ----------------------- # 4 | 5 | AR ?= ar 6 | CC ?= gcc 7 | CXX ?= g++ 8 | 9 | # -------------------------------------------------------------- 10 | # Fallback to Linux if no other OS defined 11 | 12 | ifneq ($(MACOS),true) 13 | ifneq ($(WIN32),true) 14 | LINUX=true 15 | endif 16 | endif 17 | 18 | # -------------------------------------------------------------- 19 | # Set build and link flags 20 | 21 | BASE_FLAGS = -Wall -Wextra -pipe -Wno-unused-parameter 22 | BASE_OPTS = -O3 -ffast-math 23 | 24 | ifeq ($(MACOS),true) 25 | # MacOS linker flags 26 | LINK_OPTS = -Wl,-dead_strip -Wl,-dead_strip_dylibs 27 | else 28 | # Common linker flags 29 | LINK_OPTS = -Wl,-O1 -Wl,--as-needed -Wl,--strip-all 30 | endif 31 | 32 | ifneq ($(WIN32),true) 33 | # not needed for Windows 34 | BASE_FLAGS += -fPIC -DPIC 35 | endif 36 | 37 | ifeq ($(DEBUG),true) 38 | BASE_FLAGS += -DDEBUG -O0 -g 39 | LINK_OPTS = 40 | else 41 | BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden 42 | CXXFLAGS += -fvisibility-inlines-hidden 43 | endif 44 | 45 | BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 -std=gnu99 $(CFLAGS) 46 | BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++11 $(CXXFLAGS) $(CPPFLAGS) 47 | 48 | ifeq ($(MACOS),true) 49 | # 'no-undefined' is always enabled on MacOS 50 | LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS) 51 | else 52 | # add 'no-undefined' 53 | LINK_FLAGS = $(LINK_OPTS) -Wl,--no-undefined $(LDFLAGS) 54 | endif 55 | 56 | # -------------------------------------------------------------- 57 | # Set shared lib extension 58 | 59 | LIB_EXT = .so 60 | 61 | ifeq ($(MACOS),true) 62 | LIB_EXT = .dylib 63 | endif 64 | 65 | ifeq ($(WIN32),true) 66 | LIB_EXT = .dll 67 | endif 68 | 69 | # -------------------------------------------------------------- 70 | # Set shared library CLI arg 71 | 72 | SHARED = -shared 73 | 74 | ifeq ($(MACOS),true) 75 | SHARED = -dynamiclib 76 | endif 77 | 78 | # -------------------------------------------------------------- 79 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-poly/mod-midi-to-cv-poly.lv2/manifest.ttl: -------------------------------------------------------------------------------- 1 | @prefix lv2: . 2 | @prefix rdfs: . 3 | 4 | 5 | a lv2:Plugin ; 6 | lv2:binary ; 7 | rdfs:seeAlso ; 8 | lv2:optionalFeature lv2:hardRTCapable . 9 | -------------------------------------------------------------------------------- /source/mod-midi-to-cv-poly/mod-midi-to-cv-poly.mk: -------------------------------------------------------------------------------- 1 | ###################################### 2 | # 3 | # Makefile for mod-midi-to-cv 4 | # 5 | ###################################### 6 | 7 | # where to find the source code - locally in this case 8 | MOD_MIDI_TO_CV_POLY_SITE_METHOD = local 9 | MOD_MIDI_TO_CV_POLY_SITE = $($(PKG)_PKGDIR)/ 10 | 11 | # even though this is a local build, we still need a version number 12 | # bump this number if you need to force a rebuild 13 | MOD_MIDI_TO_CV_POLY_VERSION = 1 14 | 15 | # dependencies (list of other buildroot packages, separated by space) 16 | MOD_MIDI_TO_CV_POLY_DEPENDENCIES = 17 | 18 | # LV2 bundles that this package generates (space separated list) 19 | MOD_MIDI_TO_CV_POLY_BUNDLES = mod-midi-to-cv-poly.lv2 20 | 21 | # call make with the current arguments and path. "$(@D)" is the build directory. 22 | MOD_MIDI_TO_CV_POLY_TARGET_MAKE = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/source 23 | 24 | 25 | # build command 26 | define MOD_MIDI_TO_CV_POLY_BUILD_CMDS 27 | $(MOD_MIDI_TO_CV_POLY_TARGET_MAKE) 28 | endef 29 | 30 | # install command 31 | define MOD_MIDI_TO_CV_POLY_INSTALL_TARGET_CMDS 32 | $(MOD_MIDI_TO_CV_POLY_TARGET_MAKE) install DESTDIR=$(TARGET_DIR) 33 | endef 34 | 35 | 36 | # import everything else from the buildroot generic package 37 | $(eval $(generic-package)) 38 | --------------------------------------------------------------------------------