diff --git a/examples/fx_ring_mod/android/Makefile b/examples/fx_ring_mod/android/Makefile
deleted file mode 100644
index 6b0defe..0000000
--- a/examples/fx_ring_mod/android/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
-
-NAME := bw_example_fx_ring_mod
-SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ring_mod.c
-
-include ${ROOT_DIR}/../../common/android/android.mk
diff --git a/examples/fx_ring_mod/daisy-seed/Makefile b/examples/fx_ring_mod/daisy-seed/Makefile
deleted file mode 100644
index bddfb18..0000000
--- a/examples/fx_ring_mod/daisy-seed/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
-
-TARGET = bw_example_fx_ring_mod
-
-C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_ring_mod.c
-
-include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
diff --git a/examples/fx_ring_mod/daisy-seed/config_daisy_seed.h b/examples/fx_ring_mod/daisy-seed/config_daisy_seed.h
deleted file mode 100644
index c56c264..0000000
--- a/examples/fx_ring_mod/daisy-seed/config_daisy_seed.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2023 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File authors: Stefano D'Angelo
- */
-
-#ifndef _CONFIG_DAISY_SEED_H
-#define _CONFIG_DAISY_SEED_H
-
-struct config_pin {
- int param_index;
- int pin;
-};
-
-#define NUM_PINS 2
-
-static struct config_pin config_pins[NUM_PINS] = {
- { 0, 15 },
- { 1, 16 }
-};
-
-#endif
diff --git a/examples/fx_ring_mod/ios/Makefile b/examples/fx_ring_mod/ios/Makefile
deleted file mode 100644
index b3ed2ec..0000000
--- a/examples/fx_ring_mod/ios/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
-
-NAME := bw_example_fx_ring_mod
-SOURCE := ${NAME}.c
-
-include ${ROOT_DIR}/../../common/ios/ios.mk
diff --git a/examples/fx_ring_mod/src/android.json b/examples/fx_ring_mod/src/android.json
new file mode 100644
index 0000000..4b7d633
--- /dev/null
+++ b/examples/fx_ring_mod/src/android.json
@@ -0,0 +1,5 @@
+{
+ "android": {
+ "javaPackageName": "com.orastron.bw_example_fx_ring_mod"
+ }
+}
diff --git a/examples/fx_ring_mod/src/bw_example_fx_ring_mod.c b/examples/fx_ring_mod/src/bw_example_fx_ring_mod.c
deleted file mode 100644
index faff936..0000000
--- a/examples/fx_ring_mod/src/bw_example_fx_ring_mod.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2022, 2023 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File author: Stefano D'Angelo
- */
-
-#include "bw_example_fx_ring_mod.h"
-
-#include
-
-void bw_example_fx_ring_mod_init(bw_example_fx_ring_mod *instance) {
- bw_phase_gen_init(&instance->phase_gen_coeffs);
- bw_ring_mod_init(&instance->ring_mod_coeffs);
-}
-
-void bw_example_fx_ring_mod_set_sample_rate(bw_example_fx_ring_mod *instance, float sample_rate) {
- bw_phase_gen_set_sample_rate(&instance->phase_gen_coeffs, sample_rate);
- bw_ring_mod_set_sample_rate(&instance->ring_mod_coeffs, sample_rate);
-}
-
-void bw_example_fx_ring_mod_reset(bw_example_fx_ring_mod *instance) {
- bw_phase_gen_reset_coeffs(&instance->phase_gen_coeffs);
- float v, v_inc;
- bw_phase_gen_reset_state(&instance->phase_gen_coeffs, &instance->phase_gen_state, 0.f, &v, &v_inc);
- bw_ring_mod_reset_coeffs(&instance->ring_mod_coeffs);
-}
-
-void bw_example_fx_ring_mod_process(bw_example_fx_ring_mod *instance, const float** x, float** y, int n_samples) {
- bw_phase_gen_process(&instance->phase_gen_coeffs, &instance->phase_gen_state, NULL, y[0], NULL, n_samples);
- bw_osc_sin_process(y[0], y[0], n_samples);
- bw_ring_mod_process(&instance->ring_mod_coeffs, x[0], y[0], y[0], n_samples);
-}
-
-void bw_example_fx_ring_mod_set_parameter(bw_example_fx_ring_mod *instance, int index, float value) {
- instance->params[index] = value;
- switch (index) {
- case p_freq:
- bw_phase_gen_set_frequency(&instance->phase_gen_coeffs, 100.f + (1000.f - 100.f) * value * value * value);
- break;
- case p_amount:
- bw_ring_mod_set_amount(&instance->ring_mod_coeffs, -1.f + 2.f * value);
- break;
- }
-}
-
-float bw_example_fx_ring_mod_get_parameter(bw_example_fx_ring_mod *instance, int index) {
- return instance->params[index];
-}
diff --git a/examples/fx_ring_mod/src/bw_example_fx_ring_mod.h b/examples/fx_ring_mod/src/bw_example_fx_ring_mod.h
deleted file mode 100644
index 542e465..0000000
--- a/examples/fx_ring_mod/src/bw_example_fx_ring_mod.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2023 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File author: Stefano D'Angelo
- */
-
-#ifndef _BW_EXAMPLE_FX_RING_MOD_H
-#define _BW_EXAMPLE_FX_RING_MOD_H
-
-#include "platform.h"
-
-#include
-#include
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum {
- p_freq,
- p_amount,
- p_n
-};
-
-struct _bw_example_fx_ring_mod {
- // Sub-components
- bw_phase_gen_coeffs phase_gen_coeffs;
- bw_phase_gen_state phase_gen_state;
- bw_ring_mod_coeffs ring_mod_coeffs;
-
- // Parameters
- float params[p_n];
-};
-typedef struct _bw_example_fx_ring_mod bw_example_fx_ring_mod;
-
-void bw_example_fx_ring_mod_init(bw_example_fx_ring_mod *instance);
-void bw_example_fx_ring_mod_set_sample_rate(bw_example_fx_ring_mod *instance, float sample_rate);
-void bw_example_fx_ring_mod_reset(bw_example_fx_ring_mod *instance);
-void bw_example_fx_ring_mod_process(bw_example_fx_ring_mod *instance, const float** x, float** y, int n_samples);
-void bw_example_fx_ring_mod_set_parameter(bw_example_fx_ring_mod *instance, int index, float value);
-float bw_example_fx_ring_mod_get_parameter(bw_example_fx_ring_mod *instance, int index);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/examples/fx_ring_mod/src/cmd.json b/examples/fx_ring_mod/src/cmd.json
new file mode 100644
index 0000000..8f49d95
--- /dev/null
+++ b/examples/fx_ring_mod/src/cmd.json
@@ -0,0 +1,6 @@
+{
+ "cmd": {
+ "busIds": [ "input", "output" ],
+ "parameterIds": [ "frequency", "amount" ]
+ }
+}
diff --git a/examples/fx_ring_mod/src/config.h b/examples/fx_ring_mod/src/config.h
deleted file mode 100644
index a9de353..0000000
--- a/examples/fx_ring_mod/src/config.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2022, 2023 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File authors: Stefano D'Angelo
- */
-
-#ifndef _CONFIG_H
-#define _CONFIG_H
-
-// Definitions
-
-#define IO_MONO 1
-#define IO_STEREO (1<<1)
-
-struct config_io_bus {
- const char *name;
- char out;
- char aux;
- char cv;
- char configs;
-};
-
-struct config_parameter {
- const char *name;
- const char *shortName;
- const char *units;
- char out;
- char bypass;
- int steps;
- float defaultValueUnmapped;
-};
-
-// Data
-
-#define COMPANY_NAME "Orastron"
-#define COMPANY_WEBSITE "https://www.orastron.com/"
-#define COMPANY_MAILTO "mailto:info@orastron.com"
-
-#define PLUGIN_NAME "bw_example_fx_ring_mod"
-#define PLUGIN_VERSION "1.0.0"
-
-#define NUM_BUSES_IN 1
-#define NUM_BUSES_OUT 1
-#define NUM_CHANNELS_IN 1
-#define NUM_CHANNELS_OUT 1
-
-static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
- { "Audio in", 0, 0, 0, IO_MONO }
-};
-
-static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
- { "Audio out", 1, 0, 0, IO_MONO }
-};
-
-#define NUM_PARAMETERS 2
-
-static struct config_parameter config_parameters[NUM_PARAMETERS] = {
- { "Frequency", "Freq", "Hz", 0, 0, 0, 0.5f },
- { "Amount", "Amount", "", 0, 0, 0, 1.0f },
-};
-
-// Internal API
-
-#include "bw_example_fx_ring_mod.h"
-
-#define P_TYPE bw_example_fx_ring_mod
-#define P_INIT bw_example_fx_ring_mod_init
-#define P_SET_SAMPLE_RATE bw_example_fx_ring_mod_set_sample_rate
-#define P_RESET bw_example_fx_ring_mod_reset
-#define P_PROCESS bw_example_fx_ring_mod_process
-#define P_SET_PARAMETER bw_example_fx_ring_mod_set_parameter
-#define P_GET_PARAMETER bw_example_fx_ring_mod_get_parameter
-
-#endif
diff --git a/examples/fx_ring_mod/src/config.js b/examples/fx_ring_mod/src/config.js
deleted file mode 100644
index a47b8e7..0000000
--- a/examples/fx_ring_mod/src/config.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2023 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File author: Stefano D'Angelo
- */
-
-var buses = [
- {
- stereo: false,
- output: false
- },
- {
- stereo: false,
- output: true
- }
-];
-
-var parameters = [
- {
- name: "Frequency",
- output: false,
- defaultValue: 0.5
- },
- {
- name: "Amount",
- output: false,
- defaultValue: 1.0
- }
-];
diff --git a/examples/fx_ring_mod/src/daisy-seed.json b/examples/fx_ring_mod/src/daisy-seed.json
new file mode 100644
index 0000000..00367a0
--- /dev/null
+++ b/examples/fx_ring_mod/src/daisy-seed.json
@@ -0,0 +1,5 @@
+{
+ "daisy_seed": {
+ "parameterPins": [ 15, 16 ]
+ }
+}
diff --git a/examples/fx_ring_mod/src/ios.json b/examples/fx_ring_mod/src/ios.json
new file mode 100644
index 0000000..26fcfcd
--- /dev/null
+++ b/examples/fx_ring_mod/src/ios.json
@@ -0,0 +1,5 @@
+{
+ "ios": {
+ "productBundleIdentifier": "com.orastron.bw_example_fx_ring_mod"
+ }
+}
diff --git a/examples/fx_ring_mod/src/lv2.json b/examples/fx_ring_mod/src/lv2.json
new file mode 100644
index 0000000..ba021cb
--- /dev/null
+++ b/examples/fx_ring_mod/src/lv2.json
@@ -0,0 +1,12 @@
+{
+ "lv2": {
+ "prefixes": {
+ "bw_examples": "https://www.orastron.com/brickworks/examples/"
+ },
+ "uri": "@bw_examples:fx_ring_mod",
+ "types": [ "@lv2:ModulatorPlugin" ],
+ "version": "1.0",
+ "busSymbols": [ "input", "output" ],
+ "parameterSymbols": [ "frequency", "amount" ]
+ }
+}
diff --git a/examples/fx_ring_mod/src/plugin.h b/examples/fx_ring_mod/src/plugin.h
new file mode 100644
index 0000000..74e26d7
--- /dev/null
+++ b/examples/fx_ring_mod/src/plugin.h
@@ -0,0 +1,64 @@
+#include "common.h"
+#include
+#include
+#include
+
+typedef struct plugin {
+ bw_phase_gen_coeffs phase_gen_coeffs;
+ bw_phase_gen_state phase_gen_state;
+ bw_ring_mod_coeffs ring_mod_coeffs;
+} plugin;
+
+static void plugin_init(plugin*instance) {
+ bw_phase_gen_init(&instance->phase_gen_coeffs);
+ bw_ring_mod_init(&instance->ring_mod_coeffs);
+}
+
+static void plugin_fini(plugin *instance) {
+ (void)instance;
+}
+
+static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
+ bw_phase_gen_set_sample_rate(&instance->phase_gen_coeffs, sample_rate);
+ bw_ring_mod_set_sample_rate(&instance->ring_mod_coeffs, sample_rate);
+}
+
+static size_t plugin_mem_req(plugin *instance) {
+ (void)instance;
+ return 0;
+}
+
+static void plugin_mem_set(plugin *instance, void *mem) {
+ (void)instance;
+ (void)mem;
+}
+
+static void plugin_reset(plugin *instance) {
+ bw_phase_gen_reset_coeffs(&instance->phase_gen_coeffs);
+ float v, v_inc;
+ bw_phase_gen_reset_state(&instance->phase_gen_coeffs, &instance->phase_gen_state, 0.f, &v, &v_inc);
+ bw_ring_mod_reset_coeffs(&instance->ring_mod_coeffs);
+}
+
+static void plugin_set_parameter(plugin *instance, size_t index, float value) {
+ switch (index) {
+ case 0:
+ bw_phase_gen_set_frequency(&instance->phase_gen_coeffs, value);
+ break;
+ case 1:
+ bw_ring_mod_set_amount(&instance->ring_mod_coeffs, 0.01f * value);
+ break;
+ }
+}
+
+static float plugin_get_parameter(plugin *instance, size_t index) {
+ (void)instance;
+ (void)index;
+ return 0.f;
+}
+
+static void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
+ bw_phase_gen_process(&instance->phase_gen_coeffs, &instance->phase_gen_state, NULL, outputs[0], NULL, n_samples);
+ bw_osc_sin_process(outputs[0], outputs[0], n_samples);
+ bw_ring_mod_process(&instance->ring_mod_coeffs, inputs[0], outputs[0], outputs[0], n_samples);
+}
diff --git a/examples/fx_ring_mod/src/product.json b/examples/fx_ring_mod/src/product.json
new file mode 100644
index 0000000..391fded
--- /dev/null
+++ b/examples/fx_ring_mod/src/product.json
@@ -0,0 +1,46 @@
+{
+ "product": {
+ "name": "Brickwork ring modulator example",
+ "version": "1.1.0",
+ "buildVersion": "1",
+ "bundleName": "bw_example_fx_ring_mod",
+ "buses": [
+ {
+ "type": "audio",
+ "direction": "input",
+ "channels": "mono",
+ "name": "Input",
+ "shortName": "Input"
+ },
+ {
+ "type": "audio",
+ "direction": "output",
+ "channels": "mono",
+ "name": "Output",
+ "shortName": "Output"
+ }
+ ],
+ "parameters": [
+ {
+ "name": "Frequency",
+ "shortName": "Frequency",
+ "direction": "input",
+ "defaultValue": 300.0,
+ "minimum": 100.0,
+ "maximum": 1000.0,
+ "unit": "hz",
+ "map": "logarithmic"
+ },
+ {
+ "name": "Amount",
+ "shortName": "Amount",
+ "direction": "input",
+ "defaultValue": 0.0,
+ "minimum": -100.0,
+ "maximum": 100.0,
+ "unit": "pc",
+ "map": "linear"
+ }
+ ]
+ }
+}
diff --git a/examples/fx_ring_mod/src/vst3.json b/examples/fx_ring_mod/src/vst3.json
new file mode 100644
index 0000000..24d6978
--- /dev/null
+++ b/examples/fx_ring_mod/src/vst3.json
@@ -0,0 +1,11 @@
+{
+ "vst3": {
+ "plugin": {
+ "cid": "2680121d4e0b47fab213e6e7d13cde60"
+ },
+ "controller": {
+ "cid": "c747bf7a90ac41d0b53d3df92c81a74d"
+ },
+ "subCategory": "Fx|Modulation"
+ }
+}
diff --git a/examples/fx_ring_mod/vst3/Makefile b/examples/fx_ring_mod/vst3/Makefile
deleted file mode 100644
index 56a9369..0000000
--- a/examples/fx_ring_mod/vst3/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
-
-NAME := bw_example_fx_ring_mod
-SOURCE := bw_example_fx_ring_mod.c
-
-include ${ROOT_DIR}/../../common/vst3/vst3.mk
-
-CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
-#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP
diff --git a/examples/fx_ring_mod/vst3/config_vst3.h b/examples/fx_ring_mod/vst3/config_vst3.h
deleted file mode 100644
index b222d04..0000000
--- a/examples/fx_ring_mod/vst3/config_vst3.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Brickworks
- *
- * Copyright (C) 2022 Orastron Srl unipersonale
- *
- * Brickworks is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * Brickworks is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Brickworks. If not, see .
- *
- * File authors: Stefano D'Angelo, Paolo Marrone
- */
-
-#ifndef _VST3_CONFIG_H
-#define _VST3_CONFIG_H
-
-#define PLUGIN_SUBCATEGORY "Fx"
-
-#define PLUGIN_GUID_1 0x2680121d
-#define PLUGIN_GUID_2 0x4e0b47fa
-#define PLUGIN_GUID_3 0xb213e6e7
-#define PLUGIN_GUID_4 0xd13cde60
-
-#define CTRL_GUID_1 0xc747bf7a
-#define CTRL_GUID_2 0x90ac41d0
-#define CTRL_GUID_3 0xb53d3df9
-#define CTRL_GUID_4 0x2c81a74d
-
-#endif
diff --git a/examples/fx_ring_mod/web/Makefile b/examples/fx_ring_mod/web/Makefile
deleted file mode 100644
index 302c580..0000000
--- a/examples/fx_ring_mod/web/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
-SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ring_mod.c
-
-include ${ROOT_DIR}/../../common/web/web.mk
diff --git a/examples/fxpp_ring_mod/src/android.json b/examples/fxpp_ring_mod/src/android.json
new file mode 100644
index 0000000..e785f51
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/android.json
@@ -0,0 +1,5 @@
+{
+ "android": {
+ "javaPackageName": "com.orastron.bw_example_fxpp_ring_mod"
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/cmd.json b/examples/fxpp_ring_mod/src/cmd.json
new file mode 100644
index 0000000..8f49d95
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/cmd.json
@@ -0,0 +1,6 @@
+{
+ "cmd": {
+ "busIds": [ "input", "output" ],
+ "parameterIds": [ "frequency", "amount" ]
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/daisy-seed.json b/examples/fxpp_ring_mod/src/daisy-seed.json
new file mode 100644
index 0000000..00367a0
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/daisy-seed.json
@@ -0,0 +1,5 @@
+{
+ "daisy_seed": {
+ "parameterPins": [ 15, 16 ]
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/impl.cpp b/examples/fxpp_ring_mod/src/impl.cpp
new file mode 100644
index 0000000..9d09765
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/impl.cpp
@@ -0,0 +1,65 @@
+#include "impl.h"
+
+#include "common.h"
+#include
+#include
+#include
+
+using namespace Brickworks;
+
+class Engine {
+public:
+ PhaseGen<1> phase_gen;
+ RingMod<1> ring_mod;
+};
+
+extern "C" {
+
+impl impl_new(void) {
+ Engine *instance = new Engine();
+ return reinterpret_cast(instance);
+}
+
+void impl_free(impl handle) {
+ Engine *instance = reinterpret_cast(handle);
+ delete instance;
+}
+
+void impl_set_sample_rate(impl handle, float sample_rate) {
+ Engine *instance = reinterpret_cast(handle);
+ instance->phase_gen.setSampleRate(sample_rate);
+ instance->ring_mod.setSampleRate(sample_rate);
+}
+
+void impl_reset(impl handle) {
+ Engine *instance = reinterpret_cast(handle);
+ instance->phase_gen.reset();
+ instance->ring_mod.reset();
+}
+
+void impl_set_parameter(impl handle, size_t index, float value) {
+ Engine *instance = reinterpret_cast(handle);
+ switch (index) {
+ case 0:
+ instance->phase_gen.setFrequency(value);
+ break;
+ case 1:
+ instance->ring_mod.setAmount(0.01f * value);
+ break;
+ }
+}
+
+float impl_get_parameter(impl handle, size_t index) {
+ (void)handle;
+ (void)index;
+ return 0.f;
+}
+
+void impl_process(impl handle, const float **inputs, float **outputs, size_t n_samples) {
+ Engine *instance = reinterpret_cast(handle);
+ instance->phase_gen.process(nullptr, outputs, nullptr, n_samples);
+ oscSinProcess<1>(outputs, outputs, n_samples);
+ instance->ring_mod.process(inputs, outputs, outputs, n_samples);
+}
+
+}
diff --git a/examples/fxpp_ring_mod/src/ios.json b/examples/fxpp_ring_mod/src/ios.json
new file mode 100644
index 0000000..1be18dc
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/ios.json
@@ -0,0 +1,5 @@
+{
+ "ios": {
+ "productBundleIdentifier": "com.orastron.bw_example_fxpp_ring_mod"
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/lv2.json b/examples/fxpp_ring_mod/src/lv2.json
new file mode 100644
index 0000000..67d91ca
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/lv2.json
@@ -0,0 +1,12 @@
+{
+ "lv2": {
+ "prefixes": {
+ "bw_examples": "https://www.orastron.com/brickworks/examples/"
+ },
+ "uri": "@bw_examples:fxpp_ring_mod",
+ "types": [ "@lv2:ModulatorPlugin" ],
+ "version": "1.0",
+ "busSymbols": [ "input", "output" ],
+ "parameterSymbols": [ "frequency", "amount" ]
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/product.json b/examples/fxpp_ring_mod/src/product.json
new file mode 100644
index 0000000..af9bac2
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/product.json
@@ -0,0 +1,46 @@
+{
+ "product": {
+ "name": "Brickwork ring modulator example (C++)",
+ "version": "1.1.0",
+ "buildVersion": "1",
+ "bundleName": "bw_example_fxpp_ring_mod",
+ "buses": [
+ {
+ "type": "audio",
+ "direction": "input",
+ "channels": "mono",
+ "name": "Input",
+ "shortName": "Input"
+ },
+ {
+ "type": "audio",
+ "direction": "output",
+ "channels": "mono",
+ "name": "Output",
+ "shortName": "Output"
+ }
+ ],
+ "parameters": [
+ {
+ "name": "Frequency",
+ "shortName": "Frequency",
+ "direction": "input",
+ "defaultValue": 300.0,
+ "minimum": 100.0,
+ "maximum": 1000.0,
+ "unit": "hz",
+ "map": "logarithmic"
+ },
+ {
+ "name": "Amount",
+ "shortName": "Amount",
+ "direction": "input",
+ "defaultValue": 0.0,
+ "minimum": -100.0,
+ "maximum": 100.0,
+ "unit": "pc",
+ "map": "linear"
+ }
+ ]
+ }
+}
diff --git a/examples/fxpp_ring_mod/src/vst3.json b/examples/fxpp_ring_mod/src/vst3.json
new file mode 100644
index 0000000..3bd5209
--- /dev/null
+++ b/examples/fxpp_ring_mod/src/vst3.json
@@ -0,0 +1,11 @@
+{
+ "vst3": {
+ "plugin": {
+ "cid": "f4737471b94c4c958f4091ce5da09fa8"
+ },
+ "controller": {
+ "cid": "1e8f7e86c29447c191f175ce220b5635"
+ },
+ "subCategory": "Fx|Modulation"
+ }
+}
diff --git a/examples/tibia_clean.sh b/examples/tibia_clean.sh
index ce3e4d1..3d76348 100755
--- a/examples/tibia_clean.sh
+++ b/examples/tibia_clean.sh
@@ -4,7 +4,7 @@ echo Removing common files
rm -fr common/cmd common/web common/daisy-seed common/lv2 common/vst3 common/android common/ios
-dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb synthpp_simple"
+dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb fx_ring_mod synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb fxpp_ring_mod synthpp_simple"
for d in $dirs; do
echo Removing data files for $d
diff --git a/examples/tibia_gen.sh b/examples/tibia_gen.sh
index 95905c6..9a164cd 100755
--- a/examples/tibia_gen.sh
+++ b/examples/tibia_gen.sh
@@ -33,7 +33,7 @@ if [ "$1" = "common" ]; then
fi
if [ -z "$1" ]; then
- dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb synthpp_simple"
+ dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb fx_ring_mod synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb fxpp_ring_mod synthpp_simple"
else
dirs="$1"
fi