fx(pp)_chorus + clean some examples + improve tibia_gen.sh
This commit is contained in:
parent
17ec290ae6
commit
74737a8787
@ -1,6 +0,0 @@
|
|||||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
||||||
|
|
||||||
NAME := bw_example_fx_chorus
|
|
||||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_chorus.c
|
|
||||||
|
|
||||||
include ${ROOT_DIR}/../../common/android/android.mk
|
|
@ -1,7 +0,0 @@
|
|||||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
||||||
|
|
||||||
TARGET = bw_example_fx_chorus
|
|
||||||
|
|
||||||
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_chorus.c
|
|
||||||
|
|
||||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
|
@ -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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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
|
|
@ -1,6 +0,0 @@
|
|||||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
||||||
|
|
||||||
NAME := bw_example_fx_chorus
|
|
||||||
SOURCE := ${NAME}.c
|
|
||||||
|
|
||||||
include ${ROOT_DIR}/../../common/ios/ios.mk
|
|
5
examples/fx_chorus/src/android.json
Normal file
5
examples/fx_chorus/src/android.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"android": {
|
||||||
|
"javaPackageName": "com.orastron.bw_example_fx_chorus"
|
||||||
|
}
|
||||||
|
}
|
@ -1,66 +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_chorus.h"
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_init(bw_example_fx_chorus *instance) {
|
|
||||||
bw_chorus_init(&instance->chorus_coeffs, 0.01f);
|
|
||||||
bw_chorus_set_delay(&instance->chorus_coeffs, 0.005f);
|
|
||||||
bw_chorus_set_coeff_x(&instance->chorus_coeffs, 0.7071f);
|
|
||||||
bw_chorus_set_coeff_mod(&instance->chorus_coeffs, 1.f);
|
|
||||||
bw_chorus_set_coeff_fb(&instance->chorus_coeffs, -0.7071f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_set_sample_rate(bw_example_fx_chorus *instance, float sample_rate) {
|
|
||||||
bw_chorus_set_sample_rate(&instance->chorus_coeffs, sample_rate);
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance) {
|
|
||||||
return bw_chorus_mem_req(&instance->chorus_coeffs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_mem_set(bw_example_fx_chorus *instance, void *mem) {
|
|
||||||
bw_chorus_mem_set(&instance->chorus_coeffs, &instance->chorus_state, mem);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_reset(bw_example_fx_chorus *instance) {
|
|
||||||
bw_chorus_reset_coeffs(&instance->chorus_coeffs);
|
|
||||||
bw_chorus_reset_state(&instance->chorus_coeffs, &instance->chorus_state, 0.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_process(bw_example_fx_chorus *instance, const float** x, float** y, int n_samples) {
|
|
||||||
bw_chorus_process(&instance->chorus_coeffs, &instance->chorus_state, x[0], y[0], n_samples);
|
|
||||||
}
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_set_parameter(bw_example_fx_chorus *instance, int index, float value) {
|
|
||||||
instance->params[index] = value;
|
|
||||||
switch (index) {
|
|
||||||
case p_rate:
|
|
||||||
bw_chorus_set_rate(&instance->chorus_coeffs, 0.01f + 1.99f * value * value * value);
|
|
||||||
break;
|
|
||||||
case p_depth:
|
|
||||||
bw_chorus_set_amount(&instance->chorus_coeffs, 0.004f * value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
float bw_example_fx_chorus_get_parameter(bw_example_fx_chorus *instance, int index) {
|
|
||||||
return instance->params[index];
|
|
||||||
}
|
|
@ -1,61 +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_CHORUS_H
|
|
||||||
#define _BW_EXAMPLE_FX_CHORUS_H
|
|
||||||
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
#include <bw_chorus.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum {
|
|
||||||
p_rate,
|
|
||||||
p_depth,
|
|
||||||
p_n
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _bw_example_fx_chorus {
|
|
||||||
// Sub-components
|
|
||||||
bw_chorus_coeffs chorus_coeffs;
|
|
||||||
bw_chorus_state chorus_state;
|
|
||||||
|
|
||||||
// Parameters
|
|
||||||
float params[p_n];
|
|
||||||
};
|
|
||||||
typedef struct _bw_example_fx_chorus bw_example_fx_chorus;
|
|
||||||
|
|
||||||
void bw_example_fx_chorus_init(bw_example_fx_chorus *instance);
|
|
||||||
void bw_example_fx_chorus_set_sample_rate(bw_example_fx_chorus *instance, float sample_rate);
|
|
||||||
size_t bw_example_fx_chorus_mem_req(bw_example_fx_chorus *instance);
|
|
||||||
void bw_example_fx_chorus_mem_set(bw_example_fx_chorus *instance, void *mem);
|
|
||||||
void bw_example_fx_chorus_reset(bw_example_fx_chorus *instance);
|
|
||||||
void bw_example_fx_chorus_process(bw_example_fx_chorus *instance, const float** x, float** y, int n_samples);
|
|
||||||
void bw_example_fx_chorus_set_parameter(bw_example_fx_chorus *instance, int index, float value);
|
|
||||||
float bw_example_fx_chorus_get_parameter(bw_example_fx_chorus *instance, int index);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
6
examples/fx_chorus/src/cmd.json
Normal file
6
examples/fx_chorus/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cmd": {
|
||||||
|
"busIds": [ "input", "output" ],
|
||||||
|
"parameterIds": [ "rate", "depth", "type" ]
|
||||||
|
}
|
||||||
|
}
|
@ -1,90 +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_chorus"
|
|
||||||
#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 2
|
|
||||||
|
|
||||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
|
||||||
{ "Rate", "Rate", "", 0, 0, 0, 0.5f },
|
|
||||||
{ "Depth", "Depth", "", 0, 0, 0, 0.5f },
|
|
||||||
};
|
|
||||||
|
|
||||||
// Internal API
|
|
||||||
|
|
||||||
#include "bw_example_fx_chorus.h"
|
|
||||||
|
|
||||||
#define P_TYPE bw_example_fx_chorus
|
|
||||||
#define P_INIT bw_example_fx_chorus_init
|
|
||||||
#define P_SET_SAMPLE_RATE bw_example_fx_chorus_set_sample_rate
|
|
||||||
#define P_MEM_REQ bw_example_fx_chorus_mem_req
|
|
||||||
#define P_MEM_SET bw_example_fx_chorus_mem_set
|
|
||||||
#define P_RESET bw_example_fx_chorus_reset
|
|
||||||
#define P_PROCESS bw_example_fx_chorus_process
|
|
||||||
#define P_SET_PARAMETER bw_example_fx_chorus_set_parameter
|
|
||||||
#define P_GET_PARAMETER bw_example_fx_chorus_get_parameter
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Brickworks
|
|
||||||
*
|
|
||||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
|
||||||
*
|
|
||||||
* Brickworks is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, version 3 of the License.
|
|
||||||
*
|
|
||||||
* Brickworks is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* File author: Stefano D'Angelo
|
|
||||||
*/
|
|
||||||
|
|
||||||
var buses = [
|
|
||||||
{
|
|
||||||
stereo: false,
|
|
||||||
output: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
stereo: false,
|
|
||||||
output: true
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
var parameters = [
|
|
||||||
{
|
|
||||||
name: "Rate",
|
|
||||||
output: false,
|
|
||||||
defaultValue: 0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Amount",
|
|
||||||
output: false,
|
|
||||||
defaultValue: 0.5
|
|
||||||
}
|
|
||||||
];
|
|
5
examples/fx_chorus/src/daisy-seed.json
Normal file
5
examples/fx_chorus/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"daisy_seed": {
|
||||||
|
"parameterPins": [ 15, 16, 17 ]
|
||||||
|
}
|
||||||
|
}
|
5
examples/fx_chorus/src/ios.json
Normal file
5
examples/fx_chorus/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"ios": {
|
||||||
|
"productBundleIdentifier": "com.orastron.bw_example_fx_chorus"
|
||||||
|
}
|
||||||
|
}
|
12
examples/fx_chorus/src/lv2.json
Normal file
12
examples/fx_chorus/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"lv2": {
|
||||||
|
"prefixes": {
|
||||||
|
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||||
|
},
|
||||||
|
"uri": "@bw_examples:fx_chorus",
|
||||||
|
"types": [ "@lv2:ChorusPlugin" ],
|
||||||
|
"version": "1.0",
|
||||||
|
"busSymbols": [ "input", "output" ],
|
||||||
|
"parameterSymbols": [ "rate", "depth", "type" ]
|
||||||
|
}
|
||||||
|
}
|
66
examples/fx_chorus/src/plugin.h
Normal file
66
examples/fx_chorus/src/plugin.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#include "common.h"
|
||||||
|
#include <bw_chorus.h>
|
||||||
|
|
||||||
|
typedef struct plugin {
|
||||||
|
bw_chorus_coeffs chorus_coeffs;
|
||||||
|
bw_chorus_state chorus_state;
|
||||||
|
} plugin;
|
||||||
|
|
||||||
|
static void plugin_init(plugin*instance) {
|
||||||
|
bw_chorus_init(&instance->chorus_coeffs, 0.01f);
|
||||||
|
bw_chorus_set_delay(&instance->chorus_coeffs, 0.005f);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void plugin_fini(plugin *instance) {
|
||||||
|
(void)instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||||
|
bw_chorus_set_sample_rate(&instance->chorus_coeffs, sample_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
static size_t plugin_mem_req(plugin *instance) {
|
||||||
|
return bw_chorus_mem_req(&instance->chorus_coeffs);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||||
|
bw_chorus_mem_set(&instance->chorus_coeffs, &instance->chorus_state, mem);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void plugin_reset(plugin *instance) {
|
||||||
|
bw_chorus_reset_coeffs(&instance->chorus_coeffs);
|
||||||
|
bw_chorus_reset_state(&instance->chorus_coeffs, &instance->chorus_state, 0.f);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
bw_chorus_set_rate(&instance->chorus_coeffs, value);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
bw_chorus_set_amount(&instance->chorus_coeffs, (0.01f * 0.004f) * value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// values taken from Dattorro's paper
|
||||||
|
if (value < 1.5f) { // "Industry standard chorus"
|
||||||
|
bw_chorus_set_coeff_x(&instance->chorus_coeffs, 1.f);
|
||||||
|
bw_chorus_set_coeff_mod(&instance->chorus_coeffs, 0.7071f);
|
||||||
|
bw_chorus_set_coeff_fb(&instance->chorus_coeffs, 0.f);
|
||||||
|
} else { // "White chorus"
|
||||||
|
bw_chorus_set_coeff_x(&instance->chorus_coeffs, 0.7071f);
|
||||||
|
bw_chorus_set_coeff_mod(&instance->chorus_coeffs, 1.f);
|
||||||
|
bw_chorus_set_coeff_fb(&instance->chorus_coeffs, -0.7071f);
|
||||||
|
}
|
||||||
|
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_chorus_process(&instance->chorus_coeffs, &instance->chorus_state, inputs[0], outputs[0], n_samples);
|
||||||
|
}
|
61
examples/fx_chorus/src/product.json
Normal file
61
examples/fx_chorus/src/product.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"product": {
|
||||||
|
"name": "Brickwork chorus example",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"buildVersion": "1",
|
||||||
|
"bundleName": "bw_example_fx_chorus",
|
||||||
|
"buses": [
|
||||||
|
{
|
||||||
|
"type": "audio",
|
||||||
|
"direction": "input",
|
||||||
|
"channels": "mono",
|
||||||
|
"name": "Input",
|
||||||
|
"shortName": "Input"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "audio",
|
||||||
|
"direction": "output",
|
||||||
|
"channels": "mono",
|
||||||
|
"name": "Output",
|
||||||
|
"shortName": "Output"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Rate",
|
||||||
|
"shortName": "Rate",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 1.0,
|
||||||
|
"minimum": 0.01,
|
||||||
|
"maximum": 20.0,
|
||||||
|
"unit": "hz",
|
||||||
|
"map": "logarithmic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Depth",
|
||||||
|
"shortName": "Depth",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 50.0,
|
||||||
|
"minimum": 0.0,
|
||||||
|
"maximum": 100.0,
|
||||||
|
"unit": "pc",
|
||||||
|
"map": "linear"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Type",
|
||||||
|
"shortName": "Type",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 1,
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 2,
|
||||||
|
"integer": true,
|
||||||
|
"scalePoints": {
|
||||||
|
"Standard": 1,
|
||||||
|
"White": 2
|
||||||
|
},
|
||||||
|
"list": true,
|
||||||
|
"map": "linear"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
11
examples/fx_chorus/src/vst3.json
Normal file
11
examples/fx_chorus/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"vst3": {
|
||||||
|
"plugin": {
|
||||||
|
"cid": "0715578d81f14d84b5cb3f8c2c86b83e"
|
||||||
|
},
|
||||||
|
"controller": {
|
||||||
|
"cid": "5bf9980b4f564a04bac8690c14712352"
|
||||||
|
},
|
||||||
|
"subCategory": "Fx|Modulation"
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
||||||
|
|
||||||
NAME := bw_example_fx_chorus
|
|
||||||
SOURCE := bw_example_fx_chorus.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|Modulation"
|
|
||||||
|
|
||||||
#define PLUGIN_GUID_1 0x0715578d
|
|
||||||
#define PLUGIN_GUID_2 0x81f14d84
|
|
||||||
#define PLUGIN_GUID_3 0xb5cb3f8c
|
|
||||||
#define PLUGIN_GUID_4 0x2c86b83e
|
|
||||||
|
|
||||||
#define CTRL_GUID_1 0x5bf9980b
|
|
||||||
#define CTRL_GUID_2 0x4f564a04
|
|
||||||
#define CTRL_GUID_3 0xbac8690c
|
|
||||||
#define CTRL_GUID_4 0x14712352
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +0,0 @@
|
|||||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
|
||||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_chorus.c
|
|
||||||
NEEDS_MEMSET := yes
|
|
||||||
|
|
||||||
include ${ROOT_DIR}/../../common/web/web.mk
|
|
@ -9,7 +9,6 @@ typedef struct plugin {
|
|||||||
|
|
||||||
static void plugin_init(plugin *instance) {
|
static void plugin_init(plugin *instance) {
|
||||||
bw_comp_init(&instance->comp_coeffs);
|
bw_comp_init(&instance->comp_coeffs);
|
||||||
instance->ext_sidechain = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_fini(plugin *instance) {
|
static void plugin_fini(plugin *instance) {
|
||||||
|
5
examples/fxpp_chorus/src/android.json
Normal file
5
examples/fxpp_chorus/src/android.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"android": {
|
||||||
|
"javaPackageName": "com.orastron.bw_example_fxpp_chorus"
|
||||||
|
}
|
||||||
|
}
|
6
examples/fxpp_chorus/src/cmd.json
Normal file
6
examples/fxpp_chorus/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cmd": {
|
||||||
|
"busIds": [ "input", "output" ],
|
||||||
|
"parameterIds": [ "rate", "depth", "type" ]
|
||||||
|
}
|
||||||
|
}
|
5
examples/fxpp_chorus/src/daisy-seed.json
Normal file
5
examples/fxpp_chorus/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"daisy_seed": {
|
||||||
|
"parameterPins": [ 15, 16, 17 ]
|
||||||
|
}
|
||||||
|
}
|
66
examples/fxpp_chorus/src/impl.cpp
Normal file
66
examples/fxpp_chorus/src/impl.cpp
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#include "impl.h"
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include <bw_chorus.h>
|
||||||
|
|
||||||
|
using namespace Brickworks;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
impl impl_new(void) {
|
||||||
|
Chorus<1> *instance = new Chorus<1>(0.005f);
|
||||||
|
instance->setDelay(0.005f);
|
||||||
|
return reinterpret_cast<impl>(instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
void impl_free(impl handle) {
|
||||||
|
Chorus<1> *instance = reinterpret_cast<Chorus<1> *>(handle);
|
||||||
|
delete instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void impl_set_sample_rate(impl handle, float sample_rate) {
|
||||||
|
Chorus<1> *instance = reinterpret_cast<Chorus<1> *>(handle);
|
||||||
|
instance->setSampleRate(sample_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
void impl_reset(impl handle) {
|
||||||
|
Chorus<1> *instance = reinterpret_cast<Chorus<1> *>(handle);
|
||||||
|
instance->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void impl_set_parameter(impl handle, size_t index, float value) {
|
||||||
|
Chorus<1> *instance = reinterpret_cast<Chorus<1> *>(handle);
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
instance->setRate(value);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
instance->setAmount((0.01f * 0.004f) * value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// values taken from Dattorro's paper
|
||||||
|
if (value < 1.5f) { // "Industry standard chorus"
|
||||||
|
instance->setCoeffX(1.f);
|
||||||
|
instance->setCoeffMod(0.7071f);
|
||||||
|
instance->setCoeffFB(0.f);
|
||||||
|
} else { // "White chorus"
|
||||||
|
instance->setCoeffX(0.7071f);
|
||||||
|
instance->setCoeffMod(1.f);
|
||||||
|
instance->setCoeffFB(-0.7071f);
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
Chorus<1> *instance = reinterpret_cast<Chorus<1> *>(handle);
|
||||||
|
instance->process(inputs, outputs, n_samples);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
5
examples/fxpp_chorus/src/ios.json
Normal file
5
examples/fxpp_chorus/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"ios": {
|
||||||
|
"productBundleIdentifier": "com.orastron.bw_example_fxpp_chorus"
|
||||||
|
}
|
||||||
|
}
|
12
examples/fxpp_chorus/src/lv2.json
Normal file
12
examples/fxpp_chorus/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"lv2": {
|
||||||
|
"prefixes": {
|
||||||
|
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||||
|
},
|
||||||
|
"uri": "@bw_examples:fxpp_chorus",
|
||||||
|
"types": [ "@lv2:ChorusPlugin" ],
|
||||||
|
"version": "1.0",
|
||||||
|
"busSymbols": [ "input", "output" ],
|
||||||
|
"parameterSymbols": [ "rate", "depth", "type" ]
|
||||||
|
}
|
||||||
|
}
|
61
examples/fxpp_chorus/src/product.json
Normal file
61
examples/fxpp_chorus/src/product.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"product": {
|
||||||
|
"name": "Brickwork chorus example (C++)",
|
||||||
|
"version": "1.1.0",
|
||||||
|
"buildVersion": "1",
|
||||||
|
"bundleName": "bw_example_fxpp_chorus",
|
||||||
|
"buses": [
|
||||||
|
{
|
||||||
|
"type": "audio",
|
||||||
|
"direction": "input",
|
||||||
|
"channels": "mono",
|
||||||
|
"name": "Input",
|
||||||
|
"shortName": "Input"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "audio",
|
||||||
|
"direction": "output",
|
||||||
|
"channels": "mono",
|
||||||
|
"name": "Output",
|
||||||
|
"shortName": "Output"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Rate",
|
||||||
|
"shortName": "Rate",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 1.0,
|
||||||
|
"minimum": 0.01,
|
||||||
|
"maximum": 20.0,
|
||||||
|
"unit": "hz",
|
||||||
|
"map": "logarithmic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Depth",
|
||||||
|
"shortName": "Depth",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 50.0,
|
||||||
|
"minimum": 0.0,
|
||||||
|
"maximum": 100.0,
|
||||||
|
"unit": "pc",
|
||||||
|
"map": "linear"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Type",
|
||||||
|
"shortName": "Type",
|
||||||
|
"direction": "input",
|
||||||
|
"defaultValue": 1,
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 2,
|
||||||
|
"integer": true,
|
||||||
|
"scalePoints": {
|
||||||
|
"Standard": 1,
|
||||||
|
"White": 2
|
||||||
|
},
|
||||||
|
"list": true,
|
||||||
|
"map": "linear"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
11
examples/fxpp_chorus/src/vst3.json
Normal file
11
examples/fxpp_chorus/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"vst3": {
|
||||||
|
"plugin": {
|
||||||
|
"cid": "2e8ed1acdf634f02b5cf45568f64bd42"
|
||||||
|
},
|
||||||
|
"controller": {
|
||||||
|
"cid": "7022c6fdb38b49d28df5303a2c632f6a"
|
||||||
|
},
|
||||||
|
"subCategory": "Fx|Modulation"
|
||||||
|
}
|
||||||
|
}
|
@ -15,7 +15,6 @@ extern "C" {
|
|||||||
|
|
||||||
impl impl_new(void) {
|
impl impl_new(void) {
|
||||||
Engine *instance = new Engine();
|
Engine *instance = new Engine();
|
||||||
instance->extSidechain = false;
|
|
||||||
return reinterpret_cast<impl>(instance);
|
return reinterpret_cast<impl>(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,10 +36,7 @@ static void plugin_init(plugin *instance) {
|
|||||||
bw_env_gen_init(&instance->env_gen_coeffs);
|
bw_env_gen_init(&instance->env_gen_coeffs);
|
||||||
bw_gain_init(&instance->gain_coeffs);
|
bw_gain_init(&instance->gain_coeffs);
|
||||||
bw_ppm_init(&instance->ppm_coeffs);
|
bw_ppm_init(&instance->ppm_coeffs);
|
||||||
|
|
||||||
bw_osc_pulse_set_antialiasing(&instance->osc_pulse_coeffs, 1);
|
bw_osc_pulse_set_antialiasing(&instance->osc_pulse_coeffs, 1);
|
||||||
|
|
||||||
instance->master_tune = 440.f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plugin_fini(plugin *instance) {
|
static void plugin_fini(plugin *instance) {
|
||||||
|
@ -36,7 +36,6 @@ extern "C" {
|
|||||||
impl impl_new(void) {
|
impl impl_new(void) {
|
||||||
Engine *instance = new Engine();
|
Engine *instance = new Engine();
|
||||||
instance->oscPulse.setAntialiasing(true);
|
instance->oscPulse.setAntialiasing(true);
|
||||||
instance->masterTune = 440.f;
|
|
||||||
return reinterpret_cast<impl>(instance);
|
return reinterpret_cast<impl>(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
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_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_comp synthpp_simple"
|
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_comp synthpp_simple"
|
||||||
|
|
||||||
for d in $dirs; do
|
for d in $dirs; do
|
||||||
echo Removing data files for $d
|
echo Removing data files for $d
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
TIBIA_DIR=../../../tibia
|
TIBIA_DIR=../../../tibia
|
||||||
|
|
||||||
|
if [ -z "$1" -o "$1" = "common" ]; then
|
||||||
echo Generating common files
|
echo Generating common files
|
||||||
|
|
||||||
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/cmd cmd && cd ..
|
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/cmd cmd && cd ..
|
||||||
@ -25,8 +26,17 @@ 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 ios && cd ..
|
||||||
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios-make ios && cd ..
|
cd common && $TIBIA_DIR/tibia --common $TIBIA_DIR/templates/ios-make ios && cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_comp synthpp_simple"
|
if [ "$1" = "common" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_comp synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_comp synthpp_simple"
|
||||||
|
else
|
||||||
|
dirs="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
for d in $dirs; do
|
for d in $dirs; do
|
||||||
echo Generating data files for $d
|
echo Generating data files for $d
|
||||||
|
Loading…
Reference in New Issue
Block a user