bwpp_{bd_reduce,src_reduce,clip,src_int} + fxpp_{bitcrush,clip}
This commit is contained in:
parent
063d4ffb02
commit
e331ce1125
2
TODO
2
TODO
@ -56,6 +56,8 @@ code:
|
||||
* peak gain + Q ???
|
||||
* bwpp -> bwxx
|
||||
* float -> double, etc. ?
|
||||
* sr_reduce reset_coeffs? update_coeffs? process_multi?
|
||||
* src(_int) process_multi?
|
||||
|
||||
build system:
|
||||
* make makefiles handle paths with spaces etc
|
||||
|
7
examples/fxpp_bitcrush/daisy-seed/Makefile
Normal file
7
examples/fxpp_bitcrush/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_bitcrush
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_bitcrush.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
36
examples/fxpp_bitcrush/daisy-seed/config_daisy_seed.h
Normal file
36
examples/fxpp_bitcrush/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
|
56
examples/fxpp_bitcrush/src/bw_example_fxpp_bitcrush.cpp
Normal file
56
examples/fxpp_bitcrush/src/bw_example_fxpp_bitcrush.cpp
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
|
||||
*/
|
||||
|
||||
#include "bw_example_fxpp_bitcrush.h"
|
||||
|
||||
void bw_example_fxpp_bitcrush_init(bw_example_fxpp_bitcrush *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_bitcrush_set_sample_rate(bw_example_fxpp_bitcrush *instance, float sample_rate) {
|
||||
(void)instance;
|
||||
(void)sample_rate;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_bitcrush_reset(bw_example_fxpp_bitcrush *instance) {
|
||||
instance->srReduce.reset();
|
||||
instance->bdReduce.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_bitcrush_process(bw_example_fxpp_bitcrush *instance, const float** x, float** y, int n_samples) {
|
||||
instance->srReduce.process({x[0]}, {y[0]}, n_samples);
|
||||
instance->bdReduce.process({y[0]}, {y[0]}, n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_bitcrush_set_parameter(bw_example_fxpp_bitcrush *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_sr_ratio:
|
||||
instance->srReduce.setRatio(value);
|
||||
break;
|
||||
case p_bit_depth:
|
||||
instance->bdReduce.setBitDepth(1 + (int)(15.f * value));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_bitcrush_get_parameter(bw_example_fxpp_bitcrush *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
56
examples/fxpp_bitcrush/src/bw_example_fxpp_bitcrush.h
Normal file
56
examples/fxpp_bitcrush/src/bw_example_fxpp_bitcrush.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_FXPP_BITCRUSH_H
|
||||
#define _BW_EXAMPLE_FXPP_BITCRUSH_H
|
||||
|
||||
#include <bwpp_sr_reduce.h>
|
||||
#include <bwpp_bd_reduce.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_sr_ratio,
|
||||
p_bit_depth,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fxpp_bitcrush {
|
||||
// Sub-components
|
||||
SRReduce<1> srReduce;
|
||||
BDReduce<1> bdReduce;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fxpp_bitcrush bw_example_fxpp_bitcrush;
|
||||
|
||||
void bw_example_fxpp_bitcrush_init(bw_example_fxpp_bitcrush *instance);
|
||||
void bw_example_fxpp_bitcrush_set_sample_rate(bw_example_fxpp_bitcrush *instance, float sample_rate);
|
||||
void bw_example_fxpp_bitcrush_reset(bw_example_fxpp_bitcrush *instance);
|
||||
void bw_example_fxpp_bitcrush_process(bw_example_fxpp_bitcrush *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_bitcrush_set_parameter(bw_example_fxpp_bitcrush *instance, int index, float value);
|
||||
float bw_example_fxpp_bitcrush_get_parameter(bw_example_fxpp_bitcrush *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
examples/fxpp_bitcrush/src/config.h
Normal file
88
examples/fxpp_bitcrush/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_bitcrush"
|
||||
#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] = {
|
||||
{ "Sample rate ratio", "SR ratio", "", 0, 0, 0, 1.f },
|
||||
{ "Bit depth", "Bit depth", "", 0, 0, 14, 1.f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_bitcrush.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_bitcrush
|
||||
#define P_INIT bw_example_fxpp_bitcrush_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_bitcrush_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_bitcrush_reset
|
||||
#define P_PROCESS bw_example_fxpp_bitcrush_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_bitcrush_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_bitcrush_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_bitcrush/vst3/Makefile
Normal file
6
examples/fxpp_bitcrush/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_bitcrush
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_bitcrush.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_bitcrush/vst3/config_vst3.h
Normal file
36
examples/fxpp_bitcrush/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"
|
||||
|
||||
#define PLUGIN_GUID_1 0x4ccc317b
|
||||
#define PLUGIN_GUID_2 0xcbfd4dc0
|
||||
#define PLUGIN_GUID_3 0xb2c0e24d
|
||||
#define PLUGIN_GUID_4 0x00ef876d
|
||||
|
||||
#define CTRL_GUID_1 0xf4fa2b0d
|
||||
#define CTRL_GUID_2 0x358f4709
|
||||
#define CTRL_GUID_3 0x855f940f
|
||||
#define CTRL_GUID_4 0x76cec704
|
||||
|
||||
#endif
|
7
examples/fxpp_clip/daisy-seed/Makefile
Normal file
7
examples/fxpp_clip/daisy-seed/Makefile
Normal file
@ -0,0 +1,7 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
TARGET = bw_example_fxpp_clip
|
||||
|
||||
CPP_SOURCES_EXTRA = ${ROOT_DIR}/../src/bw_example_fxpp_clip.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/daisy-seed/daisy-seed.mk
|
36
examples/fxpp_clip/daisy-seed/config_daisy_seed.h
Normal file
36
examples/fxpp_clip/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
|
62
examples/fxpp_clip/src/bw_example_fxpp_clip.cpp
Normal file
62
examples/fxpp_clip/src/bw_example_fxpp_clip.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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_clip.h"
|
||||
|
||||
void bw_example_fxpp_clip_init(bw_example_fxpp_clip *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
void bw_example_fxpp_clip_set_sample_rate(bw_example_fxpp_clip *instance, float sample_rate) {
|
||||
instance->clip.setSampleRate(2.f * sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fxpp_clip_reset(bw_example_fxpp_clip *instance) {
|
||||
instance->clip.reset();
|
||||
instance->srcUp.reset();
|
||||
instance->srcDown.reset();
|
||||
}
|
||||
|
||||
void bw_example_fxpp_clip_process(bw_example_fxpp_clip *instance, const float** x, float** y, int n_samples) {
|
||||
int i = 0;
|
||||
while (i < n_samples) {
|
||||
int n = bw_mini32(n_samples - i, BUF_SIZE >> 1);
|
||||
instance->srcUp.process({x[0] + i}, {instance->buf}, n);
|
||||
instance->clip.process({instance->buf}, {instance->buf}, n << 1);
|
||||
instance->srcDown.process({instance->buf}, {y[0] + i}, n << 1);
|
||||
i += n;
|
||||
}
|
||||
}
|
||||
|
||||
void bw_example_fxpp_clip_set_parameter(bw_example_fxpp_clip *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
switch (index) {
|
||||
case p_bias:
|
||||
instance->clip.setBias(5.f * value - 2.5f);
|
||||
break;
|
||||
case p_gain:
|
||||
instance->clip.setGain(0.1f + (10.f - 0.1f) * value * value * value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
float bw_example_fxpp_clip_get_parameter(bw_example_fxpp_clip *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
64
examples/fxpp_clip/src/bw_example_fxpp_clip.h
Normal file
64
examples/fxpp_clip/src/bw_example_fxpp_clip.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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_CLIP_H
|
||||
#define _BW_EXAMPLE_FXPP_CLIP_H
|
||||
|
||||
#include <bwpp_clip.h>
|
||||
#include <bwpp_src_int.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum {
|
||||
p_bias,
|
||||
p_gain,
|
||||
p_n
|
||||
};
|
||||
|
||||
#define BUF_SIZE 32
|
||||
|
||||
struct _bw_example_fxpp_clip {
|
||||
// Sub-components
|
||||
Clip<1> clip;
|
||||
SRCInt<1> srcUp;
|
||||
SRCInt<1> srcDown;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
|
||||
// Buffers
|
||||
float buf[BUF_SIZE];
|
||||
|
||||
_bw_example_fxpp_clip() : srcUp(2), srcDown(-2) {}
|
||||
};
|
||||
typedef struct _bw_example_fxpp_clip bw_example_fxpp_clip;
|
||||
|
||||
void bw_example_fxpp_clip_init(bw_example_fxpp_clip *instance);
|
||||
void bw_example_fxpp_clip_set_sample_rate(bw_example_fxpp_clip *instance, float sample_rate);
|
||||
void bw_example_fxpp_clip_reset(bw_example_fxpp_clip *instance);
|
||||
void bw_example_fxpp_clip_process(bw_example_fxpp_clip *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fxpp_clip_set_parameter(bw_example_fxpp_clip *instance, int index, float value);
|
||||
float bw_example_fxpp_clip_get_parameter(bw_example_fxpp_clip *instance, int index);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
examples/fxpp_clip/src/config.h
Normal file
88
examples/fxpp_clip/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_clip"
|
||||
#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] = {
|
||||
{ "Bias", "Bias", "", 0, 0, 0, 0.5f },
|
||||
{ "Gain", "Gain", "", 0, 0, 0, 0.4641588833612779f }
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fxpp_clip.h"
|
||||
|
||||
#define P_TYPE bw_example_fxpp_clip
|
||||
#define P_INIT bw_example_fxpp_clip_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fxpp_clip_set_sample_rate
|
||||
#define P_RESET bw_example_fxpp_clip_reset
|
||||
#define P_PROCESS bw_example_fxpp_clip_process
|
||||
#define P_SET_PARAMETER bw_example_fxpp_clip_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fxpp_clip_get_parameter
|
||||
|
||||
#endif
|
6
examples/fxpp_clip/vst3/Makefile
Normal file
6
examples/fxpp_clip/vst3/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
|
||||
NAME := bw_example_fxpp_clip
|
||||
SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_clip.cpp
|
||||
|
||||
include ${ROOT_DIR}/../../common/vst3/vst3.mk
|
36
examples/fxpp_clip/vst3/config_vst3.h
Normal file
36
examples/fxpp_clip/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|Distortion"
|
||||
|
||||
#define PLUGIN_GUID_1 0xa94e154c
|
||||
#define PLUGIN_GUID_2 0xca1d4e29
|
||||
#define PLUGIN_GUID_3 0xa3bb40be
|
||||
#define PLUGIN_GUID_4 0x0814b9ce
|
||||
|
||||
#define CTRL_GUID_1 0x81fcfee9
|
||||
#define CTRL_GUID_2 0xb69e412d
|
||||
#define CTRL_GUID_3 0x892acde6
|
||||
#define CTRL_GUID_4 0x5c46094c
|
||||
|
||||
#endif
|
69
include/bwpp_bd_reduce.h
Normal file
69
include/bwpp_bd_reduce.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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_BD_REDUCE_H
|
||||
#define BWPP_BD_REDUCE_H
|
||||
|
||||
#include <bw_bd_reduce.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class BDReduce {
|
||||
public:
|
||||
BDReduce();
|
||||
|
||||
void reset();
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setBitDepth(char value);
|
||||
|
||||
private:
|
||||
bw_bd_reduce_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
BDReduce<N_CHANNELS>::BDReduce() {
|
||||
bw_bd_reduce_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void BDReduce<N_CHANNELS>::reset() {
|
||||
bw_bd_reduce_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void BDReduce<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_bd_reduce_process_multi(&coeffs, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void BDReduce<N_CHANNELS>::setBitDepth(char value) {
|
||||
bw_bd_reduce_set_bit_depth(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
93
include/bwpp_clip.h
Normal file
93
include/bwpp_clip.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_CLIP_H
|
||||
#define BWPP_CLIP_H
|
||||
|
||||
#include <bw_clip.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class Clip {
|
||||
public:
|
||||
Clip();
|
||||
|
||||
void setSampleRate(float sampleRate);
|
||||
void reset();
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setBias(float value);
|
||||
void setGain(float value);
|
||||
void setGainCompensation(bool value);
|
||||
|
||||
private:
|
||||
bw_clip_coeffs coeffs;
|
||||
bw_clip_state states[N_CHANNELS];
|
||||
bw_clip_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
Clip<N_CHANNELS>::Clip() {
|
||||
bw_clip_init(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_clip_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::reset() {
|
||||
bw_clip_reset_coeffs(&coeffs);
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_clip_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_clip_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::setBias(float value) {
|
||||
bw_clip_set_bias(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::setGain(float value) {
|
||||
bw_clip_set_gain(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void Clip<N_CHANNELS>::setGainCompensation(bool value) {
|
||||
bw_clip_set_gain_compensation(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
72
include/bwpp_sr_reduce.h
Normal file
72
include/bwpp_sr_reduce.h
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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_SR_REDUCE_H
|
||||
#define BWPP_SR_REDUCE_H
|
||||
|
||||
#include <bw_sr_reduce.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class SRReduce {
|
||||
public:
|
||||
SRReduce();
|
||||
|
||||
void reset();
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
void setRatio(float value);
|
||||
|
||||
private:
|
||||
bw_sr_reduce_coeffs coeffs;
|
||||
bw_sr_reduce_state states[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
SRReduce<N_CHANNELS>::SRReduce() {
|
||||
bw_sr_reduce_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void SRReduce<N_CHANNELS>::reset() {
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_sr_reduce_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void SRReduce<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_sr_reduce_process(&coeffs, states + i, x.data()[i], y.data()[i], nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void SRReduce<N_CHANNELS>::setRatio(float value) {
|
||||
bw_sr_reduce_set_ratio(&coeffs, value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
65
include/bwpp_src_int.h
Normal file
65
include/bwpp_src_int.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* 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_SRC_INT_H
|
||||
#define BWPP_SRC_INT_H
|
||||
|
||||
#include <bw_src_int.h>
|
||||
#include <array>
|
||||
|
||||
namespace Brickworks {
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
class SRCInt {
|
||||
public:
|
||||
SRCInt(int ratio);
|
||||
|
||||
void reset(float x0 = 0.f);
|
||||
void process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nInSamples);
|
||||
|
||||
private:
|
||||
bw_src_int_coeffs coeffs;
|
||||
bw_src_int_state states[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
SRCInt<N_CHANNELS>::SRCInt(int ratio) {
|
||||
bw_src_int_init(&coeffs, ratio);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void SRCInt<N_CHANNELS>::reset(float x0) {
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_src_int_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
void SRCInt<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nInSamples) {
|
||||
for (unsigned int i = 0; i < N_CHANNELS; i++)
|
||||
bw_src_int_process(&coeffs, states + i, x.data()[i], y.data()[i], nInSamples);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user