diff --git a/examples/fx_eq_3band/android/Makefile b/examples/fx_eq_3band/android/Makefile deleted file mode 100644 index 8a1d35d..0000000 --- a/examples/fx_eq_3band/android/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_eq_3band -SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_eq_3band.c - -include ${ROOT_DIR}/../../common/android/android.mk diff --git a/examples/fx_eq_3band/daisy-seed/Makefile b/examples/fx_eq_3band/daisy-seed/Makefile deleted file mode 100644 index dd73303..0000000 --- a/examples/fx_eq_3band/daisy-seed/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -TARGET = bw_example_fx_eq_3band - -C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_eq_3band.c - -include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_eq_3band/daisy-seed/config_daisy_seed.h b/examples/fx_eq_3band/daisy-seed/config_daisy_seed.h deleted file mode 100644 index 436337a..0000000 --- a/examples/fx_eq_3band/daisy-seed/config_daisy_seed.h +++ /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 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 9 - -static struct config_pin config_pins[NUM_PINS] = { - { 0, 15 }, - { 1, 16 }, - { 2, 17 }, - { 3, 18 }, - { 4, 19 }, - { 5, 20 }, - { 6, 21 }, - { 7, 22 }, - { 8, 23 }, -}; - -#endif diff --git a/examples/fx_eq_3band/ios/Makefile b/examples/fx_eq_3band/ios/Makefile deleted file mode 100644 index da70967..0000000 --- a/examples/fx_eq_3band/ios/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_eq_3band -SOURCE := ${NAME}.c - -include ${ROOT_DIR}/../../common/ios/ios.mk diff --git a/examples/fx_eq_3band/src/android.json b/examples/fx_eq_3band/src/android.json new file mode 100644 index 0000000..72b14f6 --- /dev/null +++ b/examples/fx_eq_3band/src/android.json @@ -0,0 +1,5 @@ +{ + "android": { + "javaPackageName": "com.orastron.bw_example_fx_eq_3band" + } +} diff --git a/examples/fx_eq_3band/src/bw_example_fx_eq_3band.c b/examples/fx_eq_3band/src/bw_example_fx_eq_3band.c deleted file mode 100644 index 67c3c6f..0000000 --- a/examples/fx_eq_3band/src/bw_example_fx_eq_3band.c +++ /dev/null @@ -1,85 +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 - */ - -#include "bw_example_fx_eq_3band.h" - -void bw_example_fx_eq_3band_init(bw_example_fx_eq_3band *instance) { - bw_ls2_init(&instance->ls2_coeffs); - bw_peak_init(&instance->peak_coeffs); - bw_hs2_init(&instance->hs2_coeffs); -} - -void bw_example_fx_eq_3band_set_sample_rate(bw_example_fx_eq_3band *instance, float sample_rate) { - bw_ls2_set_sample_rate(&instance->ls2_coeffs, sample_rate); - bw_peak_set_sample_rate(&instance->peak_coeffs, sample_rate); - bw_hs2_set_sample_rate(&instance->hs2_coeffs, sample_rate); -} - -void bw_example_fx_eq_3band_reset(bw_example_fx_eq_3band *instance) { - bw_ls2_reset_coeffs(&instance->ls2_coeffs); - bw_ls2_reset_state(&instance->ls2_coeffs, &instance->ls2_state, 0.f); - bw_peak_reset_coeffs(&instance->peak_coeffs); - bw_peak_reset_state(&instance->peak_coeffs, &instance->peak_state, 0.f); - bw_hs2_reset_coeffs(&instance->hs2_coeffs); - bw_hs2_reset_state(&instance->hs2_coeffs, &instance->hs2_state, 0.f); -} - -void bw_example_fx_eq_3band_process(bw_example_fx_eq_3band *instance, const float** x, float** y, int n_samples) { - bw_ls2_process(&instance->ls2_coeffs, &instance->ls2_state, x[0], y[0], n_samples); - bw_peak_process(&instance->peak_coeffs, &instance->peak_state, y[0], y[0], n_samples); - bw_hs2_process(&instance->hs2_coeffs, &instance->hs2_state, y[0], y[0], n_samples); -} - -void bw_example_fx_eq_3band_set_parameter(bw_example_fx_eq_3band *instance, int index, float value) { - instance->params[index] = value; - switch (index) { - case p_ls_cutoff: - bw_ls2_set_cutoff(&instance->ls2_coeffs, 20.f + (20e3f - 20.f) * value * value * value); - break; - case p_ls_gain: - bw_ls2_set_dc_gain_dB(&instance->ls2_coeffs, -20.f + 40.f * value); - break; - case p_ls_Q: - bw_ls2_set_Q(&instance->ls2_coeffs, 0.5f + 4.5f * value); - break; - case p_peak_cutoff: - bw_peak_set_cutoff(&instance->peak_coeffs, 20.f + (20e3f - 20.f) * value * value * value); - break; - case p_peak_gain: - bw_peak_set_peak_gain_dB(&instance->peak_coeffs, -20.f + 40.f * value); - break; - case p_peak_bw: - bw_peak_set_bandwidth(&instance->peak_coeffs, 0.01f + 1.99f * value); - break; - case p_hs_cutoff: - bw_hs2_set_cutoff(&instance->hs2_coeffs, 20.f + (20e3f - 20.f) * value * value * value); - break; - case p_hs_gain: - bw_hs2_set_high_gain_dB(&instance->hs2_coeffs, -20.f + 40.f * value); - break; - case p_hs_Q: - bw_hs2_set_Q(&instance->hs2_coeffs, 0.5f + 4.5f * value); - break; - } -} - -float bw_example_fx_eq_3band_get_parameter(bw_example_fx_eq_3band *instance, int index) { - return instance->params[index]; -} diff --git a/examples/fx_eq_3band/src/bw_example_fx_eq_3band.h b/examples/fx_eq_3band/src/bw_example_fx_eq_3band.h deleted file mode 100644 index 600a229..0000000 --- a/examples/fx_eq_3band/src/bw_example_fx_eq_3band.h +++ /dev/null @@ -1,72 +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_EQ_3BAND_H -#define _BW_EXAMPLE_FX_EQ_3BAND_H - -#include "platform.h" - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - p_ls_cutoff, - p_ls_gain, - p_ls_Q, - p_peak_cutoff, - p_peak_gain, - p_peak_bw, - p_hs_cutoff, - p_hs_gain, - p_hs_Q, - p_n -}; - -struct _bw_example_fx_eq_3band { - // Sub-components - bw_ls2_coeffs ls2_coeffs; - bw_ls2_state ls2_state; - bw_peak_coeffs peak_coeffs; - bw_peak_state peak_state; - bw_hs2_coeffs hs2_coeffs; - bw_hs2_state hs2_state; - - // Parameters - float params[p_n]; -}; -typedef struct _bw_example_fx_eq_3band bw_example_fx_eq_3band; - -void bw_example_fx_eq_3band_init(bw_example_fx_eq_3band *instance); -void bw_example_fx_eq_3band_set_sample_rate(bw_example_fx_eq_3band *instance, float sample_rate); -void bw_example_fx_eq_3band_reset(bw_example_fx_eq_3band *instance); -void bw_example_fx_eq_3band_process(bw_example_fx_eq_3band *instance, const float** x, float** y, int n_samples); -void bw_example_fx_eq_3band_set_parameter(bw_example_fx_eq_3band *instance, int index, float value); -float bw_example_fx_eq_3band_get_parameter(bw_example_fx_eq_3band *instance, int index); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/examples/fx_eq_3band/src/cmd.json b/examples/fx_eq_3band/src/cmd.json new file mode 100644 index 0000000..b73ff9a --- /dev/null +++ b/examples/fx_eq_3band/src/cmd.json @@ -0,0 +1,6 @@ +{ + "cmd": { + "busIds": [ "input", "output" ], + "parameterIds": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ] + } +} diff --git a/examples/fx_eq_3band/src/config.h b/examples/fx_eq_3band/src/config.h deleted file mode 100644 index 23e57e2..0000000 --- a/examples/fx_eq_3band/src/config.h +++ /dev/null @@ -1,95 +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_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_eq_3band" -#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 9 - -static struct config_parameter config_parameters[NUM_PARAMETERS] = { - { "Low shelf cutoff", "LS cutoff", "Hz", 0, 0, 0, 0.2f }, - { "Low shelf gain", "LS gain", "dB", 0, 0, 0, 0.5f }, - { "Low shelf Q", "LS Q", "", 0, 0, 0, 0.f }, - { "Peak cutoff", "Peak cutoff", "Hz", 0, 0, 0, 0.5f }, - { "Peak gain", "Peak gain", "dB", 0, 0, 0, 0.5f }, - { "Peak bandiwdth", "Peak BW", "", 0, 0, 0, 1.f }, - { "High shelf cutoff", "HS cutoff", "Hz", 0, 0, 0, 0.8f }, - { "High shelf gain", "HS gain", "dB", 0, 0, 0, 0.5f }, - { "High shelf Q", "HS Q", "", 0, 0, 0, 0.f } -}; - -// Internal API - -#include "bw_example_fx_eq_3band.h" - -#define P_TYPE bw_example_fx_eq_3band -#define P_INIT bw_example_fx_eq_3band_init -#define P_SET_SAMPLE_RATE bw_example_fx_eq_3band_set_sample_rate -#define P_RESET bw_example_fx_eq_3band_reset -#define P_PROCESS bw_example_fx_eq_3band_process -#define P_SET_PARAMETER bw_example_fx_eq_3band_set_parameter -#define P_GET_PARAMETER bw_example_fx_eq_3band_get_parameter - -#endif diff --git a/examples/fx_eq_3band/src/config.js b/examples/fx_eq_3band/src/config.js deleted file mode 100644 index 93db7f1..0000000 --- a/examples/fx_eq_3band/src/config.js +++ /dev/null @@ -1,78 +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 author: Stefano D'Angelo - */ - -var buses = [ - { - stereo: false, - output: false - }, - { - stereo: false, - output: true - } -]; - -var parameters = [ - { - name: "Low shelf cutoff", - output: false, - defaultValue: 0.2 - }, - { - name: "Low shelf gain", - output: false, - defaultValue: 0.5 - }, - { - name: "Low shelf Q", - output: false, - defaultValue: 0.0 - }, - { - name: "Peak cutoff", - output: false, - defaultValue: 0.5 - }, - { - name: "Peak gain", - output: false, - defaultValue: 0.5 - }, - { - name: "Peak bandwidth", - output: false, - defaultValue: 0.0 - }, - { - name: "High shelf cutoff", - output: false, - defaultValue: 0.8 - }, - { - name: "High shelf gain", - output: false, - defaultValue: 0.5 - }, - { - name: "High shelf Q", - output: false, - defaultValue: 0.0 - } -]; diff --git a/examples/fx_eq_3band/src/daisy-seed.json b/examples/fx_eq_3band/src/daisy-seed.json new file mode 100644 index 0000000..3b3fb55 --- /dev/null +++ b/examples/fx_eq_3band/src/daisy-seed.json @@ -0,0 +1,5 @@ +{ + "daisy_seed": { + "parameterPins": [ 15, 16, 17, 18, 19, 20, 21, 22, 23 ] + } +} diff --git a/examples/fx_eq_3band/src/ios.json b/examples/fx_eq_3band/src/ios.json new file mode 100644 index 0000000..7d3076d --- /dev/null +++ b/examples/fx_eq_3band/src/ios.json @@ -0,0 +1,5 @@ +{ + "ios": { + "productBundleIdentifier": "com.orastron.bw_example_fx_eq_3band" + } +} diff --git a/examples/fx_eq_3band/src/lv2.json b/examples/fx_eq_3band/src/lv2.json new file mode 100644 index 0000000..f16334e --- /dev/null +++ b/examples/fx_eq_3band/src/lv2.json @@ -0,0 +1,12 @@ +{ + "lv2": { + "prefixes": { + "bw_examples": "https://www.orastron.com/brickworks/examples/" + }, + "uri": "@bw_examples:fx_eq_3band", + "types": [ "@lv2:ParaEQPlugin" ], + "version": "1.0", + "busSymbols": [ "input", "output" ], + "parameterSymbols": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ] + } +} diff --git a/examples/fx_eq_3band/src/plugin.h b/examples/fx_eq_3band/src/plugin.h new file mode 100644 index 0000000..6f688d7 --- /dev/null +++ b/examples/fx_eq_3band/src/plugin.h @@ -0,0 +1,92 @@ +#include "common.h" +#include +#include +#include + +typedef struct plugin { + bw_ls2_coeffs ls2_coeffs; + bw_ls2_state ls2_state; + bw_peak_coeffs peak_coeffs; + bw_peak_state peak_state; + bw_hs2_coeffs hs2_coeffs; + bw_hs2_state hs2_state; +} plugin; + +static void plugin_init(plugin *instance) { + bw_ls2_init(&instance->ls2_coeffs); + bw_peak_init(&instance->peak_coeffs); + bw_hs2_init(&instance->hs2_coeffs); +} + +static void plugin_fini(plugin *instance) { + (void)instance; +} + +static void plugin_set_sample_rate(plugin *instance, float sample_rate) { + bw_ls2_set_sample_rate(&instance->ls2_coeffs, sample_rate); + bw_peak_set_sample_rate(&instance->peak_coeffs, sample_rate); + bw_hs2_set_sample_rate(&instance->hs2_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_ls2_reset_coeffs(&instance->ls2_coeffs); + bw_ls2_reset_state(&instance->ls2_coeffs, &instance->ls2_state, 0.f); + bw_peak_reset_coeffs(&instance->peak_coeffs); + bw_peak_reset_state(&instance->peak_coeffs, &instance->peak_state, 0.f); + bw_hs2_reset_coeffs(&instance->hs2_coeffs); + bw_hs2_reset_state(&instance->hs2_coeffs, &instance->hs2_state, 0.f); +} + +static void plugin_set_parameter(plugin *instance, size_t index, float value) { + switch (index) { + case 0: + bw_ls2_set_cutoff(&instance->ls2_coeffs, value); + break; + case 1: + bw_ls2_set_dc_gain_dB(&instance->ls2_coeffs, value); + break; + case 2: + bw_ls2_set_Q(&instance->ls2_coeffs, value); + break; + case 3: + bw_peak_set_cutoff(&instance->peak_coeffs, value); + break; + case 4: + bw_peak_set_peak_gain_dB(&instance->peak_coeffs, value); + break; + case 5: + bw_peak_set_bandwidth(&instance->peak_coeffs, value); + break; + case 6: + bw_hs2_set_cutoff(&instance->hs2_coeffs, value); + break; + case 7: + bw_hs2_set_high_gain_dB(&instance->hs2_coeffs, value); + break; + case 8: + bw_hs2_set_Q(&instance->hs2_coeffs, 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_ls2_process(&instance->ls2_coeffs, &instance->ls2_state, inputs[0], outputs[0], n_samples); + bw_peak_process(&instance->peak_coeffs, &instance->peak_state, outputs[0], outputs[0], n_samples); + bw_hs2_process(&instance->hs2_coeffs, &instance->hs2_state, outputs[0], outputs[0], n_samples); +} diff --git a/examples/fx_eq_3band/src/product.json b/examples/fx_eq_3band/src/product.json new file mode 100644 index 0000000..a65e393 --- /dev/null +++ b/examples/fx_eq_3band/src/product.json @@ -0,0 +1,114 @@ +{ + "product": { + "name": "Brickworks 3-band parametric equalizer example", + "version": "1.1.0", + "buildVersion": "1", + "bundleName": "bw_example_fx_eq_3band", + "buses": [ + { + "type": "audio", + "direction": "input", + "channels": "mono", + "name": "Input", + "shortName": "Input" + }, + { + "type": "audio", + "direction": "output", + "channels": "mono", + "name": "Output", + "shortName": "Output" + } + ], + "parameters": [ + { + "name": "Low shelf cutoff", + "shortName": "LS cutoff", + "direction": "input", + "defaultValue": 112.4682650380698, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "Low shelf gain", + "shortName": "LS gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "Low shelf Q", + "shortName": "LS Q", + "direction": "input", + "defaultValue": 0.5, + "minimum": 0.5, + "maximum": 10.0, + "map": "linear" + }, + { + "name": "Peak cutoff", + "shortName": "Peak cutoff", + "direction": "input", + "defaultValue": 632.4555320336758, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "Peak gain", + "shortName": "Peak gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "Peak bandwidth", + "shortName": "Peak bw", + "direction": "input", + "defaultValue": 1.0, + "minimum": 0.01, + "maximum": 2.0, + "unit": "oct", + "map": "linear" + }, + { + "name": "High shelf cutoff", + "shortName": "HS cutoff", + "direction": "input", + "defaultValue": 3556.558820077844, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "High shelf gain", + "shortName": "HS gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "High shelf Q", + "shortName": "HS Q", + "direction": "input", + "defaultValue": 0.5, + "minimum": 0.5, + "maximum": 10.0, + "map": "linear" + } + ] + } +} diff --git a/examples/fx_eq_3band/src/vst3.json b/examples/fx_eq_3band/src/vst3.json new file mode 100644 index 0000000..ec01afd --- /dev/null +++ b/examples/fx_eq_3band/src/vst3.json @@ -0,0 +1,11 @@ +{ + "vst3": { + "plugin": { + "cid": "8a205a6da64f4ddaade68f5d60d1202d" + }, + "controller": { + "cid": "50164b4fe55046479e0865ed723341d8" + }, + "subCategory": "Fx|EQ" + } +} diff --git a/examples/fx_eq_3band/vst3/Makefile b/examples/fx_eq_3band/vst3/Makefile deleted file mode 100644 index 63b1abb..0000000 --- a/examples/fx_eq_3band/vst3/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_eq_3band -SOURCE := bw_example_fx_eq_3band.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_eq_3band/vst3/config_vst3.h b/examples/fx_eq_3band/vst3/config_vst3.h deleted file mode 100644 index decc51e..0000000 --- a/examples/fx_eq_3band/vst3/config_vst3.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, Paolo Marrone - */ - -#ifndef _VST3_CONFIG_H -#define _VST3_CONFIG_H - -#define PLUGIN_SUBCATEGORY "Fx|EQ" - -#define PLUGIN_GUID_1 0x8a205a6d -#define PLUGIN_GUID_2 0xa64f4dda -#define PLUGIN_GUID_3 0xade68f5d -#define PLUGIN_GUID_4 0x60d1202d - -#define CTRL_GUID_1 0x50164b4f -#define CTRL_GUID_2 0xe5504647 -#define CTRL_GUID_3 0x9e0865ed -#define CTRL_GUID_4 0x723341d8 - -#endif diff --git a/examples/fx_eq_3band/web/Makefile b/examples/fx_eq_3band/web/Makefile deleted file mode 100644 index 209c20b..0000000 --- a/examples/fx_eq_3band/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_eq_3band.c - -include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fxpp_eq_3band/src/android.json b/examples/fxpp_eq_3band/src/android.json new file mode 100644 index 0000000..7f10d2d --- /dev/null +++ b/examples/fxpp_eq_3band/src/android.json @@ -0,0 +1,5 @@ +{ + "android": { + "javaPackageName": "com.orastron.bw_example_fxpp_eq_3band" + } +} diff --git a/examples/fxpp_eq_3band/src/cmd.json b/examples/fxpp_eq_3band/src/cmd.json new file mode 100644 index 0000000..b73ff9a --- /dev/null +++ b/examples/fxpp_eq_3band/src/cmd.json @@ -0,0 +1,6 @@ +{ + "cmd": { + "busIds": [ "input", "output" ], + "parameterIds": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ] + } +} diff --git a/examples/fxpp_eq_3band/src/daisy-seed.json b/examples/fxpp_eq_3band/src/daisy-seed.json new file mode 100644 index 0000000..3b3fb55 --- /dev/null +++ b/examples/fxpp_eq_3band/src/daisy-seed.json @@ -0,0 +1,5 @@ +{ + "daisy_seed": { + "parameterPins": [ 15, 16, 17, 18, 19, 20, 21, 22, 23 ] + } +} diff --git a/examples/fxpp_eq_3band/src/impl.cpp b/examples/fxpp_eq_3band/src/impl.cpp new file mode 100644 index 0000000..54e953e --- /dev/null +++ b/examples/fxpp_eq_3band/src/impl.cpp @@ -0,0 +1,89 @@ +#include "impl.h" + +#include "common.h" +#include +#include +#include + +using namespace Brickworks; + +class Engine { +public: + LS2<1> ls2; + Peak<1> peak; + HS2<1> hs2; +}; + +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->ls2.setSampleRate(sample_rate); + instance->peak.setSampleRate(sample_rate); + instance->hs2.setSampleRate(sample_rate); +} + +void impl_reset(impl handle) { + Engine *instance = reinterpret_cast(handle); + instance->ls2.reset(); + instance->peak.reset(); + instance->hs2.reset(); +} + +void impl_set_parameter(impl handle, size_t index, float value) { + Engine *instance = reinterpret_cast(handle); + switch (index) { + case 0: + instance->ls2.setCutoff(value); + break; + case 1: + instance->ls2.setDcGainDB(value); + break; + case 2: + instance->ls2.setQ(value); + break; + case 3: + instance->peak.setCutoff(value); + break; + case 4: + instance->peak.setPeakGainDB(value); + break; + case 5: + instance->peak.setBandwidth(value); + break; + case 6: + instance->hs2.setCutoff(value); + break; + case 7: + instance->hs2.setHighGainDB(value); + break; + case 8: + instance->hs2.setQ(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->ls2.process(inputs, outputs, n_samples); + instance->peak.process(outputs, outputs, n_samples); + instance->hs2.process(outputs, outputs, n_samples); +} + +} diff --git a/examples/fxpp_eq_3band/src/ios.json b/examples/fxpp_eq_3band/src/ios.json new file mode 100644 index 0000000..47b1b3e --- /dev/null +++ b/examples/fxpp_eq_3band/src/ios.json @@ -0,0 +1,5 @@ +{ + "ios": { + "productBundleIdentifier": "com.orastron.bw_example_fxpp_eq_3band" + } +} diff --git a/examples/fxpp_eq_3band/src/lv2.json b/examples/fxpp_eq_3band/src/lv2.json new file mode 100644 index 0000000..4a6fa53 --- /dev/null +++ b/examples/fxpp_eq_3band/src/lv2.json @@ -0,0 +1,12 @@ +{ + "lv2": { + "prefixes": { + "bw_examples": "https://www.orastron.com/brickworks/examples/" + }, + "uri": "@bw_examples:fxpp_eq_3band", + "types": [ "@lv2:ParaEQPlugin" ], + "version": "1.0", + "busSymbols": [ "input", "output" ], + "parameterSymbols": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ] + } +} diff --git a/examples/fxpp_eq_3band/src/product.json b/examples/fxpp_eq_3band/src/product.json new file mode 100644 index 0000000..9369662 --- /dev/null +++ b/examples/fxpp_eq_3band/src/product.json @@ -0,0 +1,114 @@ +{ + "product": { + "name": "Brickworks 3-band parametric equalizer example (C++)", + "version": "1.1.0", + "buildVersion": "1", + "bundleName": "bw_example_fxpp_eq_3band", + "buses": [ + { + "type": "audio", + "direction": "input", + "channels": "mono", + "name": "Input", + "shortName": "Input" + }, + { + "type": "audio", + "direction": "output", + "channels": "mono", + "name": "Output", + "shortName": "Output" + } + ], + "parameters": [ + { + "name": "Low shelf cutoff", + "shortName": "LS cutoff", + "direction": "input", + "defaultValue": 112.4682650380698, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "Low shelf gain", + "shortName": "LS gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "Low shelf Q", + "shortName": "LS Q", + "direction": "input", + "defaultValue": 0.5, + "minimum": 0.5, + "maximum": 10.0, + "map": "linear" + }, + { + "name": "Peak cutoff", + "shortName": "Peak cutoff", + "direction": "input", + "defaultValue": 632.4555320336758, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "Peak gain", + "shortName": "Peak gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "Peak bandwidth", + "shortName": "Peak bw", + "direction": "input", + "defaultValue": 1.0, + "minimum": 0.01, + "maximum": 2.0, + "unit": "oct", + "map": "linear" + }, + { + "name": "High shelf cutoff", + "shortName": "HS cutoff", + "direction": "input", + "defaultValue": 3556.558820077844, + "minimum": 20.0, + "maximum": 20000.0, + "unit": "hz", + "map": "logarithmic" + }, + { + "name": "High shelf gain", + "shortName": "HS gain", + "direction": "input", + "defaultValue": 0.0, + "minimum": -20.0, + "maximum": 20.0, + "unit": "db", + "map": "linear" + }, + { + "name": "High shelf Q", + "shortName": "HS Q", + "direction": "input", + "defaultValue": 0.5, + "minimum": 0.5, + "maximum": 10.0, + "map": "linear" + } + ] + } +} diff --git a/examples/fxpp_eq_3band/src/vst3.json b/examples/fxpp_eq_3band/src/vst3.json new file mode 100644 index 0000000..237c7f5 --- /dev/null +++ b/examples/fxpp_eq_3band/src/vst3.json @@ -0,0 +1,11 @@ +{ + "vst3": { + "plugin": { + "cid": "230994704e2d42c0b308a6be6f943895" + }, + "controller": { + "cid": "cfaecca352a04488877ee366820e2692" + }, + "subCategory": "Fx|EQ" + } +} diff --git a/examples/tibia_clean.sh b/examples/tibia_clean.sh index 2fe501c..7775814 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 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 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 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 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 dd71574..40eb113 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 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 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 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 synthpp_simple" else dirs="$1" fi