fx(pp)_svf + no more tibia_{clean,gen}.sh juggling

This commit is contained in:
Stefano D'Angelo 2024-02-16 09:43:18 +01:00
parent 3982f14211
commit 1226e9797d
65 changed files with 345 additions and 953 deletions

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_svf
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_svf.c
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_fx_svf
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_svf.c
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -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

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_svf
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -0,0 +1,5 @@
{
"android": {
"javaPackageName": "com.orastron.bw_example_fx_svf"
}
}

View File

@ -1,55 +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_svf.h"
void bw_example_fx_svf_init(bw_example_fx_svf *instance) {
bw_svf_init(&instance->svf_coeffs);
}
void bw_example_fx_svf_set_sample_rate(bw_example_fx_svf *instance, float sample_rate) {
bw_svf_set_sample_rate(&instance->svf_coeffs, sample_rate);
}
void bw_example_fx_svf_reset(bw_example_fx_svf *instance) {
bw_svf_reset_coeffs(&instance->svf_coeffs);
float v_lp, v_bp, v_hp;
bw_svf_reset_state(&instance->svf_coeffs, &instance->svf_state, 0.f, &v_lp, &v_bp, &v_hp);
}
void bw_example_fx_svf_process(bw_example_fx_svf *instance, const float** x, float** y, int n_samples) {
bw_svf_process(&instance->svf_coeffs, &instance->svf_state, x[0], y[0], NULL, NULL, n_samples);
}
void bw_example_fx_svf_set_parameter(bw_example_fx_svf *instance, int index, float value) {
instance->params[index] = value;
switch (index) {
case p_cutoff:
bw_svf_set_cutoff(&instance->svf_coeffs, (20e3f - 20.f) * value * value * value + 20.f);
break;
case p_Q:
bw_svf_set_Q(&instance->svf_coeffs, 0.5f + 9.5f * value);
break;
}
}
float bw_example_fx_svf_get_parameter(bw_example_fx_svf *instance, int index) {
return instance->params[index];
}

View File

@ -1,59 +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_SVF_H
#define _BW_EXAMPLE_FX_SVF_H
#include "platform.h"
#include <bw_svf.h>
#ifdef __cplusplus
extern "C" {
#endif
enum {
p_cutoff,
p_Q,
p_n
};
struct _bw_example_fx_svf {
// Sub-components
bw_svf_coeffs svf_coeffs;
bw_svf_state svf_state;
// Parameters
float params[p_n];
};
typedef struct _bw_example_fx_svf bw_example_fx_svf;
void bw_example_fx_svf_init(bw_example_fx_svf *instance);
void bw_example_fx_svf_set_sample_rate(bw_example_fx_svf *instance, float sample_rate);
void bw_example_fx_svf_reset(bw_example_fx_svf *instance);
void bw_example_fx_svf_process(bw_example_fx_svf *instance, const float** x, float** y, int n_samples);
void bw_example_fx_svf_set_parameter(bw_example_fx_svf *instance, int index, float value);
float bw_example_fx_svf_get_parameter(bw_example_fx_svf *instance, int index);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,6 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "cutoff", "q" ]
}
}

View File

@ -1,88 +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_svf"
#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] = {
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
{ "Q", "Q", "", 0, 0, 0, 0.f }
};
// Internal API
#include "bw_example_fx_svf.h"
#define P_TYPE bw_example_fx_svf
#define P_INIT bw_example_fx_svf_init
#define P_SET_SAMPLE_RATE bw_example_fx_svf_set_sample_rate
#define P_RESET bw_example_fx_svf_reset
#define P_PROCESS bw_example_fx_svf_process
#define P_SET_PARAMETER bw_example_fx_svf_set_parameter
#define P_GET_PARAMETER bw_example_fx_svf_get_parameter
#endif

View File

@ -1,43 +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: "Cutoff",
output: false,
defaultValue: 0.5
},
{
name: "Q",
output: false,
defaultValue: 0.0
}
];

View File

@ -0,0 +1,5 @@
{
"daisy_seed": {
"parameterPins": [ 15, 16 ]
}
}

View File

@ -0,0 +1,5 @@
{
"ios": {
"productBundleIdentifier": "com.orastron.bw_example_fx_svf"
}
}

View File

@ -0,0 +1,12 @@
{
"lv2": {
"prefixes": {
"bw_examples": "https://www.orastron.com/brickworks/examples/"
},
"uri": "@bw_examples:fx_svf",
"types": [ "@lv2:LowpassPlugin" ],
"version": "1.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff", "q" ]
}
}

View File

@ -0,0 +1,56 @@
#include "common.h"
#include <bw_svf.h>
typedef struct plugin {
bw_svf_coeffs svf_coeffs;
bw_svf_state svf_state;
} plugin;
static void plugin_init(plugin *instance) {
bw_svf_init(&instance->svf_coeffs);
}
static void plugin_fini(plugin *instance) {
(void)instance;
}
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
bw_svf_set_sample_rate(&instance->svf_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_svf_reset_coeffs(&instance->svf_coeffs);
float v_lp, v_bp, v_hp;
bw_svf_reset_state(&instance->svf_coeffs, &instance->svf_state, 0.f, &v_lp, &v_bp, &v_hp);
}
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
bw_svf_set_cutoff(&instance->svf_coeffs, value);
break;
case 1:
bw_svf_set_Q(&instance->svf_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_svf_process(&instance->svf_coeffs, &instance->svf_state, inputs[0], outputs[0], NULL, NULL, n_samples);
}

View File

@ -0,0 +1,45 @@
{
"product": {
"name": "Brickworks state variable filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_svf",
"buses": [
{
"type": "audio",
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,
"maximum": 20000.0,
"unit": "hz",
"map": "logarithmic"
},
{
"name": "Q",
"shortName": "Q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,
"maximum": 10.0,
"map": "linear"
}
]
}
}

View File

@ -0,0 +1,11 @@
{
"vst3": {
"plugin": {
"cid": "38ebec3f24fe43e794ff4552d09f9716"
},
"controller": {
"cid": "41a5db7d15af468f9e63697f21facb4f"
},
"subCategory": "Fx|Filter"
}
}

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_svf
SOURCE := bw_example_fx_svf.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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|Filter"
#define PLUGIN_GUID_1 0x38ebec3f
#define PLUGIN_GUID_2 0x24fe43e7
#define PLUGIN_GUID_3 0x94ff4552
#define PLUGIN_GUID_4 0xd09f9716
#define CTRL_GUID_1 0x41a5db7d
#define CTRL_GUID_2 0x15af468f
#define CTRL_GUID_3 0x9e63697f
#define CTRL_GUID_4 0x21facb4f
#endif

View File

@ -1,4 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_svf.c
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_trem
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_trem.c
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_fx_trem
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_trem.c
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -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

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_trem
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_trem
SOURCE := bw_example_fx_trem.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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 0xf26324d0
#define PLUGIN_GUID_2 0x66ed4652
#define PLUGIN_GUID_3 0x9197bb20
#define PLUGIN_GUID_4 0xf6bfc407
#define CTRL_GUID_1 0x17fcf5e1
#define CTRL_GUID_2 0x93154192
#define CTRL_GUID_3 0x8264849e
#define CTRL_GUID_4 0x22e52112
#endif

View File

@ -1,4 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_trem.c
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_vibrato
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_vibrato.c
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_fx_vibrato
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_vibrato.c
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -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

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_vibrato
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_vibrato
SOURCE := bw_example_fx_vibrato.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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 0x3356ce15
#define PLUGIN_GUID_2 0x9a104154
#define PLUGIN_GUID_3 0x835fcf71
#define PLUGIN_GUID_4 0xbaca0d28
#define CTRL_GUID_1 0xfc98ee02
#define CTRL_GUID_2 0xf56b4e5a
#define CTRL_GUID_3 0xa448d84c
#define CTRL_GUID_4 0xab1f3c15
#endif

View File

@ -1,5 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_vibrato.c
NEEDS_MEMSET := yes
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_wah
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_wah.c
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_fx_wah
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_wah.c
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -1,35 +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 1
static struct config_pin config_pins[NUM_PINS] = {
{ 0, 15 }
};
#endif

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_wah
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_fx_wah
SOURCE := bw_example_fx_wah.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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|Filter"
#define PLUGIN_GUID_1 0x487359a7
#define PLUGIN_GUID_2 0x066e4c8b
#define PLUGIN_GUID_3 0x93e3a38a
#define PLUGIN_GUID_4 0x7e478d37
#define CTRL_GUID_1 0x345f339c
#define CTRL_GUID_2 0x27d344ef
#define CTRL_GUID_3 0x937537d5
#define CTRL_GUID_4 0xbacab2a6
#endif

View File

@ -1,4 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_wah.c
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -0,0 +1,5 @@
{
"android": {
"javaPackageName": "com.orastron.bw_example_fxpp_svf"
}
}

View File

@ -0,0 +1,6 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "cutoff", "q" ]
}
}

View File

@ -0,0 +1,5 @@
{
"daisy_seed": {
"parameterPins": [ 15, 16 ]
}
}

View File

@ -0,0 +1,53 @@
#include "impl.h"
#include "common.h"
#include <bw_svf.h>
using namespace Brickworks;
extern "C" {
impl impl_new(void) {
SVF<1> *instance = new SVF<1>();
return reinterpret_cast<impl>(instance);
}
void impl_free(impl handle) {
SVF<1> *instance = reinterpret_cast<SVF<1> *>(handle);
delete instance;
}
void impl_set_sample_rate(impl handle, float sample_rate) {
SVF<1> *instance = reinterpret_cast<SVF<1> *>(handle);
instance->setSampleRate(sample_rate);
}
void impl_reset(impl handle) {
SVF<1> *instance = reinterpret_cast<SVF<1> *>(handle);
instance->reset();
}
void impl_set_parameter(impl handle, size_t index, float value) {
SVF<1> *instance = reinterpret_cast<SVF<1> *>(handle);
switch (index) {
case 0:
instance->setCutoff(value);
break;
case 1:
instance->setQ(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) {
SVF<1> *instance = reinterpret_cast<SVF<1> *>(handle);
instance->process(inputs, outputs, nullptr, nullptr, n_samples);
}
}

View File

@ -0,0 +1,5 @@
{
"ios": {
"productBundleIdentifier": "com.orastron.bw_example_fxpp_svf"
}
}

View File

@ -0,0 +1,12 @@
{
"lv2": {
"prefixes": {
"bw_examples": "https://www.orastron.com/brickworks/examples/"
},
"uri": "@bw_examples:fxpp_svf",
"types": [ "@lv2:LowpassPlugin" ],
"version": "1.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff", "q" ]
}
}

View File

@ -0,0 +1,56 @@
#include "common.h"
#include <bw_svf.h>
typedef struct plugin {
bw_svf_coeffs svf_coeffs;
bw_svf_state svf_state;
} plugin;
static void plugin_init(plugin *instance) {
bw_svf_init(&instance->svf_coeffs);
}
static void plugin_fini(plugin *instance) {
(void)instance;
}
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
bw_svf_set_sample_rate(&instance->svf_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_svf_reset_coeffs(&instance->svf_coeffs);
float v_lp, v_bp, v_hp;
bw_svf_reset_state(&instance->svf_coeffs, &instance->svf_state, 0.f, &v_lp, &v_bp, &v_hp);
}
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
bw_svf_set_cutoff(&instance->svf_coeffs, value);
break;
case 1:
bw_svf_set_Q(&instance->svf_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_svf_process(&instance->svf_coeffs, &instance->svf_state, inputs[0], outputs[0], NULL, NULL, n_samples);
}

View File

@ -0,0 +1,45 @@
{
"product": {
"name": "Brickworks state variable filter example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_svf",
"buses": [
{
"type": "audio",
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,
"maximum": 20000.0,
"unit": "hz",
"map": "logarithmic"
},
{
"name": "Q",
"shortName": "Q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,
"maximum": 10.0,
"map": "linear"
}
]
}
}

View File

@ -0,0 +1,11 @@
{
"vst3": {
"plugin": {
"cid": "f0b3ea08a3ab4e7ca2b56d6497cb49b3"
},
"controller": {
"cid": "fdc70e1401114f178d1cccd69988f6df"
},
"subCategory": "Fx|Filter"
}
}

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_mono
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_synth_mono.c
SYNTH := yes
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_synth_mono
C_SOURCES += ${ROOT_DIR}/../src/bw_example_synth_mono.c
SYNTH := yes
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -1,72 +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_cc {
int param_index;
unsigned char cc;
};
#define NUM_CCS 38
static struct config_cc config_ccs[NUM_CCS] = {
{ 0, 7 }, // Volume
{ 1, 3 }, // Master tune
{ 2, 5 }, // Portamento
{ 3, 9 }, // Modulation mix
{ 4, 14 }, // VCO1 modulation
{ 5, 15 }, // VCO1 coarse
{ 6, 20 }, // VCO1 fine
{ 7, 21 }, // VCO1 waveform
{ 8, 22 }, // VCO1 pulse width/slope
{ 9, 23 }, // VCO1 level
{ 10, 24 }, // VCO2 modulation
{ 11, 25 }, // VCO2 coarse
{ 12, 26 }, // VCO2 fine
{ 13, 27 }, // VCO2 waveform
{ 14, 28 }, // VCO2 pulse width/slope
{ 15, 29 }, // VCO2 level
{ 16, 30 }, // VCO3 keyboard control
{ 17, 31 }, // VCO3 coarse
{ 18, 85 }, // VCO3 fine
{ 19, 86 }, // VCO3 waveform
{ 20, 87 }, // VCO3 puslse width/slope
{ 21, 89 }, // VCO3 level
{ 22, 90 }, // Noise color
{ 23, 102 }, // Noise level
{ 24, 103 }, // VCF modulation
{ 25, 104 }, // VCF keyboard control
{ 26, 74 }, // VCF cutoff
{ 27, 71 }, // VCF Q
{ 28, 105 }, // VCF contour
{ 29, 106 }, // VCF attack
{ 30, 107 }, // VCF decay
{ 31, 108 }, // VCF sustain
{ 32, 109 }, // VCF release
{ 33, 73 }, // VCA attack
{ 34, 110 }, // VCA decay
{ 35, 111 }, // VCA sustain
{ 36, 72 }, // VCA release
{ 37, 112 } // A440
};
#endif

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_mono
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_mono
SOURCE := bw_example_synth_mono.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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 "Instrument|Synth"
#define PLUGIN_GUID_1 0x5af9b172
#define PLUGIN_GUID_2 0x95ef439c
#define PLUGIN_GUID_3 0xb10ed6f0
#define PLUGIN_GUID_4 0xb962eef1
#define CTRL_GUID_1 0xed4990b0
#define CTRL_GUID_2 0x89894215
#define CTRL_GUID_3 0x96fc7cda
#define CTRL_GUID_4 0x5a56cec9
#endif

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_synth_mono.c
SYNTH := yes
NEEDS_MEMSET := yes
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -1,7 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_poly
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_synth_poly.c
SYNTH := yes
include ${ROOT_DIR}/../../common/android/android.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TARGET = bw_example_synth_poly
C_SOURCES += ${ROOT_DIR}/../src/bw_example_synth_poly.c
SYNTH := yes
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk

View File

@ -1,72 +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_cc {
int param_index;
unsigned char cc;
};
#define NUM_CCS 38
static struct config_cc config_ccs[NUM_CCS] = {
{ 0, 7 }, // Volume
{ 1, 3 }, // Master tune
{ 2, 5 }, // Portamento
{ 3, 9 }, // Modulation mix
{ 4, 14 }, // VCO1 modulation
{ 5, 15 }, // VCO1 coarse
{ 6, 20 }, // VCO1 fine
{ 7, 21 }, // VCO1 waveform
{ 8, 22 }, // VCO1 pulse width/slope
{ 9, 23 }, // VCO1 level
{ 10, 24 }, // VCO2 modulation
{ 11, 25 }, // VCO2 coarse
{ 12, 26 }, // VCO2 fine
{ 13, 27 }, // VCO2 waveform
{ 14, 28 }, // VCO2 pulse width/slope
{ 15, 29 }, // VCO2 level
{ 16, 30 }, // VCO3 keyboard control
{ 17, 31 }, // VCO3 coarse
{ 18, 85 }, // VCO3 fine
{ 19, 86 }, // VCO3 waveform
{ 20, 87 }, // VCO3 puslse width/slope
{ 21, 89 }, // VCO3 level
{ 22, 90 }, // Noise color
{ 23, 102 }, // Noise level
{ 24, 103 }, // VCF modulation
{ 25, 104 }, // VCF keyboard control
{ 26, 74 }, // VCF cutoff
{ 27, 71 }, // VCF Q
{ 28, 105 }, // VCF contour
{ 29, 106 }, // VCF attack
{ 30, 107 }, // VCF decay
{ 31, 108 }, // VCF sustain
{ 32, 109 }, // VCF release
{ 33, 73 }, // VCA attack
{ 34, 110 }, // VCA decay
{ 35, 111 }, // VCA sustain
{ 36, 72 }, // VCA release
{ 37, 112 } // A440
};
#endif

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_poly
SOURCE := ${NAME}.c
include ${ROOT_DIR}/../../common/ios/ios.mk

View File

@ -1,9 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
NAME := bw_example_synth_poly
SOURCE := bw_example_synth_poly.c
include ${ROOT_DIR}/../../common/vst3/vst3.mk
CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG
#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP

View File

@ -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 "Instrument|Synth"
#define PLUGIN_GUID_1 0x14f4e502
#define PLUGIN_GUID_2 0xf2314c26
#define PLUGIN_GUID_3 0xa89226a1
#define PLUGIN_GUID_4 0xd539f201
#define CTRL_GUID_1 0xd7917a95
#define CTRL_GUID_2 0xb3e14394
#define CTRL_GUID_3 0xa6c5bcb7
#define CTRL_GUID_4 0x852d78bb
#endif

View File

@ -1,6 +0,0 @@
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_synth_poly.c
SYNTH := yes
NEEDS_MEMSET := yes
include ${ROOT_DIR}/../../common/web/web.mk

View File

@ -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_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb fx_ring_mod fx_satur fx_slew_lim synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb fxpp_ring_mod fxpp_satur fxpp_slew_lim synthpp_simple" dirs="fx* synth*"
for d in $dirs; do for d in $dirs; do
echo Removing data files for $d echo Removing data files for $d

View File

@ -33,7 +33,7 @@ if [ "$1" = "common" ]; then
fi fi
if [ -z "$1" ]; then if [ -z "$1" ]; then
dirs="fx_ap1 fx_ap2 fx_balance fx_bitcrush fx_cab fx_chorus fx_clip fx_comb fx_comp fx_delay fx_dist fx_drive fx_eq_3band fx_flanger fx_fuzz fx_hp1 fx_hs1 fx_lp1 fx_ls1 fx_mm1 fx_mm2 fx_noise_gate fx_notch fx_one_pole fx_pan fx_phaser fx_reverb fx_ring_mod fx_satur fx_slew_lim synth_simple fxpp_ap1 fxpp_ap2 fxpp_balance fxpp_bitcrush fxpp_cab fxpp_chorus fxpp_clip fxpp_comb fxpp_comp fxpp_delay fxpp_dist fxpp_drive fxpp_eq_3band fxpp_flanger fxpp_fuzz fxpp_hp1 fxpp_hs1 fxpp_lp1 fxpp_ls1 fxpp_mm1 fxpp_mm2 fxpp_noise_gate fxpp_notch fxpp_one_pole fxpp_pan fxpp_phaser fxpp_reverb fxpp_ring_mod fxpp_satur fxpp_slew_lim synthpp_simple" dirs="fx* synth*"
else else
dirs="$1" dirs="$1"
fi fi