Compare commits

...

42 Commits
v1.2.0 ... main

Author SHA1 Message Date
Stefano D'Angelo
18c7d41d87 update to latest tibia 2025-04-18 06:18:29 +02:00
Stefano D'Angelo
10b7c3834a bw_sampler doc + removed useless includes 2025-04-10 15:38:03 +02:00
Stefano D'Angelo
422cdcdb8d bw_sampler fixes + synth(pp)_sampler examples 2025-04-10 12:08:20 +02:00
Stefano D'Angelo
2ceca5cc0c bw_sampler param renaming + get phase 2025-04-10 10:26:08 +02:00
e319de1a1f bw_sampler tentative 2025-04-10 09:16:45 +02:00
11f49b4276 bw_drive cosmetics 2025-04-05 09:44:02 +02:00
f960114cfb added missing bw_mm1 to list of bw_drive deps 2025-03-27 05:20:28 +01:00
5f494781ac fix doc typos in bw_slew_lim 2025-03-21 16:17:27 +01:00
97790bc330 bw_common fix bad copyright header 2025-02-28 18:21:33 +01:00
5c185738c2 bw_math: relax bw_sechf() requirements 2025-02-28 18:20:23 +01:00
c91dbd5c95 bw_math: added bw_sechf() 2025-02-27 13:52:40 +01:00
d008662ffb fix copyright typo in bw_comb 2025-02-23 10:59:07 +01:00
b5cdf2ad19 bw_svf: small optmization 2025-02-21 14:58:35 +01:00
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
182 changed files with 4951 additions and 692 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,9 @@
## 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://git.orastron.com/orastron/tibia), which you first need to [run as outlined below](#tibia).
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-related 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
@ -14,18 +14,19 @@ You need [Node.js](https://nodejs.org/en) and [npm](https://www.npmjs.com/) to b
### Usage
Get [Tibia 0.0.4](https://git.orastron.com/orastron/tibia/releases/tag/v0.0.4), 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.
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
### Prerequisites
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
@ -41,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
@ -49,7 +50,7 @@ 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
@ -71,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
@ -104,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*".
@ -116,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.
@ -130,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
@ -152,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

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

@ -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": 14.0,
"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": 14.0,
"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": 14.0,
"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 -I../common/src",
"cxxflags": "-I../../../include -I../../common/src -I../../common/src/cxx-fx -I../common/src -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 -I../common/src",
"cxxflags": "-I../../../include -I../../common/src -I../../common/src/cxx-synth -I../common/src -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 -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,76 @@
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.13004108
BUILD_TOOLS_VERSION := 36.0.0
ANDROIDX_CORE_VERSION := 1.16.0
ANDROIDX_LIFECYCLE_COMMON_VERSION := 2.8.7
ANDROIDX_VERSIONEDPARCELABLE_VERSION := 1.2.1
KOTLIN_STDLIB_VERSION := 2.1.20
KOTLINX_COROUTINES_CORE_VERSION := 1.10.2
KOTLINX_COROUTINES_CORE_JVM_VERSION := 1.10.2
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,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order allpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_ap1",
"buses": [
{

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": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks stereo balance example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_balance",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks bitcrusher example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_bitcrush",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks cab simulator example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_cab",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks chorus example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_chorus",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks hard clipper example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_clip",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks comb filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_comb",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks compressor example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_comp",
"buses": [
{

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": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks distortion example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_dist",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks overdrive example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_drive",
"buses": [
{

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": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks flanger example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_flanger",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks fuzz example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_fuzz",
"buses": [
{

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": [
{

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": [
{

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"
}
}

View File

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

View File

@ -0,0 +1,111 @@
/*
* 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_iir2.h>
typedef struct plugin {
float sample_rate;
float cutoff;
float q;
float coeff_x;
float coeff_lp;
float coeff_bp;
float coeff_hp;
float s1;
float s2;
float b0;
float b1;
float b2;
float a1;
float a2;
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_iir2_coeffs_mm2(instance->sample_rate, instance->cutoff, instance->q, 1, instance->cutoff, instance->coeff_x, instance->coeff_lp, instance->coeff_bp, instance->coeff_hp, &instance->b0, &instance->b1, &instance->b2, &instance->a1, &instance->a2);
float y;
bw_iir2_reset(0.f, &y, &instance->s1, &instance->s2, instance->b0, instance->b1, instance->b2, instance->a1, instance->a2);
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_q:
instance->q = 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;
case plugin_parameter_bp:
instance->coeff_bp = value;
instance->to_reset = 1;
break;
case plugin_parameter_hp:
instance->coeff_hp = 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_iir2_process(inputs[0], outputs[0], &instance->s1, &instance->s2, instance->b0, instance->b1, instance->b2, instance->a1, instance->a2, n_samples);
}

View File

@ -0,0 +1,87 @@
{
"product": {
"name": "Brickworks 2nd-order IIR filter example",
"bundleName": "bw_example_fx_iir2",
"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": "Q",
"shortName": "Q",
"id": "q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,
"maximum": 10.0,
"map": "linear"
},
{
"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"
},
{
"name": "Bandpass coefficient",
"shortName": "BP coeff",
"id": "bp",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
},
{
"name": "Highpass coefficient",
"shortName": "HP coeff",
"id": "hp",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
}
]
}
}

View File

@ -0,0 +1,11 @@
{
"vst3": {
"plugin": {
"cid": "b7c897b2e3984dc7b13c6d6507c766a5"
},
"controller": {
"cid": "00f0578ef0894a90a02427cbde067b8c"
},
"subCategory": "Fx|Filter"
}
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order lowpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_lp1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order low shelf example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_ls1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order multimode filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_mm1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 2nd-order multimode filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_mm2",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks noise gate example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_noise_gate",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks notch filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_notch",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks one-pole lowpass example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_one_pole",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks stereo panner example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_pan",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks phaser example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_phaser",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks stereo reverb example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_reverb",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks ring modulator example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_ring_mod",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks saturation example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_satur",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks slew-rate limiter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_slew_lim",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks state variable filter example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_svf",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks tremolo example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_trem",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks vibrato example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_vibrato",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks wah example",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fx_wah",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order allpass example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_ap1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 2nd-order allpass example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_ap2",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks stereo balance example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_balance",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks bitcrusher example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_bitcrush",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks cab simulator example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_cab",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks chorus example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_chorus",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks hard clipper example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_clip",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks comb filter example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_comb",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks compressor example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_comp",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks non-smoothed delay line example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_delay",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks distortion example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_dist",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks overdrive example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_drive",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 3-band parametric equalizer example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_eq_3band",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks flanger example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_flanger",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks fuzz example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_fuzz",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order highpass example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_hp1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order high shelf example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_hs1",
"buses": [
{

View File

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

View File

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

View File

@ -0,0 +1,94 @@
/*
* 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 "impl.h"
#include "common.h"
#include <bw_iir1.h>
using namespace Brickworks;
extern "C" {
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;
impl impl_new(void) {
return reinterpret_cast<impl>(new plugin);
}
void impl_free(impl handle) {
delete reinterpret_cast<plugin *>(handle);
}
void impl_set_sample_rate(impl handle, float sample_rate) {
plugin *instance = reinterpret_cast<plugin *>(handle);
instance->sample_rate = sample_rate;
}
void impl_reset(impl handle) {
plugin *instance = reinterpret_cast<plugin *>(handle);
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 x0[1] = { 0.f };
iir1Reset<1>(x0, BW_NULL, &instance->s, instance->b0, instance->b1, instance->a1);
instance->to_reset = 0;
}
void impl_set_parameter(impl handle, size_t index, float value) {
plugin *instance = reinterpret_cast<plugin *>(handle);
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;
}
}
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) {
plugin *instance = reinterpret_cast<plugin *>(handle);
if (instance->to_reset)
impl_reset(instance);
iir1Process<1>(inputs, outputs, &instance->s, instance->b0, instance->b1, instance->a1, n_samples);
}
}

View File

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

View File

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

View File

@ -0,0 +1,57 @@
{
"product": {
"name": "Brickworks 1st-order IIR filter example (C++)",
"bundleName": "bw_example_fxpp_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": "ebef712c02ad4f579ab633d473a18894"
},
"controller": {
"cid": "9c81c2d835fa457c9d393ef081e8f1f4"
},
"subCategory": "Fx|Filter"
}
}

View File

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

View File

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

View File

@ -0,0 +1,112 @@
/*
* 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 "impl.h"
#include "common.h"
#include <bw_iir2.h>
using namespace Brickworks;
extern "C" {
typedef struct plugin {
float sample_rate;
float cutoff;
float q;
float coeff_x;
float coeff_lp;
float coeff_bp;
float coeff_hp;
float s1;
float s2;
float b0;
float b1;
float b2;
float a1;
float a2;
char to_reset;
} plugin;
impl impl_new(void) {
return reinterpret_cast<impl>(new plugin);
}
void impl_free(impl handle) {
delete reinterpret_cast<plugin *>(handle);
}
void impl_set_sample_rate(impl handle, float sample_rate) {
plugin *instance = reinterpret_cast<plugin *>(handle);
instance->sample_rate = sample_rate;
}
void impl_reset(impl handle) {
plugin *instance = reinterpret_cast<plugin *>(handle);
bw_iir2_coeffs_mm2(instance->sample_rate, instance->cutoff, instance->q, 1, instance->cutoff, instance->coeff_x, instance->coeff_lp, instance->coeff_bp, instance->coeff_hp, &instance->b0, &instance->b1, &instance->b2, &instance->a1, &instance->a2);
float x0[1] = { 0.f };
iir2Reset<1>(x0, BW_NULL, &instance->s1, &instance->s2, instance->b0, instance->b1, instance->b2, instance->a1, instance->a2);
instance->to_reset = 0;
}
void impl_set_parameter(impl handle, size_t index, float value) {
plugin *instance = reinterpret_cast<plugin *>(handle);
switch (index) {
case plugin_parameter_cutoff:
instance->cutoff = value;
instance->to_reset = 1;
break;
case plugin_parameter_q:
instance->q = 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;
case plugin_parameter_bp:
instance->coeff_bp = value;
instance->to_reset = 1;
break;
case plugin_parameter_hp:
instance->coeff_hp = value;
instance->to_reset = 1;
break;
}
}
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) {
plugin *instance = reinterpret_cast<plugin *>(handle);
if (instance->to_reset)
impl_reset(instance);
iir2Process<1>(inputs, outputs, &instance->s1, &instance->s2, instance->b0, instance->b1, instance->b2, instance->a1, instance->a2, n_samples);
}
}

View File

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

View File

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

View File

@ -0,0 +1,87 @@
{
"product": {
"name": "Brickworks 2nd-order IIR filter example (C++)",
"bundleName": "bw_example_fxpp_iir2",
"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": "Q",
"shortName": "Q",
"id": "q",
"direction": "input",
"defaultValue": 0.5,
"minimum": 0.5,
"maximum": 10.0,
"map": "linear"
},
{
"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"
},
{
"name": "Bandpass coefficient",
"shortName": "BP coeff",
"id": "bp",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
},
{
"name": "Highpass coefficient",
"shortName": "HP coeff",
"id": "hp",
"direction": "input",
"defaultValue": 0.0,
"minimum": -1.0,
"maximum": 1.0,
"map": "linear"
}
]
}
}

View File

@ -0,0 +1,11 @@
{
"vst3": {
"plugin": {
"cid": "5daf6226848c4b85a83563377a27ecaf"
},
"controller": {
"cid": "ef53040c87b34e37b288476cdb90cc77"
},
"subCategory": "Fx|Filter"
}
}

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order lowpass example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_lp1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order low shelf example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_ls1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 1st-order multimode filter example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_mm1",
"buses": [
{

View File

@ -1,8 +1,6 @@
{
"product": {
"name": "Brickworks 2nd-order multimode filter example (C++)",
"version": "1.1.0",
"buildVersion": "1",
"bundleName": "bw_example_fxpp_mm2",
"buses": [
{

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