Compare commits

...

82 Commits
v1.1.0 ... main

Author SHA1 Message Date
181285f4ff fix C++ implementation bw_iir{1,2} 2025-02-03 11:53:25 +01:00
ca4c4fa006 fix bug in debugging code in bw_iir2_process 2025-02-03 07:10:08 +01:00
512546f108 potential optimization in bw_iir{1,2}_process_multi 2025-02-03 07:03:23 +01:00
2a6f149612 fix doc typos 2025-02-03 06:21:31 +01:00
aaeba97a37 fix typo in bw_iir2 2025-02-01 15:23:11 +01:00
d49fc15db2 updated examples' README 2025-02-01 10:19:05 +01:00
b93eb5d836 updated to latest android packages 2025-02-01 09:11:11 +01:00
5661ebc0e7 now version and build version are set by tibia_gen.sh in examples 2025-01-31 18:20:38 +01:00
7d521e51e0 bw_iir{1,2}: fixed, updated doc 2025-01-31 11:35:02 +01:00
61afaca400 bw_iir1 doc + bw_iir2 limited prewarping freq 2025-01-31 08:13:32 +01:00
fbd0890017 fix asterisk-escaping typos in doc 2025-01-30 10:23:25 +01:00
4220bed501 bw_iir{1,2}: more debugging and api improvements 2025-01-29 16:11:40 +01:00
ee327ebe80 bw_iir1 debbugging code 2025-01-28 19:27:08 +01:00
a6d52765a6 now using BW_NULL instead of nullptr in C++ API/implementations 2025-01-28 16:22:07 +01:00
029ec29f6d added prewarp_at_cutoff in bw_iir{1,2} 2025-01-28 15:45:41 +01:00
20bb3a8193 new examples fxpp_iir{1,2} 2025-01-28 10:22:55 +01:00
fb3ab23599 fx_iir2: fix reset 2025-01-28 09:39:41 +01:00
f58353bc20 bw_iir{1,2} fixes + fx_iir{1,2} examples 2025-01-28 09:33:51 +01:00
1be6e06699 bw_iir{1,2} progress 2025-01-28 08:50:33 +01:00
4487ef2176 update copyright + bw_osc_sin cosmetics + beginning of bw_iir{1,2}.h 2025-01-27 23:27:01 +01:00
65eeade32d update to latest tibia changes 2024-12-13 17:15:41 +01:00
83e101cf8e added extra makefile rules for web-demo 2024-12-13 14:33:29 +01:00
Stefano D'Angelo
c779481486 update to latest tibia again 2024-12-12 12:13:11 +01:00
Stefano D'Angelo
a605293801 hopefully updated to latest tibia 2024-12-12 11:34:17 +01:00
67756cf502 updating to latest tibia (many examples likely broken now) 2024-12-12 08:18:32 +01:00
02e628e5b0 bw_one_pole: fix doc typo 2024-12-08 21:24:15 +01:00
ff459dece1 bw_gain: fix doc typo 2024-12-08 19:01:58 +01:00
defabafb45 bw_gain: fix changelog 2024-12-08 18:06:02 +01:00
578bec397f cosmetics 2024-12-08 15:44:43 +01:00
5c91a48e42 fix doc typo 2024-12-04 12:40:54 +01:00
abc65d292a fix tibia tag link 2024-12-04 11:27:03 +01:00
d2b15d9155 not including tibia in releases anymore 2024-12-04 10:46:29 +01:00
90f03881fd change ios deployment target to 14.0 in examples 2024-12-04 10:26:34 +01:00
Stefano D'Angelo
5015dd6bbd bw_common: remove Brickworks references in doc 2024-11-29 14:18:51 +01:00
724d7c6b8a bw_math doc cosmetic fix 2024-11-19 08:53:55 +01:00
da22954810 bw_buf doc cosmetics 2024-11-18 17:52:29 +01:00
f3a12e8e0a bw_mm{1,2}: clarified implemented transfer function 2024-11-11 08:03:10 +01:00
ff99bda751 bw_{delay,env_gen}: fix BW_DEBUG_DEEP 2024-11-10 10:53:07 +01:00
b214bc896e bw_math: add bw_log2_1p2xf, bw_log_1pexpxf, bw_log10_1p10xf 2024-11-01 12:24:15 +01:00
Stefano D'Angelo
6431749bf8 bw_reverb: add missing BW_RESTRICT and fix doc 2024-10-23 08:21:35 +02:00
3a8e279fde cosmetics 2024-10-14 11:27:47 +02:00
Stefano D'Angelo
2ba329f5ea cosmetics 2024-10-11 15:59:22 +02:00
Stefano D'Angelo
f1e471e9bf fix bug in bw_note_queue_is_valid() 2024-10-11 11:02:59 +02:00
340d527ffa add bw_note_queue_all_notes_off 2024-10-11 07:09:02 +02:00
dd6f6adb2c fix typo in bw_note_queue + cosmetics 2024-10-02 11:30:32 +02:00
c7f930673f add sticky thresh to bw_gain and needed related api to bw_one_pole 2024-09-24 07:28:39 +02:00
98e5ef65c4 bw_reverb: cosmetics 2024-09-21 15:38:05 +02:00
daf0cb3e1c introduce BW_{INCLUDE_WITH_QUOTES,NO_CXX,CXX_NO_EXTERN_C} 2024-09-21 12:45:00 +02:00
324aa911fd bw_voice_alloc: added static inline 2024-09-18 17:03:31 +02:00
Stefano D'Angelo
f530db5c45 bw_buf cosmetics 2024-08-30 14:27:58 +02:00
Stefano D'Angelo
eaaeebb8ff bw_buf: add bw_buf_copy() and bw_buf_copy_multi() 2024-08-30 12:11:28 +02:00
adbd1ab61c bw_env_gen: reintroduce BW_ENV_GEN_V_MAX 2024-08-29 18:16:59 +02:00
750c807db3 oops, removed generated files 2024-08-26 17:31:07 +02:00
f6b4e1b7ec adjusted to latest tibia updated 2024-08-26 17:30:25 +02:00
b517c83cb5 bw_env_gen added process output bound debugging check 2024-08-24 17:31:25 +02:00
9cb3bb00fa bw_math int64 routines 2024-08-24 17:20:46 +02:00
099fb7507b bw_env_gen fix reset w/ skip sustain and strengthened implementation 2024-08-23 17:28:09 +02:00
Paolo Marrone
091b677663 better instructions for android example 2024-07-09 11:45:24 +02:00
862e56840f bw_phase_gen: fix doc 2024-07-07 18:11:28 +02:00
Stefano D'Angelo
6f856ec04c bw_src_int cosmetics 2024-07-05 11:51:56 +02:00
Stefano D'Angelo
07387edcc6 fixed fx(pp)_bitcrush on daisy seed and adapted to latest tibia 2024-07-02 19:12:01 +02:00
Stefano D'Angelo
eef7f35dc5 enforcing combined parameter limits also in *reset_state 2024-07-02 12:08:55 +02:00
Stefano D'Angelo
7b53b045a9 fix missing #endif in bw_bd_reduce 2024-07-02 11:37:08 +02:00
Stefano D'Angelo
99b6ec2996 this should be it 2024-07-02 11:28:45 +02:00
Stefano D'Angelo
e5cc92c72f more of the same 2024-07-02 10:27:05 +02:00
f04fcac4ea more of the same 2024-07-02 07:17:12 +02:00
c2c1979cc3 more of the same + fix new checks in bw_osc_{pulse,tri}_coeffs_is_valid 2024-07-02 06:46:45 +02:00
1e34773da8 adding extra debug checks to process_multi functions (wip) 2024-07-02 06:15:27 +02:00
f623002c27 bw_phase_gen: bw_phase_get_set_phase_inc_{min,max} doc 2024-07-01 19:30:42 +02:00
Stefano D'Angelo
2860ddc141 bw_phase_gen: add phase_inc_{min,max} comparison checks 2024-07-01 17:45:56 +02:00
Stefano D'Angelo
06fc92a2e0 bw_phase_gen: add phase_inc_{min,max} parameters 2024-07-01 17:33:45 +02:00
Stefano D'Angelo
af6ce9ba5e bw_osc_tri cosmetics 2024-06-27 17:12:16 +02:00
93ddf112bb bw_osc_{saw,pulse,tri}: extra validation checks and cosmetics 2024-06-22 18:49:12 +02:00
Stefano D'Angelo
5d3fbdbb0a more freq-related fixes in bw_phase_gen 2024-06-20 09:52:13 +02:00
Stefano D'Angelo
861cdc427e fix rounding bug and extra debug checks for bw_phase_gen 2024-06-18 15:22:13 +02:00
Stefano D'Angelo
5bd685ed7b updated to latest tibia 2024-06-17 10:48:09 +02:00
10a2d1ff45 revised process_multi buffer assumptions 2024-06-15 13:16:08 +02:00
Stefano D'Angelo
1d731eaafb accomodate msvc reporting wrong C++ standard support 2024-04-15 12:15:54 +02:00
Stefano D'Angelo
4dfbded165 fix process() invokation in fxpp_pan 2024-03-19 13:54:26 +01:00
Stefano D'Angelo
5f2a413b4d add gate param to bw_bd_reduce and examples + fix fxpp_bitcrush 2024-03-13 12:28:35 +01:00
Stefano D'Angelo
a4a8ba96ca add bw_dry_wet_get_wet(_cur)() 2024-03-07 18:45:52 +01:00
Stefano D'Angelo
93f571af18 avoid bw_minf() to compute samples in synth* 2024-03-07 16:57:50 +01:00
402 changed files with 9064 additions and 3217 deletions

View File

@ -11,7 +11,7 @@ You can find information and documentation [on the official web page](https://ww
## Legal
Copyright (C) 2021-2024 Orastron Srl unipersonale.
Copyright (C) 2021-2025 Orastron Srl unipersonale.
Authors: Stefano D'Angelo, Paolo Marrone.

View File

@ -2,9 +2,23 @@
## Premise
Each of these examples consists of a common part of code, shared by all examples, which contains all necessary boilerplate code and is not Brickworks-related, and a specific part which actually implements the audio engine. The common code is copied/generated by an external tool called [Tibia](https://github.com/sdangelo/tibia). If you downloaded an official Brickworks release you don't need to care about any of this - all needed files will already be present -, otherwise you first need to [run Tibia as outlined below](#tibia). You might also want to do that if you need to edit the location of third-party dependencies (this is better explained in the following platform-specific instructions).
Each of these examples consists of common and boilerplate code, which is not Brickworks-related, and a specific part which actually implements the audio engine. The common code is copied/generated by an external tool called [Tibia](https://git.orastron.com/orastron/tibia), which you first need to [run as outlined below](#tibia).
Each subfolder contains an example, except the `common` folder, which contains a good deal of common code and common Tibia metadata. In order to build an example just `cd` to <code>*example*/*platform*</code> and use the following platform-specific instructions. Building for any platform requires a recent enough version of [GNU Make](https://www.gnu.org/software/make/) installed.
Each subfolder contains an example, except the `common` folder, which contains a good deal of common code and common Tibia-related metadata. In order to build an example, once Tibia has generated common and boilerplate code, you can just `cd` to <code>*example*/*platform*</code> and use the following platform-specific instructions. Building for any platform requires a recent enough version of [GNU Make](https://www.gnu.org/software/make/) installed.
## Tibia
### Prerequisites
You need [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com/) to be installed.
### Usage
Get [Tibia 0.1.0](https://git.orastron.com/orastron/tibia/releases/tag/v0.1.0), extract the `tibia` folder and place it in the same parent directory as the Brickworks folder. Then either `cd` to the `tibia` folder and `npm install dot`, or install the [dot npm package](https://www.npmjs.com/package/dot) globally and make sure that the `NODE_PATH` environment variable is corretly set to find it.
Now you can `cd` to the `examples` folder and run `./tibia_gen.sh` to copy/generate files for all examples, or otherwise run `./tibia_gen.sh common` to only copy/generate files in `examples/common` or <code>./tibia\_gen.sh *example*</code> to do the same for files in <code>examples/*example*</code>.
If you want to remove all files copied/generated by Tibia, and thus restore the `examples` directory as it would appear in the official repository, run `./tibia_clean.sh` from the `examples` directory.
## VST3
@ -12,7 +26,7 @@ Each subfolder contains an example, except the `common` folder, which contains a
Windows (via [MSYS2/Mingw-w64](https://www.msys2.org/)), macOS, and Linux OSes are supported. Building tested with [GCC](https://gcc.gnu.org/), probably also works with [Clang](https://clang.llvm.org/).
You also need to download or clone the [VST3 C API](https://github.com/steinbergmedia/vst3_c_api) and place it in the same folder as the Brickworks folder, or otherwise edit `common/src/vst3-make.json` and change `cflags` to point to the correct directory then finally [run Tibia](#tibia), or invoke `make` with appropriate `CFLAGS` straight from the command line.
You also need to download or clone the [VST3 C API](https://github.com/steinbergmedia/vst3_c_api) and place it in the same parent folder as the Brickworks folder, or otherwise edit `common/src/vars-pre.mk` and change `CFLAGS_EXTRA` to point to the correct directory, or invoke `make` with appropriate `CFLAGS` straight from the command line.
### Build
@ -28,7 +42,7 @@ If all went fine, you can install for the current user (i.e., into the user VST3
Windows (via [MSYS2/Mingw-w64](https://www.msys2.org/)), macOS, and Linux OSes are supported. Building tested with [GCC](https://gcc.gnu.org/), probably also works with [Clang](https://clang.llvm.org/).
You also need to download/install [LV2](https://lv2plug.in/), so that either header files are found by the compiler in its default include path, or otherwise you could add an appropriate `cflags` value to `common/src/lv2-make.json` and [run Tibia](#tibia), or invoke `make` with appropriate `CFLAGS` straight from the command line.
You also need to download/install [LV2](https://lv2plug.in/), so that either header files are found by the compiler in its default include path, or otherwise you could add an appropriate `CFLAGS_EXTRA` value to `common/src/vars-pre.mk`, or invoke `make` with appropriate `CFLAGS` straight from the command line.
### Build
@ -36,13 +50,13 @@ In order to build just type `make`. You'll find the resulting LV2 bundle in <cod
### Installation
If all went fine, you can install for the current user (i.e., into the user VST3 folder) by invoking `make install-user` or for all users (i.e., into the system VST3 folder) by `make install`.
If all went fine, you can install for the current user (i.e., into the user LV2 folder) by invoking `make install-user` or for all users (i.e., into the system LV2 folder) by `make install`.
## Web
### Prerequisites
You need Clang with WebAssembly target support and [OpenSSL](https://www.openssl.org/) installed.
You need [Clang](https://clang.llvm.org/) with WebAssembly target support and [OpenSSL](https://www.openssl.org/) installed.
### Build
@ -58,7 +72,7 @@ The output files need to be served over HTTPS. A self-signed certificate is gene
Building and firmware upload was only tested on Linux. You need [arm-none-eabi-gcc](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) (for building) and [dfu-util](https://dfu-util.sourceforge.net/) (for firmware upload) installed.
You also need to clone/download [libDaisy](https://github.com/electro-smith/libDaisy) (beware that since version 7.0.0 you also need to clone submodules, see the [release notes](https://github.com/electro-smith/libDaisy/releases/tag/v7.0.0)), `cd` to it, and run `make`. You should either place it in the same folder as the Brickworks folder, or otherwise edit `common/src/daisy-seed-make.json` and change `libdaisyDir` to point to the correct directory then finally [run Tibia](#tibia).
You also need to clone/download [libDaisy](https://github.com/electro-smith/libDaisy) (beware that since version 7.0.0 you also need to clone submodules, see the [release notes](https://github.com/electro-smith/libDaisy/releases/tag/v7.0.0)), `cd` to it, and run `make`. You should either place it in the same folder as the Brickworks folder, or otherwise edit `common/src/vars-pre.mk` and change `LIBDAISY_DIR` to point to the correct directory.
### Build
@ -82,7 +96,7 @@ Android examples are built without the help of Android Studio or Gradle. You'll
- Android SDK (https://developer.android.com/studio/index.html) \*;
- Android NDK (https://developer.android.com/ndk/downloads) \*;
- `.jar`s and `.aar`s (and you'll also need to manually extract the inner `.jar` from each `.aar`, which are just ZIP files) for:
- `.jar`s and `.aar`s (and you'll also need to manually extract the inner `classes.jar` from each `xxx.aar`, which are just ZIP files, and rename `classes.jar` to `xxx.jar`) for:
- AndroidX Core (https://mvnrepository.com/artifact/androidx.core/core);
- AndroidX Lifecycle Common (https://mvnrepository.com/artifact/androidx.lifecycle/lifecycle-common)
- AndroidX VersionedParcelable (https://mvnrepository.com/artifact/androidx.versionedparcelable/versionedparcelable)
@ -91,7 +105,7 @@ Android examples are built without the help of Android Studio or Gradle. You'll
- Koltin Coroutines Core JVM (https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core-jvm);
- `miniaudio.h` library (http://miniaud.io/).
Then you'll probably also need to adjust paths and values in `common/src/android-make.json` and [run Tibia](#tibia).
Then you'll probably also need to adjust paths and values in `common/src/vars-pre.mk`.
\* You can install both the needed parts of the Android SDK and the NDK by downloading the so-called "command line tools" (https://developer.android.com/studio#command-line-tools-only) and using the included `sdkmanager` program. In such case you need to install the following packages: "platforms;android-*latest*", "build-tools;*latest*", "platform-tools", and "ndk;*latest*".
@ -103,7 +117,7 @@ In order to build just type `make`. You'll find the resulting `.apk` file in `bu
If all went fine, you can branch your device and install using `make install` or otherwise install manually.
### Usage and known issues
### Usage
Effect examples process audio input signals, therefore they will require permission to use the capture device.
@ -117,7 +131,7 @@ iOS examples are not directly built by the supplied Makefiles. These rather gene
For this to work you need to have the latest [Xcode](https://developer.apple.com/xcode/) and [XcodeGen](https://github.com/yonaskolb/XcodeGen) installed, as well as a copy of the latest [`miniaudio.h`](http://miniaud.io/).
Finally, you might need to adjust header search path for miniaudio in `common/src/ios-make.json`, `common/src/ios-make-cxx-fx.json`, and `common/src/io-make-cxx-synth.json`, and [run Tibia](#tibia).
Finally, you might need to adjust header search path for miniaudio in `common/src/ios-make.json` and [run Tibia](#tibia).
### Build
@ -139,7 +153,7 @@ Synth examples use input MIDI and support hotplugging.
Windows (via [MSYS2/Mingw-w64](https://www.msys2.org/)), macOS, and Linux OSes are supported. Building tested with [GCC](https://gcc.gnu.org/), probably also works with [Clang](https://clang.llvm.org/).
Depending on the specific example, you might need to download or clone [tinywav](https://github.com/mhroth/tinywav) and/or [midi-parser](https://github.com/abique/midi-parser) and place them in the same folder as the Brickworks folder, or otherwise edit `common/src/cmd-make.json`
Depending on the specific example, you might need to download or clone [tinywav](https://github.com/mhroth/tinywav) and/or [midi-parser](https://github.com/abique/midi-parser) and place them in the same folder as the Brickworks folder, or otherwise edit `common/src/vars-pre.mk`
### Build
@ -148,17 +162,3 @@ In order to build just type `make`. You'll find the resulting executable file in
### Usage
Just run the executable without arguments to get usage instructions.
## Tibia
### Prerequisites
You need [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com/) to be installed.
### Usage
Get [Tibia 0.0.1](https://github.com/sdangelo/tibia/releases/tag/v0.0.1), place it in the same directory as the Brickworks folder, and rename it as `tibia`. Then either `cd` to the Tibia folder and `npm install dot`, or install the [dot npm package](https://www.npmjs.com/package/dot) globally and make sure that the `NODE_PATH` environment variable is corretly set to find it.
Now you can `cd` to the `examples` folder and run `./tibia_gen.sh` to copy/generate files for all examples, or otherwise run `./tibia_gen.sh common` to only copy/generate files in `examples/common` or <code>./tibia\_gen.sh *example*</code> to do the same for files in <code>examples/*example*</code>.
If you want to remove all files copied/generated by Tibia, and thus restore the `examples` directory as it would appear in the official repository, run `./tibia_clean.sh` from the `examples` directory.

View File

@ -1,22 +0,0 @@
{
"android_make": {
"cxxflags": "-I../../../include -I../../common/src -I../../../../miniaudio",
"commonDir": "../../common/android",
"keyStore": "../../common/src/keystore.jks",
"keyAlias": "androidkey",
"storePass": "android",
"keyPass": "android",
"sdkDir": "${HOME}/Android/Sdk",
"ndkVersion": "25.2.9519653",
"buildToolsVersion": "34.0.0",
"androidxDir": "${HOME}/Android/androidx",
"kotlinDir": "${HOME}/Android/kotlin",
"androidVersion": "34",
"androidxCoreVersion": "1.10.1",
"androidxLifecycleCommonVersion": "2.6.1",
"androidxVersionedparcelableVersion": "1.1.1",
"kotlinStdlibVersion": "1.9.0",
"kotlinxCoroutinesCoreVersion": "1.7.3",
"kotlinxCoroutinesCoreJVMVersion": "1.7.3"
}
}

View File

@ -1,7 +0,0 @@
{
"cmd_make": {
"commonDir": "../../common/cmd",
"tinywavDir": "../../../../tinywav",
"midiParserDir": "../../../../midi-parser"
}
}

View File

@ -20,6 +20,8 @@
#include <stddef.h>
#include "plugin_api.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -25,7 +25,8 @@ typedef struct plugin {
impl handle;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
instance->handle = impl_new();
}

View File

@ -21,6 +21,8 @@
#include <stddef.h>
#include <stdint.h>
#include "plugin_api.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -25,7 +25,8 @@ typedef struct plugin {
impl handle;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
instance->handle = impl_new();
}

View File

@ -1,6 +0,0 @@
{
"daisy_seed_make": {
"commonDir": "../../common/daisy-seed",
"libdaisyDir": "../../../../libDaisy"
}
}

View File

@ -1,14 +0,0 @@
{
"ios_make": {
"headerSearchPaths": [
"../../../../../../miniaudio",
"../../../../common/src",
"../../../../../include"
],
"deploymentTarget": 16.6,
"commonDir": "../../common/ios",
"pluginDir": "../../common/src/cxx-fx",
"cSrcs": "../../common/src/cxx-fx/impl.h",
"cxxSrcs": "../src/impl.cpp"
}
}

View File

@ -1,14 +0,0 @@
{
"ios_make": {
"headerSearchPaths": [
"../../../../../../miniaudio",
"../../../../common/src",
"../../../../../include"
],
"deploymentTarget": 16.6,
"commonDir": "../../common/ios",
"pluginDir": "../../common/src/cxx-synth",
"cSrcs": "../../common/src/cxx-synth/impl.h",
"cxxSrcs": "../src/impl.cpp"
}
}

View File

@ -5,8 +5,6 @@
"../../../../common/src",
"../../../../../include"
],
"deploymentTarget": 16.6,
"commonDir": "../../common/ios",
"pluginDir": "../src"
"deploymentTarget": 14.0
}
}

View File

@ -1,5 +0,0 @@
{
"lv2_make": {
"commonDir": "../../common/lv2"
}
}

View File

@ -1,8 +1,6 @@
{
"make": {
"cxxSrcs": "../src/impl.cpp",
"cflags": "-I../../../include -I../../common/src -I../../common/src/cxx-fx",
"cxxflags": "-I../../../include -I../../common/src -I../../common/src/cxx-fx -std=c++11",
"pluginDir": "../../common/src/cxx-fx"
"mkincDir": "../../common/src",
"extra": "EXAMPLE_TYPE := cxx-fx"
}
}

View File

@ -1,8 +1,6 @@
{
"make": {
"cxxSrcs": "../src/impl.cpp",
"cflags": "-I../../../include -I../../common/src -I../../common/src/cxx-synth",
"cxxflags": "-I../../../include -I../../common/src -I../../common/src/cxx-synth -std=c++11",
"pluginDir": "../../common/src/cxx-synth"
"mkincDir": "../../common/src",
"extra": "EXAMPLE_TYPE := cxx-synth"
}
}

View File

@ -1,6 +1,6 @@
{
"make": {
"cflags": "-I../../../include -I../../common/src",
"pluginDir": "../src"
"mkincDir": "../../common/src",
"extra": "EXAMPLE_TYPE := c"
}
}

View File

@ -0,0 +1,3 @@
ifeq ($(TEMPLATE), web)
include $(COMMON_DIR)/../web/rules-extra-web-demo.mk
endif

View File

@ -0,0 +1,3 @@
ifeq ($(TEMPLATE), web)
include $(COMMON_DIR)/../web/vars-extra-web-demo.mk
endif

View File

@ -0,0 +1,77 @@
API_DIR := ../api
ifeq ($(EXAMPLE_TYPE), c)
PLUGIN_DIR := ../src
CFLAGS_EXTRA := -I../../../include -I../../common/src
endif
ifeq ($(EXAMPLE_TYPE), cxx-fx)
PLUGIN_DIR := ../../common/src/cxx-fx
CXX_SRCS_EXTRA := ../src/impl.cpp
CFLAGS_EXTRA := -I../../../include -I../../common/src -I../../common/src/cxx-fx
CXXFLAGS_EXTRA := -I../../../include -I../../common/src -I../../common/src/cxx-fx -std=c++11
endif
ifeq ($(EXAMPLE_TYPE), cxx-synth)
PLUGIN_DIR := ../../common/src/cxx-synth
CXX_SRCS_EXTRA := ../src/impl.cpp
CFLAGS_EXTRA := -I../../../include -I../../common/src -I../../common/src/cxx-synth
CXXFLAGS_EXTRA := -I../../../include -I../../common/src -I../../common/src/cxx-synth -std=c++11
endif
ifeq ($(TEMPLATE), cmd)
COMMON_DIR := ../../common/cmd
TINYWAV_DIR := ../../../../tinywav
MIDI_PARSER_DIR := ../../../../midi-parser
endif
ifeq ($(TEMPLATE), lv2)
COMMON_DIR := ../../common/lv2
endif
ifeq ($(TEMPLATE), vst3)
COMMON_DIR := ../../common/vst3
CFLAGS_EXTRA := $(CFLAGS_EXTRA) -I../../../../vst3_c_api
endif
ifeq ($(TEMPLATE), web)
COMMON_DIR := ../../common/web
CFLAGS_EXTRA := $(CFLAGS_EXTRA) -DWASM
CXXFLAGS_EXTRA := $(CXXFLAGS_EXTRA) -DWASM -std=c++11
endif
ifeq ($(TEMPLATE), daisy-seed)
COMMON_DIR := ../../common/daisy-seed
LIBDAISY_DIR := ../../../../libDaisy
endif
ifeq ($(TEMPLATE), ios)
COMMON_DIR := ../../common/ios
ifeq ($(EXAMPLE_TYPE), cxx-fx)
C_SRCS_EXTRA := ../../common/src/cxx-fx/impl.h
endif
ifeq ($(EXAMPLE_TYPE), cxx-synth)
C_SRCS_EXTRA := ../../common/src/cxx-synth/impl.h
endif
endif
ifeq ($(TEMPLATE), android)
COMMON_DIR := ../../common/android
CXXFLAGS_EXTRA := -I../../../include -I../../common/src -I../../../../miniaudio
KEY_STORE := ../../common/src/keystore.jks
KEY_ALIAS := androidkey
STORE_PASS := android
KEY_PASS := android
SDK_DIR := $(HOME)/Android/Sdk
ANDROIDX_DIR := $(HOME)/Android/androidx
KOTLIN_DIR := $(HOME)/Android/kotlin
NDK_VERSION := 28.0.12674087
BUILD_TOOLS_VERSION := 35.0.0
ANDROID_VERSION := 35
ANDROIDX_CORE_VERSION := 1.15.0
ANDROIDX_LIFECYCLE_COMMON_VERSION := 2.8.7
ANDROIDX_VERSIONEDPARCELABLE_VERSION := 1.2.1
KOTLIN_STDLIB_VERSION := 2.1.10
KOTLINX_COROUTINES_CORE_VERSION := 1.10.1
KOTLINX_COROUTINES_CORE_JVM_VERSION := 1.10.1
endif

View File

@ -1,6 +0,0 @@
{
"vst3_make": {
"cflags": "-I../../../../vst3_c_api",
"commonDir": "../../common/vst3"
}
}

View File

@ -1,7 +0,0 @@
{
"web_make": {
"cflags": "-DWASM",
"cxxflags": "-DWASM -std=c++11",
"commonDir": "../../common/web"
}
}

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_ap1",
"types": [ "@lv2:AllpassPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_ap1_state ap1_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_ap1_init(&instance->ap1_coeffs);
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order allpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_ap1",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"id" : "cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_ap2",
"types": [ "@lv2:AllpassPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff", "q" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_ap2_state ap2_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_ap2_init(&instance->ap2_coeffs);
}
@ -55,10 +56,10 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_cutoff:
bw_ap2_set_cutoff(&instance->ap2_coeffs, value);
break;
case 1:
case plugin_parameter_q:
bw_ap2_set_Q(&instance->ap2_coeffs, value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 2nd-order allpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_ap2",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"id": "cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,
@ -34,6 +35,7 @@
{
"name": "Q",
"shortName": "Q",
"id": "q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "balance", "l_level", "r_level" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_balance",
"types": [ "@lv2:SpatialPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "balance", "l_level", "r_level" ]
"version": "0.0"
}
}

View File

@ -29,7 +29,8 @@ typedef struct plugin {
bw_ppm_state ppm_r_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_balance_init(&instance->balance_coeffs);
bw_ppm_init(&instance->ppm_coeffs);
}
@ -68,10 +69,10 @@ static void plugin_set_parameter(plugin *instance, size_t index, float value) {
static float plugin_get_parameter(plugin *instance, size_t index) {
float v = 0.f;
switch (index) {
case 1:
case plugin_parameter_l_level:
v = bw_ppm_get_y_z1(&instance->ppm_l_state);
break;
case 2:
case plugin_parameter_r_level:
v = bw_ppm_get_y_z1(&instance->ppm_r_state);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks stereo balance example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_balance",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "stereo",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "stereo",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Balance",
"shortName": "Balance",
"id": "balance",
"direction": "input",
"defaultValue": 0.0,
"minimum": -100.0,
@ -34,6 +35,7 @@
{
"name": "Left level",
"shortName": "L level",
"id": "l_level",
"direction": "output",
"defaultValue": -60.0,
"minimum": -60.0,
@ -44,6 +46,7 @@
{
"name": "Right level",
"shortName": "R level",
"id": "r_level",
"direction": "output",
"defaultValue": -60.0,
"minimum": -60.0,

View File

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

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_bitcrush",
"types": [ "@lv2:DistortionPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "sr_ratio", "bit_depth" ]
"version": "0.0"
}
}

View File

@ -28,7 +28,8 @@ typedef struct plugin {
bw_bd_reduce_coeffs bd_reduce_coeffs;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_sr_reduce_init(&instance->sr_reduce_coeffs);
bw_bd_reduce_init(&instance->bd_reduce_coeffs);
bw_bd_reduce_set_silence_dc(&instance->bd_reduce_coeffs, 0);
@ -61,12 +62,15 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_sr_ratio:
bw_sr_reduce_set_ratio(&instance->sr_reduce_coeffs, 0.01f * value);
break;
case 1:
case plugin_parameter_bit_depth:
bw_bd_reduce_set_bit_depth(&instance->bd_reduce_coeffs, (char)value);
break;
case plugin_parameter_gate:
bw_bd_reduce_set_gate_lin(&instance->bd_reduce_coeffs, value);
break;
}
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks bitcrusher example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_bitcrush",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Sample rate ratio",
"shortName": "SR ratio",
"id": "sr_ratio",
"direction": "input",
"defaultValue": 100.0,
"minimum": 1.0,
@ -34,12 +35,24 @@
{
"name": "Bit depth",
"shortName": "Bit depth",
"id": "bit_depth",
"direction": "input",
"defaultValue": 16.0,
"minimum": 1.0,
"maximum": 16.0,
"integer": true,
"map": "linear"
},
{
"name": "Gate",
"shortName": "Gate",
"id": "gate",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
"maximum": 1.0,
"optional": true,
"map": "linear"
}
]
}

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "cutoff_low", "cutoff_high", "tone" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_cab",
"types": [ "@lv2:SimulatorPlugin", "@lv2:FilterPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff_low", "cutoff_high", "tone" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_cab_state cab_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_cab_init(&instance->cab_coeffs);
}
@ -55,13 +56,13 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_cutoff_low:
bw_cab_set_cutoff_low(&instance->cab_coeffs, 0.01f * value);
break;
case 1:
case plugin_parameter_cutoff_high:
bw_cab_set_cutoff_high(&instance->cab_coeffs, 0.01f * value);
break;
case 2:
case plugin_parameter_tone:
bw_cab_set_tone(&instance->cab_coeffs, 0.01f * value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks cab simulator example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_cab",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff low",
"shortName": "Cutoff low",
"id": "cutoff_low",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -34,6 +35,7 @@
{
"name": "Cutoff high",
"shortName": "Cutoff high",
"id": "cutoff_high",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Tone",
"shortName": "Tone",
"id": "tone",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "rate", "depth", "type" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_chorus",
"types": [ "@lv2:ChorusPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "rate", "depth", "type" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_chorus_state chorus_state;
} plugin;
static void plugin_init(plugin*instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_chorus_init(&instance->chorus_coeffs, 0.01f);
bw_chorus_set_delay(&instance->chorus_coeffs, 0.005f);
}
@ -54,13 +55,13 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_rate:
bw_chorus_set_rate(&instance->chorus_coeffs, value);
break;
case 1:
case plugin_parameter_depth:
bw_chorus_set_amount(&instance->chorus_coeffs, (0.01f * 0.004f) * value);
break;
case 2:
case plugin_parameter_type:
// values taken from Dattorro's paper
if (value < 1.5f) { // "Industry standard chorus"
bw_chorus_set_coeff_x(&instance->chorus_coeffs, 1.f);

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks chorus example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_chorus",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Rate",
"shortName": "Rate",
"id": "rate",
"direction": "input",
"defaultValue": 1.0,
"minimum": 0.01,
@ -34,6 +35,7 @@
{
"name": "Depth",
"shortName": "Depth",
"id": "depth",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Type",
"shortName": "Type",
"id": "type",
"direction": "input",
"defaultValue": 1,
"minimum": 1,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_clip",
"types": [ "@lv2:WaveshaperPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "gain", "bias" ]
"version": "0.0"
}
}

View File

@ -35,7 +35,8 @@ typedef struct plugin {
float buf[BUF_SIZE];
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_clip_init(&instance->clip_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
@ -69,10 +70,10 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_gain:
bw_clip_set_gain(&instance->clip_coeffs, value);
break;
case 1:
case plugin_parameter_bias:
bw_clip_set_bias(&instance->clip_coeffs, value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks hard clipper example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_clip",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Gain",
"shortName": "Gain",
"id": "gain",
"direction": "input",
"defaultValue": 1.0,
"minimum": 0.1,
@ -33,6 +34,7 @@
{
"name": "Bias",
"shortName": "Bias",
"id": "bias",
"direction": "input",
"defaultValue": 0.0,
"minimum": -2.5,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_comb",
"types": [ "@lv2:CombPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_comb_state comb_state;
} plugin;
static void plugin_init(plugin*instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_comb_init(&instance->comb_coeffs, 1.f);
}
@ -53,19 +54,19 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_ff_delay:
bw_comb_set_delay_ff(&instance->comb_coeffs, 0.001f * value);
break;
case 1:
case plugin_parameter_fb_delay:
bw_comb_set_delay_fb(&instance->comb_coeffs, 0.001f * value);
break;
case 2:
case plugin_parameter_blend:
bw_comb_set_coeff_blend(&instance->comb_coeffs, value);
break;
case 3:
case plugin_parameter_ff:
bw_comb_set_coeff_ff(&instance->comb_coeffs, value);
break;
case 4:
case plugin_parameter_fb:
bw_comb_set_coeff_fb(&instance->comb_coeffs, value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks comb filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_comb",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Feedforward delay",
"shortName": "FF delay",
"id": "ff_delay",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -34,6 +35,7 @@
{
"name": "Feedback delay",
"shortName": "FB delay",
"id": "fb_delay",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Blend coefficient",
"shortName": "Blend coeff",
"id": "blend",
"direction": "input",
"defaultValue": 1.0,
"minimum": 0.0,
@ -53,6 +56,7 @@
{
"name": "Feedforward coefficient",
"shortName": "FF coeff",
"id": "ff",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
@ -62,6 +66,7 @@
{
"name": "Feedback coefficient",
"shortName": "FB coeff",
"id": "fb",
"direction": "input",
"defaultValue": 0.0,
"minimum": -0.999,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output", "sidechain_in" ],
"parameterIds": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_comp",
"types": [ "@lv2:CompressorPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output", "sidechain_in" ],
"parameterSymbols": [ "threshold", "ratio", "attack", "release", "gain", "ext_sidechain" ]
"version": "0.0"
}
}

View File

@ -27,7 +27,8 @@ typedef struct plugin {
char ext_sidechain;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_comp_init(&instance->comp_coeffs);
}
@ -56,24 +57,24 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_threshold:
bw_comp_set_thresh_dBFS(&instance->comp_coeffs, value);
break;
case 1:
case plugin_parameter_ratio:
bw_comp_set_ratio(&instance->comp_coeffs, bw_rcpf(value));
break;
case 2:
case plugin_parameter_attack:
// using rise time 10% -> 90%: tau = rise time / log(9)
bw_comp_set_attack_tau(&instance->comp_coeffs, (0.001f * 0.4551196133134186f) * value);
break;
case 3:
case plugin_parameter_release:
// as before
bw_comp_set_release_tau(&instance->comp_coeffs, (0.001f * 0.4551196133134186f) * value);
break;
case 4:
case plugin_parameter_gain:
bw_comp_set_gain_dB(&instance->comp_coeffs, value);
break;
case 5:
case plugin_parameter_ext_sidechain:
instance->ext_sidechain = (char)value;
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks compressor example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_comp",
"buses": [
{
@ -10,14 +8,16 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
},
{
"type": "audio",
@ -25,6 +25,7 @@
"channels": "mono",
"name": "Sidechain input",
"shortName": "Sidechain in",
"id": "sidechain_in",
"sidechain": true,
"cv": false,
"optional": true
@ -34,6 +35,7 @@
{
"name": "Threshold",
"shortName": "Threshold",
"id": "threshold",
"direction": "input",
"defaultValue": 0.0,
"minimum": -60.0,
@ -44,6 +46,7 @@
{
"name": "Ratio",
"shortName": "Ratio",
"id": "ratio",
"direction": "input",
"defaultValue": 1.0,
"minimum": 1.0,
@ -53,6 +56,7 @@
{
"name": "Attack",
"shortName": "Attack",
"id": "attack",
"direction": "input",
"defaultValue": 20.0,
"minimum": 1.0,
@ -63,6 +67,7 @@
{
"name": "Release",
"shortName": "Release",
"id": "release",
"direction": "input",
"defaultValue": 250.0,
"minimum": 1.0,
@ -73,6 +78,7 @@
{
"name": "Makeup gain",
"shortName": "Gain",
"id": "gain",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -83,6 +89,7 @@
{
"name": "External sidechain",
"shortName": "Ext sidechain",
"id": "ext_sidechain",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_delay",
"types": [ "@lv2:DelayPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "delay" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_delay_state delay_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_delay_init(&instance->delay_coeffs, 1.f);
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks non-smoothed delay line example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_delay",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Delay",
"shortName": "Delay",
"id": "delay",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "distortion", "tone", "volume" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_dist",
"types": [ "@lv2:DistortionPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "distortion", "tone", "volume" ]
"version": "0.0"
}
}

View File

@ -35,7 +35,8 @@ typedef struct plugin {
float buf[BUF_SIZE];
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_dist_init(&instance->dist_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
@ -68,13 +69,13 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_distortion:
bw_dist_set_distortion(&instance->dist_coeffs, 0.01f * value);
break;
case 1:
case plugin_parameter_tone:
bw_dist_set_tone(&instance->dist_coeffs, 0.01f * value);
break;
case 2:
case plugin_parameter_volume:
bw_dist_set_volume(&instance->dist_coeffs, 0.01f * value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks distortion example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_dist",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Distortion",
"shortName": "Distortion",
"id": "distortion",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -34,6 +35,7 @@
{
"name": "Tone",
"shortName": "Tone",
"id": "tone",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Volume",
"shortName": "Volume",
"id": "volume",
"direction": "input",
"defaultValue": 100.0,
"minimum": 0.0,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "drive", "tone", "volume" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_drive",
"types": [ "@lv2:DistortionPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "drive", "tone", "volume" ]
"version": "0.0"
}
}

View File

@ -35,7 +35,8 @@ typedef struct plugin {
float buf[BUF_SIZE];
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_drive_init(&instance->drive_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
@ -68,13 +69,13 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_drive:
bw_drive_set_drive(&instance->drive_coeffs, 0.01f * value);
break;
case 1:
case plugin_parameter_tone:
bw_drive_set_tone(&instance->drive_coeffs, 0.01f * value);
break;
case 2:
case plugin_parameter_volume:
bw_drive_set_volume(&instance->drive_coeffs, 0.01f * value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks overdrive example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_drive",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Drive",
"shortName": "Drive",
"id": "drive",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -34,6 +35,7 @@
{
"name": "Tone",
"shortName": "Tone",
"id": "tone",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Volume",
"shortName": "Volume",
"id": "volume",
"direction": "input",
"defaultValue": 100.0,
"minimum": 0.0,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_eq_3band",
"types": [ "@lv2:ParaEQPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "ls_cutoff", "ls_gain", "ls_q", "peak_cutoff", "peak_gain", "peak_bw", "hs_cutoff", "hs_gain", "hs_q" ]
"version": "0.0"
}
}

View File

@ -32,7 +32,8 @@ typedef struct plugin {
bw_hs2_state hs2_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_ls2_init(&instance->ls2_coeffs);
bw_peak_init(&instance->peak_coeffs);
bw_hs2_init(&instance->hs2_coeffs);
@ -69,31 +70,31 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_ls_cutoff:
bw_ls2_set_cutoff(&instance->ls2_coeffs, value);
break;
case 1:
case plugin_parameter_ls_gain:
bw_ls2_set_dc_gain_dB(&instance->ls2_coeffs, value);
break;
case 2:
case plugin_parameter_ls_q:
bw_ls2_set_Q(&instance->ls2_coeffs, value);
break;
case 3:
case plugin_parameter_peak_cutoff:
bw_peak_set_cutoff(&instance->peak_coeffs, value);
break;
case 4:
case plugin_parameter_peak_gain:
bw_peak_set_peak_gain_dB(&instance->peak_coeffs, value);
break;
case 5:
case plugin_parameter_peak_bw:
bw_peak_set_bandwidth(&instance->peak_coeffs, value);
break;
case 6:
case plugin_parameter_hs_cutoff:
bw_hs2_set_cutoff(&instance->hs2_coeffs, value);
break;
case 7:
case plugin_parameter_hs_gain:
bw_hs2_set_high_gain_dB(&instance->hs2_coeffs, value);
break;
case 8:
case plugin_parameter_hs_q:
bw_hs2_set_Q(&instance->hs2_coeffs, value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 3-band parametric equalizer example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_eq_3band",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Low shelf cutoff",
"shortName": "LS cutoff",
"id": "ls_cutoff",
"direction": "input",
"defaultValue": 112.4682650380698,
"minimum": 20.0,
@ -34,6 +35,7 @@
{
"name": "Low shelf gain",
"shortName": "LS gain",
"id": "ls_gain",
"direction": "input",
"defaultValue": 0.0,
"minimum": -20.0,
@ -44,6 +46,7 @@
{
"name": "Low shelf Q",
"shortName": "LS Q",
"id": "ls_q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,
@ -53,6 +56,7 @@
{
"name": "Peak cutoff",
"shortName": "Peak cutoff",
"id": "peak_cutoff",
"direction": "input",
"defaultValue": 632.4555320336758,
"minimum": 20.0,
@ -63,6 +67,7 @@
{
"name": "Peak gain",
"shortName": "Peak gain",
"id": "peak_gain",
"direction": "input",
"defaultValue": 0.0,
"minimum": -20.0,
@ -73,6 +78,7 @@
{
"name": "Peak bandwidth",
"shortName": "Peak bw",
"id": "peak_bw",
"direction": "input",
"defaultValue": 1.0,
"minimum": 0.01,
@ -83,6 +89,7 @@
{
"name": "High shelf cutoff",
"shortName": "HS cutoff",
"id": "hs_cutoff",
"direction": "input",
"defaultValue": 3556.558820077844,
"minimum": 20.0,
@ -93,6 +100,7 @@
{
"name": "High shelf gain",
"shortName": "HS gain",
"id": "hs_gain",
"direction": "input",
"defaultValue": 0.0,
"minimum": -20.0,
@ -103,6 +111,7 @@
{
"name": "High shelf Q",
"shortName": "HS Q",
"id": "hs_q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,

View File

@ -1,6 +0,0 @@
{
"cmd": {
"busIds": [ "input", "output" ],
"parameterIds": [ "rate", "depth", "feedback" ]
}
}

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_flanger",
"types": [ "@lv2:FlangerPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "rate", "depth", "feedback" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_chorus_state chorus_state;
} plugin;
static void plugin_init(plugin*instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_chorus_init(&instance->chorus_coeffs, 0.002f);
bw_chorus_set_delay(&instance->chorus_coeffs, 0.001f);
// values taken from Dattorro's paper
@ -57,13 +58,13 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_rate:
bw_chorus_set_rate(&instance->chorus_coeffs, value);
break;
case 1:
case plugin_parameter_amount:
bw_chorus_set_amount(&instance->chorus_coeffs, (0.01f * 0.001f) * value);
break;
case 2:
case plugin_parameter_feedback:
bw_chorus_set_coeff_fb(&instance->chorus_coeffs, 0.01f * value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks flanger example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_flanger",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Rate",
"shortName": "Rate",
"id": "rate",
"direction": "input",
"defaultValue": 1.0,
"minimum": 0.01,
@ -34,6 +35,7 @@
{
"name": "Amount",
"shortName": "Amount",
"id": "amount",
"direction": "input",
"defaultValue": 50.0,
"minimum": 0.0,
@ -44,6 +46,7 @@
{
"name": "Feedback",
"shortName": "Feedback",
"id": "feedback",
"direction": "input",
"defaultValue": 0.0,
"minimum": -99.9,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_fuzz",
"types": [ "@lv2:DistortionPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "fuzz", "volume" ]
"version": "0.0"
}
}

View File

@ -35,7 +35,8 @@ typedef struct plugin {
float buf[BUF_SIZE];
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_fuzz_init(&instance->fuzz_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
@ -68,10 +69,10 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_fuzz:
bw_fuzz_set_fuzz(&instance->fuzz_coeffs, 0.01f * value);
break;
case 1:
case plugin_parameter_volume:
bw_fuzz_set_volume(&instance->fuzz_coeffs, 0.01f * value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks fuzz example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_fuzz",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Fuzz",
"shortName": "Fuzz",
"id": "fuzz",
"direction": "input",
"defaultValue": 0.0,
"minimum": 0.0,
@ -34,6 +35,7 @@
{
"name": "Volume",
"shortName": "Volume",
"id": "volume",
"direction": "input",
"defaultValue": 100.0,
"minimum": 0.0,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_hp1",
"types": [ "@lv2:HighpassPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_hp1_state hp1_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_hp1_init(&instance->hp1_coeffs);
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order highpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_hp1",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"id": "cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,

View File

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

View File

@ -5,8 +5,6 @@
},
"uri": "@bw_examples:fx_hs1",
"types": [ "@lv2:FilterPlugin" ],
"version": "0.0",
"busSymbols": [ "input", "output" ],
"parameterSymbols": [ "cutoff", "gain" ]
"version": "0.0"
}
}

View File

@ -26,7 +26,8 @@ typedef struct plugin {
bw_hs1_state hs1_state;
} plugin;
static void plugin_init(plugin *instance) {
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)cbs;
bw_hs1_init(&instance->hs1_coeffs);
}
@ -55,10 +56,10 @@ static void plugin_reset(plugin *instance) {
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case 0:
case plugin_parameter_cutoff:
bw_hs1_set_cutoff(&instance->hs1_coeffs, value);
break;
case 1:
case plugin_parameter_gain:
bw_hs1_set_high_gain_dB(&instance->hs1_coeffs, value);
break;
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order high shelf example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_hs1",
"buses": [
{
@ -10,20 +8,23 @@
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input"
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output"
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"id": "cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,
@ -34,6 +35,7 @@
{
"name": "Gain",
"shortName": "Gain",
"id": "gain",
"direction": "input",
"defaultValue": 0.0,
"minimum": -20.0,

View File

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

View File

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

View File

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

View File

@ -0,0 +1,10 @@
{
"lv2": {
"prefixes": {
"bw_examples": "https://www.orastron.com/brickworks/examples/"
},
"uri": "@bw_examples:fx_iir1",
"types": [ "@lv2:FilterPlugin" ],
"version": "0.0"
}
}

View File

@ -0,0 +1,93 @@
/*
* Brickworks
*
* Copyright (C) 2025 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 "common.h"
#include <bw_iir1.h>
typedef struct plugin {
float sample_rate;
float cutoff;
float coeff_x;
float coeff_lp;
float s;
float b0;
float b1;
float a1;
char to_reset;
} plugin;
static void plugin_init(plugin *instance, plugin_callbacks *cbs) {
(void)instance;
(void)cbs;
}
static void plugin_fini(plugin *instance) {
(void)instance;
}
static void plugin_set_sample_rate(plugin *instance, float sample_rate) {
instance->sample_rate = 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_iir1_coeffs_mm1(instance->sample_rate, instance->cutoff, 1, instance->cutoff, instance->coeff_x, instance->coeff_lp, &instance->b0, &instance->b1, &instance->a1);
float y;
bw_iir1_reset(0.f, &y, &instance->s, instance->b0, instance->b1, instance->a1);
instance->to_reset = 0;
}
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
switch (index) {
case plugin_parameter_cutoff:
instance->cutoff = value;
instance->to_reset = 1;
break;
case plugin_parameter_in:
instance->coeff_x = value;
instance->to_reset = 1;
break;
case plugin_parameter_lp:
instance->coeff_lp = value;
instance->to_reset = 1;
break;
}
}
static float plugin_get_parameter(plugin *instance, size_t index) {
(void)instance;
(void)index;
return 0.f;
}
static void plugin_process(plugin *instance, const float **inputs, float **outputs, size_t n_samples) {
if (instance->to_reset)
plugin_reset(instance);
bw_iir1_process(inputs[0], outputs[0], &instance->s, instance->b0, instance->b1, instance->a1, n_samples);
}

View File

@ -0,0 +1,57 @@
{
"product": {
"name": "Brickworks 1st-order IIR filter example",
"bundleName": "bw_example_fx_iir1",
"buses": [
{
"type": "audio",
"direction": "input",
"channels": "mono",
"name": "Input",
"shortName": "Input",
"id": "input"
},
{
"type": "audio",
"direction": "output",
"channels": "mono",
"name": "Output",
"shortName": "Output",
"id": "output"
}
],
"parameters": [
{
"name": "Cutoff",
"shortName": "Cutoff",
"id": "cutoff",
"direction": "input",
"defaultValue": 1000.0,
"minimum": 20.0,
"maximum": 20000.0,
"unit": "hz",
"map": "logarithmic"
},
{
"name": "Input coefficient",
"shortName": "In coeff",
"id": "in",
"direction": "input",
"defaultValue": 1.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
},
{
"name": "Lowpass coefficient",
"shortName": "LP coeff",
"id": "lp",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
}
]
}
}

View File

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

View File

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

View File

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

View File

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

Some files were not shown because too many files have changed in this diff Show More