fx(pp)_comb + homogenize c++ examples a bit
This commit is contained in:
parent
9685ac9b4b
commit
93df684ac8
@ -1,6 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_comb
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_comb.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/android/android.mk
|
@ -1,7 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fx_comb
|
||||
|
||||
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_comb.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
@ -1,39 +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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* 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 5
|
||||
|
||||
static struct config_pin config_pins[NUM_PINS] = {
|
||||
{ 0, 15 },
|
||||
{ 1, 16 },
|
||||
{ 2, 17 },
|
||||
{ 3, 18 },
|
||||
{ 4, 19 },
|
||||
};
|
||||
|
||||
#endif
|
@ -1,6 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_comb
|
||||
SOURCE := ${NAME}.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/ios/ios.mk
|
5
examples/fx_comb/src/android.json
Normal file
5
examples/fx_comb/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fx_comb"
|
||||
}
|
||||
}
|
@ -1,71 +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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fx_comb.h"
|
||||
|
||||
void bw_example_fx_comb_init(bw_example_fx_comb *instance) {
|
||||
bw_comb_init(&instance->comb_coeffs, 1.f);
|
||||
}
|
||||
|
||||
void bw_example_fx_comb_set_sample_rate(bw_example_fx_comb *instance, float sample_rate) {
|
||||
bw_comb_set_sample_rate(&instance->comb_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
size_t bw_example_fx_comb_mem_req(bw_example_fx_comb *instance) {
|
||||
return bw_comb_mem_req(&instance->comb_coeffs);
|
||||
}
|
||||
|
||||
void bw_example_fx_comb_mem_set(bw_example_fx_comb *instance, void *mem) {
|
||||
bw_comb_mem_set(&instance->comb_coeffs, &instance->comb_state, mem);
|
||||
}
|
||||
|
||||
void bw_example_fx_comb_reset(bw_example_fx_comb *instance) {
|
||||
bw_comb_reset_coeffs(&instance->comb_coeffs);
|
||||
bw_comb_reset_state(&instance->comb_coeffs, &instance->comb_state, 0.f);
|
||||
}
|
||||
|
||||
void bw_example_fx_comb_process(bw_example_fx_comb *instance, const float** x, float** y, int n_samples) {
|
||||
bw_comb_process(&instance->comb_coeffs, &instance->comb_state, x[0], y[0], n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fx_comb_set_parameter(bw_example_fx_comb *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_ff_delay:
|
||||
bw_comb_set_delay_ff(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case p_fb_delay:
|
||||
bw_comb_set_delay_fb(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case p_blend:
|
||||
bw_comb_set_coeff_blend(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case p_ff:
|
||||
bw_comb_set_coeff_ff(&instance->comb_coeffs, value + value - 1.f);
|
||||
break;
|
||||
case p_fb:
|
||||
bw_comb_set_coeff_fb(&instance->comb_coeffs, 1.99f * value - 0.995f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fx_comb_get_parameter(bw_example_fx_comb *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
@ -1,64 +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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef _BW_EXAMPLE_FX_COMB_H
|
||||
#define _BW_EXAMPLE_FX_COMB_H
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#include <bw_comb.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
p_ff_delay,
|
||||
p_fb_delay,
|
||||
p_blend,
|
||||
p_ff,
|
||||
p_fb,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fx_comb {
|
||||
// Sub-components
|
||||
bw_comb_coeffs comb_coeffs;
|
||||
bw_comb_state comb_state;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fx_comb bw_example_fx_comb;
|
||||
|
||||
void bw_example_fx_comb_init(bw_example_fx_comb *instance);
|
||||
void bw_example_fx_comb_set_sample_rate(bw_example_fx_comb *instance, float sample_rate);
|
||||
size_t bw_example_fx_comb_mem_req(bw_example_fx_comb *instance);
|
||||
void bw_example_fx_comb_mem_set(bw_example_fx_comb *instance, void *mem);
|
||||
void bw_example_fx_comb_reset(bw_example_fx_comb *instance);
|
||||
void bw_example_fx_comb_process(bw_example_fx_comb *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fx_comb_set_parameter(bw_example_fx_comb *instance, int index, float value);
|
||||
float bw_example_fx_comb_get_parameter(bw_example_fx_comb *instance, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
6
examples/fx_comb/src/cmd.json
Normal file
6
examples/fx_comb/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
|
||||
}
|
||||
}
|
@ -1,93 +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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* 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_comb"
|
||||
#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 5
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Feedforward delay", "FF delay", "", 0, 0, 0, 0.f },
|
||||
{ "Feedback delay", "FB delay", "", 0, 0, 0, 0.f },
|
||||
{ "Blend", "Blend", "", 0, 0, 0, 1.f },
|
||||
{ "Feedforward", "FF", "", 0, 0, 0, 0.5f },
|
||||
{ "Feedback", "FB", "", 0, 0, 0, 0.5f },
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fx_comb.h"
|
||||
|
||||
#define P_TYPE bw_example_fx_comb
|
||||
#define P_INIT bw_example_fx_comb_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fx_comb_set_sample_rate
|
||||
#define P_MEM_REQ bw_example_fx_comb_mem_req
|
||||
#define P_MEM_SET bw_example_fx_comb_mem_set
|
||||
#define P_RESET bw_example_fx_comb_reset
|
||||
#define P_PROCESS bw_example_fx_comb_process
|
||||
#define P_SET_PARAMETER bw_example_fx_comb_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fx_comb_get_parameter
|
||||
|
||||
#endif
|
@ -1,58 +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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
var buses = [
|
||||
{
|
||||
stereo: false,
|
||||
output: false
|
||||
},
|
||||
{
|
||||
stereo: false,
|
||||
output: true
|
||||
}
|
||||
];
|
||||
|
||||
var parameters = [
|
||||
{
|
||||
name: "Feedforward delay",
|
||||
output: false,
|
||||
defaultValue: 0.0
|
||||
},
|
||||
{
|
||||
name: "Feedback delay",
|
||||
output: false,
|
||||
defaultValue: 0.0
|
||||
},
|
||||
{
|
||||
name: "Blend",
|
||||
output: false,
|
||||
defaultValue: 1.0
|
||||
},
|
||||
{
|
||||
name: "Feedforward",
|
||||
output: false,
|
||||
defaultValue: 0.5
|
||||
},
|
||||
{
|
||||
name: "Feedback",
|
||||
output: false,
|
||||
defaultValue: 0.5
|
||||
}
|
||||
];
|
5
examples/fx_comb/src/daisy-seed.json
Normal file
5
examples/fx_comb/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15, 16, 17, 18, 19 ]
|
||||
}
|
||||
}
|
5
examples/fx_comb/src/ios.json
Normal file
5
examples/fx_comb/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fx_comb"
|
||||
}
|
||||
}
|
12
examples/fx_comb/src/lv2.json
Normal file
12
examples/fx_comb/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fx_comb",
|
||||
"types": [ "@lv2:CombPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
|
||||
}
|
||||
}
|
62
examples/fx_comb/src/plugin.h
Normal file
62
examples/fx_comb/src/plugin.h
Normal file
@ -0,0 +1,62 @@
|
||||
#include "common.h"
|
||||
#include <bw_comb.h>
|
||||
|
||||
typedef struct plugin {
|
||||
bw_comb_coeffs comb_coeffs;
|
||||
bw_comb_state comb_state;
|
||||
} plugin;
|
||||
|
||||
static void plugin_init(plugin*instance) {
|
||||
bw_comb_init(&instance->comb_coeffs, 1.f);
|
||||
}
|
||||
|
||||
static void plugin_fini(plugin *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||
bw_comb_set_sample_rate(&instance->comb_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static size_t plugin_mem_req(plugin *instance) {
|
||||
return bw_comb_mem_req(&instance->comb_coeffs);
|
||||
}
|
||||
|
||||
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||
bw_comb_mem_set(&instance->comb_coeffs, &instance->comb_state, mem);
|
||||
}
|
||||
|
||||
static void plugin_reset(plugin *instance) {
|
||||
bw_comb_reset_coeffs(&instance->comb_coeffs);
|
||||
bw_comb_reset_state(&instance->comb_coeffs, &instance->comb_state, 0.f);
|
||||
}
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
bw_comb_set_delay_ff(&instance->comb_coeffs, 0.001f * value);
|
||||
break;
|
||||
case 1:
|
||||
bw_comb_set_delay_fb(&instance->comb_coeffs, 0.001f * value);
|
||||
break;
|
||||
case 2:
|
||||
bw_comb_set_coeff_blend(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case 3:
|
||||
bw_comb_set_coeff_ff(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case 4:
|
||||
bw_comb_set_coeff_fb(&instance->comb_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_comb_process(&instance->comb_coeffs, &instance->comb_state, inputs[0], outputs[0], n_samples);
|
||||
}
|
73
examples/fx_comb/src/product.json
Normal file
73
examples/fx_comb/src/product.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickwork comb filter example",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fx_comb",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Feedforward delay",
|
||||
"shortName": "FF delay",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1000.0,
|
||||
"unit": "ms",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedback delay",
|
||||
"shortName": "FB delay",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1000.0,
|
||||
"unit": "ms",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Blend coefficient",
|
||||
"shortName": "Blend coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 1.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedforward coefficient",
|
||||
"shortName": "FF coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -1.0,
|
||||
"maximum": 1.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedback coefficient",
|
||||
"shortName": "FB coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -0.999,
|
||||
"maximum": 0.999,
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fx_comb/src/vst3.json
Normal file
11
examples/fx_comb/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "8b64718032e14de28e15ad4c5b9dab92"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "f692427bcd9c46bf81b42ae046afbea1"
|
||||
},
|
||||
"subCategory": "Fx|Delay"
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_comb
|
||||
SOURCE := bw_example_fx_comb.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
||||
|
||||
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
|
||||
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File authors: Stefano D'Angelo, Paolo Marrone
|
||||
*/
|
||||
|
||||
#ifndef _VST3_CONFIG_H
|
||||
#define _VST3_CONFIG_H
|
||||
|
||||
#define PLUGIN_SUBCATEGORY "Fx|Delay"
|
||||
|
||||
#define PLUGIN_GUID_1 0x8b647180
|
||||
#define PLUGIN_GUID_2 0x32e14de2
|
||||
#define PLUGIN_GUID_3 0x8e15ad4c
|
||||
#define PLUGIN_GUID_4 0x5b9dab92
|
||||
|
||||
#define CTRL_GUID_1 0xf692427b
|
||||
#define CTRL_GUID_2 0xcd9c46bf
|
||||
#define CTRL_GUID_3 0x81b42ae0
|
||||
#define CTRL_GUID_4 0x46afbea1
|
||||
|
||||
#endif
|
@ -1,5 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_comb.c
|
||||
NEEDS_MEMSET := yes
|
||||
|
||||
include ${ROOT_DIR}/../../common/web/web.mk
|
@ -8,7 +8,8 @@ using namespace Brickworks;
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
return reinterpret_cast<impl>(new AP1<1>());
|
||||
AP1<1> *instance = new AP1<1>();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
|
@ -8,7 +8,8 @@ using namespace Brickworks;
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
return reinterpret_cast<impl>(new AP2<1>());
|
||||
AP2<1> *instance = new AP2<1>();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
|
@ -15,7 +15,8 @@ public:
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
return reinterpret_cast<impl>(new Engine());
|
||||
Engine *instance = new Engine();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
|
@ -15,7 +15,8 @@ public:
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
return reinterpret_cast<impl>(new Engine());
|
||||
Engine *instance = new Engine();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
|
@ -8,7 +8,8 @@ using namespace Brickworks;
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
return reinterpret_cast<impl>(new Cab<1>());
|
||||
Cab<1> *instance = new Cab<1>();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
|
5
examples/fxpp_comb/src/android.json
Normal file
5
examples/fxpp_comb/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fxpp_comb"
|
||||
}
|
||||
}
|
6
examples/fxpp_comb/src/cmd.json
Normal file
6
examples/fxpp_comb/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
|
||||
}
|
||||
}
|
5
examples/fxpp_comb/src/daisy-seed.json
Normal file
5
examples/fxpp_comb/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15, 16, 17, 18, 19 ]
|
||||
}
|
||||
}
|
62
examples/fxpp_comb/src/impl.cpp
Normal file
62
examples/fxpp_comb/src/impl.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
#include "impl.h"
|
||||
|
||||
#include "common.h"
|
||||
#include <bw_comb.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
Comb<1> *instance = new Comb<1>(1.f);
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
Comb<1> *instance = reinterpret_cast<Comb<1> *>(handle);
|
||||
delete instance;
|
||||
}
|
||||
|
||||
void impl_set_sample_rate(impl handle, float sample_rate) {
|
||||
Comb<1> *instance = reinterpret_cast<Comb<1> *>(handle);
|
||||
instance->setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void impl_reset(impl handle) {
|
||||
Comb<1> *instance = reinterpret_cast<Comb<1> *>(handle);
|
||||
instance->reset();
|
||||
}
|
||||
|
||||
void impl_set_parameter(impl handle, size_t index, float value) {
|
||||
Comb<1> *instance = reinterpret_cast<Comb<1> *>(handle);
|
||||
switch (index) {
|
||||
case 0:
|
||||
instance->setDelayFF(0.001f * value);
|
||||
break;
|
||||
case 1:
|
||||
instance->setDelayFB(0.001f * value);
|
||||
break;
|
||||
case 2:
|
||||
instance->setCoeffBlend(value);
|
||||
break;
|
||||
case 3:
|
||||
instance->setCoeffFF(value);
|
||||
break;
|
||||
case 4:
|
||||
instance->setCoeffFB(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) {
|
||||
Comb<1> *instance = reinterpret_cast<Comb<1> *>(handle);
|
||||
instance->process(inputs, outputs, n_samples);
|
||||
}
|
||||
|
||||
}
|
5
examples/fxpp_comb/src/ios.json
Normal file
5
examples/fxpp_comb/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fxpp_comb"
|
||||
}
|
||||
}
|
12
examples/fxpp_comb/src/lv2.json
Normal file
12
examples/fxpp_comb/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fxpp_comb",
|
||||
"types": [ "@lv2:CombPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
|
||||
}
|
||||
}
|
62
examples/fxpp_comb/src/plugin.h
Normal file
62
examples/fxpp_comb/src/plugin.h
Normal file
@ -0,0 +1,62 @@
|
||||
#include "common.h"
|
||||
#include <bw_comb.h>
|
||||
|
||||
typedef struct plugin {
|
||||
bw_comb_coeffs comb_coeffs;
|
||||
bw_comb_state comb_state;
|
||||
} plugin;
|
||||
|
||||
static void plugin_init(plugin*instance) {
|
||||
bw_comb_init(&instance->comb_coeffs, 1.f);
|
||||
}
|
||||
|
||||
static void plugin_fini(plugin *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||
bw_comb_set_sample_rate(&instance->comb_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static size_t plugin_mem_req(plugin *instance) {
|
||||
return bw_comb_mem_req(&instance->comb_coeffs);
|
||||
}
|
||||
|
||||
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||
bw_comb_mem_set(&instance->comb_coeffs, &instance->comb_state, mem);
|
||||
}
|
||||
|
||||
static void plugin_reset(plugin *instance) {
|
||||
bw_comb_reset_coeffs(&instance->comb_coeffs);
|
||||
bw_comb_reset_state(&instance->comb_coeffs, &instance->comb_state, 0.f);
|
||||
}
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
bw_comb_set_delay_ff(&instance->comb_coeffs, 0.001f * value);
|
||||
break;
|
||||
case 1:
|
||||
bw_comb_set_delay_fb(&instance->comb_coeffs, 0.001f * value);
|
||||
break;
|
||||
case 2:
|
||||
bw_comb_set_coeff_blend(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case 3:
|
||||
bw_comb_set_coeff_ff(&instance->comb_coeffs, value);
|
||||
break;
|
||||
case 4:
|
||||
bw_comb_set_coeff_fb(&instance->comb_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_comb_process(&instance->comb_coeffs, &instance->comb_state, inputs[0], outputs[0], n_samples);
|
||||
}
|
73
examples/fxpp_comb/src/product.json
Normal file
73
examples/fxpp_comb/src/product.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickwork comb filter example (C++)",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fxpp_comb",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Feedforward delay",
|
||||
"shortName": "FF delay",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1000.0,
|
||||
"unit": "ms",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedback delay",
|
||||
"shortName": "FB delay",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1000.0,
|
||||
"unit": "ms",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Blend coefficient",
|
||||
"shortName": "Blend coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 1.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedforward coefficient",
|
||||
"shortName": "FF coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -1.0,
|
||||
"maximum": 1.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Feedback coefficient",
|
||||
"shortName": "FB coeff",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -0.999,
|
||||
"maximum": 0.999,
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fxpp_comb/src/vst3.json
Normal file
11
examples/fxpp_comb/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "7b0953c9ba334cb1963394cf700098b9"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "089396db58854e748a70c9de97e810dd"
|
||||
},
|
||||
"subCategory": "Fx|Delay"
|
||||
}
|
||||
}
|
@ -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_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comp synthpp_simple"
|
||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp synthpp_simple"
|
||||
|
||||
for d in $dirs; do
|
||||
echo Removing data files for $d
|
||||
|
@ -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_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comp synthpp_simple"
|
||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp synthpp_simple"
|
||||
else
|
||||
dirs="$1"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user