added fxpp_comp, fixed/cleaned fx_comp
This commit is contained in:
parent
1c74f053db
commit
0b7da2dda9
@ -1,6 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_comp
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_comp.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/android/android.mk
|
@ -1,7 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fx_comp
|
||||
|
||||
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_comp.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_comp
|
||||
SOURCE := ${NAME}.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/ios/ios.mk
|
5
examples/fx_comp/src/android.json
Normal file
5
examples/fx_comp/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fx_comp"
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fx_comp.h"
|
||||
|
||||
void bw_example_fx_comp_init(bw_example_fx_comp *instance) {
|
||||
bw_comp_init(&instance->comp_coeffs);
|
||||
}
|
||||
|
||||
void bw_example_fx_comp_set_sample_rate(bw_example_fx_comp *instance, float sample_rate) {
|
||||
bw_comp_set_sample_rate(&instance->comp_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fx_comp_reset(bw_example_fx_comp *instance) {
|
||||
bw_comp_reset_coeffs(&instance->comp_coeffs);
|
||||
bw_comp_reset_state(&instance->comp_coeffs, &instance->comp_state, 0.f, 0.f);
|
||||
}
|
||||
|
||||
void bw_example_fx_comp_process(bw_example_fx_comp *instance, const float** x, float** y, int n_samples) {
|
||||
bw_comp_process(&instance->comp_coeffs, &instance->comp_state, x[0], x[0], y[0], n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fx_comp_set_parameter(bw_example_fx_comp *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_thresh:
|
||||
bw_comp_set_thresh_dBFS(&instance->comp_coeffs, 60.f * value - 60.f);
|
||||
break;
|
||||
case p_ratio:
|
||||
bw_comp_set_ratio(&instance->comp_coeffs, value);
|
||||
break;
|
||||
case p_attack:
|
||||
bw_comp_set_attack_tau(&instance->comp_coeffs, value);
|
||||
break;
|
||||
case p_release:
|
||||
bw_comp_set_release_tau(&instance->comp_coeffs, value);
|
||||
break;
|
||||
case p_gain:
|
||||
bw_comp_set_gain_dB(&instance->comp_coeffs, 60.f * value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fx_comp_get_parameter(bw_example_fx_comp *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef _BW_EXAMPLE_FX_COMP_H
|
||||
#define _BW_EXAMPLE_FX_COMP_H
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#include <bw_comp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
p_thresh,
|
||||
p_ratio,
|
||||
p_attack,
|
||||
p_release,
|
||||
p_gain,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fx_comp {
|
||||
// Sub-components
|
||||
bw_comp_coeffs comp_coeffs;
|
||||
bw_comp_state comp_state;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fx_comp bw_example_fx_comp;
|
||||
|
||||
void bw_example_fx_comp_init(bw_example_fx_comp *instance);
|
||||
void bw_example_fx_comp_set_sample_rate(bw_example_fx_comp *instance, float sample_rate);
|
||||
void bw_example_fx_comp_reset(bw_example_fx_comp *instance);
|
||||
void bw_example_fx_comp_process(bw_example_fx_comp *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fx_comp_set_parameter(bw_example_fx_comp *instance, int index, float value);
|
||||
float bw_example_fx_comp_get_parameter(bw_example_fx_comp *instance, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
6
examples/fx_comp/src/cmd.json
Normal file
6
examples/fx_comp/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output", "sidechain_in" ],
|
||||
"parameterIds": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_comp"
|
||||
#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] = {
|
||||
{ "Threshold", "Thresh", "", 0, 0, 0, 1.f },
|
||||
{ "Ratio", "Ratio", "", 0, 0, 0, 1.f },
|
||||
{ "Attack", "Attack", "s", 0, 0, 0, 0.f },
|
||||
{ "Release", "Release", "s", 0, 0, 0, 0.f },
|
||||
{ "Makeup gain", "Gain", "", 0, 0, 0, 0.f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fx_comp.h"
|
||||
|
||||
#define P_TYPE bw_example_fx_comp
|
||||
#define P_INIT bw_example_fx_comp_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fx_comp_set_sample_rate
|
||||
#define P_RESET bw_example_fx_comp_reset
|
||||
#define P_PROCESS bw_example_fx_comp_process
|
||||
#define P_SET_PARAMETER bw_example_fx_comp_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fx_comp_get_parameter
|
||||
|
||||
#endif
|
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
var buses = [
|
||||
{
|
||||
stereo: false,
|
||||
output: false
|
||||
},
|
||||
{
|
||||
stereo: false,
|
||||
output: true
|
||||
}
|
||||
];
|
||||
|
||||
var parameters = [
|
||||
{
|
||||
name: "Threshold",
|
||||
output: false,
|
||||
defaultValue: 1.0
|
||||
},
|
||||
{
|
||||
name: "Ratio",
|
||||
output: false,
|
||||
defaultValue: 1.0
|
||||
},
|
||||
{
|
||||
name: "Attack",
|
||||
output: false,
|
||||
defaultValue: 0.0
|
||||
},
|
||||
{
|
||||
name: "Release",
|
||||
output: false,
|
||||
defaultValue: 0.0
|
||||
},
|
||||
{
|
||||
name: "Makeup gain",
|
||||
output: false,
|
||||
defaultValue: 0.0
|
||||
}
|
||||
];
|
5
examples/fx_comp/src/daisy-seed.json
Normal file
5
examples/fx_comp/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15, 16, 17, 18, 19, 20 ]
|
||||
}
|
||||
}
|
5
examples/fx_comp/src/ios.json
Normal file
5
examples/fx_comp/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fx_comp"
|
||||
}
|
||||
}
|
12
examples/fx_comp/src/lv2.json
Normal file
12
examples/fx_comp/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fx_comp",
|
||||
"types": [ "@lv2:CompressorPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output", "sidechain_in" ],
|
||||
"parameterSymbols": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
|
||||
}
|
||||
}
|
71
examples/fx_comp/src/plugin.h
Normal file
71
examples/fx_comp/src/plugin.h
Normal file
@ -0,0 +1,71 @@
|
||||
#include "common.h"
|
||||
#include <bw_comp.h>
|
||||
|
||||
typedef struct plugin {
|
||||
bw_comp_coeffs comp_coeffs;
|
||||
bw_comp_state comp_state;
|
||||
char ext_sidechain;
|
||||
} plugin;
|
||||
|
||||
static void plugin_init(plugin *instance) {
|
||||
bw_comp_init(&instance->comp_coeffs);
|
||||
instance->ext_sidechain = 0;
|
||||
}
|
||||
|
||||
static void plugin_fini(plugin *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||
bw_comp_set_sample_rate(&instance->comp_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static size_t plugin_mem_req(plugin *instance) {
|
||||
(void)instance;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||
(void)instance;
|
||||
(void)mem;
|
||||
}
|
||||
|
||||
static void plugin_reset(plugin *instance) {
|
||||
bw_comp_reset_coeffs(&instance->comp_coeffs);
|
||||
bw_comp_reset_state(&instance->comp_coeffs, &instance->comp_state, 0.f, 0.f);
|
||||
}
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
bw_comp_set_thresh_dBFS(&instance->comp_coeffs, value);
|
||||
break;
|
||||
case 1:
|
||||
bw_comp_set_ratio(&instance->comp_coeffs, bw_rcpf(value));
|
||||
break;
|
||||
case 2:
|
||||
// using rise time 10% -> 90%: tau = rise time / log(9)
|
||||
bw_comp_set_attack_tau(&instance->comp_coeffs, (0.001f * 0.4551196133134186f) * value);
|
||||
break;
|
||||
case 3:
|
||||
// as before
|
||||
bw_comp_set_release_tau(&instance->comp_coeffs, (0.001f * 0.4551196133134186f) * value);
|
||||
break;
|
||||
case 4:
|
||||
bw_comp_set_gain_dB(&instance->comp_coeffs, value);
|
||||
break;
|
||||
case 5:
|
||||
instance->ext_sidechain = (char)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_comp_process(&instance->comp_coeffs, &instance->comp_state, inputs[0], instance->ext_sidechain ? inputs[1] : inputs[0], outputs[0], n_samples);
|
||||
}
|
95
examples/fx_comp/src/product.json
Normal file
95
examples/fx_comp/src/product.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickworks compressor example",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fx_comp",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Sidechain input",
|
||||
"shortName": "Sidechain in",
|
||||
"sidechain": true,
|
||||
"cv": false,
|
||||
"optional": true
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Threshold",
|
||||
"shortName": "Threshold",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -60.0,
|
||||
"maximum": 0.0,
|
||||
"unit": "db",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Ratio",
|
||||
"shortName": "Ratio",
|
||||
"direction": "input",
|
||||
"defaultValue": 1.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 20.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Attack",
|
||||
"shortName": "Attack",
|
||||
"direction": "input",
|
||||
"defaultValue": 20.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 2000.0,
|
||||
"unit": "ms",
|
||||
"map": "logarithmic"
|
||||
},
|
||||
{
|
||||
"name": "Release",
|
||||
"shortName": "Release",
|
||||
"direction": "input",
|
||||
"defaultValue": 250.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 2000.0,
|
||||
"unit": "ms",
|
||||
"map": "logarithmic"
|
||||
},
|
||||
{
|
||||
"name": "Makeup gain",
|
||||
"shortName": "Gain",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 40.0,
|
||||
"unit": "db",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "External sidechain",
|
||||
"shortName": "Ext sidechain",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"toggled": true,
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fx_comp/src/vst3.json
Normal file
11
examples/fx_comp/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "f1d5383023874b119afca13e546a1560"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "5175a583ab0841c59f720d2901d97767"
|
||||
},
|
||||
"subCategory": "Fx|Dynamics"
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_comp
|
||||
SOURCE := bw_example_fx_comp.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) 2022 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File authors: Stefano D'Angelo, Paolo Marrone
|
||||
*/
|
||||
|
||||
#ifndef _VST3_CONFIG_H
|
||||
#define _VST3_CONFIG_H
|
||||
|
||||
#define PLUGIN_SUBCATEGORY "Fx|Dynamics"
|
||||
|
||||
#define PLUGIN_GUID_1 0xf1d53830
|
||||
#define PLUGIN_GUID_2 0x23874b11
|
||||
#define PLUGIN_GUID_3 0x9afca13e
|
||||
#define PLUGIN_GUID_4 0x546a1560
|
||||
|
||||
#define CTRL_GUID_1 0x5175a583
|
||||
#define CTRL_GUID_2 0xab0841c5
|
||||
#define CTRL_GUID_3 0x9f720d29
|
||||
#define CTRL_GUID_4 0x01d97767
|
||||
|
||||
#endif
|
@ -1,4 +0,0 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_comp.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/web/web.mk
|
5
examples/fxpp_comp/src/android.json
Normal file
5
examples/fxpp_comp/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fxpp_comp"
|
||||
}
|
||||
}
|
6
examples/fxpp_comp/src/cmd.json
Normal file
6
examples/fxpp_comp/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output", "sidechain_in" ],
|
||||
"parameterIds": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
|
||||
}
|
||||
}
|
5
examples/fxpp_comp/src/daisy-seed.json
Normal file
5
examples/fxpp_comp/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15, 16, 17, 18, 19, 20 ]
|
||||
}
|
||||
}
|
81
examples/fxpp_comp/src/impl.cpp
Normal file
81
examples/fxpp_comp/src/impl.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include "impl.h"
|
||||
|
||||
#include "common.h"
|
||||
#include <bw_comp.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
class Engine {
|
||||
public:
|
||||
Comp<1> comp;
|
||||
bool extSidechain;
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
Engine *instance = new Engine();
|
||||
instance->extSidechain = false;
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
Engine *instance = reinterpret_cast<Engine *>(handle);
|
||||
delete instance;
|
||||
}
|
||||
|
||||
void impl_set_sample_rate(impl handle, float sample_rate) {
|
||||
Engine *instance = reinterpret_cast<Engine *>(handle);
|
||||
instance->comp.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void impl_reset(impl handle) {
|
||||
Engine *instance = reinterpret_cast<Engine *>(handle);
|
||||
instance->comp.reset();
|
||||
}
|
||||
|
||||
void impl_set_parameter(impl handle, size_t index, float value) {
|
||||
Engine *instance = reinterpret_cast<Engine *>(handle);
|
||||
switch (index) {
|
||||
case 0:
|
||||
instance->comp.setThreshDBFS(value);
|
||||
break;
|
||||
case 1:
|
||||
instance->comp.setRatio(bw_rcpf(value));
|
||||
break;
|
||||
case 2:
|
||||
// using rise time 10% -> 90%: tau = rise time / log(9)
|
||||
instance->comp.setAttackTau((0.001f * 0.4551196133134186f) * value);
|
||||
break;
|
||||
case 3:
|
||||
// as before
|
||||
instance->comp.setReleaseTau((0.001f * 0.4551196133134186f) * value);
|
||||
break;
|
||||
case 4:
|
||||
instance->comp.setGainDB(value);
|
||||
break;
|
||||
case 5:
|
||||
instance->extSidechain = value >= 0.5f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float impl_get_parameter(impl handle, size_t index) {
|
||||
(void)handle;
|
||||
(void)index;
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
void impl_process(impl handle, const float **inputs, float **outputs, size_t n_samples) {
|
||||
Engine *instance = reinterpret_cast<Engine *>(handle);
|
||||
#ifdef WASM
|
||||
const float *x[1] = {inputs[0]};
|
||||
const float *xSc[1] = {instance->extSidechain ? inputs[1] : inputs[0]};
|
||||
float *y[1] = {outputs[0]};
|
||||
instance->comp.process(x, xSc, y, n_samples);
|
||||
#else
|
||||
instance->comp.process({inputs[0]}, {instance->extSidechain ? inputs[1] : inputs[0]}, {outputs[0]}, n_samples);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
5
examples/fxpp_comp/src/ios.json
Normal file
5
examples/fxpp_comp/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fxpp_comp"
|
||||
}
|
||||
}
|
12
examples/fxpp_comp/src/lv2.json
Normal file
12
examples/fxpp_comp/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fxpp_comp",
|
||||
"types": [ "@lv2:CompressorPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output", "sidechain_in" ],
|
||||
"parameterSymbols": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
|
||||
}
|
||||
}
|
95
examples/fxpp_comp/src/product.json
Normal file
95
examples/fxpp_comp/src/product.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickworks compressor example (C++)",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fxpp_comp",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Sidechain input",
|
||||
"shortName": "Sidechain in",
|
||||
"sidechain": true,
|
||||
"cv": false,
|
||||
"optional": true
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Threshold",
|
||||
"shortName": "Threshold",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -60.0,
|
||||
"maximum": 0.0,
|
||||
"unit": "db",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Ratio",
|
||||
"shortName": "Ratio",
|
||||
"direction": "input",
|
||||
"defaultValue": 1.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 20.0,
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "Attack",
|
||||
"shortName": "Attack",
|
||||
"direction": "input",
|
||||
"defaultValue": 20.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 2000.0,
|
||||
"unit": "ms",
|
||||
"map": "logarithmic"
|
||||
},
|
||||
{
|
||||
"name": "Release",
|
||||
"shortName": "Release",
|
||||
"direction": "input",
|
||||
"defaultValue": 250.0,
|
||||
"minimum": 1.0,
|
||||
"maximum": 2000.0,
|
||||
"unit": "ms",
|
||||
"map": "logarithmic"
|
||||
},
|
||||
{
|
||||
"name": "Makeup gain",
|
||||
"shortName": "Gain",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 40.0,
|
||||
"unit": "db",
|
||||
"map": "linear"
|
||||
},
|
||||
{
|
||||
"name": "External sidechain",
|
||||
"shortName": "Ext sidechain",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 1.0,
|
||||
"toggled": true,
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fxpp_comp/src/vst3.json
Normal file
11
examples/fxpp_comp/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "395834d5b4cb40b4a26ad106d342e89c"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "9fbc1f8fa974456ba43a4e14e5b11e9b"
|
||||
},
|
||||
"subCategory": "Fx|Dynamics"
|
||||
}
|
||||
}
|
@ -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 fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab"
|
||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_comp fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_comp"
|
||||
|
||||
for d in $dirs; do
|
||||
echo Removing data files for $d
|
||||
|
@ -26,7 +26,7 @@ cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/android-make android
|
||||
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios ios && cd ..
|
||||
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios-make ios && cd ..
|
||||
|
||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab"
|
||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_comp fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_comp"
|
||||
|
||||
for d in $dirs; do
|
||||
echo Generating data files for $d
|
||||
|
Loading…
Reference in New Issue
Block a user