From fffab40cd209c2cb2f64758c014432678e4897f0 Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Wed, 15 Feb 2023 14:04:21 +0100 Subject: [PATCH] added missing examples + fixed bw_{ap2,hs1,ls1} + cosmetic changes --- examples/fx_ap1/daisy-seed/Makefile | 7 ++ .../fx_ap1/daisy-seed/config_daisy_seed.h | 35 ++++++++ examples/fx_ap1/src/bw_example_fx_ap1.c | 47 ++++++++++ examples/fx_ap1/src/bw_example_fx_ap1.h | 56 ++++++++++++ examples/fx_ap1/src/config.h | 87 ++++++++++++++++++ examples/fx_ap1/vst3/Makefile | 6 ++ examples/fx_ap1/vst3/config_vst3.h | 36 ++++++++ examples/fx_ap1/web/Makefile | 4 + examples/fx_ap1/web/config.js | 38 ++++++++ examples/fx_ap2/daisy-seed/Makefile | 7 ++ .../fx_ap2/daisy-seed/config_daisy_seed.h | 36 ++++++++ examples/fx_ap2/src/bw_example_fx_ap2.c | 50 +++++++++++ examples/fx_ap2/src/bw_example_fx_ap2.h | 56 ++++++++++++ examples/fx_ap2/src/config.h | 88 +++++++++++++++++++ examples/fx_ap2/vst3/Makefile | 6 ++ examples/fx_ap2/vst3/config_vst3.h | 36 ++++++++ examples/fx_ap2/web/Makefile | 4 + examples/fx_ap2/web/config.js | 43 +++++++++ examples/fx_hp1/daisy-seed/Makefile | 7 ++ .../fx_hp1/daisy-seed/config_daisy_seed.h | 35 ++++++++ examples/fx_hp1/src/bw_example_fx_hp1.c | 47 ++++++++++ examples/fx_hp1/src/bw_example_fx_hp1.h | 56 ++++++++++++ examples/fx_hp1/src/config.h | 87 ++++++++++++++++++ examples/fx_hp1/vst3/Makefile | 6 ++ examples/fx_hp1/vst3/config_vst3.h | 36 ++++++++ examples/fx_hp1/web/Makefile | 4 + examples/fx_hp1/web/config.js | 38 ++++++++ examples/fx_hs1/daisy-seed/Makefile | 7 ++ .../fx_hs1/daisy-seed/config_daisy_seed.h | 36 ++++++++ examples/fx_hs1/src/bw_example_fx_hs1.c | 50 +++++++++++ examples/fx_hs1/src/bw_example_fx_hs1.h | 56 ++++++++++++ examples/fx_hs1/src/config.h | 88 +++++++++++++++++++ examples/fx_hs1/vst3/Makefile | 6 ++ examples/fx_hs1/vst3/config_vst3.h | 36 ++++++++ examples/fx_hs1/web/Makefile | 4 + examples/fx_hs1/web/config.js | 43 +++++++++ examples/fx_ls1/daisy-seed/Makefile | 7 ++ .../fx_ls1/daisy-seed/config_daisy_seed.h | 36 ++++++++ examples/fx_ls1/src/bw_example_fx_ls1.c | 50 +++++++++++ examples/fx_ls1/src/bw_example_fx_ls1.h | 56 ++++++++++++ examples/fx_ls1/src/config.h | 88 +++++++++++++++++++ examples/fx_ls1/vst3/Makefile | 6 ++ examples/fx_ls1/vst3/config_vst3.h | 36 ++++++++ examples/fx_ls1/web/Makefile | 4 + examples/fx_ls1/web/config.js | 43 +++++++++ examples/fx_mm1/src/config.h | 2 +- examples/fx_mm2/src/config.h | 2 +- examples/fx_notch/src/config.h | 2 +- include/bw_ap2.h | 4 +- include/bw_hs1.h | 14 +-- include/bw_ls1.h | 4 +- 51 files changed, 1624 insertions(+), 14 deletions(-) create mode 100644 examples/fx_ap1/daisy-seed/Makefile create mode 100644 examples/fx_ap1/daisy-seed/config_daisy_seed.h create mode 100644 examples/fx_ap1/src/bw_example_fx_ap1.c create mode 100644 examples/fx_ap1/src/bw_example_fx_ap1.h create mode 100644 examples/fx_ap1/src/config.h create mode 100644 examples/fx_ap1/vst3/Makefile create mode 100644 examples/fx_ap1/vst3/config_vst3.h create mode 100644 examples/fx_ap1/web/Makefile create mode 100644 examples/fx_ap1/web/config.js create mode 100644 examples/fx_ap2/daisy-seed/Makefile create mode 100644 examples/fx_ap2/daisy-seed/config_daisy_seed.h create mode 100644 examples/fx_ap2/src/bw_example_fx_ap2.c create mode 100644 examples/fx_ap2/src/bw_example_fx_ap2.h create mode 100644 examples/fx_ap2/src/config.h create mode 100644 examples/fx_ap2/vst3/Makefile create mode 100644 examples/fx_ap2/vst3/config_vst3.h create mode 100644 examples/fx_ap2/web/Makefile create mode 100644 examples/fx_ap2/web/config.js create mode 100644 examples/fx_hp1/daisy-seed/Makefile create mode 100644 examples/fx_hp1/daisy-seed/config_daisy_seed.h create mode 100644 examples/fx_hp1/src/bw_example_fx_hp1.c create mode 100644 examples/fx_hp1/src/bw_example_fx_hp1.h create mode 100644 examples/fx_hp1/src/config.h create mode 100644 examples/fx_hp1/vst3/Makefile create mode 100644 examples/fx_hp1/vst3/config_vst3.h create mode 100644 examples/fx_hp1/web/Makefile create mode 100644 examples/fx_hp1/web/config.js create mode 100644 examples/fx_hs1/daisy-seed/Makefile create mode 100644 examples/fx_hs1/daisy-seed/config_daisy_seed.h create mode 100644 examples/fx_hs1/src/bw_example_fx_hs1.c create mode 100644 examples/fx_hs1/src/bw_example_fx_hs1.h create mode 100644 examples/fx_hs1/src/config.h create mode 100644 examples/fx_hs1/vst3/Makefile create mode 100644 examples/fx_hs1/vst3/config_vst3.h create mode 100644 examples/fx_hs1/web/Makefile create mode 100644 examples/fx_hs1/web/config.js create mode 100644 examples/fx_ls1/daisy-seed/Makefile create mode 100644 examples/fx_ls1/daisy-seed/config_daisy_seed.h create mode 100644 examples/fx_ls1/src/bw_example_fx_ls1.c create mode 100644 examples/fx_ls1/src/bw_example_fx_ls1.h create mode 100644 examples/fx_ls1/src/config.h create mode 100644 examples/fx_ls1/vst3/Makefile create mode 100644 examples/fx_ls1/vst3/config_vst3.h create mode 100644 examples/fx_ls1/web/Makefile create mode 100644 examples/fx_ls1/web/config.js diff --git a/examples/fx_ap1/daisy-seed/Makefile b/examples/fx_ap1/daisy-seed/Makefile new file mode 100644 index 0000000..27c9391 --- /dev/null +++ b/examples/fx_ap1/daisy-seed/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +TARGET = bw_example_fx_ap1 + +C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_ap1.c + +include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_ap1/daisy-seed/config_daisy_seed.h b/examples/fx_ap1/daisy-seed/config_daisy_seed.h new file mode 100644 index 0000000..466205b --- /dev/null +++ b/examples/fx_ap1/daisy-seed/config_daisy_seed.h @@ -0,0 +1,35 @@ +/* + * 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 1 + +static struct config_pin config_pins[NUM_PINS] = { + { 0, 15 } +}; + +#endif diff --git a/examples/fx_ap1/src/bw_example_fx_ap1.c b/examples/fx_ap1/src/bw_example_fx_ap1.c new file mode 100644 index 0000000..fbe7cee --- /dev/null +++ b/examples/fx_ap1/src/bw_example_fx_ap1.c @@ -0,0 +1,47 @@ +/* + * 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_ap1.h" + +void bw_example_fx_ap1_init(bw_example_fx_ap1 *instance) { + bw_ap1_init(&instance->ap1_coeffs); +} + +void bw_example_fx_ap1_set_sample_rate(bw_example_fx_ap1 *instance, float sample_rate) { + bw_ap1_set_sample_rate(&instance->ap1_coeffs, sample_rate); +} + +void bw_example_fx_ap1_reset(bw_example_fx_ap1 *instance) { + bw_ap1_reset_coeffs(&instance->ap1_coeffs); + bw_ap1_reset_state(&instance->ap1_coeffs, &instance->ap1_state); +} + +void bw_example_fx_ap1_process(bw_example_fx_ap1 *instance, const float** x, float** y, int n_samples) { + bw_ap1_process(&instance->ap1_coeffs, &instance->ap1_state, x[0], y[0], n_samples); +} + +void bw_example_fx_ap1_set_parameter(bw_example_fx_ap1 *instance, int index, float value) { + instance->params[index] = value; + bw_ap1_set_cutoff(&instance->ap1_coeffs, 20.f + (20e3f - 20.f) * value * value * value); +} + +float bw_example_fx_ap1_get_parameter(bw_example_fx_ap1 *instance, int index) { + return instance->params[index]; +} diff --git a/examples/fx_ap1/src/bw_example_fx_ap1.h b/examples/fx_ap1/src/bw_example_fx_ap1.h new file mode 100644 index 0000000..63f784d --- /dev/null +++ b/examples/fx_ap1/src/bw_example_fx_ap1.h @@ -0,0 +1,56 @@ +/* + * 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_AP1_H +#define _BW_EXAMPLE_FX_AP1_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +enum { + p_ap1, + p_n +}; + +struct _bw_example_fx_ap1 { + // Sub-components + bw_ap1_coeffs ap1_coeffs; + bw_ap1_state ap1_state; + + // Parameters + float params[p_n]; +}; +typedef struct _bw_example_fx_ap1 bw_example_fx_ap1; + +void bw_example_fx_ap1_init(bw_example_fx_ap1 *instance); +void bw_example_fx_ap1_set_sample_rate(bw_example_fx_ap1 *instance, float sample_rate); +void bw_example_fx_ap1_reset(bw_example_fx_ap1 *instance); +void bw_example_fx_ap1_process(bw_example_fx_ap1 *instance, const float** x, float** y, int n_samples); +void bw_example_fx_ap1_set_parameter(bw_example_fx_ap1 *instance, int index, float value); +float bw_example_fx_ap1_get_parameter(bw_example_fx_ap1 *instance, int index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/fx_ap1/src/config.h b/examples/fx_ap1/src/config.h new file mode 100644 index 0000000..5305862 --- /dev/null +++ b/examples/fx_ap1/src/config.h @@ -0,0 +1,87 @@ +/* + * 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_ap1" +#define PLUGIN_VERSION "0.3.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 1 + +static struct config_parameter config_parameters[NUM_PARAMETERS] = { + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, +}; + +// Internal API + +#include "bw_example_fx_ap1.h" + +#define P_TYPE bw_example_fx_ap1 +#define P_INIT bw_example_fx_ap1_init +#define P_SET_SAMPLE_RATE bw_example_fx_ap1_set_sample_rate +#define P_RESET bw_example_fx_ap1_reset +#define P_PROCESS bw_example_fx_ap1_process +#define P_SET_PARAMETER bw_example_fx_ap1_set_parameter +#define P_GET_PARAMETER bw_example_fx_ap1_get_parameter + +#endif diff --git a/examples/fx_ap1/vst3/Makefile b/examples/fx_ap1/vst3/Makefile new file mode 100644 index 0000000..42fc482 --- /dev/null +++ b/examples/fx_ap1/vst3/Makefile @@ -0,0 +1,6 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +NAME := bw_example_fx_ap1 +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ap1.c + +include ${ROOT_DIR}/../../common/vst3/vst3.mk diff --git a/examples/fx_ap1/vst3/config_vst3.h b/examples/fx_ap1/vst3/config_vst3.h new file mode 100644 index 0000000..344ff45 --- /dev/null +++ b/examples/fx_ap1/vst3/config_vst3.h @@ -0,0 +1,36 @@ +/* + * 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 0x6b8ec305 +#define PLUGIN_GUID_2 0x32bf4d7b +#define PLUGIN_GUID_3 0x9cbbcbe4 +#define PLUGIN_GUID_4 0x7d145d6b + +#define CTRL_GUID_1 0xe4f45e61 +#define CTRL_GUID_2 0x236e4427 +#define CTRL_GUID_3 0xab8393bf +#define CTRL_GUID_4 0xa6b57e62 + +#endif diff --git a/examples/fx_ap1/web/Makefile b/examples/fx_ap1/web/Makefile new file mode 100644 index 0000000..4ad635c --- /dev/null +++ b/examples/fx_ap1/web/Makefile @@ -0,0 +1,4 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ap1.c + +include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fx_ap1/web/config.js b/examples/fx_ap1/web/config.js new file mode 100644 index 0000000..7062107 --- /dev/null +++ b/examples/fx_ap1/web/config.js @@ -0,0 +1,38 @@ +/* + * 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", + output: false, + defaultValue: 0.5 + } +]; diff --git a/examples/fx_ap2/daisy-seed/Makefile b/examples/fx_ap2/daisy-seed/Makefile new file mode 100644 index 0000000..e99c99e --- /dev/null +++ b/examples/fx_ap2/daisy-seed/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +TARGET = bw_example_fx_ap2 + +C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_ap2.c + +include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_ap2/daisy-seed/config_daisy_seed.h b/examples/fx_ap2/daisy-seed/config_daisy_seed.h new file mode 100644 index 0000000..c56c264 --- /dev/null +++ b/examples/fx_ap2/daisy-seed/config_daisy_seed.h @@ -0,0 +1,36 @@ +/* + * 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_ap2/src/bw_example_fx_ap2.c b/examples/fx_ap2/src/bw_example_fx_ap2.c new file mode 100644 index 0000000..72bc08e --- /dev/null +++ b/examples/fx_ap2/src/bw_example_fx_ap2.c @@ -0,0 +1,50 @@ +/* + * 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_ap2.h" + +void bw_example_fx_ap2_init(bw_example_fx_ap2 *instance) { + bw_ap2_init(&instance->ap2_coeffs); +} + +void bw_example_fx_ap2_set_sample_rate(bw_example_fx_ap2 *instance, float sample_rate) { + bw_ap2_set_sample_rate(&instance->ap2_coeffs, sample_rate); +} + +void bw_example_fx_ap2_reset(bw_example_fx_ap2 *instance) { + bw_ap2_reset_coeffs(&instance->ap2_coeffs); + bw_ap2_reset_state(&instance->ap2_coeffs, &instance->ap2_state); +} + +void bw_example_fx_ap2_process(bw_example_fx_ap2 *instance, const float** x, float** y, int n_samples) { + bw_ap2_process(&instance->ap2_coeffs, &instance->ap2_state, x[0], y[0], n_samples); +} + +void bw_example_fx_ap2_set_parameter(bw_example_fx_ap2 *instance, int index, float value) { + instance->params[index] = value; + if (index == 0) + bw_ap2_set_cutoff(&instance->ap2_coeffs, 20.f + (20e3f - 20.f) * value * value * value); + else + bw_ap2_set_Q(&instance->ap2_coeffs, 0.5f + 9.5f * value); +} + +float bw_example_fx_ap2_get_parameter(bw_example_fx_ap2 *instance, int index) { + return instance->params[index]; +} diff --git a/examples/fx_ap2/src/bw_example_fx_ap2.h b/examples/fx_ap2/src/bw_example_fx_ap2.h new file mode 100644 index 0000000..f975bc9 --- /dev/null +++ b/examples/fx_ap2/src/bw_example_fx_ap2.h @@ -0,0 +1,56 @@ +/* + * 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_AP2_H +#define _BW_EXAMPLE_FX_AP2_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +enum { + p_ap2, + p_n +}; + +struct _bw_example_fx_ap2 { + // Sub-components + bw_ap2_coeffs ap2_coeffs; + bw_ap2_state ap2_state; + + // Parameters + float params[p_n]; +}; +typedef struct _bw_example_fx_ap2 bw_example_fx_ap2; + +void bw_example_fx_ap2_init(bw_example_fx_ap2 *instance); +void bw_example_fx_ap2_set_sample_rate(bw_example_fx_ap2 *instance, float sample_rate); +void bw_example_fx_ap2_reset(bw_example_fx_ap2 *instance); +void bw_example_fx_ap2_process(bw_example_fx_ap2 *instance, const float** x, float** y, int n_samples); +void bw_example_fx_ap2_set_parameter(bw_example_fx_ap2 *instance, int index, float value); +float bw_example_fx_ap2_get_parameter(bw_example_fx_ap2 *instance, int index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/fx_ap2/src/config.h b/examples/fx_ap2/src/config.h new file mode 100644 index 0000000..3aa36f4 --- /dev/null +++ b/examples/fx_ap2/src/config.h @@ -0,0 +1,88 @@ +/* + * 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_ap2" +#define PLUGIN_VERSION "0.3.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] = { + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, + { "Q", "Q", "", 0, 0, 0, 0.f }, +}; + +// Internal API + +#include "bw_example_fx_ap2.h" + +#define P_TYPE bw_example_fx_ap2 +#define P_INIT bw_example_fx_ap2_init +#define P_SET_SAMPLE_RATE bw_example_fx_ap2_set_sample_rate +#define P_RESET bw_example_fx_ap2_reset +#define P_PROCESS bw_example_fx_ap2_process +#define P_SET_PARAMETER bw_example_fx_ap2_set_parameter +#define P_GET_PARAMETER bw_example_fx_ap2_get_parameter + +#endif diff --git a/examples/fx_ap2/vst3/Makefile b/examples/fx_ap2/vst3/Makefile new file mode 100644 index 0000000..6c3308d --- /dev/null +++ b/examples/fx_ap2/vst3/Makefile @@ -0,0 +1,6 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +NAME := bw_example_fx_ap2 +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ap2.c + +include ${ROOT_DIR}/../../common/vst3/vst3.mk diff --git a/examples/fx_ap2/vst3/config_vst3.h b/examples/fx_ap2/vst3/config_vst3.h new file mode 100644 index 0000000..4dfcd84 --- /dev/null +++ b/examples/fx_ap2/vst3/config_vst3.h @@ -0,0 +1,36 @@ +/* + * 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 0x0f66cf3b +#define PLUGIN_GUID_2 0x7f054ae8 +#define PLUGIN_GUID_3 0xb39fa788 +#define PLUGIN_GUID_4 0x625425ad + +#define CTRL_GUID_1 0x0362e060 +#define CTRL_GUID_2 0xa322413f +#define CTRL_GUID_3 0xa523e18e +#define CTRL_GUID_4 0xc74ced9f + +#endif diff --git a/examples/fx_ap2/web/Makefile b/examples/fx_ap2/web/Makefile new file mode 100644 index 0000000..d5673cb --- /dev/null +++ b/examples/fx_ap2/web/Makefile @@ -0,0 +1,4 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ap2.c + +include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fx_ap2/web/config.js b/examples/fx_ap2/web/config.js new file mode 100644 index 0000000..fef667c --- /dev/null +++ b/examples/fx_ap2/web/config.js @@ -0,0 +1,43 @@ +/* + * 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", + output: false, + defaultValue: 0.5 + }, + { + name: "Q", + output: false, + defaultValue: 0.0 + } +]; diff --git a/examples/fx_hp1/daisy-seed/Makefile b/examples/fx_hp1/daisy-seed/Makefile new file mode 100644 index 0000000..6def36d --- /dev/null +++ b/examples/fx_hp1/daisy-seed/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +TARGET = bw_example_fx_hp1 + +C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_hp1.c + +include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_hp1/daisy-seed/config_daisy_seed.h b/examples/fx_hp1/daisy-seed/config_daisy_seed.h new file mode 100644 index 0000000..466205b --- /dev/null +++ b/examples/fx_hp1/daisy-seed/config_daisy_seed.h @@ -0,0 +1,35 @@ +/* + * 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 1 + +static struct config_pin config_pins[NUM_PINS] = { + { 0, 15 } +}; + +#endif diff --git a/examples/fx_hp1/src/bw_example_fx_hp1.c b/examples/fx_hp1/src/bw_example_fx_hp1.c new file mode 100644 index 0000000..43909c8 --- /dev/null +++ b/examples/fx_hp1/src/bw_example_fx_hp1.c @@ -0,0 +1,47 @@ +/* + * 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_hp1.h" + +void bw_example_fx_hp1_init(bw_example_fx_hp1 *instance) { + bw_hp1_init(&instance->hp1_coeffs); +} + +void bw_example_fx_hp1_set_sample_rate(bw_example_fx_hp1 *instance, float sample_rate) { + bw_hp1_set_sample_rate(&instance->hp1_coeffs, sample_rate); +} + +void bw_example_fx_hp1_reset(bw_example_fx_hp1 *instance) { + bw_hp1_reset_coeffs(&instance->hp1_coeffs); + bw_hp1_reset_state(&instance->hp1_coeffs, &instance->hp1_state); +} + +void bw_example_fx_hp1_process(bw_example_fx_hp1 *instance, const float** x, float** y, int n_samples) { + bw_hp1_process(&instance->hp1_coeffs, &instance->hp1_state, x[0], y[0], n_samples); +} + +void bw_example_fx_hp1_set_parameter(bw_example_fx_hp1 *instance, int index, float value) { + instance->params[index] = value; + bw_hp1_set_cutoff(&instance->hp1_coeffs, 20.f + (20e3f - 20.f) * value * value * value); +} + +float bw_example_fx_hp1_get_parameter(bw_example_fx_hp1 *instance, int index) { + return instance->params[index]; +} diff --git a/examples/fx_hp1/src/bw_example_fx_hp1.h b/examples/fx_hp1/src/bw_example_fx_hp1.h new file mode 100644 index 0000000..3d8cd4f --- /dev/null +++ b/examples/fx_hp1/src/bw_example_fx_hp1.h @@ -0,0 +1,56 @@ +/* + * 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_HP1_H +#define _BW_EXAMPLE_FX_HP1_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +enum { + p_hp1, + p_n +}; + +struct _bw_example_fx_hp1 { + // Sub-components + bw_hp1_coeffs hp1_coeffs; + bw_hp1_state hp1_state; + + // Parameters + float params[p_n]; +}; +typedef struct _bw_example_fx_hp1 bw_example_fx_hp1; + +void bw_example_fx_hp1_init(bw_example_fx_hp1 *instance); +void bw_example_fx_hp1_set_sample_rate(bw_example_fx_hp1 *instance, float sample_rate); +void bw_example_fx_hp1_reset(bw_example_fx_hp1 *instance); +void bw_example_fx_hp1_process(bw_example_fx_hp1 *instance, const float** x, float** y, int n_samples); +void bw_example_fx_hp1_set_parameter(bw_example_fx_hp1 *instance, int index, float value); +float bw_example_fx_hp1_get_parameter(bw_example_fx_hp1 *instance, int index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/fx_hp1/src/config.h b/examples/fx_hp1/src/config.h new file mode 100644 index 0000000..fa47074 --- /dev/null +++ b/examples/fx_hp1/src/config.h @@ -0,0 +1,87 @@ +/* + * 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_hp1" +#define PLUGIN_VERSION "0.3.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 1 + +static struct config_parameter config_parameters[NUM_PARAMETERS] = { + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, +}; + +// Internal API + +#include "bw_example_fx_hp1.h" + +#define P_TYPE bw_example_fx_hp1 +#define P_INIT bw_example_fx_hp1_init +#define P_SET_SAMPLE_RATE bw_example_fx_hp1_set_sample_rate +#define P_RESET bw_example_fx_hp1_reset +#define P_PROCESS bw_example_fx_hp1_process +#define P_SET_PARAMETER bw_example_fx_hp1_set_parameter +#define P_GET_PARAMETER bw_example_fx_hp1_get_parameter + +#endif diff --git a/examples/fx_hp1/vst3/Makefile b/examples/fx_hp1/vst3/Makefile new file mode 100644 index 0000000..3244755 --- /dev/null +++ b/examples/fx_hp1/vst3/Makefile @@ -0,0 +1,6 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +NAME := bw_example_fx_hp1 +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_hp1.c + +include ${ROOT_DIR}/../../common/vst3/vst3.mk diff --git a/examples/fx_hp1/vst3/config_vst3.h b/examples/fx_hp1/vst3/config_vst3.h new file mode 100644 index 0000000..5a506d4 --- /dev/null +++ b/examples/fx_hp1/vst3/config_vst3.h @@ -0,0 +1,36 @@ +/* + * 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 0x4457c77e +#define PLUGIN_GUID_2 0x68634509 +#define PLUGIN_GUID_3 0xb182be49 +#define PLUGIN_GUID_4 0xf5bfa92b + +#define CTRL_GUID_1 0xf5738314 +#define CTRL_GUID_2 0x025a4368 +#define CTRL_GUID_3 0xbccd6ec0 +#define CTRL_GUID_4 0x6b12df02 + +#endif diff --git a/examples/fx_hp1/web/Makefile b/examples/fx_hp1/web/Makefile new file mode 100644 index 0000000..de19683 --- /dev/null +++ b/examples/fx_hp1/web/Makefile @@ -0,0 +1,4 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_hp1.c + +include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fx_hp1/web/config.js b/examples/fx_hp1/web/config.js new file mode 100644 index 0000000..7062107 --- /dev/null +++ b/examples/fx_hp1/web/config.js @@ -0,0 +1,38 @@ +/* + * 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", + output: false, + defaultValue: 0.5 + } +]; diff --git a/examples/fx_hs1/daisy-seed/Makefile b/examples/fx_hs1/daisy-seed/Makefile new file mode 100644 index 0000000..66be9ec --- /dev/null +++ b/examples/fx_hs1/daisy-seed/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +TARGET = bw_example_fx_hs1 + +C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_hs1.c + +include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_hs1/daisy-seed/config_daisy_seed.h b/examples/fx_hs1/daisy-seed/config_daisy_seed.h new file mode 100644 index 0000000..c56c264 --- /dev/null +++ b/examples/fx_hs1/daisy-seed/config_daisy_seed.h @@ -0,0 +1,36 @@ +/* + * 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_hs1/src/bw_example_fx_hs1.c b/examples/fx_hs1/src/bw_example_fx_hs1.c new file mode 100644 index 0000000..47b3ff2 --- /dev/null +++ b/examples/fx_hs1/src/bw_example_fx_hs1.c @@ -0,0 +1,50 @@ +/* + * 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_hs1.h" + +void bw_example_fx_hs1_init(bw_example_fx_hs1 *instance) { + bw_hs1_init(&instance->hs1_coeffs); +} + +void bw_example_fx_hs1_set_sample_rate(bw_example_fx_hs1 *instance, float sample_rate) { + bw_hs1_set_sample_rate(&instance->hs1_coeffs, sample_rate); +} + +void bw_example_fx_hs1_reset(bw_example_fx_hs1 *instance) { + bw_hs1_reset_coeffs(&instance->hs1_coeffs); + bw_hs1_reset_state(&instance->hs1_coeffs, &instance->hs1_state); +} + +void bw_example_fx_hs1_process(bw_example_fx_hs1 *instance, const float** x, float** y, int n_samples) { + bw_hs1_process(&instance->hs1_coeffs, &instance->hs1_state, x[0], y[0], n_samples); +} + +void bw_example_fx_hs1_set_parameter(bw_example_fx_hs1 *instance, int index, float value) { + instance->params[index] = value; + if (index == 0) + bw_hs1_set_cutoff(&instance->hs1_coeffs, 20.f + (20e3f - 20.f) * value * value * value); + else + bw_hs1_set_high_gain_dB(&instance->hs1_coeffs, -20.f + 40.f * value); +} + +float bw_example_fx_hs1_get_parameter(bw_example_fx_hs1 *instance, int index) { + return instance->params[index]; +} diff --git a/examples/fx_hs1/src/bw_example_fx_hs1.h b/examples/fx_hs1/src/bw_example_fx_hs1.h new file mode 100644 index 0000000..e911b09 --- /dev/null +++ b/examples/fx_hs1/src/bw_example_fx_hs1.h @@ -0,0 +1,56 @@ +/* + * 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_HS1_H +#define _BW_EXAMPLE_FX_HS1_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +enum { + p_hs1, + p_n +}; + +struct _bw_example_fx_hs1 { + // Sub-components + bw_hs1_coeffs hs1_coeffs; + bw_hs1_state hs1_state; + + // Parameters + float params[p_n]; +}; +typedef struct _bw_example_fx_hs1 bw_example_fx_hs1; + +void bw_example_fx_hs1_init(bw_example_fx_hs1 *instance); +void bw_example_fx_hs1_set_sample_rate(bw_example_fx_hs1 *instance, float sample_rate); +void bw_example_fx_hs1_reset(bw_example_fx_hs1 *instance); +void bw_example_fx_hs1_process(bw_example_fx_hs1 *instance, const float** x, float** y, int n_samples); +void bw_example_fx_hs1_set_parameter(bw_example_fx_hs1 *instance, int index, float value); +float bw_example_fx_hs1_get_parameter(bw_example_fx_hs1 *instance, int index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/fx_hs1/src/config.h b/examples/fx_hs1/src/config.h new file mode 100644 index 0000000..4804975 --- /dev/null +++ b/examples/fx_hs1/src/config.h @@ -0,0 +1,88 @@ +/* + * 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_hs1" +#define PLUGIN_VERSION "0.3.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] = { + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, + { "Gain", "Gain", "dB", 0, 0, 0, 0.5f }, +}; + +// Internal API + +#include "bw_example_fx_hs1.h" + +#define P_TYPE bw_example_fx_hs1 +#define P_INIT bw_example_fx_hs1_init +#define P_SET_SAMPLE_RATE bw_example_fx_hs1_set_sample_rate +#define P_RESET bw_example_fx_hs1_reset +#define P_PROCESS bw_example_fx_hs1_process +#define P_SET_PARAMETER bw_example_fx_hs1_set_parameter +#define P_GET_PARAMETER bw_example_fx_hs1_get_parameter + +#endif diff --git a/examples/fx_hs1/vst3/Makefile b/examples/fx_hs1/vst3/Makefile new file mode 100644 index 0000000..9977d4a --- /dev/null +++ b/examples/fx_hs1/vst3/Makefile @@ -0,0 +1,6 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +NAME := bw_example_fx_hs1 +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_hs1.c + +include ${ROOT_DIR}/../../common/vst3/vst3.mk diff --git a/examples/fx_hs1/vst3/config_vst3.h b/examples/fx_hs1/vst3/config_vst3.h new file mode 100644 index 0000000..938c468 --- /dev/null +++ b/examples/fx_hs1/vst3/config_vst3.h @@ -0,0 +1,36 @@ +/* + * 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 0x8b009cab +#define PLUGIN_GUID_2 0xc7be4869 +#define PLUGIN_GUID_3 0x8f9c47eb +#define PLUGIN_GUID_4 0xe5b6a58d + +#define CTRL_GUID_1 0xb5463860 +#define CTRL_GUID_2 0x002d4c93 +#define CTRL_GUID_3 0xaa02c6b3 +#define CTRL_GUID_4 0xe8474fe6 + +#endif diff --git a/examples/fx_hs1/web/Makefile b/examples/fx_hs1/web/Makefile new file mode 100644 index 0000000..a2c4750 --- /dev/null +++ b/examples/fx_hs1/web/Makefile @@ -0,0 +1,4 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_hs1.c + +include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fx_hs1/web/config.js b/examples/fx_hs1/web/config.js new file mode 100644 index 0000000..51f18dc --- /dev/null +++ b/examples/fx_hs1/web/config.js @@ -0,0 +1,43 @@ +/* + * 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", + output: false, + defaultValue: 0.5 + }, + { + name: "Gain", + output: false, + defaultValue: 0.5 + } +]; diff --git a/examples/fx_ls1/daisy-seed/Makefile b/examples/fx_ls1/daisy-seed/Makefile new file mode 100644 index 0000000..4c5985e --- /dev/null +++ b/examples/fx_ls1/daisy-seed/Makefile @@ -0,0 +1,7 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +TARGET = bw_example_fx_ls1 + +C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_ls1.c + +include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk diff --git a/examples/fx_ls1/daisy-seed/config_daisy_seed.h b/examples/fx_ls1/daisy-seed/config_daisy_seed.h new file mode 100644 index 0000000..c56c264 --- /dev/null +++ b/examples/fx_ls1/daisy-seed/config_daisy_seed.h @@ -0,0 +1,36 @@ +/* + * 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_ls1/src/bw_example_fx_ls1.c b/examples/fx_ls1/src/bw_example_fx_ls1.c new file mode 100644 index 0000000..ccc5bfb --- /dev/null +++ b/examples/fx_ls1/src/bw_example_fx_ls1.c @@ -0,0 +1,50 @@ +/* + * 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_ls1.h" + +void bw_example_fx_ls1_init(bw_example_fx_ls1 *instance) { + bw_ls1_init(&instance->ls1_coeffs); +} + +void bw_example_fx_ls1_set_sample_rate(bw_example_fx_ls1 *instance, float sample_rate) { + bw_ls1_set_sample_rate(&instance->ls1_coeffs, sample_rate); +} + +void bw_example_fx_ls1_reset(bw_example_fx_ls1 *instance) { + bw_ls1_reset_coeffs(&instance->ls1_coeffs); + bw_ls1_reset_state(&instance->ls1_coeffs, &instance->ls1_state); +} + +void bw_example_fx_ls1_process(bw_example_fx_ls1 *instance, const float** x, float** y, int n_samples) { + bw_ls1_process(&instance->ls1_coeffs, &instance->ls1_state, x[0], y[0], n_samples); +} + +void bw_example_fx_ls1_set_parameter(bw_example_fx_ls1 *instance, int index, float value) { + instance->params[index] = value; + if (index == 0) + bw_ls1_set_cutoff(&instance->ls1_coeffs, 20.f + (20e3f - 20.f) * value * value * value); + else + bw_ls1_set_dc_gain_dB(&instance->ls1_coeffs, -20.f + 40.f * value); +} + +float bw_example_fx_ls1_get_parameter(bw_example_fx_ls1 *instance, int index) { + return instance->params[index]; +} diff --git a/examples/fx_ls1/src/bw_example_fx_ls1.h b/examples/fx_ls1/src/bw_example_fx_ls1.h new file mode 100644 index 0000000..9165d8f --- /dev/null +++ b/examples/fx_ls1/src/bw_example_fx_ls1.h @@ -0,0 +1,56 @@ +/* + * 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_LS1_H +#define _BW_EXAMPLE_FX_LS1_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +enum { + p_ls1, + p_n +}; + +struct _bw_example_fx_ls1 { + // Sub-components + bw_ls1_coeffs ls1_coeffs; + bw_ls1_state ls1_state; + + // Parameters + float params[p_n]; +}; +typedef struct _bw_example_fx_ls1 bw_example_fx_ls1; + +void bw_example_fx_ls1_init(bw_example_fx_ls1 *instance); +void bw_example_fx_ls1_set_sample_rate(bw_example_fx_ls1 *instance, float sample_rate); +void bw_example_fx_ls1_reset(bw_example_fx_ls1 *instance); +void bw_example_fx_ls1_process(bw_example_fx_ls1 *instance, const float** x, float** y, int n_samples); +void bw_example_fx_ls1_set_parameter(bw_example_fx_ls1 *instance, int index, float value); +float bw_example_fx_ls1_get_parameter(bw_example_fx_ls1 *instance, int index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/fx_ls1/src/config.h b/examples/fx_ls1/src/config.h new file mode 100644 index 0000000..0487630 --- /dev/null +++ b/examples/fx_ls1/src/config.h @@ -0,0 +1,88 @@ +/* + * 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_ls1" +#define PLUGIN_VERSION "0.3.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] = { + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, + { "Gain", "Gain", "dB", 0, 0, 0, 0.5f }, +}; + +// Internal API + +#include "bw_example_fx_ls1.h" + +#define P_TYPE bw_example_fx_ls1 +#define P_INIT bw_example_fx_ls1_init +#define P_SET_SAMPLE_RATE bw_example_fx_ls1_set_sample_rate +#define P_RESET bw_example_fx_ls1_reset +#define P_PROCESS bw_example_fx_ls1_process +#define P_SET_PARAMETER bw_example_fx_ls1_set_parameter +#define P_GET_PARAMETER bw_example_fx_ls1_get_parameter + +#endif diff --git a/examples/fx_ls1/vst3/Makefile b/examples/fx_ls1/vst3/Makefile new file mode 100644 index 0000000..69e14e3 --- /dev/null +++ b/examples/fx_ls1/vst3/Makefile @@ -0,0 +1,6 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +NAME := bw_example_fx_ls1 +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ls1.c + +include ${ROOT_DIR}/../../common/vst3/vst3.mk diff --git a/examples/fx_ls1/vst3/config_vst3.h b/examples/fx_ls1/vst3/config_vst3.h new file mode 100644 index 0000000..13bb2e5 --- /dev/null +++ b/examples/fx_ls1/vst3/config_vst3.h @@ -0,0 +1,36 @@ +/* + * 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 0xbb74cecf +#define PLUGIN_GUID_2 0x01ce4903 +#define PLUGIN_GUID_3 0xb37f02ed +#define PLUGIN_GUID_4 0x9510a859 + +#define CTRL_GUID_1 0xb51fa6e2 +#define CTRL_GUID_2 0xf6be4880 +#define CTRL_GUID_3 0x91564918 +#define CTRL_GUID_4 0x97a7cf24 + +#endif diff --git a/examples/fx_ls1/web/Makefile b/examples/fx_ls1/web/Makefile new file mode 100644 index 0000000..8111fba --- /dev/null +++ b/examples/fx_ls1/web/Makefile @@ -0,0 +1,4 @@ +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_ls1.c + +include ${ROOT_DIR}/../../common/web/web.mk diff --git a/examples/fx_ls1/web/config.js b/examples/fx_ls1/web/config.js new file mode 100644 index 0000000..51f18dc --- /dev/null +++ b/examples/fx_ls1/web/config.js @@ -0,0 +1,43 @@ +/* + * 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", + output: false, + defaultValue: 0.5 + }, + { + name: "Gain", + output: false, + defaultValue: 0.5 + } +]; diff --git a/examples/fx_mm1/src/config.h b/examples/fx_mm1/src/config.h index 548e10d..35f73d4 100644 --- a/examples/fx_mm1/src/config.h +++ b/examples/fx_mm1/src/config.h @@ -69,7 +69,7 @@ static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = { #define NUM_PARAMETERS 3 static struct config_parameter config_parameters[NUM_PARAMETERS] = { - { "Cutoff", "Cutoff", "", 0, 0, 0, 0.5f }, + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, { "Input coefficient", "In coeff", "", 0, 0, 0, 1.f }, { "Lowpass coefficient", "LP coeff", "", 0, 0, 0, 0.5f } }; diff --git a/examples/fx_mm2/src/config.h b/examples/fx_mm2/src/config.h index 6b7ace3..b37eabb 100644 --- a/examples/fx_mm2/src/config.h +++ b/examples/fx_mm2/src/config.h @@ -69,7 +69,7 @@ static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = { #define NUM_PARAMETERS 6 static struct config_parameter config_parameters[NUM_PARAMETERS] = { - { "Cutoff", "Cutoff", "", 0, 0, 0, 0.5f }, + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, { "Q", "Q", "", 0, 0, 0, 0.f }, { "Input coefficient", "In coeff", "", 0, 0, 0, 1.f }, { "Lowpass coefficient", "LP coeff", "", 0, 0, 0, 0.5f }, diff --git a/examples/fx_notch/src/config.h b/examples/fx_notch/src/config.h index 1797cfd..bd80853 100644 --- a/examples/fx_notch/src/config.h +++ b/examples/fx_notch/src/config.h @@ -69,7 +69,7 @@ static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = { #define NUM_PARAMETERS 2 static struct config_parameter config_parameters[NUM_PARAMETERS] = { - { "Cutoff", "Cutoff", "", 0, 0, 0, 0.5f }, + { "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }, { "Q", "Q", "", 0, 0, 0, 0.f } }; diff --git a/include/bw_ap2.h b/include/bw_ap2.h index 857e801..690a619 100644 --- a/include/bw_ap2.h +++ b/include/bw_ap2.h @@ -120,7 +120,7 @@ static inline void bw_ap2_set_cutoff(bw_ap2_coeffs *BW_RESTRICT coeffs, float va * * #### bw_ap2_set_Q() * ```>>> */ -static inline void bw_ap2_set_Q(bw_svf_coeffs *BW_RESTRICT coeffs, float value); +static inline void bw_ap2_set_Q(bw_ap2_coeffs *BW_RESTRICT coeffs, float value); /*! <<<``` * Sets the quality factor to the given `value` in `coeffs`. * @@ -188,7 +188,7 @@ static inline void bw_ap2_set_cutoff(bw_ap2_coeffs *BW_RESTRICT coeffs, float va bw_svf_set_cutoff(&coeffs->svf_coeffs, value); } -static inline void bw_ap2_set_Q(bw_svf_coeffs *BW_RESTRICT coeffs, float value) { +static inline void bw_ap2_set_Q(bw_ap2_coeffs *BW_RESTRICT coeffs, float value) { bw_svf_set_Q(&coeffs->svf_coeffs, value); } diff --git a/include/bw_hs1.h b/include/bw_hs1.h index 97c10aa..9152fd8 100644 --- a/include/bw_hs1.h +++ b/include/bw_hs1.h @@ -164,21 +164,21 @@ struct _bw_hs1_state { static inline void bw_hs1_init(bw_hs1_coeffs *BW_RESTRICT coeffs) { bw_mm1_init(&coeffs->mm1_coeffs); bw_mm1_set_prewarp_at_cutoff(&coeffs->mm1_coeffs, 0); - bw_mm1_set_coeffs_x(&coeffs->mm1_coeffs, 0.f); - bw_mm1_set_coeffs_lp(&coeffs->mm1_coeffs, 1.f); + bw_mm1_set_coeff_x(&coeffs->mm1_coeffs, 0.f); + bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, 1.f); coeffs->cutoff = 1e3f; - coeffs->dc_gain = 1.f; + coeffs->high_gain = 1.f; } static inline void bw_hs1_set_sample_rate(bw_hs1_coeffs *BW_RESTRICT coeffs, float sample_rate) { bw_mm1_set_sample_rate(&coeffs->mm1_coeffs, sample_rate); } -static inline void _bw_hs1_update_mm1_params(bw_ls1_coeffs *BW_RESTRICT coeffs) { +static inline void _bw_hs1_update_mm1_params(bw_hs1_coeffs *BW_RESTRICT coeffs) { if (coeffs->update) { - bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_sqrtf_2(coeffs->dc_gain)); - bw_mm1_set_coeff_x(&coeffs->mm1_coeffs, coeffs->dc_gain); - bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, 1.f - coeffs->dc_gain); + bw_mm1_set_cutoff(&coeffs->mm1_coeffs, coeffs->cutoff * bw_sqrtf_2(coeffs->high_gain)); + bw_mm1_set_coeff_x(&coeffs->mm1_coeffs, coeffs->high_gain); + bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, 1.f - coeffs->high_gain); bw_mm1_set_prewarp_freq(&coeffs->mm1_coeffs, coeffs->cutoff); coeffs->update = 0; } diff --git a/include/bw_ls1.h b/include/bw_ls1.h index 1b59c47..4447361 100644 --- a/include/bw_ls1.h +++ b/include/bw_ls1.h @@ -162,8 +162,8 @@ struct _bw_ls1_state { static inline void bw_ls1_init(bw_ls1_coeffs *BW_RESTRICT coeffs) { bw_mm1_init(&coeffs->mm1_coeffs); bw_mm1_set_prewarp_at_cutoff(&coeffs->mm1_coeffs, 0); - bw_mm1_set_coeffs_x(&coeffs->mm1_coeffs, 1.f); - bw_mm1_set_coeffs_lp(&coeffs->mm1_coeffs, 0.f); + bw_mm1_set_coeff_x(&coeffs->mm1_coeffs, 1.f); + bw_mm1_set_coeff_lp(&coeffs->mm1_coeffs, 0.f); coeffs->cutoff = 1e3f; coeffs->dc_gain = 1.f; }