Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/signal_simd
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Feb 10, 2024
2 parents dfb21d6 + 99343d6 commit f0beb00
Show file tree
Hide file tree
Showing 39 changed files with 356 additions and 375 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.0
current_version = 0.10.0

[bumpversion:file:setup.cfg]

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "tests/src/midifile"]
path = tests/src/midifile
url = https://github.com/craigsapp/midifile.git
[submodule "tests/src/tinywav"]
path = tests/src/tinywav
url = https://github.com/mhroth/tinywav.git
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ CHANGELOG
Next Release
-----

* Core: add attributes and send type to send params
* DPF: add "read only" outputParameter type based on send params
* JS Bugfix: printHook and sendHook for AudioWorklet; mention emsdk limitations in docs
* Bugfix: stripnote missing right inlet

0.10.0
-----

* Objects: `[bang~]`
* Object improvements: support `[clear(` message for `[delwrite~]`
* Documentation fixes/additions
* Daisy: ability to set samplerate and blocksize
* Daisy: adding midirealtimein, polytouchin/out, midiin (midiout WIP)
* Daisy: use `libdaisy_path` in meta config; both string/path and int/depth possible
* DPF: enum for UI parameter IDs
* DPF bugfixes: correct input PortGroup names; correct UI slider updates; midiout reimplementation
* Wwise: complete rewrite/refactor - now uses SDK build tools - thanks to @eu-ch !!
Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,25 @@ It has since then been expanded to provide further support for many different pl

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).
* [plugdata](https://plugdata.org/) - Modern interface for Pure Data. Includes a full cross-platform toolchain and targets Daisy, DPF and PD Externals.
* [mod-cloud-builder](https://github.com/moddevices/mod-cloud-builder) - Online service for building LV2 plugins for the MOD platform.
* [OWL Patch Library](https://www.rebeltech.org/patch-library) - Online service for building OWL plugins (uses an old fork).

## Requirements

python 3.8 until 3.12
Python 3.8 up to 3.12

* `jinja2` (for generator templating)
* `importlib_resources` (for reading static resources)
* `json2daisy` (for daisy integration)
* `tox` (for tests, optional)
* `numpy/scipy` (for tests, optional)
* `midifile` (for tests, optional)
* `clang/clang++` (for building tests, optional)
* `jinja2` (for generator templating)
* `importlib_resources` (for reading static resources)
* `json2daisy` (for daisy integration)

For tests:

* `tox` (python install)
* `numpy/scipy` (requirements-dev)
* `midifile` (git submodule)
* `tinywav` (git submodule)
* `clang/clang++` (system install)

## Installation

Expand Down
4 changes: 3 additions & 1 deletion docs/02.getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ To send audio output add a `[dac~]` The number of channels can be configured by

Note that top-level graphs (e.g. `_main.pd`) should not have any `[inlet~]` or `[outlet~]` objects. These are reserved only for abstractions.

> NOTE: Currently if your main patch does not have at least an `adc~` or `dac~` configured signal rate objects will not be evaluated in the graph!
## Exposing Parameters

### Input Parameters
Expand Down Expand Up @@ -40,7 +42,7 @@ See the specific framework details for more information on output parameter supp

## Exposing Events

All (control) `[receive]` and `[r]` objects annotated with `@hv_event` will be exposed as events in the Unity target only.
All (control) `[receive]` and `[r]` objects annotated with `@hv_event` will be exposed as events in the Unity and Javascript targets only.

![events](img/docs_exposed_events.png)

Expand Down
20 changes: 20 additions & 0 deletions docs/03.gen.daisy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ The custom layout can be passed on via the meta.json as such:
}
```

You can also set a custom path to your libDaisy directory. This can either be a string to the full or relative path or a number indicating the levels deep this directory is compared to the output directory. The default value for this is `2`.

```json
{
"daisy": {
"libdaisy_path": "/somewhere/libdaisy/"
}
}
```

Or the level:

```json
{
"daisy": {
"libdaisy_path": 5
}
}
```

## MIDI

Board files that have `OOPSY_TARGET_HAS_MIDI_INPUT` configured will automatically set up UART MIDI on the default USART1 Rx and Tx pins of the Daisy (D13/14).
Expand Down
4 changes: 4 additions & 0 deletions docs/03.gen.javascript.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Javascript

> Emscripten versions 3.1.42 until 3.1.47 contain a bug that breaks our builds.
>
> Use a version earlier or later with this Generator for functional output.
## Getting Started

Heavy can provide a Javascript (JS) implementation of your patch using WebAssembly. The library provides a basic interface for processing audio, handling playback and sending or receiving messages. Both `AudioWorklet` and `ScriptProcessorNode` are supported. The old `asm.js` implementation has been deprecated.
Expand Down
14 changes: 7 additions & 7 deletions docs/03.gen.wwise.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ cd Hvcc_Out_Dir\wwise
Generate Visual Studio project files; note, WWISEROOT environment variable can be set from Wwise Launcher by clicking on *Set Environment Variables* button in front of an installed Wwise entry:

```cmd
python %WWISEROOT%\Scripts\Build\Plugins\wp.py premake Authoring
python %WWISEROOT%\Scripts\Build\Plugins\wp.py premake Windows_vc160
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" premake Authoring
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" premake Windows_vc160
```

Build Authoring and Engine plugins in Release configurations; for Visual Studio 2022 replace vc160 with vc170:

```cmd
python %WWISEROOT%\Scripts\Build\Plugins\wp.py build -c Release -x x64 -t vc160 Authoring
python %WWISEROOT%\Scripts\Build\Plugins\wp.py build -c Release -x x64 -t vc160 Windows_vc160
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" build -c Release -x x64 -t vc160 Authoring
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" build -c Release -x x64 -t vc160 Windows_vc160
```

At this point, the plugins should be placed in correct SDK directories and be ready for use in the Authoring app.
Expand All @@ -119,9 +119,9 @@ At this point, the plugins should be placed in correct SDK directories and be re
We can go a step further and package the plugins into a bundle that can be installed conveniently from Wwise Launcher.

```cmd
python %WWISEROOT%\Scripts\Build\Plugins\wp.py package --version 2022.1.0.1 Authoring
python %WWISEROOT%\Scripts\Build\Plugins\wp.py package --version 2022.1.0.1 Windows_vc160
python %WWISEROOT%\Scripts\Build\Plugins\wp.py generate-bundle --version 2022.1.0.1
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" package --version 2022.1.0.1 Authoring
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" package --version 2022.1.0.1 Windows_vc160
python "%WWISEROOT%\Scripts\Build\Plugins\wp.py" generate-bundle --version 2022.1.0.1
mkdir Bundle
copy /y bundle.json Bundle
copy /y *.tar.xz Bundle
Expand Down
2 changes: 2 additions & 0 deletions hvcc/core/hv2ir/HIrSend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ def get_ir_control_list(self) -> List:
on_message_list = [x for o in receive_objs for x in o.get_ir_on_message(inlet_index=0)]
return [{
"id": self.id,
"type": "send",
"onMessage": [on_message_list],
"extern": self.args["extern"],
"attributes": self.args["attributes"],
"hash": self.args["hash"],
"display": self.args["name"],
"name": ((f"_{self.args['name']}") if re.match(r"\d", self.args["name"]) else self.args["name"])
Expand Down
26 changes: 22 additions & 4 deletions hvcc/generators/c2daisy/c2daisy.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,22 @@ def compile(
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['samplerate'] = daisy_meta.get('samplerate')

blocksize = daisy_meta.get('blocksize')
# samplerate
samplerate = daisy_meta.get('samplerate', 48000)
if samplerate >= 96000:
component_glue['samplerate'] = 96000
elif samplerate >= 48000:
component_glue['samplerate'] = 48000
elif samplerate >= 32000:
component_glue['samplerate'] = 32000
elif samplerate >= 16000:
component_glue['samplerate'] = 16000
else:
component_glue['samplerate'] = 8000

# blocksize
blocksize = daisy_meta.get('blocksize')
if blocksize:
component_glue['blocksize'] = max(min(256, blocksize), 1)
else:
Expand All @@ -115,8 +127,14 @@ def compile(
makefile_replacements['linker_script'] = daisy_meta.get('linker_script', '')
if makefile_replacements['linker_script'] != '':
makefile_replacements['linker_script'] = daisy_meta["linker_script"]
depth = daisy_meta.get('libdaisy_depth', 2)
makefile_replacements['libdaisy_path'] = f'{"../" * depth}libdaisy'

# libdaisy path
path = daisy_meta.get('libdaisy_path', 2)
if isinstance(path, int):
makefile_replacements['libdaisy_path'] = f'{"../" * path}libdaisy'
elif isinstance(path, str):
makefile_replacements['libdaisy_path'] = path

makefile_replacements['bootloader'] = daisy_meta.get('bootloader', '')
makefile_replacements['debug_printing'] = daisy_meta.get('debug_printing', False)

Expand Down
2 changes: 1 addition & 1 deletion hvcc/generators/c2daisy/templates/HeavyDaisy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "Heavy_{{patch_name}}.hpp"
#include "HeavyDaisy_{{patch_name}}.hpp"

#define SAMPLE_RATE 48000.f
#define SAMPLE_RATE {{samplerate}}.f

{% if has_midi or usb_midi %}
#define HV_HASH_NOTEIN 0x67E37CA3
Expand Down
7 changes: 4 additions & 3 deletions hvcc/generators/c2dpf/c2dpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def compile(

out_dir = os.path.join(out_dir, "plugin")
receiver_list = externs['parameters']['in']
sender_list = externs["parameters"]["out"]

if patch_meta:
patch_name = patch_meta.get("name", patch_name)
Expand Down Expand Up @@ -87,6 +88,7 @@ def compile(
num_input_channels=num_input_channels,
num_output_channels=num_output_channels,
receivers=receiver_list,
senders=sender_list,
copyright=copyright_c))
dpf_cpp_path = os.path.join(source_dir, f"HeavyDPF_{patch_name}.cpp")
with open(dpf_cpp_path, "w") as f:
Expand All @@ -97,6 +99,7 @@ def compile(
num_input_channels=num_input_channels,
num_output_channels=num_output_channels,
receivers=receiver_list,
senders=sender_list,
pool_sizes_kb=externs["memoryPoolSizesKb"],
copyright=copyright_c))
if dpf_meta.get("enable_ui"):
Expand All @@ -106,9 +109,8 @@ def compile(
name=patch_name,
meta=dpf_meta,
class_name=f"HeavyDPF_{patch_name}",
num_input_channels=num_input_channels,
num_output_channels=num_output_channels,
receivers=receiver_list,
senders=sender_list,
copyright=copyright_c))
dpf_h_path = os.path.join(source_dir, "DistrhoPluginInfo.h")
with open(dpf_h_path, "w") as f:
Expand All @@ -118,7 +120,6 @@ def compile(
class_name=f"HeavyDPF_{patch_name}",
num_input_channels=num_input_channels,
num_output_channels=num_output_channels,
receivers=receiver_list,
pool_sizes_kb=externs["memoryPoolSizesKb"],
copyright=copyright_c))

Expand Down
Loading

0 comments on commit f0beb00

Please sign in to comment.