Compare commits

...

146 Commits
v1.0.0 ... main

Author SHA1 Message Date
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
Stefano D'Angelo
5a4b9dc9b3 fix a few bugs in synth(pp)_{mono,poly} 2024-02-24 19:23:25 +01:00
Stefano D'Angelo
ba9fdc710c some synth(pp)_poly optimization + synth_mono cosmetics 2024-02-24 13:48:50 +01:00
Stefano D'Angelo
e9d80f55ac synth(pp)_mono, some optimization 2024-02-24 11:04:41 +01:00
Stefano D'Angelo
e0bfcdbdd7 damn underlines 2024-02-23 15:09:13 +01:00
Stefano D'Angelo
0b64fcbb61 readme cosmetics 2024-02-23 15:08:29 +01:00
Stefano D'Angelo
5fcbe57ad0 update README 2024-02-23 15:07:34 +01:00
Stefano D'Angelo
7a8ef7ae25 updated changelog 2024-02-23 15:04:45 +01:00
Stefano D'Angelo
4b10a04b3c copyright notices in examples 2024-02-23 14:17:01 +01:00
Stefano D'Angelo
590dbb8177 example instructions remove leftovers 2024-02-23 12:05:01 +01:00
Stefano D'Angelo
442d5ac283 cmd line examples instructions 2024-02-23 12:04:08 +01:00
Stefano D'Angelo
cedcbce960 oops, fix examples readme typo 2024-02-23 11:55:58 +01:00
Stefano D'Angelo
c39e1df4a5 tibia instructions 2024-02-23 11:54:03 +01:00
Stefano D'Angelo
ed80795731 test new examples README 2024-02-23 10:35:13 +01:00
Stefano D'Angelo
d3ec90a16e changed lv2 versions and vst3 guids 2024-02-21 18:26:02 +01:00
Stefano D'Angelo
e6cb568b04 remove useless label 2024-02-21 14:44:45 +01:00
Stefano D'Angelo
3e26125eb4 exagerate some example parameter ranges 2024-02-21 12:26:04 +01:00
Stefano D'Angelo
43d20f5c52 add silence_dc param to bw_bd_reduce, use it in examples 2024-02-21 10:37:20 +01:00
Stefano D'Angelo
61d3459b95 synthpp_poly 2024-02-21 09:03:09 +01:00
Stefano D'Angelo
4f7eb0a82f synth_poly + small fixes synth(pp)_mono 2024-02-20 18:24:49 +01:00
Stefano D'Angelo
cbfae97e42 synthpp_mono + synth_mono adjustments 2024-02-20 14:47:23 +01:00
Stefano D'Angelo
a5e56e2dd1 synth_mono + portamento in ms also in synth(pp)_simple 2024-02-20 11:33:50 +01:00
Stefano D'Angelo
a80aa87b27 fx(pp)_wah 2024-02-16 11:44:29 +01:00
Stefano D'Angelo
2bb3d1c9f5 fx(pp)_vibrato 2024-02-16 11:27:13 +01:00
Stefano D'Angelo
da25dcde75 fx(pp)_trem + fixed some product.json 2024-02-16 10:09:35 +01:00
Stefano D'Angelo
1226e9797d fx(pp)_svf + no more tibia_{clean,gen}.sh juggling 2024-02-16 09:43:18 +01:00
Stefano D'Angelo
3982f14211 fx(pp)_slew_lim 2024-02-16 09:26:10 +01:00
Stefano D'Angelo
3dcfeaf9fa fx(pp)_satur + fixed bw_satur_process_multi gain compensation 2024-02-15 20:49:31 +01:00
Stefano D'Angelo
c9c425e30e fx(pp)_ring_mod 2024-02-15 17:16:46 +01:00
Stefano D'Angelo
ef299091ff fx(pp)_reverb 2024-02-15 16:36:49 +01:00
Stefano D'Angelo
5e5a2f0032 fxpp_phaser for real 2024-02-15 15:48:21 +01:00
Stefano D'Angelo
b9f49672d1 fx(pp)_phaser 2024-02-15 15:42:27 +01:00
Stefano D'Angelo
eff4dab968 fx(pp)_pan 2024-02-15 15:20:26 +01:00
93d960e3b8 DEBUG preprocessor flag 2024-02-14 06:20:00 +01:00
a4924ff832 fx(pp)_{notch,one_pole} 2024-02-14 05:44:11 +01:00
d17387f377 fx(pp)_noise_gate 2024-02-14 05:18:42 +01:00
Stefano D'Angelo
763a024f07 fx(pp)_mm2 2024-02-12 17:54:06 +01:00
Stefano D'Angelo
4769d090c4 fx(pp)_mm1 2024-02-12 17:26:38 +01:00
Stefano D'Angelo
da1a3ef91b fx(pp)_ls1 2024-02-12 13:58:44 +01:00
Stefano D'Angelo
14650e8495 fx(pp)_lp1 2024-02-12 13:48:37 +01:00
Stefano D'Angelo
65e0e13b55 fx(pp)_hs1 2024-02-12 13:40:27 +01:00
Stefano D'Angelo
a4a979ad1d fx(pp)_hp1 2024-02-12 12:21:03 +01:00
Stefano D'Angelo
56f98d6d89 fx(pp)_fuzz 2024-02-12 12:02:02 +01:00
Stefano D'Angelo
2dca881f03 fx(pp)_flanger 2024-02-12 11:21:25 +01:00
Stefano D'Angelo
e828804d35 fx(pp)_eq_3band 2024-02-12 10:54:27 +01:00
397c36a7a0 fx(pp)_drive + fix bw_drive #endif in wrong place 2024-02-11 10:58:11 +01:00
76343595d8 fx(pp)_dist + cleaning 2024-02-11 10:34:23 +01:00
9af1146e48 fx(pp)_delay + cosmetics 2024-02-11 10:09:15 +01:00
93df684ac8 fx(pp)_comb + homogenize c++ examples a bit 2024-02-10 12:27:53 +01:00
9685ac9b4b fx(pp)_clip 2024-02-10 11:45:04 +01:00
Stefano D'Angelo
74737a8787 fx(pp)_chorus + clean some examples + improve tibia_gen.sh 2024-02-10 10:34:07 +01:00
Stefano D'Angelo
17ec290ae6 fixed synthpp_simple on web 2024-02-10 09:25:18 +01:00
Stefano D'Angelo
129d44db76 non-working synthpp_simple/wasm attempt 2024-02-09 18:20:20 +01:00
Stefano D'Angelo
404530cbbe differentiate and fix c++ fx and synth, beginning of synthpp_simple 2024-02-09 17:21:29 +01:00
Stefano D'Angelo
a9a690bc69 fix android-make.json 2024-02-09 15:54:31 +01:00
Stefano D'Angelo
f9e1f5eb73 new synth_simple + cosmetics in fx_balance 2024-02-09 11:35:27 +01:00
Stefano D'Angelo
df5f3837ea fixed bw_{comp,noise_gate}_process_multi 2024-02-08 15:54:42 +01:00
Stefano D'Angelo
0b7da2dda9 added fxpp_comp, fixed/cleaned fx_comp 2024-02-08 15:54:05 +01:00
Stefano D'Angelo
1c74f053db relax sidechain input api in bw_{comp,noise_gate} 2024-02-07 14:09:50 +01:00
Stefano D'Angelo
745ba9c2dd fxpp_cab mostly 2024-02-06 11:56:23 +01:00
Stefano D'Angelo
9b0496474b lots of example-related improvements + fx(pp)_bitcrush 2024-02-06 11:19:39 +01:00
Stefano D'Angelo
684f021476 tibia/ios 2024-02-05 16:34:22 +01:00
4ff4ceed70 add fxpp_{ap2,balance}, fix fx_balance daisy seed, c++ array in non-wasm 2024-02-03 08:09:18 +01:00
Stefano D'Angelo
e4e9643509 finally we can use C++ in web examples 2024-02-02 17:48:53 +01:00
Stefano D'Angelo
1d2f9dda39 introuced BW_CXX_NO_ARRAY 2024-02-02 17:42:12 +01:00
Stefano D'Angelo
2a62abe93b beginning of new c++ examples (fxpp_ap1) 2024-02-02 11:26:00 +01:00
1b4035b5ac removed c++ examples, updated fx_balance and more 2024-02-01 16:32:40 +01:00
156374aca4 just comments 2024-02-01 15:15:47 +01:00
0605204593 replace pragmas with dumb code in bw_{env_gen,hs2,ls2,one_pole,peak} 2024-02-01 15:12:51 +01:00
4b2f07852b updated fx_ap2 and tibia-related scripts 2024-02-01 10:08:32 +01:00
233c9d7303 integrating tibia, fx_ap1 works 2024-02-01 09:56:12 +01:00
37055e65ad added changelog entries for bw_common and bw_math 2024-01-31 10:08:25 +01:00
Stefano D'Angelo
ef8b5626a3 remove useless bw_config.h 2024-01-13 10:54:15 +01:00
2ba9b443c1 introduced BW_NULL 2024-01-02 11:20:52 +01:00
Stefano D'Angelo
4ee0c0d0cc fix two more warnings in bw_math (thx again kevin molcard) 2023-12-08 00:24:04 +01:00
Stefano D'Angelo
2b104fc7f2 fix some sign-related warnings (thx kevin molcard) 2023-12-06 14:40:16 +01:00
Stefano D'Angelo
e6903eef7f fix building examples requiring memory on ios 2023-11-03 13:08:48 +01:00
Stefano D'Angelo
0cb5a29a8b fixed documentation typos in bw_ls2 2023-10-27 15:48:32 +02:00
891fa64c9b new bw_cab modules, fx(pp)_cab examples 2023-10-25 15:35:33 +02:00
92e312766b fixed rounding bug when frequency is tiny and negative in bw_phase_gen 2023-10-17 16:36:27 +02:00
Stefano D'Angelo
df05bf1740 add skip_sustain and always_reach_sustain parameters to bw_env_gen 2023-10-16 15:34:25 +02:00
3ae4947855 cosmetics 2023-10-03 10:39:32 +02:00
cb37f4f977 cosmetics 2023-10-03 10:08:06 +02:00
d1e4e0f7c3 bw_{mm1,mm2,reverb}: fix reset_state 2023-10-03 09:13:38 +02:00
928b0752ff cosmetics 2023-10-03 08:59:09 +02:00
1389 changed files with 25666 additions and 35302 deletions

View File

@ -1,3 +1,31 @@
1.1.0
-----
* Added new bw_cab module.
* Added new fx_cab and fxpp_cab examples.
* Added skip_sustain and always_reach_sustain parameters to bw_env_gen.
* Added silence_dc parameter to bw_bd_reduce.
* Added BW_NULL definition in bw_common and used it throughout the entire
codebase.
* Added BW_CXX_NO_ARRAY to control the inclusion of features depending on
C++ <array>.
* Relaxed sidechain APIs in bw_comp and bw_noise_gate to accept BW_NULL to
represent null sidechain inputs.
* Added setThreshLin() and setThreshDb() methods to the C++ APIs of bw_comp
and bw_noise_gate to fix naming typos without breaking the API.
* Reworked all example code and added LV2, command line application, and
C++/WebAssembly targets.
* Fixed gain compensation in bw_satur_process_multi().
* Fixed rounding bug in bw_phase_gen when frequency is tiny and negative.
* Fixed smoothing of decay parameter in bw_reverb.
* Fixed computation of initial states in bw_mm1 and bw_mm2.
* Fixed sign-related issues in bw_hash_sdbm(), bw_truncf(), bw_roundf(), and
bw_sqrtf() (thanks Kevin Molcard).
* Replace GCC pragmas to suppress uninitalized variable warnings with
useless harmless statements in bw_env_gen, bw_hs2, bw_ls2, bw_one_pole, and
bw_peak.
* Fixed documentation typos in bw_ls2.
* Updated examples' documentation.
1.0.0
-----
* Removed C++ headers and moved C++ code to now-unique C/C++ headers.

View File

@ -6,18 +6,18 @@ You can find information and documentation [on the official web page](https://ww
## Subfolders
* examples: synth and an effect examples in VST3, Web Audio, Daisy Seed, Android app, and iOS app formats;
* include: header files.
* `examples`: synth and an effect examples in VST3, LV2, Web Audio, Daisy Seed, Android app, iOS app, and command line program formats;
* `include`: header files.
## Legal
Copyright (C) 2021-2023 Orastron Srl unipersonale.
Copyright (C) 2021-2024 Orastron Srl unipersonale.
Authors: Stefano D'Angelo, Paolo Marrone.
All the code in the repo is released under GPLv3. See the LICENSE file. Alternatively, we offer a commercial license that doesn't restrict usage with respect to time, projects, or developers involved. More details [on the official web page](https://www.orastron.com/brickworks#license-pricing).
All the code in the repo is released under GPLv3. See the `LICENSE` file. Alternatively, we offer a commercial license that doesn't restrict usage with respect to time, projects, or developers involved. More details [on the official web page](https://www.orastron.com/brickworks#license-pricing).
The file include/bw\_rand.h contains code from https://nullprogram.com/blog/2017/09/21/, which was released into the public domain by its author.
The `include/bw_rand.h` file contains code from https://nullprogram.com/blog/2017/09/21/, which was released into the public domain by its author.
VST is a registered trademark of Steinberg Media Technologies GmbH.

View File

@ -1,5 +1,8 @@
We wish to thank and give credit to:
- the adopters of this software, of which at the moment we can only publicly mention our friends at [Elk Audio](https://www.elk.audio/);
- the adopters of this software, of which at the moment we can publicly mention, in alphabetical order:
- [Elk Audio](https://www.elk.audio/);
- [Faselunare](http://faselunare.com/);
- Kevin Molcard for finding compilation warnings that needed fixing in Brickworks 1.0.0;
- users participating to [this thread on the KVR Audio forum](https://www.kvraudio.com/forum/viewtopic.php?f=33&t=589519) for providing useful feedback;
- [Mads Kjeldgaard](https://madskjeldgaard.dk/) for publishing [instructions to build for the Daisy Seed and uploading the firmware](https://madskjeldgaard.dk/posts/daisy-setup/);
- [Hereket](https://hereket.github.io/) for providing instructions on [how to build an Android app without Android Studio or Gradle](https://hereket.github.io/posts/android_from_command_line/);

View File

@ -1,34 +1,61 @@
# Examples
Each subfolder contains an example application, except the `common` folder, which contains common code for all examples.
## Premise
In order to build an example just `cd` to `*example*/*platofrm*` and use 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).
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
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 the [VST3 SDK](https://www.steinberg.net/developers/) and place it in the same folder as the Brickworks folder, or otherwise edit `common/vst3/vst3.mk` and change the `VST3_SDK_DIR` variable to point to the correct directory.
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.
### Build
In order to build just type `make`. You'll find the resulting VST3 directory in `build/example.vst3`.
In order to build just type `make`. You'll find the resulting VST3 directory in <code>build/bw\_example\_*example*.vst3</code>.
### Installation
If all went fine, you can install for the current user (i.e., into the user VST3 folder) by invoking `make install-user`.
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`.
On macOS and Linux you can also install for all users (i.e., into the system VST3 folder) by `make install`.
## LV2
### 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/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.
### Build
In order to build just type `make`. You'll find the resulting LV2 bundle in <code>build/bw\_example\_*example*.lv2</code>.
### 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`.
## 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
@ -44,7 +71,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 [libDaisy](https://github.com/electro-smith/libDaisy), `cd` to it, and run `make`. You should either place it in the same folder as the Brickworks folder, or otherwise edit `common/daisy-seed/daisy-seed.mk` and change the `LIBDAISY_DIR` variable to point to the correct directory.
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).
### Build
@ -64,11 +91,11 @@ Effect examples report output parameter values and CPU usage statistics via USB
### Prerequisites
Android examples are built without the help of Android Studio or Gradle. You'll however need to have a recent enough JDK (we need `javac` and `keytool`), as well as to download the latest stable:
Android examples are built without the help of Android Studio or Gradle. You'll however need to have a recent enough JDK (we need `javac`), as well as to download the latest stable:
- 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)
@ -77,7 +104,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 in `common/android/android.mk`.
Then you'll probably also need to adjust paths and values in `common/src/android-make.json` and [run Tibia](#tibia).
\* 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*".
@ -87,15 +114,13 @@ In order to build just type `make`. You'll find the resulting `.apk` file in `bu
### Installation
If all went fine, you can branch your device and install using `make install`.
Otherwise, you can also install manually, but please remember to first uninstall the application from the device (`adb install -r` is not sufficient as the signature might have changed while building).
If all went fine, you can branch your device and install using `make install` or otherwise install manually.
### Usage and known issues
Effect examples process audio input signals, therefore they will require permission to use the capture device.
Synth examples use input MIDI. While they are coded to support hotplugging, this doesn't seem to work as expected on the devices we tested. You'll need to press "STOP" and then "START" again after plugging a new device.
Synth examples use input MIDI and support hotplugging.
## iOS
@ -105,7 +130,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 `build/common/ios/project.yml`.
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).
### Build
@ -120,3 +145,19 @@ At this point you can build and run as with any other iOS app.
Effect examples process audio input signals, therefore they will require permission to use the capture device.
Synth examples use input MIDI and support hotplugging.
## Command line program
### 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/).
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`
### Build
In order to build just type `make`. You'll find the resulting executable file in `build`.
### Usage
Just run the executable without arguments to get usage instructions.

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.orastron.@NAME@">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-sdk android:minSdkVersion="26" /> <!-- for androidx core and AAudio -->
<uses-sdk android:targetSdkVersion="34" />
<application android:label="@NAME@">
<activity android:name=".MainActivity" android:label="@NAME@" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.orastron.@NAME@">
<uses-sdk android:minSdkVersion="29" /> <!-- for AMidi -->
<uses-sdk android:targetSdkVersion="34" />
<application android:label="@NAME@">
<activity android:name=".MainActivity" android:label="@NAME@" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -1,97 +0,0 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* Brickworks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
*
* File author: Stefano D'Angelo, Paolo Marrone
*/
package com.orastron.@NAME@;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebSettings;
import android.webkit.WebChromeClient;
import android.webkit.WebViewClient;
import android.webkit.JavascriptInterface;
import android.content.Context;
import android.content.pm.PackageManager;
import androidx.core.app.ActivityCompat;
public class MainActivity extends Activity {
static {
System.loadLibrary("@NAME@");
}
public native boolean nativeAudioStart();
public native void nativeAudioStop();
public native float nativeGetParameter(int i);
public native void nativeSetParameter(int i, float v);
private WebView webView;
public class WebAppInterface {
@JavascriptInterface
public boolean hasAudioPermission() {
return MainActivity.this.checkCallingOrSelfPermission(android.Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED;
}
@JavascriptInterface
public void requestAudioPermission() {
ActivityCompat.requestPermissions(MainActivity.this, new String[] { android.Manifest.permission.RECORD_AUDIO }, 0);
}
@JavascriptInterface
public boolean audioStart() {
return nativeAudioStart();
}
@JavascriptInterface
public void audioStop() {
nativeAudioStop();
}
@JavascriptInterface
public float getParameter(int i) {
return nativeGetParameter(i);
}
@JavascriptInterface
public void setParameter(int i, float v) {
nativeSetParameter(i, v);
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
webView = new WebView(this);
setContentView(webView);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient());
webSettings.setDomStorageEnabled(true);
webView.addJavascriptInterface(new WebAppInterface(), "Android");
webView.loadUrl("file:///android_asset/index.html");
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (grantResults.length > 0)
webView.loadUrl("javascript:gotAudioPermission()");
}
}

View File

@ -1,180 +0,0 @@
/*
* Brickworks
*
* Copyright (C) 2023 Orastron Srl unipersonale
*
* Brickworks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* Brickworks is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
*
* File author: Stefano D'Angelo, Paolo Marrone
*/
package com.orastron.@NAME@;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebSettings;
import android.webkit.WebChromeClient;
import android.webkit.WebViewClient;
import android.webkit.JavascriptInterface;
import android.content.Context;
import android.content.pm.PackageManager;
import androidx.core.app.ActivityCompat;
import android.media.midi.MidiManager;
import android.media.midi.MidiManager.DeviceCallback;
import android.media.midi.MidiDeviceInfo;
import android.media.midi.MidiDeviceInfo.PortInfo;
import android.media.midi.MidiDevice;
import java.util.ArrayList;
import android.util.Log;
public class MainActivity extends Activity {
static {
System.loadLibrary("@NAME@");
}
public native boolean nativeAudioStart();
public native void nativeAudioStop();
public native float nativeGetParameter(int i);
public native void nativeSetParameter(int i, float v);
public native void addMidiPort(MidiDevice d, int p);
public native void removeMidiPort(MidiDevice d, int p);
private WebView webView;
public class WebAppInterface {
private MidiManager midiManager;
private MidiDeviceCallback midiDeviceCallback;
public ArrayList<MidiDevice> midiDevices = new ArrayList<MidiDevice>();
public void addMidiDevices(MidiDeviceInfo[] devices) {
for (int i = 0; i < devices.length; i++) {
if (devices[i].getOutputPortCount() == 0)
continue;
midiManager.openDevice(devices[i],
new MidiManager.OnDeviceOpenedListener() {
@Override
public void onDeviceOpened(MidiDevice device) {
PortInfo[] ports = device.getInfo().getPorts();
for (int i = 0; i < ports.length; i++)
if (ports[i].getType() == PortInfo.TYPE_OUTPUT)
addMidiPort(device, ports[i].getPortNumber());
WebAppInterface.this.midiDevices.add(device);
}
}, null);
}
}
public void removeMidiDevices(MidiDeviceInfo[] devices) {
for (int i = 0; i < midiDevices.size(); i++) {
MidiDevice device = midiDevices.get(i);
int id = device.getInfo().getId();
int j = 0;
for (; j < devices.length; j++)
if (id == devices[j].getId())
break;
if (j == devices.length)
continue;
PortInfo[] ports = device.getInfo().getPorts();
for (j = 0; j < ports.length; j++)
if (ports[j].getType() == PortInfo.TYPE_OUTPUT)
removeMidiPort(device, ports[j].getPortNumber());
midiDevices.remove(i);
}
}
public void removeAllMidiDevices() {
for (int i = 0; i < midiDevices.size(); i++) {
MidiDevice device = midiDevices.get(i);
PortInfo[] ports = device.getInfo().getPorts();
for (int j = 0; j < ports.length; j++)
if (ports[j].getType() == PortInfo.TYPE_OUTPUT)
removeMidiPort(device, ports[j].getPortNumber());
}
midiDevices.clear();
}
public class MidiDeviceCallback extends MidiManager.DeviceCallback {
@Override
public void onDeviceAdded(MidiDeviceInfo device) {
WebAppInterface.this.addMidiDevices(new MidiDeviceInfo[]{device});
}
@Override
public void onDeviceRemoved(MidiDeviceInfo device) {
WebAppInterface.this.removeMidiDevices(new MidiDeviceInfo[]{device});
}
}
@JavascriptInterface
public boolean hasAudioPermission() {
return MainActivity.this.checkCallingOrSelfPermission(android.Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED;
}
@JavascriptInterface
public void requestAudioPermission() {
ActivityCompat.requestPermissions(MainActivity.this, new String[] { android.Manifest.permission.RECORD_AUDIO }, 0);
}
@JavascriptInterface
public boolean audioStart() {
midiManager = (MidiManager)getSystemService(Context.MIDI_SERVICE);
addMidiDevices(midiManager.getDevices());
midiDeviceCallback = new MidiDeviceCallback();
midiManager.registerDeviceCallback(midiDeviceCallback, null);
return nativeAudioStart();
}
@JavascriptInterface
public void audioStop() {
nativeAudioStop();
midiManager.unregisterDeviceCallback(midiDeviceCallback);
removeAllMidiDevices();
}
@JavascriptInterface
public float getParameter(int i) {
return nativeGetParameter(i);
}
@JavascriptInterface
public void setParameter(int i, float v) {
nativeSetParameter(i, v);
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
webView = new WebView(this);
setContentView(webView);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new WebViewClient());
webSettings.setDomStorageEnabled(true);
webView.addJavascriptInterface(new WebAppInterface(), "Android");
webView.loadUrl("file:///android_asset/index.html");
}
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (grantResults.length > 0)
webView.loadUrl("javascript:gotAudioPermission()");
}
}

View File

@ -1,138 +0,0 @@
COMMON_DIR := ${ROOT_DIR}/../../common/android
ANDROID_SDK_DIR := ${HOME}/Android/Sdk
ANDROID_NDK_DIR := ${ANDROID_SDK_DIR}/ndk/25.2.9519653
ANDROIDX_DIR := ${HOME}/Android/androidx
KOTLIN_DIR := ${HOME}/Android/kotlin
MINIAUDIO_DIR := ${ROOT_DIR}/../../../../miniaudio
BUILD_TOOLS_DIR := ${ANDROID_SDK_DIR}/build-tools/34.0.0
JAR_FILE := ${ANDROID_SDK_DIR}/platforms/android-34/android.jar
ANDROIDX_CORE_FILE := ${ANDROIDX_DIR}/core-1.10.1.jar
ANDROIDX_LIFECYCLE_COMMON_FILE := ${ANDROIDX_DIR}/lifecycle-common-2.6.1.jar
ANDROIDX_VERSIONEDPARCELABLE_FILE := ${ANDROIDX_DIR}/versionedparcelable-1.1.1.jar
KOTLIN_STDLIB_FILE := ${KOTLIN_DIR}/kotlin-stdlib-1.9.0.jar
KOTLINX_COROUTINES_CORE_FILE := ${KOTLIN_DIR}/kotlinx-coroutines-core-1.7.3.jar
KOTLINX_COROUTINES_CORE_JVM_FILE := ${KOTLIN_DIR}/kotlinx-coroutines-core-jvm-1.7.3.jar
JAVAC := javac
KEYTOOL := keytool
ifdef SYNTH
CXX := ${ANDROID_NDK_DIR}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi29-clang++
else
CXX := ${ANDROID_NDK_DIR}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi26-clang++
endif
ADB := ${HOME}/Android/Sdk/platform-tools/adb
APKSIGNER := ${BUILD_TOOLS_DIR}/apksigner
ZIPALIGN := ${BUILD_TOOLS_DIR}/zipalign
AAPT := ${BUILD_TOOLS_DIR}/aapt
D8 := ${BUILD_TOOLS_DIR}/d8
CXXFLAGS := \
-fPIC \
-DNDEBUG \
-DBW_NO_DEBUG \
-I${ROOT_DIR}/../src \
-I${COMMON_DIR} \
-I${ROOT_DIR}/../../../include \
-I${MINIAUDIO_DIR} \
-O3 \
-Wall \
-Wextra \
-Wpedantic \
-std=c++11
LDFLAGS := \
-shared \
-static-libstdc++ \
-ljnigraphics \
-llog \
-landroid
ifdef SYNTH
LDFLAGS += -lamidi
endif
SOURCES_COMMON := \
build/gen/jni.cpp
JARS := \
${JAR_FILE} \
${ANDROIDX_CORE_FILE} \
${ANDROIDX_LIFECYCLE_COMMON_FILE} \
${ANDROIDX_VERSIONEDPARCELABLE_FILE} \
${KOTLIN_STDLIB_FILE} \
${KOTLINX_COROUTINES_CORE_FILE} \
${KOTLINX_COROUTINES_CORE_JVM_FILE}
JNI_NAME := $(shell echo ${NAME} | sed 's:_:_1:g')
ifdef SYNTH
ANDROID_MANIFEST_SOURCE := ${COMMON_DIR}/AndroidManifest-synth.xml
MAIN_ACTIVITY_SOURCE := ${COMMON_DIR}/MainActivity-synth.java
else
ANDROID_MANIFEST_SOURCE := ${COMMON_DIR}/AndroidManifest-fx.xml
MAIN_ACTIVITY_SOURCE := ${COMMON_DIR}/MainActivity-fx.java
endif
all: build/${NAME}.apk
build/${NAME}.apk: build/gen/${NAME}.aligned.apk build/apk/lib/armeabi-v7a/lib${NAME}.so build/gen/keystore.jks
${APKSIGNER} sign --ks build/gen/keystore.jks --ks-key-alias androidkey --ks-pass pass:android --key-pass pass:android --out $@ build/gen/${NAME}.aligned.apk
build/gen/keystore.jks: | build/gen
${KEYTOOL} -genkeypair -keystore $@ -alias androidkey -dname "CN=orastron.com, OU=ID, O=ORASTRON, L=Abc, S=Xyz, C=IT" -validity 10000 -keyalg RSA -keysize 2048 -storepass android -keypass android
build/gen/${NAME}.aligned.apk: build/gen/${NAME}.unsigned.apk
${ZIPALIGN} -f -p 4 $^ $@
build/gen/${NAME}.unsigned.apk: build/apk/classes.dex build/gen/AndroidManifest.xml build/assets/index.html build/assets/config.js build/apk/lib/armeabi-v7a/lib${NAME}.so| build/gen
${AAPT} package -f -M build/gen/AndroidManifest.xml -A build/assets -I ${JAR_FILE} -I ${ANDROIDX_CORE_FILE} -I ${ANDROIDX_LIFECYCLE_COMMON_FILE} -I ${ANDROIDX_VERSIONEDPARCELABLE_FILE} -I ${KOTLIN_STDLIB_FILE} -I ${KOTLINX_COROUTINES_CORE_FILE} -I ${KOTLINX_COROUTINES_CORE_JVM_FILE} -F $@ build/apk
ifdef SYNTH
build/apk/classes.dex: build/apk/my_classes.jar
cd build/apk && ${D8} --min-api 29 ../../$^ ${JARS} && cd ../..
build/apk/my_classes.jar: build/obj/com/orastron/${NAME}/MainActivity.class build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface.class build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface$$MidiDeviceCallback.class build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface$$1.class | build/apk
${D8} build/obj/com/orastron/${NAME}/MainActivity.class 'build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface.class' 'build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface$$MidiDeviceCallback.class' 'build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface$$1.class' --min-api 29 --output $@ --no-desugaring
else
build/apk/classes.dex: build/apk/my_classes.jar
cd build/apk && ${D8} --min-api 26 ../../$^ ${JARS} && cd ../..
build/apk/my_classes.jar: build/obj/com/orastron/${NAME}/MainActivity.class build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface.class | build/apk
${D8} build/obj/com/orastron/${NAME}/MainActivity.class 'build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface.class' --min-api 26 --output $@ --no-desugaring
endif
build/apk/lib/armeabi-v7a/lib${NAME}.so: ${SOURCES} | build/apk/lib/armeabi-v7a
${CXX} $^ ${CXXFLAGS} ${LDFLAGS} -o $@
build/gen/jni.cpp: ${COMMON_DIR}/jni.cpp | build/gen
cat $^ | sed s:@JNI_NAME@:${JNI_NAME}:g > $@
build/obj/com/orastron/${NAME}/MainActivity$$WebAppInterface.class: build/obj/com/orastron/${NAME}/MainActivity.class
build/obj/com/orastron/${NAME}/MainActivity.class: build/gen/com/orastron/${NAME}/MainActivity.java | build/obj
${JAVAC} -classpath "${JAR_FILE}:${ANDROIDX_CORE_FILE}:${ANDROIDX_LIFECYCLE_COMMON_FILE}:${ANDROIDX_VERSIONEDPARCELABLE_FILE}:${KOTLIN_STDLIB_FILE}:${KOTLINX_COROUTINES_CORE_FILE}:${KOTLINX_COROUTINES_CORE_JVM_FILE}" -d build/obj build/gen/com/orastron/${NAME}/MainActivity.java
build/gen/com/orastron/${NAME}/MainActivity.java: ${MAIN_ACTIVITY_SOURCE} | build/gen/com/orastron/${NAME}
cat $^ | sed s:@NAME@:${NAME}:g > $@
build/gen/AndroidManifest.xml: ${ANDROID_MANIFEST_SOURCE} | build/gen/com/orastron/${NAME}
cat $^ | sed s:@NAME@:${NAME}:g > $@
build/assets/index.html: ${COMMON_DIR}/index.html | build/assets
cp $^ $@
build/assets/config.js: ${ROOT_DIR}/../src/config.js | build/assets
cp $^ $@
build/apk build/apk/lib/armeabi-v7a build/obj build/gen/com/orastron/${NAME} build/gen build/assets:
mkdir -p $@
clean:
rm -fr build
install: build/${NAME}.apk
[ -n "`${ADB} shell pm list packages | grep ^package:com.orastron.${NAME}$$`" ] && ${ADB} uninstall com.orastron.${NAME}; exit 0
${ADB} install $^
.PHONY: all clean install

View File

@ -1,139 +0,0 @@
<!DOCTYPE html>
<!--
Brickworks
Copyright (C) 2023 Orastron Srl unipersonale
Brickworks is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
Brickworks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Brickworks. If not, see <http://www.gnu.org/licenses/>.
File author: Stefano D'Angelo, Paolo Marrone
-->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript">
var hasAudioPermission = true;
for (var i = 0; i < buses.length; i++)
if (!buses[i].output) {
hasAudioPermission = Android.hasAudioPermission();
break;
}
var audioStarted = false;
var topButtonElem;
var outParamInterval;
window.onload = function () {
topButtonElem = document.getElementById("topButton");
var paramsElem = document.getElementById("params");
topButtonElem.value = hasAudioPermission ? "START" : "INIT";
topButtonElem.addEventListener("click", function () {
if (hasAudioPermission) {
if (audioStarted) {
clearInterval(outParamInterval);
Android.audioStop();
paramsElem.innerHTML = "";
topButtonElem.value = "START";
audioStarted = false;
} else {
if (Android.audioStart()) {
for (var i = 0; i < parameters.length; i++) {
var div = document.createElement("div");
paramsElem.appendChild(div);
var label = document.createElement("label");
label.innerText = parameters[i].name;
div.appendChild(label);
div.appendChild(document.createElement("br"));
var range = document.createElement("input");
range.classList.add("range");
range.setAttribute("type", "range");
range.setAttribute("id", "p" + i);
range.setAttribute("min", 0);
range.setAttribute("max", 1);
range.setAttribute("step", parameters[i].step ? 1 / parameters[i].step : "any");
range.value = parameters[i].defaultValue;
if (parameters[i].output)
range.setAttribute("readonly", "readonly");
else {
let index = i;
range.addEventListener("input",
function (ev) {
Android.setParameter(index, parseFloat(ev.target.value));
});
}
div.appendChild(range);
}
outParamInterval = setInterval(
function () {
for (var i = 0; i < parameters.length; i++)
if (parameters[i].output)
document.getElementById("p" + i).value = Android.getParameter(i);
}, 50);
topButtonElem.value = "STOP";
audioStarted = true;
} else
alert("Could not start audio");
}
}
else
Android.requestAudioPermission();
});
};
function gotAudioPermission() {
hasAudioPermission = true;
topButtonElem.value = "START";
}
</script>
<style>
* {
margin: 0;
padding: 0;
user-select: none;
}
body {
margin: 1em;
}
#topButton {
width: 100%;
border: 0;
background-color: #04aa6d;
color: white;
padding: 0.5em;
text-align: center;
margin-bottom: 1em;
padding: 1em;
}
.range {
width: 90%;
}
</style>
</head>