Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
65eeade32d | |||
83e101cf8e | |||
|
c779481486 | ||
|
a605293801 | ||
67756cf502 | |||
02e628e5b0 | |||
ff459dece1 | |||
defabafb45 | |||
578bec397f | |||
5c91a48e42 | |||
abc65d292a | |||
d2b15d9155 | |||
90f03881fd | |||
|
5015dd6bbd | ||
724d7c6b8a | |||
da22954810 | |||
f3a12e8e0a | |||
ff99bda751 | |||
b214bc896e | |||
|
6431749bf8 | ||
3a8e279fde | |||
|
2ba329f5ea | ||
|
f1e471e9bf | ||
340d527ffa | |||
dd6f6adb2c | |||
c7f930673f | |||
98e5ef65c4 | |||
daf0cb3e1c | |||
324aa911fd | |||
|
f530db5c45 | ||
|
eaaeebb8ff | ||
adbd1ab61c | |||
750c807db3 | |||
f6b4e1b7ec | |||
b517c83cb5 | |||
9cb3bb00fa | |||
099fb7507b | |||
|
091b677663 | ||
862e56840f | |||
|
6f856ec04c | ||
|
07387edcc6 | ||
|
eef7f35dc5 | ||
|
7b53b045a9 | ||
|
99b6ec2996 | ||
|
e5cc92c72f | ||
f04fcac4ea | |||
c2c1979cc3 | |||
1e34773da8 | |||
f623002c27 | |||
|
2860ddc141 | ||
|
06fc92a2e0 | ||
|
af6ce9ba5e | ||
93ddf112bb | |||
|
5d3fbdbb0a | ||
|
861cdc427e | ||
|
5bd685ed7b | ||
10a2d1ff45 | |||
|
1d731eaafb | ||
|
4dfbded165 | ||
|
5f2a413b4d | ||
|
a4a8ba96ca | ||
|
93f571af18 |
@ -2,10 +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 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 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 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.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.
|
||||
|
||||
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
|
||||
@ -42,7 +55,7 @@ If all went fine, you can install for the current user (i.e., into the user VST3
|
||||
|
||||
### 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
|
||||
|
||||
@ -82,7 +95,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)
|
||||
@ -148,17 +161,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.
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"cmd_make": {
|
||||
"commonDir": "../../common/cmd",
|
||||
"tinywavDir": "../../../../tinywav",
|
||||
"midiParserDir": "../../../../midi-parser"
|
||||
}
|
||||
}
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "plugin_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "plugin_api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"daisy_seed_make": {
|
||||
"commonDir": "../../common/daisy-seed",
|
||||
"libdaisyDir": "../../../../libDaisy"
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@
|
||||
"../../../../common/src",
|
||||
"../../../../../include"
|
||||
],
|
||||
"deploymentTarget": 16.6,
|
||||
"commonDir": "../../common/ios",
|
||||
"pluginDir": "../src"
|
||||
"deploymentTarget": 14.0
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"lv2_make": {
|
||||
"commonDir": "../../common/lv2"
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"make": {
|
||||
"cflags": "-I../../../include -I../../common/src",
|
||||
"pluginDir": "../src"
|
||||
"mkincDir": "../../common/src",
|
||||
"extra": "EXAMPLE_TYPE := c"
|
||||
}
|
||||
}
|
||||
|
3
examples/common/src/rules-extra.mk
Normal file
3
examples/common/src/rules-extra.mk
Normal file
@ -0,0 +1,3 @@
|
||||
ifeq ($(TEMPLATE), web)
|
||||
include $(COMMON_DIR)/../web/rules-extra-web-demo.mk
|
||||
endif
|
3
examples/common/src/vars-extra.mk
Normal file
3
examples/common/src/vars-extra.mk
Normal file
@ -0,0 +1,3 @@
|
||||
ifeq ($(TEMPLATE), web)
|
||||
include $(COMMON_DIR)/../web/vars-extra-web-demo.mk
|
||||
endif
|
77
examples/common/src/vars-pre.mk
Normal file
77
examples/common/src/vars-pre.mk
Normal 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 := 27.2.12479018
|
||||
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.0
|
||||
KOTLIN_STDLIB_VERSION := 2.1.0
|
||||
KOTLINX_COROUTINES_CORE_VERSION := 1.9.0
|
||||
KOTLINX_COROUTINES_CORE_JVM_VERSION := 1.9.0
|
||||
endif
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"vst3_make": {
|
||||
"cflags": "-I../../../../vst3_c_api",
|
||||
"commonDir": "../../common/vst3"
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"web_make": {
|
||||
"cflags": "-DWASM",
|
||||
"cxxflags": "-DWASM -std=c++11",
|
||||
"commonDir": "../../common/web"
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "cutoff" ]
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@
|
||||
},
|
||||
"uri": "@bw_examples:fx_ap1",
|
||||
"types": [ "@lv2:AllpassPlugin" ],
|
||||
"version": "0.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "cutoff" ]
|
||||
"version": "0.0"
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -10,20 +10,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,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "cutoff", "q" ]
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@
|
||||
},
|
||||
"uri": "@bw_examples:fx_ap2",
|
||||
"types": [ "@lv2:AllpassPlugin" ],
|
||||
"version": "0.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "cutoff", "q" ]
|
||||
"version": "0.0"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -10,20 +10,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 +37,7 @@
|
||||
{
|
||||
"name": "Q",
|
||||
"shortName": "Q",
|
||||
"id": "q",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.5,
|
||||
"minimum": 0.5,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "balance", "l_level", "r_level" ]
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -10,20 +10,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 +37,7 @@
|
||||
{
|
||||
"name": "Left level",
|
||||
"shortName": "L level",
|
||||
"id": "l_level",
|
||||
"direction": "output",
|
||||
"defaultValue": -60.0,
|
||||
"minimum": -60.0,
|
||||
@ -44,6 +48,7 @@
|
||||
{
|
||||
"name": "Right level",
|
||||
"shortName": "R level",
|
||||
"id": "r_level",
|
||||
"direction": "output",
|
||||
"defaultValue": -60.0,
|
||||
"minimum": -60.0,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "sr_ratio", "bit_depth" ]
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"daisy_seed": {
|
||||
"parameterPins": [ 15, 16 ]
|
||||
"parameterPins": [ 15, 16, 22 ]
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,20 +10,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 +37,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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "cutoff_low", "cutoff_high", "tone" ]
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -10,20 +10,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 +37,7 @@
|
||||
{
|
||||
"name": "Cutoff high",
|
||||
"shortName": "Cutoff high",
|
||||
"id": "cutoff_high",
|
||||
"direction": "input",
|
||||
"defaultValue": 50.0,
|
||||
"minimum": 0.0,
|
||||
@ -44,6 +48,7 @@
|
||||
{
|
||||
"name": "Tone",
|
||||
"shortName": "Tone",
|
||||
"id": "tone",
|
||||
"direction": "input",
|
||||
"defaultValue": 50.0,
|
||||
"minimum": 0.0,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "rate", "depth", "type" ]
|
||||
}
|
||||
}
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -10,20 +10,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 +37,7 @@
|
||||
{
|
||||
"name": "Depth",
|
||||
"shortName": "Depth",
|
||||
"id": "depth",
|
||||
"direction": "input",
|
||||
"defaultValue": 50.0,
|
||||
"minimum": 0.0,
|
||||
@ -44,6 +48,7 @@
|
||||
{
|
||||
"name": "Type",
|
||||
"shortName": "Type",
|
||||
"id": "type",
|
||||
"direction": "input",
|
||||
"defaultValue": 1,
|
||||
"minimum": 1,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "gain", "bias" ]
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@
|
||||
},
|
||||
"uri": "@bw_examples:fx_clip",
|
||||
"types": [ "@lv2:WaveshaperPlugin" ],
|
||||
"version": "0.0",
|
||||
"busSymbols": [ "input", "output" ],
|
||||
"parameterSymbols": [ "gain", "bias" ]
|
||||
"version": "0.0"
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -10,20 +10,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 +36,7 @@
|
||||
{
|
||||
"name": "Bias",
|
||||
"shortName": "Bias",
|
||||
"id": "bias",
|
||||
"direction": "input",
|
||||
"defaultValue": 0.0,
|
||||
"minimum": -2.5,
|
||||
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmd": {
|
||||
"busIds": [ "input", "output" ],
|
||||
"parameterIds": [ "ff_delay", "fb_delay", "blend", "ff", "fb" ]
|
||||
}
|
||||
}
|
@ -5,8 +5,6 @@
|
||||
},
|
||||
"uri": "@bw_examples:fx_comb",
|
||||
"types": [ "@lv2:CombPlugin" ],
|
||||
"version": "0.0",
|
||||