From a2568c781c4e9dc35ac88f10a50bea398bbb857d Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 11 Oct 2023 14:47:02 +0200 Subject: [PATCH 01/17] error in DPF input portgroups template --- hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp index 12c8417c..31d5a1da 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_PortGroups.cpp @@ -10,8 +10,8 @@ void {{class_name}}::initAudioPort(bool input, uint32_t index, AudioPort& port) {%- for group, gConfig in meta.port_groups.input.items() %} {%- for port, value in gConfig.items() %} case {{value}}: - port.name = "Output {{port}} ({{group}})"; - port.symbol = "out_{{port|lower}}_{{group|lower}}"; + port.name = "Input {{port}} ({{group}})"; + port.symbol = "in_{{port|lower}}_{{group|lower}}"; port.groupId = kPortGroup{{group}}; break; {%- endfor %} From 59cd913ab57128fd9d4632bdb40be065ad5e35b3 Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 11 Oct 2023 16:24:15 +0200 Subject: [PATCH 02/17] SliderInt for integer typed params --- hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp index 01bb782f..20f53805 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp @@ -116,6 +116,8 @@ class ImGuiPluginUI : public UI {%- else %} {%- if v.attributes.type == 'bool': %} if (ImGui::Toggle("{{v.display.replace('_', ' ')}}", &f{{v_display}})) + {%- elif v.attributes.type == 'int' %} + if (ImGui::SliderInt("{{v.display.replace('_', ' ')}}", &f{{v_display}}, {{v.attributes.min}}f, {{v.attributes.max}}f)) {%- else %} if (ImGui::SliderFloat("{{v.display.replace('_', ' ')}}", &f{{v_display}}, {{v.attributes.min}}f, {{v.attributes.max}}f)) {%- endif %} From 46dc5afddb04c3cf881e8c326a5c6a2b8f562705 Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 13 Oct 2023 21:35:39 +0200 Subject: [PATCH 03/17] update Daisy docs --- docs/03.gen.daisy.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/03.gen.daisy.md b/docs/03.gen.daisy.md index 3b92c859..77ce2c90 100644 --- a/docs/03.gen.daisy.md +++ b/docs/03.gen.daisy.md @@ -2,8 +2,6 @@ Daisy is an embedded platform for music. It features everything you need for creating high fidelity audio hardware devices. -This Generator is typically it is used in combination with [pd2dsy](https://github.com/electro-smith/pd2dsy). - Currently daisy platform is supported for: * `field` @@ -11,6 +9,8 @@ Currently daisy platform is supported for: * `pod` * `petal` * `patch` +* `patch_init` +* `patch_sm` Which can be configured using the `-m` metadata.json `daisy.board` setting: @@ -50,6 +50,8 @@ Additionally `usb_midi`, running on the onboard micro-usb, can be enabled separa At the moment all midi messages will be merged between USB and UART MIDI interfaces. In the future it will likely be possible to assign additional UART pins and group them under a specific PD midi "port". +Currently supported MIDI messages are: Note On/Off, Control Change, Program Change, Channel Pressure, and Pitch Bend. + ## [print] object Printing to serial console can be enabled using the `debug_printing` flag in the meta.json: From 4156f9129697217641fc1acea0ede031d0c2c98a Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 1 Nov 2023 07:06:10 +0100 Subject: [PATCH 04/17] mention lack of control input on some objects --- docs/02.getting_started.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/02.getting_started.md b/docs/02.getting_started.md index c8e2496f..3a8dfb34 100644 --- a/docs/02.getting_started.md +++ b/docs/02.getting_started.md @@ -82,6 +82,7 @@ If you experience any problems or have some thoughts on how to improve heavy mak ## Known Limitations +* Many objects do not take control signals on their left inlet. `[osc~]` for instance always requires the use of `[sig~]` before connecting a value. * Heavy does not support numbers in `[unpack]`, e.g. `[unpack 0 0]` gives `Heavy only supports arguments 'f' and 's' to unpack.` Workaround is to use `f` instead, e.g. `[unpack f f]`, and if necessary prime the default values with a `[loadbang]` and `[0 0(`. * Heavy does not accept arguments and control connections to: `[rzero~]`, `[rzero_rev~]`, `[czero~]`, `[czero_rev~]`. In Heavy, these objects accept only signal inputs. Arguments and control connections are ignored. * On the `[select]` object it is currently not possible to set the arguments via the right inlet (internally a hardcoded switch_case is used). From 6b0a13a1a16d8d829841e5d2891091c24ac1da6e Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 1 Nov 2023 07:37:57 +0100 Subject: [PATCH 05/17] update midifile dep --- tests/src/midifile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/midifile b/tests/src/midifile index 0015eada..78a85f51 160000 --- a/tests/src/midifile +++ b/tests/src/midifile @@ -1 +1 @@ -Subproject commit 0015eada0a315fbd663e728e7b1088acd9877f19 +Subproject commit 78a85f51f92b7f57904c2d14f1813f5a6f7e7318 From 57f9dedfef4e1efda2cdb16b42cdf2aaa772b22d Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:01:52 +0100 Subject: [PATCH 06/17] try 20.04 instead of latest (#128) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c046aeaa..0af5b80b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] From ecfec8cb10852911f296b35ff526448ec66d4d5d Mon Sep 17 00:00:00 2001 From: dreamer Date: Thu, 2 Nov 2023 13:43:11 +0100 Subject: [PATCH 07/17] add symbol comment for pack --- docs/02.getting_started.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/02.getting_started.md b/docs/02.getting_started.md index 3a8dfb34..ffdd99b3 100644 --- a/docs/02.getting_started.md +++ b/docs/02.getting_started.md @@ -83,6 +83,7 @@ If you experience any problems or have some thoughts on how to improve heavy mak ## Known Limitations * Many objects do not take control signals on their left inlet. `[osc~]` for instance always requires the use of `[sig~]` before connecting a value. +* Heavy does not support symbols in `[pack]`. e.g. `[pack s f]`. * Heavy does not support numbers in `[unpack]`, e.g. `[unpack 0 0]` gives `Heavy only supports arguments 'f' and 's' to unpack.` Workaround is to use `f` instead, e.g. `[unpack f f]`, and if necessary prime the default values with a `[loadbang]` and `[0 0(`. * Heavy does not accept arguments and control connections to: `[rzero~]`, `[rzero_rev~]`, `[czero~]`, `[czero_rev~]`. In Heavy, these objects accept only signal inputs. Arguments and control connections are ignored. * On the `[select]` object it is currently not possible to set the arguments via the right inlet (internally a hardcoded switch_case is used). From 0aeb8495aefdc7e4fedc356bac4a08ba7c3342bb Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 3 Nov 2023 17:38:40 +0100 Subject: [PATCH 08/17] note slider behavior in the docs --- docs/02.getting_started.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/02.getting_started.md b/docs/02.getting_started.md index ffdd99b3..b3db0686 100644 --- a/docs/02.getting_started.md +++ b/docs/02.getting_started.md @@ -85,6 +85,7 @@ If you experience any problems or have some thoughts on how to improve heavy mak * Many objects do not take control signals on their left inlet. `[osc~]` for instance always requires the use of `[sig~]` before connecting a value. * Heavy does not support symbols in `[pack]`. e.g. `[pack s f]`. * Heavy does not support numbers in `[unpack]`, e.g. `[unpack 0 0]` gives `Heavy only supports arguments 'f' and 's' to unpack.` Workaround is to use `f` instead, e.g. `[unpack f f]`, and if necessary prime the default values with a `[loadbang]` and `[0 0(`. +* Sliders and number inputs are converted to `[f ]` and thus do not store send/receive/initialization/etc. settings. * Heavy does not accept arguments and control connections to: `[rzero~]`, `[rzero_rev~]`, `[czero~]`, `[czero_rev~]`. In Heavy, these objects accept only signal inputs. Arguments and control connections are ignored. * On the `[select]` object it is currently not possible to set the arguments via the right inlet (internally a hardcoded switch_case is used). * `[metro]` and `[timer]` objects do not accept tempo messages or unit arguments. From 21bd97a47bcb308ce42f0ab107b01db4f399cf4b Mon Sep 17 00:00:00 2001 From: dreamer Date: Sat, 4 Nov 2023 01:50:13 +0100 Subject: [PATCH 09/17] add pypi and python icons to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 481ecc09..b606ec85 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Heavy Compiler Collection (hvcc) [![Build Status](https://github.com/Wasted-Audio/hvcc/actions/workflows/build.yml/badge.svg)](https://github.com/Wasted-Audio/hvcc/actions) +[![pypi](https://img.shields.io/pypi/v/hvcc.svg)](https://pypi.python.org/pypi/hvcc) +[![python](https://img.shields.io/pypi/pyversions/hvcc.svg)](https://pypi.python.org/pypi/hvcc) `hvcc` is a python-based dataflow audio programming language compiler that generates C/C++ code and a variety of specific framework wrappers. From f111545adb4c70ed17d6a5ee42e1f35f77802609 Mon Sep 17 00:00:00 2001 From: dreamer Date: Tue, 7 Nov 2023 15:05:50 +0100 Subject: [PATCH 10/17] add ko-fi and liberpay links --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e2ccfbd7..667d1ce2 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,4 @@ github: Wasted-Audio patreon: WastedAudio +ko_fi: wastedaudio +liberapay: WastedAudio From 16512fa5b11ec04794278b05457ef0644b9922c3 Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Fri, 10 Nov 2023 10:37:12 +0100 Subject: [PATCH 11/17] use enumerator for parameter IDs in the UI (#132) --- .../c2dpf/templates/HeavyDPF_UI.cpp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp index 20f53805..7343eb3f 100644 --- a/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp +++ b/hvcc/generators/c2dpf/templates/HeavyDPF_UI.cpp @@ -6,6 +6,14 @@ START_NAMESPACE_DISTRHO // -------------------------------------------------------------------------------------------------------------------- +{%- if receivers|length > 0 %} +enum HeavyParams { + {%- for k, v in receivers %} + {{v.display|upper}}, + {%- endfor %} +}; +{%- endif %} + class ImGuiPluginUI : public UI { {% for k, v in receivers -%} @@ -51,7 +59,7 @@ class ImGuiPluginUI : public UI {%- if receivers|length > 0 %} switch (index) { {% for k, v in receivers -%} - case {{loop.index-1}}: + case {{v.display|upper}}: {%- if v.attributes.type == 'bool': %} f{{v.display|lower}} = value != 0.0f; {%- else %} @@ -105,8 +113,8 @@ class ImGuiPluginUI : public UI if (ImGui::Selectable({{enum_list}}[n], is_selected)) { f{{v_display}} = n; - editParameter({{loop.index-1}}, true); - setParameterValue({{loop.index-1}}, f{{v_display}}); + editParameter({{v.display|upper}}, true); + setParameterValue({{v.display|upper}}, f{{v_display}}); } if (is_selected) ImGui::SetItemDefaultFocus(); @@ -124,17 +132,17 @@ class ImGuiPluginUI : public UI { if (ImGui::IsItemActivated()) { - editParameter({{loop.index-1}}, true); - setParameterValue({{loop.index-1}}, f{{v_display}}); + editParameter({{v.display|upper}}, true); + setParameterValue({{v.display|upper}}, f{{v_display}}); } } {%- endif %} {% endfor %} if (ImGui::IsItemDeactivated()) { - {%- for i in range(0, receivers|length) %} - editParameter({{i}}, false); - {%- endfor %} + {%- for k, v in receivers -%} + editParameter({{v.display|upper}}, false); + {% endfor -%} } } ImGui::End(); From 94224d665be9cf32f5c48da5b86b6720101e22e0 Mon Sep 17 00:00:00 2001 From: dreamer Date: Fri, 10 Nov 2023 10:56:46 +0100 Subject: [PATCH 12/17] start new changelog; restructure readme and mention integrations --- CHANGELOG.md | 7 +++++++ README.md | 47 ++++++++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ede5bd..385a7014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ===== +Next Release +----- + +* Documentation fixes/additions +* DPF: enum for UI parameter IDs +* DPF bugfixes: correct input PortGroup names + 0.9.0 ----- diff --git a/README.md b/README.md index b606ec85..f931e7f2 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,36 @@ The goal was to leverage Pure Data as a design interface and statically interpre It has since then been expanded to provide further support for many different platforms and frameworks, targeting game audio design, daw plugins and embedded production tools. In 2021 Wasted Audio took over maintenance of the project. +## Documentation + +* [Introduction](/docs/01.introduction.md) + * [What is heavy?](/docs/01.introduction.md#what-is-heavy) + * [Supported patch formats](/docs/01.introduction.md#supported-patch-formats) + * [Supported platforms](/docs/01.introduction.md#supported-platforms) + * [Supported frameworks](/docs/01.introduction.md#supported-frameworks) + * [Licensing](/docs/01.introduction.md#licensing) +* [Getting Started](/docs/02.getting_started.md) +* [Generators](/docs/03.generators.md) +* [MIDI](/docs/04.midi.md) +* [C API](/docs/05.c.md) +* [C++ API](/docs/06.cpp.md) +* [Heavy Lang Info](/docs/07.heavy_lang.md) +* [Heavy IR Info](/docs/08.heavy_ir_lang.md) +* [Supported vanilla objects](/docs/09.supported_vanilla_objects.md) +* [Unsupported vanilla objects](/docs/10.unsupported_vanilla_objects.md) + +## Integrations + +hvcc has been integrated into several projects and services. This allows to easily compile patches without having to install hvcc manually. + +* [plugdata](https://plugdata.org/) - a new way to use Pure Data. Includes a full toolchain and targets Daisy, DPF and pd externals. +* [mod-cloud-builder](https://github.com/moddevices/mod-cloud-builder) - An online service for building LV2 plugins for the MOD platform. +* [OWL Patch Library](https://www.rebeltech.org/patch-library) - An online service for building OWL plugins (uses an old fork). + ## Requirements -* python 3.7 or higher +python 3.7 or higher + * `jinja2` (for generator templating) * `importlib_resources` (for reading static resources) * `json2daisy` (for daisy integration) @@ -115,24 +142,6 @@ This can be changed with `--copyright` parameter Displays all the available parameters and options for hvcc. -## Documentation - -* [Introduction](/docs/01.introduction.md) - * [What is heavy?](/docs/01.introduction.md#what-is-heavy) - * [Supported patch formats](/docs/01.introduction.md#supported-patch-formats) - * [Supported platforms](/docs/01.introduction.md#supported-platforms) - * [Supported frameworks](/docs/01.introduction.md#supported-frameworks) - * [Licensing](/docs/01.introduction.md#licensing) -* [Getting Started](/docs/02.getting_started.md) -* [Generators](/docs/03.generators.md) -* [MIDI](/docs/04.midi.md) -* [C API](/docs/05.c.md) -* [C++ API](/docs/06.cpp.md) -* [Heavy Lang Info](/docs/07.heavy_lang.md) -* [Heavy IR Info](/docs/08.heavy_ir_lang.md) -* [Supported vanilla objects](/docs/09.supported_vanilla_objects.md) -* [Unsupported vanilla objects](/docs/10.unsupported_vanilla_objects.md) - ## Contact There are several places where heavy/hvcc conversation is happening: From 9b2c80e52f90b4e308b28b82f03558e691ec0438 Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Fri, 10 Nov 2023 11:36:14 +0100 Subject: [PATCH 13/17] WIP: try basic bang~ implementation (#120) * try basic bang~ implementation * update docs * put at end of process(); send loadbang for first iteration * use normal loadbang object * update changelog --- CHANGELOG.md | 1 + docs/09.supported_vanilla_objects.md | 1 + docs/10.unsupported_vanilla_objects.md | 1 - hvcc/generators/ir2c/templates/Heavy_NAME.cpp | 2 ++ hvcc/interpreters/pd2hv/libs/pd/bang~.pd | 9 +++++++++ 5 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 hvcc/interpreters/pd2hv/libs/pd/bang~.pd diff --git a/CHANGELOG.md b/CHANGELOG.md index 385a7014..0553a376 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ CHANGELOG Next Release ----- +* Objects: `[bang~]` * Documentation fixes/additions * DPF: enum for UI parameter IDs * DPF bugfixes: correct input PortGroup names diff --git a/docs/09.supported_vanilla_objects.md b/docs/09.supported_vanilla_objects.md index e3f09221..6a98bc30 100644 --- a/docs/09.supported_vanilla_objects.md +++ b/docs/09.supported_vanilla_objects.md @@ -124,6 +124,7 @@ wrap /~ abs~ adc~ +bang~ biquad~ bp~ catch~ diff --git a/docs/10.unsupported_vanilla_objects.md b/docs/10.unsupported_vanilla_objects.md index 393b5b39..783c8a68 100644 --- a/docs/10.unsupported_vanilla_objects.md +++ b/docs/10.unsupported_vanilla_objects.md @@ -67,7 +67,6 @@ value ## Signal Objects ```list -bang~ block~ bob~ bonk~ diff --git a/hvcc/generators/ir2c/templates/Heavy_NAME.cpp b/hvcc/generators/ir2c/templates/Heavy_NAME.cpp index c984c5d7..f2a3dd08 100644 --- a/hvcc/generators/ir2c/templates/Heavy_NAME.cpp +++ b/hvcc/generators/ir2c/templates/Heavy_NAME.cpp @@ -246,6 +246,8 @@ int Heavy_{{name}}::process(float **inputBuffers, float **outputBuffers, int n) blockStartTimestamp = nextBlock; return n; {%- endif %} + + sendBangToReceiver(0xDD21C0EB); // send to __hv_bang~ } int Heavy_{{name}}::processInline(float *inputBuffers, float *outputBuffers, int n4) { diff --git a/hvcc/interpreters/pd2hv/libs/pd/bang~.pd b/hvcc/interpreters/pd2hv/libs/pd/bang~.pd new file mode 100644 index 00000000..23fae332 --- /dev/null +++ b/hvcc/interpreters/pd2hv/libs/pd/bang~.pd @@ -0,0 +1,9 @@ +#N canvas 320 37 549 254 12; +#X obj 99 102 r __hv_bang~; +#X obj 99 173 outlet; +#X obj 99 71 inlet; +#X text 151 69 inlet is inactive; +#X text 255 111 because we only receive the first bang at the end of the first process() loop we first send a loadbang; +#X obj 128 132 loadbang; +#X connect 0 0 1 0; +#X connect 5 0 1 0; From 4f810174ae5d04c63c279724936f48cc084c786a Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Mon, 13 Nov 2023 09:10:46 +0100 Subject: [PATCH 14/17] allow setting samplerate and blocksize for Daisy using meta info (#133) * allow setting samplerate and blocksize for Daisy using meta info * add sr/bs to Daisy docs * mention max blocksize; clamp blocksize between 1 and 256 * reword Daisy docs --- CHANGELOG.md | 1 + docs/03.gen.daisy.md | 17 ++++++++++++++++- hvcc/generators/c2daisy/c2daisy.py | 10 +++++++++- .../generators/c2daisy/templates/HeavyDaisy.cpp | 6 ++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0553a376..e2c35db4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Next Release * Objects: `[bang~]` * Documentation fixes/additions +* Daisy: ability to set samplerate and blocksize * DPF: enum for UI parameter IDs * DPF bugfixes: correct input PortGroup names diff --git a/docs/03.gen.daisy.md b/docs/03.gen.daisy.md index 77ce2c90..a93d21d4 100644 --- a/docs/03.gen.daisy.md +++ b/docs/03.gen.daisy.md @@ -4,13 +4,13 @@ Daisy is an embedded platform for music. It features everything you need for cre Currently daisy platform is supported for: -* `field` * `seed` * `pod` * `petal` * `patch` * `patch_init` * `patch_sm` +* `field` Which can be configured using the `-m` metadata.json `daisy.board` setting: @@ -65,3 +65,18 @@ Printing to serial console can be enabled using the `debug_printing` flag in the ``` This will increase the program size with a few kb and will disable `usb_midi` as we currently do not have composite USB device yet. + +## Custom samplerate and blocksize + +This can be done by adding either to the meta.json: + +```json +{ + "daisy": { + "samplerate": 96000, + "blocksize": 128 + } +} +``` + +Do note that the samplerate will be automatically set to either 16k, 32k, 48k, or 96k. Blocksize will need to be 256 or less and is automatically capped. diff --git a/hvcc/generators/c2daisy/c2daisy.py b/hvcc/generators/c2daisy/c2daisy.py index 7cce9b44..e72c7298 100644 --- a/hvcc/generators/c2daisy/c2daisy.py +++ b/hvcc/generators/c2daisy/c2daisy.py @@ -84,9 +84,17 @@ def compile( component_glue['header'] = f"HeavyDaisy_{patch_name}.hpp" component_glue['max_channels'] = board_info['channels'] component_glue['num_output_channels'] = num_output_channels + component_glue['has_midi'] = board_info['has_midi'] component_glue['debug_printing'] = daisy_meta.get('debug_printing', False) component_glue['usb_midi'] = daisy_meta.get('usb_midi', False) - component_glue['has_midi'] = board_info['has_midi'] + component_glue['samplerate'] = daisy_meta.get('samplerate') + + blocksize = daisy_meta.get('blocksize') + + if blocksize: + component_glue['blocksize'] = max(min(256, blocksize), 1) + else: + component_glue['blocksize'] = None component_glue['copyright'] = copyright_c diff --git a/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp b/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp index 1c55ffb1..f153ae27 100644 --- a/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp +++ b/hvcc/generators/c2daisy/templates/HeavyDaisy.cpp @@ -153,6 +153,12 @@ void HandleMidiMessage(MidiEvent m) int main(void) { hardware.Init(true); + {% if samplerate is not none %} + hardware.SetAudioSampleRate({{samplerate}}); + {% endif %} + {% if blocksize is not none %} + hardware.SetAudioBlockSize({{blocksize}}); + {% endif %} {% if has_midi %} MidiUartHandler::Config midi_config; hardware.midi.Init(midi_config); From 669b1f549922990fde0a388b5900ab3be63c9539 Mon Sep 17 00:00:00 2001 From: dreamer <1185977+dromer@users.noreply.github.com> Date: Mon, 13 Nov 2023 09:18:22 +0100 Subject: [PATCH 15/17] Remove/build json (#134) * clean up deprecated build.json * add changelog --- CHANGELOG.md | 1 + hvcc/generators/buildjson/__init__.py | 0 hvcc/generators/buildjson/buildjson.py | 85 -------------------------- hvcc/generators/c2daisy/c2daisy.py | 5 -- hvcc/generators/c2owl/c2owl.py | 26 +------- hvcc/generators/c2unity/c2unity.py | 12 ---- hvcc/generators/c2wwise/c2wwise.py | 25 -------- 7 files changed, 3 insertions(+), 151 deletions(-) delete mode 100644 hvcc/generators/buildjson/__init__.py delete mode 100644 hvcc/generators/buildjson/buildjson.py diff --git a/CHANGELOG.md b/CHANGELOG.md index e2c35db4..76b57e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ Next Release * Daisy: ability to set samplerate and blocksize * DPF: enum for UI parameter IDs * DPF bugfixes: correct input PortGroup names +* Cleanup: remove deprecated build.json 0.9.0 ----- diff --git a/hvcc/generators/buildjson/__init__.py b/hvcc/generators/buildjson/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/hvcc/generators/buildjson/buildjson.py b/hvcc/generators/buildjson/buildjson.py deleted file mode 100644 index 752b4f35..00000000 --- a/hvcc/generators/buildjson/buildjson.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2014-2018 Enzien Audio, Ltd. -# -# This program 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, either version 3 of the License, or -# (at your option) any later version. -# -# This program 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 this program. If not, see . - -from collections import defaultdict -import json -import os -from typing import Dict, List, Optional - -# generate build configuration files for use with https://github.com/enzienaudio/courtesan -# Example arguments: -# macos_x64_args=["-project", "Hv_test_WwiseSourcePlugin.xcodeproj", "-arch", "x86_64", "-alltargets"] -# android_armv7a_args=["APP_ABI=armeabi-v7a", "-j"] -# win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", -# "/t:Rebuild", "Hv_{0}_Unity.sln".format(patch_name), "/m"] - - -def generate_json( - out_dir: str, - android_armv7a_args: Optional[List] = None, - ios_armv7a_args: Optional[List] = None, - linux_armv7a_args: Optional[List] = None, - linux_x64_args: Optional[List] = None, - macos_x64_args: Optional[List] = None, - win_x64_args: Optional[List] = None, - win_x86_args: Optional[List] = None -) -> None: - build_json: Dict = defaultdict(dict) - - if android_armv7a_args: - build_json["android"]["armv7a"] = { - "args": [android_armv7a_args], - "projectDir": ["android", "jni"], - "binaryDir": ["android", "libs", "armeabi-v7a"] - } - if ios_armv7a_args: - build_json["ios"]["armv7a"] = { - "args": [ios_armv7a_args], - "projectDir": ["xcode"], - "binaryDir": ["build", "ios", "armv7s", "Release"] - } - if linux_armv7a_args: - build_json["linux"]["armv7a"] = { - "args": [linux_armv7a_args], - "projectDir": ["linux"], - "binaryDir": ["build", "linux", "armv7a", "release"] - } - if linux_x64_args: - build_json["linux"]["x64"] = { - "args": [linux_x64_args], - "projectDir": ["linux"], - "binaryDir": ["build", "linux", "x64", "release"] - } - if macos_x64_args: - build_json["macos"]["x64"] = { - "args": [macos_x64_args], - "projectDir": ["xcode"], - "binaryDir": ["build", "macos", "x86_64", "Release"] - } - if win_x64_args: - build_json["win"]["x64"] = { - "args": [win_x64_args], - "projectDir": ["vs2015"], - "binaryDir": ["build", "win", "x64", "Release"] - } - if win_x86_args: - build_json["win"]["x86"] = { - "args": [win_x86_args], - "projectDir": ["vs2015"], - "binaryDir": ["build", "win", "x86", "Release"] - } - - with open(os.path.join(out_dir, "build.json"), "w") as f: - json.dump(build_json, f) diff --git a/hvcc/generators/c2daisy/c2daisy.py b/hvcc/generators/c2daisy/c2daisy.py index e72c7298..524708ae 100644 --- a/hvcc/generators/c2daisy/c2daisy.py +++ b/hvcc/generators/c2daisy/c2daisy.py @@ -6,7 +6,6 @@ from typing import Dict, Optional -from ..buildjson import buildjson from ..copyright import copyright_manager from . import parameters @@ -125,10 +124,6 @@ def compile( # ====================================================================================== - buildjson.generate_json( - out_dir, - linux_x64_args=["-j"]) - return { "stage": "c2daisy", "notifs": { diff --git a/hvcc/generators/c2owl/c2owl.py b/hvcc/generators/c2owl/c2owl.py index 5e94f234..898bbab0 100644 --- a/hvcc/generators/c2owl/c2owl.py +++ b/hvcc/generators/c2owl/c2owl.py @@ -5,10 +5,10 @@ import jinja2 import json from typing import Dict, List, Optional -from ..buildjson import buildjson -from ..copyright import copyright_manager import hvcc.core.hv2ir.HeavyLangObject as HeavyLangObject +from ..copyright import copyright_manager + heavy_hash = HeavyLangObject.HeavyLangObject.get_hash @@ -121,29 +121,7 @@ def compile( jdata=jdata, copyright=copyright_c)) - # generate list of Heavy source files - # files = os.listdir(out_dir) - # ====================================================================================== - # Linux - # - # linux_path = os.path.join(out_dir, "linux") - # os.makedirs(linux_path) - - # with open(os.path.join(out_dir, "Makefile"), "w") as f: - # f.write(env.get_template("Makefile").render( - # name=patch_name, - # class_name=f"HeavyOWL_{patch_name}")) - - buildjson.generate_json( - out_dir, - linux_x64_args=["-j"]) - # macos_x64_args=["-project", "{0}.xcodeproj".format(patch_name), "-arch", - # "x86_64", "-alltargets"], - # win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", - # "/t:Rebuild", "{0}.sln".format(patch_name), "/m"], - # win_x86_args=["/property:Configuration=Release", "/property:Platform=x86", - # "/t:Rebuild", "{0}.sln".format(patch_name), "/m"]) return { "stage": "c2owl", diff --git a/hvcc/generators/c2unity/c2unity.py b/hvcc/generators/c2unity/c2unity.py index a4644716..09150b3e 100644 --- a/hvcc/generators/c2unity/c2unity.py +++ b/hvcc/generators/c2unity/c2unity.py @@ -21,7 +21,6 @@ from typing import Dict, Optional from ..copyright import copyright_manager -from ..buildjson import buildjson from ..filters import filter_string_cap, filter_templates, filter_xcode_build, filter_xcode_fileref @@ -100,17 +99,6 @@ def compile( compile_files=os.listdir(src_out_dir), copyright=copyright)) - buildjson.generate_json( - out_dir, - android_armv7a_args=["APP_ABI=armeabi-v7a", "-j"], - linux_x64_args=["-j"], - macos_x64_args=["-project", f"Hv_{patch_name}_Unity.xcodeproj", - "-arch", "x86_64", "-alltargets"], - win_x64_args=["/property:Configuration=Release", "/property:Platform=x64", - "/t:Rebuild", f"Hv_{patch_name}_Unity.sln", "/m"], - win_x86_args=["/property:Configuration=Release", "/property:Platform=x86", - "/t:Rebuild", f"Hv_{patch_name}_Unity.sln", "/m"]) - return { "stage": "c2unity", "notifs": { diff --git a/hvcc/generators/c2wwise/c2wwise.py b/hvcc/generators/c2wwise/c2wwise.py index 28f7bd85..e3db4932 100644 --- a/hvcc/generators/c2wwise/c2wwise.py +++ b/hvcc/generators/c2wwise/c2wwise.py @@ -20,7 +20,6 @@ import jinja2 from typing import Dict, Optional -from ..buildjson import buildjson from ..copyright import copyright_manager from ..filters import filter_plugin_id, filter_xcode_build, filter_xcode_fileref @@ -180,30 +179,6 @@ def compile( files=files, wwise_version=wwise_sdk_version)) - proj_name = f"Hv_{patch_name}_Wwise{plugin_type}Plugin" - - buildjson.generate_json( - out_dir, - ios_armv7a_args=[ - "-arch", "armv7s", - "-target", f"{proj_name}_iOS", - "-project", f"{proj_name}.xcodeproj"], - linux_x64_args=["-j"], - macos_x64_args=[ - "-arch", "x86_64", - "-target", f"{proj_name}", - "-project", f"{proj_name}.xcodeproj"], - win_x64_args=[ - "/property:Configuration=Release", - "/property:Platform=x64", - "/t:Rebuild", "/m", - f"{proj_name}.sln"], - win_x86_args=[ - "/property:Configuration=Release", - "/property:Platform=x86", - "/t:Rebuild", "/m", - f"{proj_name}.sln"]) - return { "stage": "c2wwise", "notifs": { From 54ac3c37c5aef1d75f363466a6664be7087e6534 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 13 Nov 2023 09:32:20 +0100 Subject: [PATCH 16/17] flake8 --- hvcc/generators/c2owl/c2owl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hvcc/generators/c2owl/c2owl.py b/hvcc/generators/c2owl/c2owl.py index 898bbab0..908938bb 100644 --- a/hvcc/generators/c2owl/c2owl.py +++ b/hvcc/generators/c2owl/c2owl.py @@ -10,7 +10,6 @@ from ..copyright import copyright_manager - heavy_hash = HeavyLangObject.HeavyLangObject.get_hash OWL_BUTTONS = ['Push', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8'] From daa5c94252c32a855e5c1244c932631f2d0b1727 Mon Sep 17 00:00:00 2001 From: dreamer Date: Mon, 13 Nov 2023 09:35:37 +0100 Subject: [PATCH 17/17] docs --- docs/01.introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/01.introduction.md b/docs/01.introduction.md index 03736d94..f15e3491 100644 --- a/docs/01.introduction.md +++ b/docs/01.introduction.md @@ -25,7 +25,7 @@ Heavy can interpret and convert a subset of features from Pure Data patches: ## Supported Platforms -* Windows 8, 10 and WSA +* Windows 10, 11 and WSA * Mac OSX * Linux * PS4