From 745ba9c2dd63e59971a725c899278ba627bdf0c1 Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Tue, 6 Feb 2024 11:56:23 +0100 Subject: [PATCH] fxpp_cab mostly --- examples/fx_cab/android/Makefile | 6 -- examples/fx_cab/daisy-seed/Makefile | 7 -- .../fx_cab/daisy-seed/config_daisy_seed.h | 37 -------- examples/fx_cab/ios/Makefile | 6 -- examples/fx_cab/src/android.json | 5 ++ examples/fx_cab/src/bw_example_fx_cab.c | 57 ------------ examples/fx_cab/src/bw_example_fx_cab.h | 60 ------------- examples/fx_cab/src/cmd.json | 6 ++ examples/fx_cab/src/config.h | 89 ------------------- examples/fx_cab/src/config.js | 48 ---------- examples/fx_cab/src/daisy-seed.json | 5 ++ examples/fx_cab/src/ios.json | 5 ++ examples/fx_cab/src/lv2.json | 12 +++ examples/fx_cab/src/plugin.h | 58 ++++++++++++ examples/fx_cab/src/product.json | 56 ++++++++++++ examples/fx_cab/src/vst3.json | 11 +++ examples/fx_cab/vst3/Makefile | 9 -- examples/fx_cab/vst3/config_vst3.h | 36 -------- examples/fx_cab/web/Makefile | 4 - examples/fxpp_cab/src/android.json | 5 ++ examples/fxpp_cab/src/cmd.json | 6 ++ examples/fxpp_cab/src/daisy-seed.json | 5 ++ examples/fxpp_cab/src/impl.cpp | 55 ++++++++++++ examples/fxpp_cab/src/ios.json | 5 ++ examples/fxpp_cab/src/lv2.json | 12 +++ examples/fxpp_cab/src/product.json | 56 ++++++++++++ examples/fxpp_cab/src/vst3.json | 11 +++ examples/tibia_clean.sh | 2 +- examples/tibia_gen.sh | 2 +- 29 files changed, 315 insertions(+), 361 deletions(-) delete mode 100644 examples/fx_cab/android/Makefile delete mode 100644 examples/fx_cab/daisy-seed/Makefile delete mode 100644 examples/fx_cab/daisy-seed/config_daisy_seed.h delete mode 100644 examples/fx_cab/ios/Makefile create mode 100644 examples/fx_cab/src/android.json delete mode 100644 examples/fx_cab/src/bw_example_fx_cab.c delete mode 100644 examples/fx_cab/src/bw_example_fx_cab.h create mode 100644 examples/fx_cab/src/cmd.json delete mode 100644 examples/fx_cab/src/config.h delete mode 100644 examples/fx_cab/src/config.js create mode 100644 examples/fx_cab/src/daisy-seed.json create mode 100644 examples/fx_cab/src/ios.json create mode 100644 examples/fx_cab/src/lv2.json create mode 100644 examples/fx_cab/src/plugin.h create mode 100644 examples/fx_cab/src/product.json create mode 100644 examples/fx_cab/src/vst3.json delete mode 100644 examples/fx_cab/vst3/Makefile delete mode 100644 examples/fx_cab/vst3/config_vst3.h delete mode 100644 examples/fx_cab/web/Makefile create mode 100644 examples/fxpp_cab/src/android.json create mode 100644 examples/fxpp_cab/src/cmd.json create mode 100644 examples/fxpp_cab/src/daisy-seed.json create mode 100644 examples/fxpp_cab/src/impl.cpp create mode 100644 examples/fxpp_cab/src/ios.json create mode 100644 examples/fxpp_cab/src/lv2.json create mode 100644 examples/fxpp_cab/src/product.json create mode 100644 examples/fxpp_cab/src/vst3.json diff --git a/examples/fx_cab/android/Makefile b/examples/fx_cab/android/Makefile deleted file mode 100644 index c00cabf..0000000 --- a/examples/fx_cab/android/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_cab -SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_cab.c - -include ${ROOT_DIR}/../../common/android/android.mk diff --git a/examples/fx_cab/daisy-seed/Makefile b/examples/fx_cab/daisy-seed/Makefile deleted file mode 100644 index 96e045c..0000000 --- a/examples/fx_cab/daisy-seed/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -TARGET = bw_example_fx_cab - -C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_cab.c - -include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_cab/daisy-seed/config_daisy_seed.h b/examples/fx_cab/daisy-seed/config_daisy_seed.h deleted file mode 100644 index 8aa4923..0000000 --- a/examples/fx_cab/daisy-seed/config_daisy_seed.h +++ /dev/null @@ -1,37 +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 3 - -static struct config_pin config_pins[NUM_PINS] = { - { 0, 15 }, - { 1, 16 }, - { 2, 17 } -}; - -#endif diff --git a/examples/fx_cab/ios/Makefile b/examples/fx_cab/ios/Makefile deleted file mode 100644 index c462aea..0000000 --- a/examples/fx_cab/ios/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_cab -SOURCE := ${NAME}.c - -include ${ROOT_DIR}/../../common/ios/ios.mk diff --git a/examples/fx_cab/src/android.json b/examples/fx_cab/src/android.json new file mode 100644 index 0000000..48cdd41 --- /dev/null +++ b/examples/fx_cab/src/android.json @@ -0,0 +1,5 @@ +{ + "android": { + "javaPackageName": "com.orastron.bw_example_fx_cab" + } +} diff --git a/examples/fx_cab/src/bw_example_fx_cab.c b/examples/fx_cab/src/bw_example_fx_cab.c deleted file mode 100644 index f09f481..0000000 --- a/examples/fx_cab/src/bw_example_fx_cab.c +++ /dev/null @@ -1,57 +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_cab.h" - -void bw_example_fx_cab_init(bw_example_fx_cab *instance) { - bw_cab_init(&instance->cab_coeffs); -} - -void bw_example_fx_cab_set_sample_rate(bw_example_fx_cab *instance, float sample_rate) { - bw_cab_set_sample_rate(&instance->cab_coeffs, sample_rate); -} - -void bw_example_fx_cab_reset(bw_example_fx_cab *instance) { - bw_cab_reset_coeffs(&instance->cab_coeffs); - bw_cab_reset_state(&instance->cab_coeffs, &instance->cab_state, 0.f); -} - -void bw_example_fx_cab_process(bw_example_fx_cab *instance, const float** x, float** y, int n_samples) { - bw_cab_process(&instance->cab_coeffs, &instance->cab_state, x[0], y[0], n_samples); -} - -void bw_example_fx_cab_set_parameter(bw_example_fx_cab *instance, int index, float value) { - instance->params[index] = value; - switch (index) { - case p_cutoff_low: - bw_cab_set_cutoff_low(&instance->cab_coeffs, value); - break; - case p_cutoff_high: - bw_cab_set_cutoff_high(&instance->cab_coeffs, value); - break; - case p_tone: - bw_cab_set_tone(&instance->cab_coeffs, value); - break; - } -} - -float bw_example_fx_cab_get_parameter(bw_example_fx_cab *instance, int index) { - return instance->params[index]; -} diff --git a/examples/fx_cab/src/bw_example_fx_cab.h b/examples/fx_cab/src/bw_example_fx_cab.h deleted file mode 100644 index a4497ad..0000000 --- a/examples/fx_cab/src/bw_example_fx_cab.h +++ /dev/null @@ -1,60 +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_CAB_H -#define _BW_EXAMPLE_FX_CAB_H - -#include "platform.h" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - p_cutoff_low, - p_cutoff_high, - p_tone, - p_n -}; - -struct _bw_example_fx_cab { - // Sub-components - bw_cab_coeffs cab_coeffs; - bw_cab_state cab_state; - - // Parameters - float params[p_n]; -}; -typedef struct _bw_example_fx_cab bw_example_fx_cab; - -void bw_example_fx_cab_init(bw_example_fx_cab *instance); -void bw_example_fx_cab_set_sample_rate(bw_example_fx_cab *instance, float sample_rate); -void bw_example_fx_cab_reset(bw_example_fx_cab *instance); -void bw_example_fx_cab_process(bw_example_fx_cab *instance, const float** x, float** y, int n_samples); -void bw_example_fx_cab_set_parameter(bw_example_fx_cab *instance, int index, float value); -float bw_example_fx_cab_get_parameter(bw_example_fx_cab *instance, int index); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/examples/fx_cab/src/cmd.json b/examples/fx_cab/src/cmd.json new file mode 100644 index 0000000..a61361d --- /dev/null +++ b/examples/fx_cab/src/cmd.json @@ -0,0 +1,6 @@ +{ + "cmd": { + "busIds": [ "input", "output" ], + "parameterIds": [ "cutoff_low", "cutoff_high", "tone" ] + } +} diff --git a/examples/fx_cab/src/config.h b/examples/fx_cab/src/config.h deleted file mode 100644 index 88ff0fa..0000000 --- a/examples/fx_cab/src/config.h +++ /dev/null @@ -1,89 +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_cab" -#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 3 - -static struct config_parameter config_parameters[NUM_PARAMETERS] = { - { "Cutoff low", "Low", "", 0, 0, 0, 0.5f }, - { "Cutoff high", "High", "", 0, 0, 0, 0.5f }, - { "Tone", "Tone", "", 0, 0, 0, 0.5f } -}; - -// Internal API - -#include "bw_example_fx_cab.h" - -#define P_TYPE bw_example_fx_cab -#define P_INIT bw_example_fx_cab_init -#define P_SET_SAMPLE_RATE bw_example_fx_cab_set_sample_rate -#define P_RESET bw_example_fx_cab_reset -#define P_PROCESS bw_example_fx_cab_process -#define P_SET_PARAMETER bw_example_fx_cab_set_parameter -#define P_GET_PARAMETER bw_example_fx_cab_get_parameter - -#endif diff --git a/examples/fx_cab/src/config.js b/examples/fx_cab/src/config.js deleted file mode 100644 index 7b3ec0e..0000000 --- a/examples/fx_cab/src/config.js +++ /dev/null @@ -1,48 +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: "Cutoff low", - output: false, - defaultValue: 0.5 - }, - { - name: "Cutoff high", - output: false, - defaultValue: 0.5 - }, - { - name: "Tone", - output: false, - defaultValue: 0.5 - } -]; diff --git a/examples/fx_cab/src/daisy-seed.json b/examples/fx_cab/src/daisy-seed.json new file mode 100644 index 0000000..fd02e95 --- /dev/null +++ b/examples/fx_cab/src/daisy-seed.json @@ -0,0 +1,5 @@ +{ + "daisy_seed": { + "parameterPins": [ 15, 16, 17 ] + } +} diff --git a/examples/fx_cab/src/ios.json b/examples/fx_cab/src/ios.json new file mode 100644 index 0000000..ed64031 --- /dev/null +++ b/examples/fx_cab/src/ios.json @@ -0,0 +1,5 @@ +{ + "ios": { + "productBundleIdentifier": "com.orastron.bw_example_fx_cab" + } +} diff --git a/examples/fx_cab/src/lv2.json b/examples/fx_cab/src/lv2.json new file mode 100644 index 0000000..2b32cf6 --- /dev/null +++ b/examples/fx_cab/src/lv2.json @@ -0,0 +1,12 @@ +{ + "lv2": { + "prefixes": { + "bw_examples": "https://www.orastron.com/brickworks/examples/" + }, + "uri": "@bw_examples:fx_cab", + "types": [ "@lv2:SimulatorPlugin", "@lv2:FilterPlugin" ], + "version": "1.0", + "busSymbols": [ "input", "output" ], + "parameterSymbols": [ "cutoff_low", "cutoff_high", "tone" ] + } +} diff --git a/examples/fx_cab/src/plugin.h b/examples/fx_cab/src/plugin.h new file mode 100644 index 0000000..827d308 --- /dev/null +++ b/examples/fx_cab/src/plugin.h @@ -0,0 +1,58 @@ +#include "common.h" +#include + +typedef struct plugin { + bw_cab_coeffs cab_coeffs; + bw_cab_state cab_state; +} plugin; + +static void plugin_init(plugin *instance) { + bw_cab_init(&instance->cab_coeffs); +} + +static void plugin_fini(plugin *instance) { + (void)instance; +} + +static void plugin_set_sample_rate(plugin *instance, float sample_rate) { + bw_cab_set_sample_rate(&instance->cab_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_cab_reset_coeffs(&instance->cab_coeffs); + bw_cab_reset_state(&instance->cab_coeffs, &instance->cab_state, 0.f); +} + +static void plugin_set_parameter(plugin *instance, size_t index, float value) { + switch (index) { + case 0: + bw_cab_set_cutoff_low(&instance->cab_coeffs, 0.01f * value); + break; + case 1: + bw_cab_set_cutoff_high(&instance->cab_coeffs, 0.01f * value); + break; + case 2: + bw_cab_set_tone(&instance->cab_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_cab_process(&instance->cab_coeffs, &instance->cab_state, inputs[0], outputs[0], n_samples); +} diff --git a/examples/fx_cab/src/product.json b/examples/fx_cab/src/product.json new file mode 100644 index 0000000..f160f52 --- /dev/null +++ b/examples/fx_cab/src/product.json @@ -0,0 +1,56 @@ +{ + "product": { + "name": "Brickworks cab simulator example", + "version": "1.1.0", + "buildVersion": "1", + "bundleName": "bw_example_fx_cab", + "buses": [ + { + "type": "audio", + "direction": "input", + "channels": "mono", + "name": "Input", + "shortName": "Input" + }, + { + "type": "audio", + "direction": "output", + "channels": "mono", + "name": "Output", + "shortName": "Output" + } + ], + "parameters": [ + { + "name": "Cutoff low", + "shortName": "Cutoff low", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + }, + { + "name": "Cutoff high", + "shortName": "Cutoff high", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + }, + { + "name": "Tone", + "shortName": "Tone", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + } + ] + } +} diff --git a/examples/fx_cab/src/vst3.json b/examples/fx_cab/src/vst3.json new file mode 100644 index 0000000..88f062f --- /dev/null +++ b/examples/fx_cab/src/vst3.json @@ -0,0 +1,11 @@ +{ + "vst3": { + "plugin": { + "cid": "55dfa68a343f4cfe9ab7e2f575f4ddd0" + }, + "controller": { + "cid": "828749ce6a1d4f2d87f464a537de42e0" + }, + "subCategory": "Fx|Filter" + } +} diff --git a/examples/fx_cab/vst3/Makefile b/examples/fx_cab/vst3/Makefile deleted file mode 100644 index 92d1792..0000000 --- a/examples/fx_cab/vst3/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -NAME := bw_example_fx_cab -SOURCE := bw_example_fx_cab.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_cab/vst3/config_vst3.h b/examples/fx_cab/vst3/config_vst3.h deleted file mode 100644 index 08f3734..0000000 --- a/examples/fx_cab/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|Filter" - -#define PLUGIN_GUID_1 0x55dfa68a -#define PLUGIN_GUID_2 0x343f4cfe -#define PLUGIN_GUID_3 0x9ab7e2f5 -#define PLUGIN_GUID_4 0x75f4ddd0 - -#define CTRL_GUID_1 0x828749ce -#define CTRL_GUID_2 0x6a1d4f2d -#define CTRL_GUID_3 0x87f464a5 -#define CTRL_GUID_4 0x37de42e0 - -#endif diff --git a/examples/fx_cab/web/Makefile b/examples/fx_cab/web/Makefile deleted file mode 100644 index b3419d8..0000000 --- a/examples/fx_cab/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_cab.c - -include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fxpp_cab/src/android.json b/examples/fxpp_cab/src/android.json new file mode 100644 index 0000000..b21b50b --- /dev/null +++ b/examples/fxpp_cab/src/android.json @@ -0,0 +1,5 @@ +{ + "android": { + "javaPackageName": "com.orastron.bw_example_fxpp_cab" + } +} diff --git a/examples/fxpp_cab/src/cmd.json b/examples/fxpp_cab/src/cmd.json new file mode 100644 index 0000000..a61361d --- /dev/null +++ b/examples/fxpp_cab/src/cmd.json @@ -0,0 +1,6 @@ +{ + "cmd": { + "busIds": [ "input", "output" ], + "parameterIds": [ "cutoff_low", "cutoff_high", "tone" ] + } +} diff --git a/examples/fxpp_cab/src/daisy-seed.json b/examples/fxpp_cab/src/daisy-seed.json new file mode 100644 index 0000000..fd02e95 --- /dev/null +++ b/examples/fxpp_cab/src/daisy-seed.json @@ -0,0 +1,5 @@ +{ + "daisy_seed": { + "parameterPins": [ 15, 16, 17 ] + } +} diff --git a/examples/fxpp_cab/src/impl.cpp b/examples/fxpp_cab/src/impl.cpp new file mode 100644 index 0000000..c152eed --- /dev/null +++ b/examples/fxpp_cab/src/impl.cpp @@ -0,0 +1,55 @@ +#include "impl.h" + +#include "common.h" +#include + +using namespace Brickworks; + +extern "C" { + +impl impl_new(void) { + return reinterpret_cast(new Cab<1>()); +} + +void impl_free(impl handle) { + Cab<1> *instance = reinterpret_cast *>(handle); + delete instance; +} + +void impl_set_sample_rate(impl handle, float sample_rate) { + Cab<1> *instance = reinterpret_cast *>(handle); + instance->setSampleRate(sample_rate); +} + +void impl_reset(impl handle) { + Cab<1> *instance = reinterpret_cast *>(handle); + instance->reset(); +} + +void impl_set_parameter(impl handle, size_t index, float value) { + Cab<1> *instance = reinterpret_cast *>(handle); + switch (index) { + case 0: + instance->setCutoffLow(0.01f * value); + break; + case 1: + instance->setCutoffHigh(0.01f * value); + break; + case 2: + instance->setTone(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) { + Cab<1> *instance = reinterpret_cast *>(handle); + instance->process(inputs, outputs, n_samples); +} + +} diff --git a/examples/fxpp_cab/src/ios.json b/examples/fxpp_cab/src/ios.json new file mode 100644 index 0000000..ec257c9 --- /dev/null +++ b/examples/fxpp_cab/src/ios.json @@ -0,0 +1,5 @@ +{ + "ios": { + "productBundleIdentifier": "com.orastron.bw_example_fxpp_cab" + } +} diff --git a/examples/fxpp_cab/src/lv2.json b/examples/fxpp_cab/src/lv2.json new file mode 100644 index 0000000..3517a79 --- /dev/null +++ b/examples/fxpp_cab/src/lv2.json @@ -0,0 +1,12 @@ +{ + "lv2": { + "prefixes": { + "bw_examples": "https://www.orastron.com/brickworks/examples/" + }, + "uri": "@bw_examples:fxpp_cab", + "types": [ "@lv2:SimulatorPlugin", "@lv2:FilterPlugin" ], + "version": "1.0", + "busSymbols": [ "input", "output" ], + "parameterSymbols": [ "cutoff_low", "cutoff_high", "tone" ] + } +} diff --git a/examples/fxpp_cab/src/product.json b/examples/fxpp_cab/src/product.json new file mode 100644 index 0000000..60ead97 --- /dev/null +++ b/examples/fxpp_cab/src/product.json @@ -0,0 +1,56 @@ +{ + "product": { + "name": "Brickworks cab simulator example (C++)", + "version": "1.1.0", + "buildVersion": "1", + "bundleName": "bw_example_fxpp_cab", + "buses": [ + { + "type": "audio", + "direction": "input", + "channels": "mono", + "name": "Input", + "shortName": "Input" + }, + { + "type": "audio", + "direction": "output", + "channels": "mono", + "name": "Output", + "shortName": "Output" + } + ], + "parameters": [ + { + "name": "Cutoff low", + "shortName": "Cutoff low", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + }, + { + "name": "Cutoff high", + "shortName": "Cutoff high", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + }, + { + "name": "Tone", + "shortName": "Tone", + "direction": "input", + "defaultValue": 50.0, + "minimum": 0.0, + "maximum": 100.0, + "unit": "pc", + "map": "linear" + } + ] + } +} diff --git a/examples/fxpp_cab/src/vst3.json b/examples/fxpp_cab/src/vst3.json new file mode 100644 index 0000000..56edead --- /dev/null +++ b/examples/fxpp_cab/src/vst3.json @@ -0,0 +1,11 @@ +{ + "vst3": { + "plugin": { + "cid": "5a6af39b3d3d4d8db770d068970eb848" + }, + "controller": { + "cid": "29ea612e754d401ba6164ba3931dc498" + }, + "subCategory": "Fx|Filter" + } +} diff --git a/examples/tibia_clean.sh b/examples/tibia_clean.sh index 3c44609..ce733ed 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 fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush" +dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab" for d in $dirs; do echo Removing data files for $d diff --git a/examples/tibia_gen.sh b/examples/tibia_gen.sh index f4b994d..f733a98 100755 --- a/examples/tibia_gen.sh +++ b/examples/tibia_gen.sh @@ -26,7 +26,7 @@ cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/android-make android cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios ios && cd .. cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios-make ios && cd .. -dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush" +dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab" for d in $dirs; do echo Generating data files for $d