a bunch of c++ wrappers and fxpp examples + new fx_lp1
This commit is contained in:
parent
c79d799842
commit
b16a964498
7
examples/fx_lp1/daisy-seed/Makefile
Normal file
7
examples/fx_lp1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fx_lp1
|
||||
|
||||
C_SOURCES += ${ROOT_DIR}/../src/bw_example_fx_lp1.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
35
examples/fx_lp1/daisy-seed/config_daisy_seed.h
Normal file
35
examples/fx_lp1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
47
examples/fx_lp1/src/bw_example_fx_lp1.c
Normal file
47
examples/fx_lp1/src/bw_example_fx_lp1.c
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fx_lp1.h"
|
||||
|
||||
void bw_example_fx_lp1_init(bw_example_fx_lp1 *instance) {
|
||||
bw_lp1_init(&instance->lp1_coeffs);
|
||||
}
|
||||
|
||||
void bw_example_fx_lp1_set_sample_rate(bw_example_fx_lp1 *instance, float sample_rate) {
|
||||
bw_lp1_set_sample_rate(&instance->lp1_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fx_lp1_reset(bw_example_fx_lp1 *instance) {
|
||||
bw_lp1_reset_coeffs(&instance->lp1_coeffs);
|
||||
bw_lp1_reset_state(&instance->lp1_coeffs, &instance->lp1_state, 0.f);
|
||||
}
|
||||
|
||||
void bw_example_fx_lp1_process(bw_example_fx_lp1 *instance, const float** x, float** y, int n_samples) {
|
||||
bw_lp1_process(&instance->lp1_coeffs, &instance->lp1_state, x[0], y[0], n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fx_lp1_set_parameter(bw_example_fx_lp1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
bw_lp1_set_cutoff(&instance->lp1_coeffs, 20.f + (20e3f - 20.f) * value * value * value);
|
||||
}
|
||||
|
||||
float bw_example_fx_lp1_get_parameter(bw_example_fx_lp1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
56
examples/fx_lp1/src/bw_example_fx_lp1.h
Normal file
56
examples/fx_lp1/src/bw_example_fx_lp1.h
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef _BW_EXAMPLE_FX_LP1_H
|
||||
#define _BW_EXAMPLE_FX_LP1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <bw_lp1.h>
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fx_lp1 {
|
||||
// Sub-components
|
||||
bw_lp1_coeffs lp1_coeffs;
|
||||
bw_lp1_state lp1_state;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fx_lp1 bw_example_fx_lp1;
|
||||
|
||||
void bw_example_fx_lp1_init(bw_example_fx_lp1 *instance);
|
||||
void bw_example_fx_lp1_set_sample_rate(bw_example_fx_lp1 *instance, float sample_rate);
|
||||
void bw_example_fx_lp1_reset(bw_example_fx_lp1 *instance);
|
||||
void bw_example_fx_lp1_process(bw_example_fx_lp1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fx_lp1_set_parameter(bw_example_fx_lp1 *instance, int index, float value);
|
||||
float bw_example_fx_lp1_get_parameter(bw_example_fx_lp1 *instance, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
87
examples/fx_lp1/src/config.h
Normal file
87
examples/fx_lp1/src/config.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_lp1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 1
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fx_lp1.h"
|
||||
|
||||
#define P_TYPE bw_example_fx_lp1
|
||||
#define P_INIT bw_example_fx_lp1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fx_lp1_set_sample_rate
|
||||
#define P_RESET bw_example_fx_lp1_reset
|
||||
#define P_PROCESS bw_example_fx_lp1_process
|
||||
#define P_SET_PARAMETER bw_example_fx_lp1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fx_lp1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fx_lp1/vst3/Makefile
Normal file
6
examples/fx_lp1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fx_lp1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_lp1.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fx_lp1/vst3/config_vst3.h
Normal file
36
examples/fx_lp1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0x996b1328
|
||||
#define PLUGIN_GUID_2 0x43b54ca9
|
||||
#define PLUGIN_GUID_3 0x81ff971c
|
||||
#define PLUGIN_GUID_4 0x7f8f8787
|
||||
|
||||
#define CTRL_GUID_1 0x828f7ed5
|
||||
#define CTRL_GUID_2 0x10d7454f
|
||||
#define CTRL_GUID_3 0xbe5c7c9d
|
||||
#define CTRL_GUID_4 0x8d541fc1
|
||||
|
||||
#endif
|
4
examples/fx_lp1/web/Makefile
Normal file
4
examples/fx_lp1/web/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_lp1.c
|
||||
|
||||
include ${ROOT_DIR}/../../common/web/web.mk
|
38
examples/fx_lp1/web/config.js
Normal file
38
examples/fx_lp1/web/config.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
||||
}
|
||||
];
|
@ -69,7 +69,7 @@ static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
#define NUM_PARAMETERS 2
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "", 0, 0, 0, 0.5f },
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
|
||||
{ "Q", "Q", "", 0, 0, 0, 0.f }
|
||||
};
|
||||
|
||||
|
7
examples/fxpp_ap1/daisy-seed/Makefile
Normal file
7
examples/fxpp_ap1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_ap1
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_ap1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
35
examples/fxpp_ap1/daisy-seed/config_daisy_seed.h
Normal file
35
examples/fxpp_ap1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
50
examples/fxpp_ap1/src/bw_example_fxpp_ap1.cpp
Normal file
50
examples/fxpp_ap1/src/bw_example_fxpp_ap1.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fxpp_ap1.h"
|
||||
|
||||
void bw_example_fxpp_ap1_init(bw_example_fxpp_ap1 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap1_set_sample_rate(bw_example_fxpp_ap1 *instance, float sample_rate) {
|
||||
instance->ap1.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap1_reset(bw_example_fxpp_ap1 *instance) {
|
||||
instance->ap1.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap1_process(bw_example_fxpp_ap1 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->ap1.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap1_set_parameter(bw_example_fxpp_ap1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->ap1.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_ap1_get_parameter(bw_example_fxpp_ap1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
53
examples/fxpp_ap1/src/bw_example_fxpp_ap1.h
Normal file
53
examples/fxpp_ap1/src/bw_example_fxpp_ap1.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_FXPP_AP1_H
|
||||
#define _BW_EXAMPLE_FXPP_AP1_H
|
||||
|
||||
#include <bwpp_ap1.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_ap1 {
|
||||
// Sub-components
|
||||
AP1<1> ap1;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_ap1 bw_example_fxpp_ap1;
|
||||
|
||||
void bw_example_fxpp_ap1_init(bw_example_fxpp_ap1 *instance);
|
||||
void bw_example_fxpp_ap1_set_sample_rate(bw_example_fxpp_ap1 *instance, float sample_rate);
|
||||
void bw_example_fxpp_ap1_reset(bw_example_fxpp_ap1 *instance);
|
||||
void bw_example_fxpp_ap1_process(bw_example_fxpp_ap1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_ap1_set_parameter(bw_example_fxpp_ap1 *instance, int index, float value);
|
||||
float bw_example_fxpp_ap1_get_parameter(bw_example_fxpp_ap1 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
87
examples/fxpp_ap1/src/config.h
Normal file
87
examples/fxpp_ap1/src/config.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_ap1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 1
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_ap1.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_ap1
|
||||
#define P_INIT bw_example_fxpp_ap1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_ap1_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_ap1_reset
|
||||
#define P_PROCESS bw_example_fxpp_ap1_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_ap1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_ap1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_ap1/vst3/Makefile
Normal file
6
examples/fxpp_ap1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_ap1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_ap1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_ap1/vst3/config_vst3.h
Normal file
36
examples/fxpp_ap1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0x67f9cd8d
|
||||
#define PLUGIN_GUID_2 0x2865469b
|
||||
#define PLUGIN_GUID_3 0xbcea5838
|
||||
#define PLUGIN_GUID_4 0xfa1e0944
|
||||
|
||||
#define CTRL_GUID_1 0x3b74ce84
|
||||
#define CTRL_GUID_2 0x5132450c
|
||||
#define CTRL_GUID_3 0xb9aa48ef
|
||||
#define CTRL_GUID_4 0xe2d68cd3
|
||||
|
||||
#endif
|
7
examples/fxpp_ap2/daisy-seed/Makefile
Normal file
7
examples/fxpp_ap2/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_ap2
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_ap2.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
36
examples/fxpp_ap2/daisy-seed/config_daisy_seed.h
Normal file
36
examples/fxpp_ap2/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
53
examples/fxpp_ap2/src/bw_example_fxpp_ap2.cpp
Normal file
53
examples/fxpp_ap2/src/bw_example_fxpp_ap2.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_fxpp_ap2.h"
|
||||
|
||||
void bw_example_fxpp_ap2_init(bw_example_fxpp_ap2 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap2_set_sample_rate(bw_example_fxpp_ap2 *instance, float sample_rate) {
|
||||
instance->ap2.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap2_reset(bw_example_fxpp_ap2 *instance) {
|
||||
instance->ap2.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap2_process(bw_example_fxpp_ap2 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->ap2.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ap2_set_parameter(bw_example_fxpp_ap2 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->ap2.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
case p_Q:
|
||||
instance->ap2.setQ(0.5f + 9.5f * value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_ap2_get_parameter(bw_example_fxpp_ap2 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
54
examples/fxpp_ap2/src/bw_example_fxpp_ap2.h
Normal file
54
examples/fxpp_ap2/src/bw_example_fxpp_ap2.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_FXPP_AP2_H
|
||||
#define _BW_EXAMPLE_FXPP_AP2_H
|
||||
|
||||
#include <bwpp_ap2.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_Q,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_ap2 {
|
||||
// Sub-components
|
||||
AP2<1> ap2;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_ap2 bw_example_fxpp_ap2;
|
||||
|
||||
void bw_example_fxpp_ap2_init(bw_example_fxpp_ap2 *instance);
|
||||
void bw_example_fxpp_ap2_set_sample_rate(bw_example_fxpp_ap2 *instance, float sample_rate);
|
||||
void bw_example_fxpp_ap2_reset(bw_example_fxpp_ap2 *instance);
|
||||
void bw_example_fxpp_ap2_process(bw_example_fxpp_ap2 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_ap2_set_parameter(bw_example_fxpp_ap2 *instance, int index, float value);
|
||||
float bw_example_fxpp_ap2_get_parameter(bw_example_fxpp_ap2 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
examples/fxpp_ap2/src/config.h
Normal file
88
examples/fxpp_ap2/src/config.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_ap2"
|
||||
#define PLUGIN_VERSION "0.5.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_fxpp_ap2.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_ap2
|
||||
#define P_INIT bw_example_fxpp_ap2_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_ap2_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_ap2_reset
|
||||
#define P_PROCESS bw_example_fxpp_ap2_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_ap2_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_ap2_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_ap2/vst3/Makefile
Normal file
6
examples/fxpp_ap2/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_ap2
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_ap2.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_ap2/vst3/config_vst3.h
Normal file
36
examples/fxpp_ap2/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0x32fc0150
|
||||
#define PLUGIN_GUID_2 0xb5e44732
|
||||
#define PLUGIN_GUID_3 0x86c506af
|
||||
#define PLUGIN_GUID_4 0x49a9e7ec
|
||||
|
||||
#define CTRL_GUID_1 0x62821948
|
||||
#define CTRL_GUID_2 0x5d3748e2
|
||||
#define CTRL_GUID_3 0x865579ed
|
||||
#define CTRL_GUID_4 0xe52e66bb
|
||||
|
||||
#endif
|
7
examples/fxpp_hp1/daisy-seed/Makefile
Normal file
7
examples/fxpp_hp1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_hp1
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_hp1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
35
examples/fxpp_hp1/daisy-seed/config_daisy_seed.h
Normal file
35
examples/fxpp_hp1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
50
examples/fxpp_hp1/src/bw_example_fxpp_hp1.cpp
Normal file
50
examples/fxpp_hp1/src/bw_example_fxpp_hp1.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fxpp_hp1.h"
|
||||
|
||||
void bw_example_fxpp_hp1_init(bw_example_fxpp_hp1 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hp1_set_sample_rate(bw_example_fxpp_hp1 *instance, float sample_rate) {
|
||||
instance->hp1.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hp1_reset(bw_example_fxpp_hp1 *instance) {
|
||||
instance->hp1.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hp1_process(bw_example_fxpp_hp1 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->hp1.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hp1_set_parameter(bw_example_fxpp_hp1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->hp1.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_hp1_get_parameter(bw_example_fxpp_hp1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
53
examples/fxpp_hp1/src/bw_example_fxpp_hp1.h
Normal file
53
examples/fxpp_hp1/src/bw_example_fxpp_hp1.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_FXPP_HP1_H
|
||||
#define _BW_EXAMPLE_FXPP_HP1_H
|
||||
|
||||
#include <bwpp_hp1.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_hp1 {
|
||||
// Sub-components
|
||||
HP1<1> hp1;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_hp1 bw_example_fxpp_hp1;
|
||||
|
||||
void bw_example_fxpp_hp1_init(bw_example_fxpp_hp1 *instance);
|
||||
void bw_example_fxpp_hp1_set_sample_rate(bw_example_fxpp_hp1 *instance, float sample_rate);
|
||||
void bw_example_fxpp_hp1_reset(bw_example_fxpp_hp1 *instance);
|
||||
void bw_example_fxpp_hp1_process(bw_example_fxpp_hp1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_hp1_set_parameter(bw_example_fxpp_hp1 *instance, int index, float value);
|
||||
float bw_example_fxpp_hp1_get_parameter(bw_example_fxpp_hp1 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
87
examples/fxpp_hp1/src/config.h
Normal file
87
examples/fxpp_hp1/src/config.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_hp1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 1
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_hp1.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_hp1
|
||||
#define P_INIT bw_example_fxpp_hp1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_hp1_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_hp1_reset
|
||||
#define P_PROCESS bw_example_fxpp_hp1_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_hp1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_hp1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_hp1/vst3/Makefile
Normal file
6
examples/fxpp_hp1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_hp1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_hp1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_hp1/vst3/config_vst3.h
Normal file
36
examples/fxpp_hp1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0x96de37e3
|
||||
#define PLUGIN_GUID_2 0x100e4807
|
||||
#define PLUGIN_GUID_3 0x8a7ec651
|
||||
#define PLUGIN_GUID_4 0xa90b8d91
|
||||
|
||||
#define CTRL_GUID_1 0x596d678c
|
||||
#define CTRL_GUID_2 0x734140e6
|
||||
#define CTRL_GUID_3 0xbb94baf4
|
||||
#define CTRL_GUID_4 0xad364367
|
||||
|
||||
#endif
|
7
examples/fxpp_hs1/daisy-seed/Makefile
Normal file
7
examples/fxpp_hs1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_hs1
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_hs1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
36
examples/fxpp_hs1/daisy-seed/config_daisy_seed.h
Normal file
36
examples/fxpp_hs1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
53
examples/fxpp_hs1/src/bw_example_fxpp_hs1.cpp
Normal file
53
examples/fxpp_hs1/src/bw_example_fxpp_hs1.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_fxpp_hs1.h"
|
||||
|
||||
void bw_example_fxpp_hs1_init(bw_example_fxpp_hs1 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hs1_set_sample_rate(bw_example_fxpp_hs1 *instance, float sample_rate) {
|
||||
instance->hs1.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hs1_reset(bw_example_fxpp_hs1 *instance) {
|
||||
instance->hs1.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hs1_process(bw_example_fxpp_hs1 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->hs1.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_hs1_set_parameter(bw_example_fxpp_hs1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->hs1.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
case p_gain:
|
||||
instance->hs1.setHighGainDB(-20.f + 40.f * value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_hs1_get_parameter(bw_example_fxpp_hs1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
54
examples/fxpp_hs1/src/bw_example_fxpp_hs1.h
Normal file
54
examples/fxpp_hs1/src/bw_example_fxpp_hs1.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_FXPP_HS1_H
|
||||
#define _BW_EXAMPLE_FXPP_HS1_H
|
||||
|
||||
#include <bwpp_hs1.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_gain,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_hs1 {
|
||||
// Sub-components
|
||||
HS1<1> hs1;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_hs1 bw_example_fxpp_hs1;
|
||||
|
||||
void bw_example_fxpp_hs1_init(bw_example_fxpp_hs1 *instance);
|
||||
void bw_example_fxpp_hs1_set_sample_rate(bw_example_fxpp_hs1 *instance, float sample_rate);
|
||||
void bw_example_fxpp_hs1_reset(bw_example_fxpp_hs1 *instance);
|
||||
void bw_example_fxpp_hs1_process(bw_example_fxpp_hs1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_hs1_set_parameter(bw_example_fxpp_hs1 *instance, int index, float value);
|
||||
float bw_example_fxpp_hs1_get_parameter(bw_example_fxpp_hs1 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
examples/fxpp_hs1/src/config.h
Normal file
88
examples/fxpp_hs1/src/config.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_hs1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 2
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
|
||||
{ "Gain", "Gain", "dB", 0, 0, 0, 0.5f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_hs1.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_hs1
|
||||
#define P_INIT bw_example_fxpp_hs1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_hs1_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_hs1_reset
|
||||
#define P_PROCESS bw_example_fxpp_hs1_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_hs1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_hs1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_hs1/vst3/Makefile
Normal file
6
examples/fxpp_hs1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_hs1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_hs1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_hs1/vst3/config_vst3.h
Normal file
36
examples/fxpp_hs1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0x50758061
|
||||
#define PLUGIN_GUID_2 0x59a547b2
|
||||
#define PLUGIN_GUID_3 0x82d000c7
|
||||
#define PLUGIN_GUID_4 0xc07f71bd
|
||||
|
||||
#define CTRL_GUID_1 0x68fead0c
|
||||
#define CTRL_GUID_2 0x894f45d5
|
||||
#define CTRL_GUID_3 0xa5eae123
|
||||
#define CTRL_GUID_4 0x2efa7b92
|
||||
|
||||
#endif
|
7
examples/fxpp_lp1/daisy-seed/Makefile
Normal file
7
examples/fxpp_lp1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_lp1
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_lp1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
35
examples/fxpp_lp1/daisy-seed/config_daisy_seed.h
Normal file
35
examples/fxpp_lp1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
50
examples/fxpp_lp1/src/bw_example_fxpp_lp1.cpp
Normal file
50
examples/fxpp_lp1/src/bw_example_fxpp_lp1.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fxpp_lp1.h"
|
||||
|
||||
void bw_example_fxpp_lp1_init(bw_example_fxpp_lp1 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_lp1_set_sample_rate(bw_example_fxpp_lp1 *instance, float sample_rate) {
|
||||
instance->lp1.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_lp1_reset(bw_example_fxpp_lp1 *instance) {
|
||||
instance->lp1.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_lp1_process(bw_example_fxpp_lp1 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->lp1.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_lp1_set_parameter(bw_example_fxpp_lp1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->lp1.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_lp1_get_parameter(bw_example_fxpp_lp1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
53
examples/fxpp_lp1/src/bw_example_fxpp_lp1.h
Normal file
53
examples/fxpp_lp1/src/bw_example_fxpp_lp1.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_FXPP_LP1_H
|
||||
#define _BW_EXAMPLE_FXPP_LP1_H
|
||||
|
||||
#include <bwpp_lp1.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_lp1 {
|
||||
// Sub-components
|
||||
LP1<1> lp1;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_lp1 bw_example_fxpp_lp1;
|
||||
|
||||
void bw_example_fxpp_lp1_init(bw_example_fxpp_lp1 *instance);
|
||||
void bw_example_fxpp_lp1_set_sample_rate(bw_example_fxpp_lp1 *instance, float sample_rate);
|
||||
void bw_example_fxpp_lp1_reset(bw_example_fxpp_lp1 *instance);
|
||||
void bw_example_fxpp_lp1_process(bw_example_fxpp_lp1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_lp1_set_parameter(bw_example_fxpp_lp1 *instance, int index, float value);
|
||||
float bw_example_fxpp_lp1_get_parameter(bw_example_fxpp_lp1 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
87
examples/fxpp_lp1/src/config.h
Normal file
87
examples/fxpp_lp1/src/config.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_lp1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 1
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_lp1.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_lp1
|
||||
#define P_INIT bw_example_fxpp_lp1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_lp1_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_lp1_reset
|
||||
#define P_PROCESS bw_example_fxpp_lp1_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_lp1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_lp1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_lp1/vst3/Makefile
Normal file
6
examples/fxpp_lp1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_lp1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_lp1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_lp1/vst3/config_vst3.h
Normal file
36
examples/fxpp_lp1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0xabc96761
|
||||
#define PLUGIN_GUID_2 0x6efc45b3
|
||||
#define PLUGIN_GUID_3 0x94b75626
|
||||
#define PLUGIN_GUID_4 0x07fb04b6
|
||||
|
||||
#define CTRL_GUID_1 0x76e08d3b
|
||||
#define CTRL_GUID_2 0xeaf04e96
|
||||
#define CTRL_GUID_3 0xa17196c7
|
||||
#define CTRL_GUID_4 0x2bf9f232
|
||||
|
||||
#endif
|
7
examples/fxpp_ls1/daisy-seed/Makefile
Normal file
7
examples/fxpp_ls1/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_ls1
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_ls1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
36
examples/fxpp_ls1/daisy-seed/config_daisy_seed.h
Normal file
36
examples/fxpp_ls1/daisy-seed/config_daisy_seed.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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
|
53
examples/fxpp_ls1/src/bw_example_fxpp_ls1.cpp
Normal file
53
examples/fxpp_ls1/src/bw_example_fxpp_ls1.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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_fxpp_ls1.h"
|
||||
|
||||
void bw_example_fxpp_ls1_init(bw_example_fxpp_ls1 *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ls1_set_sample_rate(bw_example_fxpp_ls1 *instance, float sample_rate) {
|
||||
instance->ls1.setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ls1_reset(bw_example_fxpp_ls1 *instance) {
|
||||
instance->ls1.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ls1_process(bw_example_fxpp_ls1 *instance, const float** x, float** y, int n_samples) {
|
||||
instance->ls1.process({x[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_ls1_set_parameter(bw_example_fxpp_ls1 *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_cutoff:
|
||||
instance->ls1.setCutoff((20e3f - 20.f) * value * value * value + 20.f);
|
||||
break;
|
||||
case p_gain:
|
||||
instance->ls1.setDcGainDB(-20.f + 40.f * value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_ls1_get_parameter(bw_example_fxpp_ls1 *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
54
examples/fxpp_ls1/src/bw_example_fxpp_ls1.h
Normal file
54
examples/fxpp_ls1/src/bw_example_fxpp_ls1.h
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_FXPP_LS1_H
|
||||
#define _BW_EXAMPLE_FXPP_LS1_H
|
||||
|
||||
#include <bwpp_ls1.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_cutoff,
|
||||
p_gain,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_ls1 {
|
||||
// Sub-components
|
||||
LS1<1> ls1;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_ls1 bw_example_fxpp_ls1;
|
||||
|
||||
void bw_example_fxpp_ls1_init(bw_example_fxpp_ls1 *instance);
|
||||
void bw_example_fxpp_ls1_set_sample_rate(bw_example_fxpp_ls1 *instance, float sample_rate);
|
||||
void bw_example_fxpp_ls1_reset(bw_example_fxpp_ls1 *instance);
|
||||
void bw_example_fxpp_ls1_process(bw_example_fxpp_ls1 *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_ls1_set_parameter(bw_example_fxpp_ls1 *instance, int index, float value);
|
||||
float bw_example_fxpp_ls1_get_parameter(bw_example_fxpp_ls1 *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
examples/fxpp_ls1/src/config.h
Normal file
88
examples/fxpp_ls1/src/config.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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_fxpp_ls1"
|
||||
#define PLUGIN_VERSION "0.5.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 2
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
|
||||
{ "Gain", "Gain", "dB", 0, 0, 0, 0.5f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_ls1.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_ls1
|
||||
#define P_INIT bw_example_fxpp_ls1_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_ls1_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_ls1_reset
|
||||
#define P_PROCESS bw_example_fxpp_ls1_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_ls1_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_ls1_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_ls1/vst3/Makefile
Normal file
6
examples/fxpp_ls1/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_ls1
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_ls1.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_ls1/vst3/config_vst3.h
Normal file
36
examples/fxpp_ls1/vst3/config_vst3.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <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 0xdc073e1d
|
||||
#define PLUGIN_GUID_2 0xafed4991
|
||||
#define PLUGIN_GUID_3 0xb3181e9e
|
||||
#define PLUGIN_GUID_4 0x79acb2af
|
||||
|
||||
#define CTRL_GUID_1 0x5e701fae
|
||||
#define CTRL_GUID_2 0x56c34a23
|
||||
#define CTRL_GUID_3 0x9b781b85
|
||||
#define CTRL_GUID_4 0xcbc803b1
|
||||
|
||||
#endif
|
@ -69,7 +69,7 @@ static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
#define NUM_PARAMETERS 2
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Cutoff", "Cutoff", "", 0, 0, 0, 0.5f },
|
||||
{ "Cutoff", "Cutoff", "Hz", 0, 0, 0, 0.5f },
|
||||
{ "Q", "Q", "", 0, 0, 0, 0.f }
|
||||
};
|
||||
|
||||
|
81
include/bwpp_ap1.h
Normal file
81
include/bwpp_ap1.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 BWPP_AP1_H
|
||||
#define BWPP_AP1_H
|
||||
|
||||
#include <bw_ap1.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class AP1 {
|
||||
public:
|
||||
AP1();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
|
||||
private:
|
||||
bw_ap1_coeffs coeffs;
|
||||
bw_ap1_state states[N_CHANNELS];
|
||||
bw_ap1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
AP1<N_CHANNELS>::AP1() {
|
||||
bw_ap1_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ap1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_ap1_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_ap1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_ap1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ap1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
87
include/bwpp_ap2.h
Normal file
87
include/bwpp_ap2.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef BWPP_AP2_H
|
||||
#define BWPP_AP2_H
|
||||
|
||||
#include <bw_ap2.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class AP2 {
|
||||
public:
|
||||
AP2();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
void setQ(float value);
|
||||
|
||||
private:
|
||||
bw_ap2_coeffs coeffs;
|
||||
bw_ap2_state states[N_CHANNELS];
|
||||
bw_ap2_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
AP2<N_CHANNELS>::AP2() {
|
||||
bw_ap2_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP2<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ap2_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP2<N_CHANNELS>::reset(float x0) {
|
||||
bw_ap2_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_ap2_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP2<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_ap2_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP2<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ap2_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void AP2<N_CHANNELS>::setQ(float value) {
|
||||
bw_ap2_set_Q(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
81
include/bwpp_hp1.h
Normal file
81
include/bwpp_hp1.h
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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 BWPP_HP1_H
|
||||
#define BWPP_HP1_H
|
||||
|
||||
#include <bw_hp1.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class HP1 {
|
||||
public:
|
||||
HP1();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
|
||||
private:
|
||||
bw_hp1_coeffs coeffs;
|
||||
bw_hp1_state states[N_CHANNELS];
|
||||
bw_hp1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
HP1<N_CHANNELS>::HP1() {
|
||||
bw_hp1_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_hp1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_hp1_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_hp1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_hp1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_hp1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
93
include/bwpp_hs1.h
Normal file
93
include/bwpp_hs1.h
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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 BWPP_HS1_H
|
||||
#define BWPP_HS1_H
|
||||
|
||||
#include <bw_hs1.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class HS1 {
|
||||
public:
|
||||
HS1();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
void setHighGainLin(float value);
|
||||
void setHighGainDB(float value);
|
||||
|
||||
private:
|
||||
bw_hs1_coeffs coeffs;
|
||||
bw_hs1_state states[N_CHANNELS];
|
||||
bw_hs1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
HS1<N_CHANNELS>::HS1() {
|
||||
bw_hs1_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_hs1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::reset(float x0) {
|
||||
bw_hs1_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_hs1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_hs1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_hs1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::setHighGainLin(float value) {
|
||||
bw_hs1_set_high_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void HS1<N_CHANNELS>::setHighGainDB(float value) {
|
||||
bw_hs1_set_high_gain_dB(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
93
include/bwpp_lp1.h
Normal file
93
include/bwpp_lp1.h
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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 BWPP_LP1_H
|
||||
#define BWPP_LP1_H
|
||||
|
||||
#include <bw_lp1.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class LP1 {
|
||||
public:
|
||||
LP1();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
void setPrewarpAtCutoff(bool value);
|
||||
void setPrewarpFreq(float value);
|
||||
|
||||
private:
|
||||
bw_lp1_coeffs coeffs;
|
||||
bw_lp1_state states[N_CHANNELS];
|
||||
bw_lp1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
LP1<N_CHANNELS>::LP1() {
|
||||
bw_lp1_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_lp1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_lp1_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_lp1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_lp1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_lp1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::setPrewarpAtCutoff(bool value) {
|
||||
bw_lp1_set_prewarp_at_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LP1<N_CHANNELS>::setPrewarpFreq(float value) {
|
||||
bw_lp1_set_prewarp_freq(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
93
include/bwpp_ls1.h
Normal file
93
include/bwpp_ls1.h
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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 BWPP_LS1_H
|
||||
#define BWPP_LS1_H
|
||||
|
||||
#include <bw_ls1.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class LS1 {
|
||||
public:
|
||||
LS1();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
void setDcGainLin(float value);
|
||||
void setDcGainDB(float value);
|
||||
|
||||
private:
|
||||
bw_ls1_coeffs coeffs;
|
||||
bw_ls1_state states[N_CHANNELS];
|
||||
bw_ls1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
LS1<N_CHANNELS>::LS1() {
|
||||
bw_ls1_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ls1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::reset(float x0) {
|
||||
bw_ls1_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_ls1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_ls1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ls1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::setDcGainLin(float value) {
|
||||
bw_ls1_set_dc_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void LS1<N_CHANNELS>::setDcGainDB(float value) {
|
||||
bw_ls1_set_dc_gain_dB(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
130
include/bwpp_one_pole.h
Normal file
130
include/bwpp_one_pole.h
Normal file
@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 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 BWPP_ONE_POLE_H
|
||||
#define BWPP_ONE_POLE_H
|
||||
|
||||
#include <bw_one_pole.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class OnePole {
|
||||
public:
|
||||
OnePole();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset(float y_z1 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setCutoff(float value);
|
||||
void setCutoffUp(float value);
|
||||
void setCutoffDown(float value);
|
||||
void setTau(float value);
|
||||
void setTauUp(float value);
|
||||
void setTauDown(float value);
|
||||
void setStickyThresh(float value);
|
||||
void setStickyMode(bw_one_pole_sticky_mode value);
|
||||
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
|
||||
private:
|
||||
bw_one_pole_coeffs coeffs;
|
||||
bw_one_pole_state states[N_CHANNELS];
|
||||
bw_one_pole_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
OnePole<N_CHANNELS>::OnePole() {
|
||||
bw_one_pole_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_one_pole_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::reset(float y_z1) {
|
||||
bw_one_pole_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_one_pole_reset_state(&coeffs, states + i, y_z1);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_one_pole_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_one_pole_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setCutoffUp(float value) {
|
||||
bw_one_pole_set_cutoff_up(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setCutoffDown(float value) {
|
||||
bw_one_pole_set_cutoff_down(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setTau(float value) {
|
||||
bw_one_pole_set_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setTauUp(float value) {
|
||||
bw_one_pole_set_tau_up(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setTauDown(float value) {
|
||||
bw_one_pole_set_tau_down(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setStickyThresh(float value) {
|
||||
bw_one_pole_set_sticky_thresh(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void OnePole<N_CHANNELS>::setStickyMode(bw_one_pole_sticky_mode value) {
|
||||
bw_one_pole_set_sticky_mode(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
float OnePole<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
return bw_one_pole_get_y_z1(states + channel);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user