fx(pp)_wah
This commit is contained in:
parent
2bb3d1c9f5
commit
a80aa87b27
5
examples/fx_wah/src/android.json
Normal file
5
examples/fx_wah/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fx_wah"
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#include "bw_example_fx_wah.h"
|
||||
|
||||
void bw_example_fx_wah_init(bw_example_fx_wah *instance) {
|
||||
bw_wah_init(&instance->wah_coeffs);
|
||||
}
|
||||
|
||||
void bw_example_fx_wah_set_sample_rate(bw_example_fx_wah *instance, float sample_rate) {
|
||||
bw_wah_set_sample_rate(&instance->wah_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
void bw_example_fx_wah_reset(bw_example_fx_wah *instance) {
|
||||
bw_wah_reset_coeffs(&instance->wah_coeffs);
|
||||
bw_wah_reset_state(&instance->wah_coeffs, &instance->wah_state, 0.f);
|
||||
}
|
||||
|
||||
void bw_example_fx_wah_process(bw_example_fx_wah *instance, const float** x, float** y, int n_samples) {
|
||||
bw_wah_process(&instance->wah_coeffs, &instance->wah_state, x[0], y[0], n_samples);
|
||||
}
|
||||
|
||||
void bw_example_fx_wah_set_parameter(bw_example_fx_wah *instance, int index, float value) {
|
||||
instance->params[index] = value;
|
||||
bw_wah_set_wah(&instance->wah_coeffs, value);
|
||||
}
|
||||
|
||||
float bw_example_fx_wah_get_parameter(bw_example_fx_wah *instance, int index) {
|
||||
return instance->params[index];
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef _BW_EXAMPLE_FX_WAH_H
|
||||
#define _BW_EXAMPLE_FX_WAH_H
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#include <bw_wah.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
p_wah,
|
||||
p_n
|
||||
};
|
||||
|
||||
struct _bw_example_fx_wah {
|
||||
// Sub-components
|
||||
bw_wah_coeffs wah_coeffs;
|
||||
bw_wah_state wah_state;
|
||||
|
||||
// Parameters
|
||||
float params[p_n];
|
||||
};
|
||||
typedef struct _bw_example_fx_wah bw_example_fx_wah;
|
||||
|
||||
void bw_example_fx_wah_init(bw_example_fx_wah *instance);
|
||||
void bw_example_fx_wah_set_sample_rate(bw_example_fx_wah *instance, float sample_rate);
|
||||
void bw_example_fx_wah_reset(bw_example_fx_wah *instance);
|
||||
void bw_example_fx_wah_process(bw_example_fx_wah *instance, const float** x, float** y, int n_samples);
|
||||
void bw_example_fx_wah_set_parameter(bw_example_fx_wah *instance, int index, float value);
|
||||
float bw_example_fx_wah_get_parameter(bw_example_fx_wah *instance, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
6
examples/fx_wah/src/cmd.json
Normal file
6
examples/fx_wah/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "wah" ]
|
||||
}
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File authors: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef _CONFIG_H
|
||||
#define _CONFIG_H
|
||||
|
||||
// Definitions
|
||||
|
||||
#define IO_MONO 1
|
||||
#define IO_STEREO (1<<1)
|
||||
|
||||
struct config_io_bus {
|
||||
const char *name;
|
||||
char out;
|
||||
char aux;
|
||||
char cv;
|
||||
char configs;
|
||||
};
|
||||
|
||||
struct config_parameter {
|
||||
const char *name;
|
||||
const char *shortName;
|
||||
const char *units;
|
||||
char out;
|
||||
char bypass;
|
||||
int steps;
|
||||
float defaultValueUnmapped;
|
||||
};
|
||||
|
||||
// Data
|
||||
|
||||
#define COMPANY_NAME "Orastron"
|
||||
#define COMPANY_WEBSITE "https://www.orastron.com/"
|
||||
#define COMPANY_MAILTO "mailto:info@orastron.com"
|
||||
|
||||
#define PLUGIN_NAME "bw_example_fx_wah"
|
||||
#define PLUGIN_VERSION "1.0.0"
|
||||
|
||||
#define NUM_BUSES_IN 1
|
||||
#define NUM_BUSES_OUT 1
|
||||
#define NUM_CHANNELS_IN 1
|
||||
#define NUM_CHANNELS_OUT 1
|
||||
|
||||
static struct config_io_bus config_buses_in[NUM_BUSES_IN] = {
|
||||
{ "Audio in", 0, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
static struct config_io_bus config_buses_out[NUM_BUSES_OUT] = {
|
||||
{ "Audio out", 1, 0, 0, IO_MONO }
|
||||
};
|
||||
|
||||
#define NUM_PARAMETERS 1
|
||||
|
||||
static struct config_parameter config_parameters[NUM_PARAMETERS] = {
|
||||
{ "Wah", "Wah", "", 0, 0, 0, 0.5f },
|
||||
};
|
||||
|
||||
// Internal API
|
||||
|
||||
#include "bw_example_fx_wah.h"
|
||||
|
||||
#define P_TYPE bw_example_fx_wah
|
||||
#define P_INIT bw_example_fx_wah_init
|
||||
#define P_SET_SAMPLE_RATE bw_example_fx_wah_set_sample_rate
|
||||
#define P_RESET bw_example_fx_wah_reset
|
||||
#define P_PROCESS bw_example_fx_wah_process
|
||||
#define P_SET_PARAMETER bw_example_fx_wah_set_parameter
|
||||
#define P_GET_PARAMETER bw_example_fx_wah_get_parameter
|
||||
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* Brickworks is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
var buses = [
|
||||
{
|
||||
stereo: false,
|
||||
output: false
|
||||
},
|
||||
{
|
||||
stereo: false,
|
||||
output: true
|
||||
}
|
||||
];
|
||||
|
||||
var parameters = [
|
||||
{
|
||||
name: "Wah",
|
||||
output: false,
|
||||
defaultValue: 0.5
|
||||
}
|
||||
];
|
5
examples/fx_wah/src/daisy-seed.json
Normal file
5
examples/fx_wah/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15 ]
|
||||
}
|
||||
}
|
5
examples/fx_wah/src/ios.json
Normal file
5
examples/fx_wah/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fx_wah"
|
||||
}
|
||||
}
|
12
examples/fx_wah/src/lv2.json
Normal file
12
examples/fx_wah/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fx_wah",
|
||||
"types": [ "@lv2:FilterPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "wah" ]
|
||||
}
|
||||
}
|
49
examples/fx_wah/src/plugin.h
Normal file
49
examples/fx_wah/src/plugin.h
Normal file
@ -0,0 +1,49 @@
|
||||
#include "common.h"
|
||||
#include <bw_wah.h>
|
||||
|
||||
typedef struct plugin {
|
||||
bw_wah_coeffs wah_coeffs;
|
||||
bw_wah_state wah_state;
|
||||
} plugin;
|
||||
|
||||
static void plugin_init(plugin *instance) {
|
||||
bw_wah_init(&instance->wah_coeffs);
|
||||
}
|
||||
|
||||
static void plugin_fini(plugin *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||
bw_wah_set_sample_rate(&instance->wah_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static size_t plugin_mem_req(plugin *instance) {
|
||||
(void)instance;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||
(void)instance;
|
||||
(void)mem;
|
||||
}
|
||||
|
||||
static void plugin_reset(plugin *instance) {
|
||||
bw_wah_reset_coeffs(&instance->wah_coeffs);
|
||||
bw_wah_reset_state(&instance->wah_coeffs, &instance->wah_state, 0.f);
|
||||
}
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
(void)index;
|
||||
bw_wah_set_wah(&instance->wah_coeffs, 0.01f * value);
|
||||
}
|
||||
|
||||
static float plugin_get_parameter(plugin *instance, size_t index) {
|
||||
(void)instance;
|
||||
(void)index;
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
static void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
|
||||
bw_wah_process(&instance->wah_coeffs, &instance->wah_state, inputs[0], outputs[0], n_samples);
|
||||
}
|
36
examples/fx_wah/src/product.json
Normal file
36
examples/fx_wah/src/product.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickworks wah example",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fx_wah",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Wah",
|
||||
"shortName": "Wah",
|
||||
"direction": "input",
|
||||
"defaultValue": 50.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 100.0,
|
||||
"unit": "pc",
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fx_wah/src/vst3.json
Normal file
11
examples/fx_wah/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "487359a7066e4c8b93e3a38a7e478d37"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "345f339c27d344ef937537d5bacab2a6"
|
||||
},
|
||||
"subCategory": "Fx|Filter"
|
||||
}
|
||||
}
|
5
examples/fxpp_wah/src/android.json
Normal file
5
examples/fxpp_wah/src/android.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"android": {
|
||||
"javaPackageName": "com.orastron.bw_example_fxpp_wah"
|
||||
}
|
||||
}
|
6
examples/fxpp_wah/src/cmd.json
Normal file
6
examples/fxpp_wah/src/cmd.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "wah" ]
|
||||
}
|
||||
}
|
5
examples/fxpp_wah/src/daisy-seed.json
Normal file
5
examples/fxpp_wah/src/daisy-seed.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15 ]
|
||||
}
|
||||
}
|
47
examples/fxpp_wah/src/impl.cpp
Normal file
47
examples/fxpp_wah/src/impl.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include "impl.h"
|
||||
|
||||
#include "common.h"
|
||||
#include <bw_wah.h>
|
||||
|
||||
using namespace Brickworks;
|
||||
|
||||
extern "C" {
|
||||
|
||||
impl impl_new(void) {
|
||||
Wah<1> *instance = new Wah<1>();
|
||||
return reinterpret_cast<impl>(instance);
|
||||
}
|
||||
|
||||
void impl_free(impl handle) {
|
||||
Wah<1> *instance = reinterpret_cast<Wah<1> *>(handle);
|
||||
delete instance;
|
||||
}
|
||||
|
||||
void impl_set_sample_rate(impl handle, float sample_rate) {
|
||||
Wah<1> *instance = reinterpret_cast<Wah<1> *>(handle);
|
||||
instance->setSampleRate(sample_rate);
|
||||
}
|
||||
|
||||
void impl_reset(impl handle) {
|
||||
Wah<1> *instance = reinterpret_cast<Wah<1> *>(handle);
|
||||
instance->reset();
|
||||
}
|
||||
|
||||
void impl_set_parameter(impl handle, size_t index, float value) {
|
||||
(void)index;
|
||||
Wah<1> *instance = reinterpret_cast<Wah<1> *>(handle);
|
||||
instance->setWah(0.01f * value);
|
||||
}
|
||||
|
||||
float impl_get_parameter(impl handle, size_t index) {
|
||||
(void)handle;
|
||||
(void)index;
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
void impl_process(impl handle, const float **inputs, float **outputs, size_t n_samples) {
|
||||
Wah<1> *instance = reinterpret_cast<Wah<1> *>(handle);
|
||||
instance->process(inputs, outputs, n_samples);
|
||||
}
|
||||
|
||||
}
|
5
examples/fxpp_wah/src/ios.json
Normal file
5
examples/fxpp_wah/src/ios.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"ios": {
|
||||
"productBundleIdentifier": "com.orastron.bw_example_fxpp_wah"
|
||||
}
|
||||
}
|
12
examples/fxpp_wah/src/lv2.json
Normal file
12
examples/fxpp_wah/src/lv2.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"lv2": {
|
||||
"prefixes": {
|
||||
"bw_examples": "https://www.orastron.com/brickworks/examples/"
|
||||
},
|
||||
"uri": "@bw_examples:fxpp_wah",
|
||||
"types": [ "@lv2:FilterPlugin" ],
|
||||
"version": "1.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "wah" ]
|
||||
}
|
||||
}
|
49
examples/fxpp_wah/src/plugin.h
Normal file
49
examples/fxpp_wah/src/plugin.h
Normal file
@ -0,0 +1,49 @@
|
||||
#include "common.h"
|
||||
#include <bw_wah.h>
|
||||
|
||||
typedef struct plugin {
|
||||
bw_wah_coeffs wah_coeffs;
|
||||
bw_wah_state wah_state;
|
||||
} plugin;
|
||||
|
||||
static void plugin_init(plugin *instance) {
|
||||
bw_wah_init(&instance->wah_coeffs);
|
||||
}
|
||||
|
||||
static void plugin_fini(plugin *instance) {
|
||||
(void)instance;
|
||||
}
|
||||
|
||||
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
|
||||
bw_wah_set_sample_rate(&instance->wah_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static size_t plugin_mem_req(plugin *instance) {
|
||||
(void)instance;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void plugin_mem_set(plugin *instance, void *mem) {
|
||||
(void)instance;
|
||||
(void)mem;
|
||||
}
|
||||
|
||||
static void plugin_reset(plugin *instance) {
|
||||
bw_wah_reset_coeffs(&instance->wah_coeffs);
|
||||
bw_wah_reset_state(&instance->wah_coeffs, &instance->wah_state, 0.f);
|
||||
}
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
(void)index;
|
||||
bw_wah_set_wah(&instance->wah_coeffs, 0.01f * value);
|
||||
}
|
||||
|
||||
static float plugin_get_parameter(plugin *instance, size_t index) {
|
||||
(void)instance;
|
||||
(void)index;
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
static void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
|
||||
bw_wah_process(&instance->wah_coeffs, &instance->wah_state, inputs[0], outputs[0], n_samples);
|
||||
}
|
36
examples/fxpp_wah/src/product.json
Normal file
36
examples/fxpp_wah/src/product.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"product": {
|
||||
"name": "Brickworks wah example (C++)",
|
||||
"version": "1.1.0",
|
||||
"buildVersion": "1",
|
||||
"bundleName": "bw_example_fxpp_wah",
|
||||
"buses": [
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "input",
|
||||
"channels": "mono",
|
||||
"name": "Input",
|
||||
"shortName": "Input"
|
||||
},
|
||||
{
|
||||
"type": "audio",
|
||||
"direction": "output",
|
||||
"channels": "mono",
|
||||
"name": "Output",
|
||||
"shortName": "Output"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "Wah",
|
||||
"shortName": "Wah",
|
||||
"direction": "input",
|
||||
"defaultValue": 50.0,
|
||||
"minimum": 0.0,
|
||||
"maximum": 100.0,
|
||||
"unit": "pc",
|
||||
"map": "linear"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
11
examples/fxpp_wah/src/vst3.json
Normal file
11
examples/fxpp_wah/src/vst3.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"vst3": {
|
||||
"plugin": {
|
||||
"cid": "18b26026c0ab4b9c815e8de8a85b3417"
|
||||
},
|
||||
"controller": {
|
||||
"cid": "6c3a4f05e0444e70a581c0d26a5bd4be"
|
||||
},
|
||||
"subCategory": "Fx|Filter"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user