bwpp_{dist,drive,fuzz} + fxpp_{dist,drive,fuzz}

This commit is contained in:
Stefano D'Angelo 2023-06-25 16:40:30 +02:00
parent dccc39907e
commit 2a5e3d3ece
25 changed files with 1184 additions and 2 deletions

View File

@ -43,10 +43,10 @@ struct _bw_example_fxpp_clip {
SRCInt<1> srcDown;
// Parameters
float params[p_n];
float params[p_n];
// Buffers
float buf[BUF_SIZE];
float buf[BUF_SIZE];
_bw_example_fxpp_clip() : srcUp(2), srcDown(-2) {}
};

View File

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

View File

@ -0,0 +1,37 @@
/*
* 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 3
static struct config_pin config_pins[NUM_PINS] = {
{ 0, 15 },
{ 1, 16 },
{ 2, 17 }
};
#endif

View 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
*/
#include "bw_example_fxpp_dist.h"
void bw_example_fxpp_dist_init(bw_example_fxpp_dist *instance) {
(void)instance;
}
void bw_example_fxpp_dist_set_sample_rate(bw_example_fxpp_dist *instance, float sample_rate) {
instance->dist.setSampleRate(2.f * sample_rate);
}
void bw_example_fxpp_dist_reset(bw_example_fxpp_dist *instance) {
instance->dist.reset();
instance->srcUp.reset();
instance->srcDown.reset();
}
void bw_example_fxpp_dist_process(bw_example_fxpp_dist *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->dist.process({instance->buf}, {instance->buf}, n << 1);
instance->srcDown.process({instance->buf}, {y[0] + i}, n << 1);
i += n;
}
}
void bw_example_fxpp_dist_set_parameter(bw_example_fxpp_dist *instance, int index, float value) {
instance->params[index] = value;
switch (index) {
case p_dist:
instance->dist.setDistortion(value);
break;
case p_tone:
instance->dist.setTone(value);
break;
case p_volume:
instance->dist.setVolume(value);
break;
}
}
float bw_example_fxpp_dist_get_parameter(bw_example_fxpp_dist *instance, int index) {
return instance->params[index];
}

View 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 _BW_EXAMPLE_FXPP_DIST_H
#define _BW_EXAMPLE_FXPP_DIST_H
#include <bwpp_dist.h>
#include <bwpp_src_int.h>
using namespace Brickworks;
extern "C" {
enum {
p_dist,
p_tone,
p_volume,
p_n
};
#define BUF_SIZE 32
struct _bw_example_fxpp_dist {
// Sub-components
Dist<1> dist;
SRCInt<1> srcUp;
SRCInt<1> srcDown;
// Parameters
float params[p_n];
// Buffers
float buf[BUF_SIZE];
_bw_example_fxpp_dist() : srcUp(2), srcDown(-2) {}
};
typedef struct _bw_example_fxpp_dist bw_example_fxpp_dist;
void bw_example_fxpp_dist_init(bw_example_fxpp_dist *instance);
void bw_example_fxpp_dist_set_sample_rate(bw_example_fxpp_dist *instance, float sample_rate);
void bw_example_fxpp_dist_reset(bw_example_fxpp_dist *instance);
void bw_example_fxpp_dist_process(bw_example_fxpp_dist *instance, const float** x, float** y, int n_samples);
void bw_example_fxpp_dist_set_parameter(bw_example_fxpp_dist *instance, int index, float value);
float bw_example_fxpp_dist_get_parameter(bw_example_fxpp_dist *instance, int index);
}
#endif

View File

@ -0,0 +1,89 @@
/*
* 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_dist"
#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 3
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
{ "Distortion", "Distortion", "", 0, 0, 0, 0.f },
{ "Tone", "Tone", "", 0, 0, 0, 0.5f },
{ "Volume", "Volume", "", 0, 0, 0, 1.f }
};
// Internal API
#include "bw_example_fxpp_dist.h"
#define P_TYPE bw_example_fxpp_dist
#define P_INIT bw_example_fxpp_dist_init
#define P_SET_SAMPLE_RATE bw_example_fxpp_dist_set_sample_rate
#define P_RESET bw_example_fxpp_dist_reset
#define P_PROCESS bw_example_fxpp_dist_process
#define P_SET_PARAMETER bw_example_fxpp_dist_set_parameter
#define P_GET_PARAMETER bw_example_fxpp_dist_get_parameter
#endif

View File

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

View 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 0x2e8f9a39
#define PLUGIN_GUID_2 0x9e364b22
#define PLUGIN_GUID_3 0x86b3700c
#define PLUGIN_GUID_4 0xe45f087f
#define CTRL_GUID_1 0xeaedaadf
#define CTRL_GUID_2 0x47f24b9a
#define CTRL_GUID_3 0xba44a3f5
#define CTRL_GUID_4 0xe2381a56
#endif

View File

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

View File

@ -0,0 +1,37 @@
/*
* 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 3
static struct config_pin config_pins[NUM_PINS] = {
{ 0, 15 },
{ 1, 16 },
{ 2, 17 }
};
#endif

View File

@ -0,0 +1,65 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redriveribute 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 driveributed 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_drive.h"
void bw_example_fxpp_drive_init(bw_example_fxpp_drive *instance) {
(void)instance;
}
void bw_example_fxpp_drive_set_sample_rate(bw_example_fxpp_drive *instance, float sample_rate) {
instance->drive.setSampleRate(2.f * sample_rate);
}
void bw_example_fxpp_drive_reset(bw_example_fxpp_drive *instance) {
instance->drive.reset();
instance->srcUp.reset();
instance->srcDown.reset();
}
void bw_example_fxpp_drive_process(bw_example_fxpp_drive *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->drive.process({instance->buf}, {instance->buf}, n << 1);
instance->srcDown.process({instance->buf}, {y[0] + i}, n << 1);
i += n;
}
}
void bw_example_fxpp_drive_set_parameter(bw_example_fxpp_drive *instance, int index, float value) {
instance->params[index] = value;
switch (index) {
case p_drive:
instance->drive.setDrive(value);
break;
case p_tone:
instance->drive.setTone(value);
break;
case p_volume:
instance->drive.setVolume(value);
break;
}
}
float bw_example_fxpp_drive_get_parameter(bw_example_fxpp_drive *instance, int index) {
return instance->params[index];
}

View File

@ -0,0 +1,65 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redriveribute 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 driveributed 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_DRIVE_H
#define _BW_EXAMPLE_FXPP_DRIVE_H
#include <bwpp_drive.h>
#include <bwpp_src_int.h>
using namespace Brickworks;
extern "C" {
enum {
p_drive,
p_tone,
p_volume,
p_n
};
#define BUF_SIZE 32
struct _bw_example_fxpp_drive {
// Sub-components
Drive<1> drive;
SRCInt<1> srcUp;
SRCInt<1> srcDown;
// Parameters
float params[p_n];
// Buffers
float buf[BUF_SIZE];
_bw_example_fxpp_drive() : srcUp(2), srcDown(-2) {}
};
typedef struct _bw_example_fxpp_drive bw_example_fxpp_drive;
void bw_example_fxpp_drive_init(bw_example_fxpp_drive *instance);
void bw_example_fxpp_drive_set_sample_rate(bw_example_fxpp_drive *instance, float sample_rate);
void bw_example_fxpp_drive_reset(bw_example_fxpp_drive *instance);
void bw_example_fxpp_drive_process(bw_example_fxpp_drive *instance, const float** x, float** y, int n_samples);
void bw_example_fxpp_drive_set_parameter(bw_example_fxpp_drive *instance, int index, float value);
float bw_example_fxpp_drive_get_parameter(bw_example_fxpp_drive *instance, int index);
}
#endif

View File

@ -0,0 +1,89 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redriveribute 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 driveributed 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_drive"
#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 3
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
{ "Overdrive", "Overdrive", "", 0, 0, 0, 0.f },
{ "Tone", "Tone", "", 0, 0, 0, 0.5f },
{ "Volume", "Volume", "", 0, 0, 0, 1.f }
};
// Internal API
#include "bw_example_fxpp_drive.h"
#define P_TYPE bw_example_fxpp_drive
#define P_INIT bw_example_fxpp_drive_init
#define P_SET_SAMPLE_RATE bw_example_fxpp_drive_set_sample_rate
#define P_RESET bw_example_fxpp_drive_reset
#define P_PROCESS bw_example_fxpp_drive_process
#define P_SET_PARAMETER bw_example_fxpp_drive_set_parameter
#define P_GET_PARAMETER bw_example_fxpp_drive_get_parameter
#endif

View File

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

View 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 0x42c027c9
#define PLUGIN_GUID_2 0x56f7494a
#define PLUGIN_GUID_3 0xbb2d3e2c
#define PLUGIN_GUID_4 0xe5198cb3
#define CTRL_GUID_1 0xb2401d4b
#define CTRL_GUID_2 0x3708439b
#define CTRL_GUID_3 0x81577630
#define CTRL_GUID_4 0xb7860b39
#endif

View File

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

View 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

View File

@ -0,0 +1,62 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can refuzzribute 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 fuzzributed 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_fuzz.h"
void bw_example_fxpp_fuzz_init(bw_example_fxpp_fuzz *instance) {
(void)instance;
}
void bw_example_fxpp_fuzz_set_sample_rate(bw_example_fxpp_fuzz *instance, float sample_rate) {
instance->fuzz.setSampleRate(2.f * sample_rate);
}
void bw_example_fxpp_fuzz_reset(bw_example_fxpp_fuzz *instance) {
instance->fuzz.reset();
instance->srcUp.reset();
instance->srcDown.reset();
}
void bw_example_fxpp_fuzz_process(bw_example_fxpp_fuzz *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->fuzz.process({instance->buf}, {instance->buf}, n << 1);
instance->srcDown.process({instance->buf}, {y[0] + i}, n << 1);
i += n;
}
}
void bw_example_fxpp_fuzz_set_parameter(bw_example_fxpp_fuzz *instance, int index, float value) {
instance->params[index] = value;
switch (index) {
case p_fuzz:
instance->fuzz.setFuzz(value);
break;
case p_volume:
instance->fuzz.setVolume(value);
break;
}
}
float bw_example_fxpp_fuzz_get_parameter(bw_example_fxpp_fuzz *instance, int index) {
return instance->params[index];
}

View File

@ -0,0 +1,64 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can refuzzribute 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 fuzzributed 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_FUZZ_H
#define _BW_EXAMPLE_FXPP_FUZZ_H
#include <bwpp_fuzz.h>
#include <bwpp_src_int.h>
using namespace Brickworks;
extern "C" {
enum {
p_fuzz,
p_volume,
p_n
};
#define BUF_SIZE 32
struct _bw_example_fxpp_fuzz {
// Sub-components
Fuzz<1> fuzz;
SRCInt<1> srcUp;
SRCInt<1> srcDown;
// Parameters
float params[p_n];
// Buffers
float buf[BUF_SIZE];
_bw_example_fxpp_fuzz() : srcUp(2), srcDown(-2) {}
};
typedef struct _bw_example_fxpp_fuzz bw_example_fxpp_fuzz;
void bw_example_fxpp_fuzz_init(bw_example_fxpp_fuzz *instance);
void bw_example_fxpp_fuzz_set_sample_rate(bw_example_fxpp_fuzz *instance, float sample_rate);
void bw_example_fxpp_fuzz_reset(bw_example_fxpp_fuzz *instance);
void bw_example_fxpp_fuzz_process(bw_example_fxpp_fuzz *instance, const float** x, float** y, int n_samples);
void bw_example_fxpp_fuzz_set_parameter(bw_example_fxpp_fuzz *instance, int index, float value);
float bw_example_fxpp_fuzz_get_parameter(bw_example_fxpp_fuzz *instance, int index);
}
#endif

View File

@ -0,0 +1,88 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can refuzzribute 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 fuzzributed 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_fuzz"
#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] = {
{ "Fuzz", "Fuzz", "", 0, 0, 0, 0.f },
{ "Volume", "Volume", "", 0, 0, 0, 1.f }
};
// Internal API
#include "bw_example_fxpp_fuzz.h"
#define P_TYPE bw_example_fxpp_fuzz
#define P_INIT bw_example_fxpp_fuzz_init
#define P_SET_SAMPLE_RATE bw_example_fxpp_fuzz_set_sample_rate
#define P_RESET bw_example_fxpp_fuzz_reset
#define P_PROCESS bw_example_fxpp_fuzz_process
#define P_SET_PARAMETER bw_example_fxpp_fuzz_set_parameter
#define P_GET_PARAMETER bw_example_fxpp_fuzz_get_parameter
#endif

View File

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

View 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 0x91a20c9a
#define PLUGIN_GUID_2 0x069f4b8e
#define PLUGIN_GUID_3 0xa76bef96
#define PLUGIN_GUID_4 0x6ed536b3
#define CTRL_GUID_1 0x7bf90a59
#define CTRL_GUID_2 0x3f854724
#define CTRL_GUID_3 0x9fa315de
#define CTRL_GUID_4 0x5fd7de7c
#endif

93
include/bwpp_dist.h Normal file
View 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_DIST_H
#define BWPP_DIST_H
#include <bw_dist.h>
#include <array>
namespace Brickworks {
template<BW_SIZE_T N_CHANNELS>
class Dist {
public:
Dist();
void setSampleRate(float sampleRate);
void reset();
void process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples);
void setDistortion(float value);
void setTone(float value);
void setVolume(float value);
private:
bw_dist_coeffs coeffs;
bw_dist_state states[N_CHANNELS];
bw_dist_state *statesP[N_CHANNELS];
};
template<BW_SIZE_T N_CHANNELS>
Dist<N_CHANNELS>::Dist() {
bw_dist_init(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
statesP[i] = states + i;
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::setSampleRate(float sampleRate) {
bw_dist_set_sample_rate(&coeffs, sampleRate);
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::reset() {
bw_dist_reset_coeffs(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
bw_dist_reset_state(&coeffs, states + i);
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples) {
bw_dist_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::setDistortion(float value) {
bw_dist_set_distortion(&coeffs, value);
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::setTone(float value) {
bw_dist_set_tone(&coeffs, value);
}
template<BW_SIZE_T N_CHANNELS>
void Dist<N_CHANNELS>::setVolume(float value) {
bw_dist_set_volume(&coeffs, value);
}
}
#endif

93
include/bwpp_drive.h Normal file
View File

@ -0,0 +1,93 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redriveribute 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 driveributed 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_DRIVE_H
#define BWPP_DRIVE_H
#include <bw_drive.h>
#include <array>
namespace Brickworks {
template<BW_SIZE_T N_CHANNELS>
class Drive {
public:
Drive();
void setSampleRate(float sampleRate);
void reset();
void process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples);
void setDrive(float value);
void setTone(float value);
void setVolume(float value);
private:
bw_drive_coeffs coeffs;
bw_drive_state states[N_CHANNELS];
bw_drive_state *statesP[N_CHANNELS];
};
template<BW_SIZE_T N_CHANNELS>
Drive<N_CHANNELS>::Drive() {
bw_drive_init(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
statesP[i] = states + i;
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::setSampleRate(float sampleRate) {
bw_drive_set_sample_rate(&coeffs, sampleRate);
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::reset() {
bw_drive_reset_coeffs(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
bw_drive_reset_state(&coeffs, states + i);
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples) {
bw_drive_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::setDrive(float value) {
bw_drive_set_drive(&coeffs, value);
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::setTone(float value) {
bw_drive_set_tone(&coeffs, value);
}
template<BW_SIZE_T N_CHANNELS>
void Drive<N_CHANNELS>::setVolume(float value) {
bw_drive_set_volume(&coeffs, value);
}
}
#endif

87
include/bwpp_fuzz.h Normal file
View File

@ -0,0 +1,87 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can refuzzribute 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 fuzzributed 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_FUZZ_H
#define BWPP_FUZZ_H
#include <bw_fuzz.h>
#include <array>
namespace Brickworks {
template<BW_SIZE_T N_CHANNELS>
class Fuzz {
public:
Fuzz();
void setSampleRate(float sampleRate);
void reset();
void process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples);
void setFuzz(float value);
void setVolume(float value);
private:
bw_fuzz_coeffs coeffs;
bw_fuzz_state states[N_CHANNELS];
bw_fuzz_state *statesP[N_CHANNELS];
};
template<BW_SIZE_T N_CHANNELS>
Fuzz<N_CHANNELS>::Fuzz() {
bw_fuzz_init(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
statesP[i] = states + i;
}
template<BW_SIZE_T N_CHANNELS>
void Fuzz<N_CHANNELS>::setSampleRate(float sampleRate) {
bw_fuzz_set_sample_rate(&coeffs, sampleRate);
}
template<BW_SIZE_T N_CHANNELS>
void Fuzz<N_CHANNELS>::reset() {
bw_fuzz_reset_coeffs(&coeffs);
for (unsigned int i = 0; i < N_CHANNELS; i++)
bw_fuzz_reset_state(&coeffs, states + i);
}
template<BW_SIZE_T N_CHANNELS>
void Fuzz<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y,
int nSamples) {
bw_fuzz_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
}
template<BW_SIZE_T N_CHANNELS>
void Fuzz<N_CHANNELS>::setFuzz(float value) {
bw_fuzz_set_fuzz(&coeffs, value);
}
template<BW_SIZE_T N_CHANNELS>
void Fuzz<N_CHANNELS>::setVolume(float value) {
bw_fuzz_set_volume(&coeffs, value);
}
}
#endif