Skip to content

Commit

Permalink
Merge branch 'v0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dromer committed Oct 11, 2022
2 parents ff48586 + 889142a commit e58bd87
Show file tree
Hide file tree
Showing 83 changed files with 1,238 additions and 2,024 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.5.0
current_version = 0.6.0

[bumpversion:file:setup.cfg]

Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: HVCC

on:
push:
pull_request:
branches: [ develop ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10-dev]

steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Initialize lfs
run: git lfs pull
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tox
run: tox

dispatch:
needs: build
strategy:
matrix:
repo: ['Wasted-Audio/hvcc-examples-dpf']
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.HVCC_REPOSITORY_DISPATCH_TOKEN }}
repository: ${{ matrix.repo }}
event-type: nightly
client-payload: '{"nightly": true, "branch": "develop"}'
if: ${{ github.ref == 'refs/heads/develop' }}
29 changes: 0 additions & 29 deletions .github/workflows/python.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
CHANGELOG
=====

0.6.0
-----

* aligned memory and freed patch instance
* js: WASM AudioWorklet
* js: deprecate asm.js
* dpf: configurable subpath
* midi: add stripnote
* deprecate max2hv
* documentation updates
* code cleanup
* tests: refactor and deprecate test_uploader

0.5.0
-----

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ A list of available generator options can be found [here](/docs/03.generators.md

### `-p` Search Paths

`hvcc` will iterate through various directories when resolving patch objects and abstractions. The `-p` or `--search_paths` argument can be used to add additional folders for `hvcc` to look in.
`hvcc` will iterate through various directories when resolving patch objects and abstractions. The `-p` or `--search_paths` argument can be used to add additional folders for `hvcc` to look in. Note that this argument is not needed for abstractions in the same folder as the top-level patch.

This can be handy when using a third-party patch library for example https://github.com/Wasted-Audio/heavylib.

Expand Down Expand Up @@ -134,5 +134,6 @@ There are several places where heavy/hvcc conversation is happening:
* [Bela](https://forum.bela.io/?q=hvcc)
* [Rebel Technology](https://community.rebeltech.org/tags/puredata)
* [Daisy](https://forum.electro-smith.com/t/pure-data/110)
* [MOD](https://forum.moddevices.com/c/developers/pure-data/56)

Or you can use the [discussions](https://github.com/Wasted-Audio/hvcc/discussions) tab of this repository
2 changes: 2 additions & 0 deletions docs/03.gen.dpf.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Heavy can generate LV2 and VST2 plugins from your patch using the [Distrho Plugin Framework](https://github.com/DISTRHO/DPF). It can be either a synth (output-only) or an effect (input and output), supports an arbitrary number of parameters, and can process midi events.

Some [examples](https://github.com/Wasted-Audio/hvcc-examples-dpf) are built for the major operating systems (Linux/Windows/MacOS) in various formats (LV2/VST2/VST3).

## Defining Parameters
Each [exposed parameter](02.getting_started.md#exposing-parameters) will automatically generate a slider in the plugin interface.

Expand Down
96 changes: 52 additions & 44 deletions docs/03.gen.javascript.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,27 @@
# Javascript

## Getting Started
Heavy can provide a Javascript (JS) implementation of your patch. The library can be served directly from our servers or downloaded locally and provides a basic interface for processing audio, handling playback and sending or receiving messages.
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.

## Web Preview

The quickest way to try out your patch in the web is to use the pre-generated widget. This is automatically generated each time the patch is compiled, see the patch target pages for a example of it running.

```html
<iframe type="text/html" frameborder="0"
width="100%" height="592"
src="https://enzienaudio.com/h/{USERNAME}/{PATCH}/{VERSION}/web/{PATCH}.html">
</iframe>
```

When specifying the `{VERSION}` you can either provide a number indicating the version of the patch, or use '`latest`' to get the most recent revision.

For example:
```html
<iframe type="text/html" frameborder="0"
width="100%" height="592"
src="https://enzienaudio.com/h/enzien/springy/latest/web/springy.html">
</iframe>
```
The quickest way to try out your patch in the web is to use the pre-generated widget.

Alternatively if you want to use a custom HTML interface it is possible to link against just the javascript library, see below for more instructions on how to do that.

```html
<script type="application/javascript" src="https://enzienaudio.com/h/{USERNAME}/{PATCH}/{VERSION}/web/{PATCH}.js"></script>
```
Some [examples](https://github.com/Wasted-Audio/hvcc-examples-js) are hosted on [github pages](https://wasted-audio.github.io/hvcc-examples-js).

Feel free to use our servers for hosting the JS library, or choose to download it for linking locally...
## The JS Target

## Download the JS Target

For a more detailed example of running your patch in the web it can be more informative to download the JS target.
For a more detailed example of running your patch in the web it can be more informative to inspect the JS target.

Heavy provides the following:

| File | Description |
| --- | --- |
| index.html | A simple web page similar to the pre-generated widget |
| `{PATCH}`.js | The main javascript library to link against |
| `{PATCH}`.wasm | A [web assembly](http://webassembly.org) compiled binary of the patch. The main js library will reference this |
| `{PATCH}`.asm.js | An [asmjs](http://asmjs.org) fallback library for non wasm compatible browsers |
| `{PATCH}`.js | The main javascript library to link against, contains the basic [web assembly](http://webassembly.org) compiled binary of the patch. |
| `{PATCH}`_AudioLibWorklet.js | AudioWorklet implementation of the patch, used when AudioWorklet interface is available and provides low latency audio on a separate thread. |

## AudioLibLoader

Expand All @@ -56,29 +34,45 @@ This object simplifies the set-up required and should be sufficient for most use
The initial set up should look something like this:

```html
<script type="application/javascript" src="https://enzienaudio.com/h/{USERNAME}/{PATCH}/latest/web/{PATCH}.js"></script>

<script type="text/javascript">
// the AudioLibLoader object
var heavyModule = null;
var loader = null;
// construct a new patch module, this contains all the necessary libraries
// make sure to replace {PATCH} with the name of your patch
var heavyModule = {PATCH}_Module();
// set a callback to be notified when the module has finished loading
heavyModule['onRuntimeInitialized'] = onModuleLoaded;
window.onload = function() {
{PANRT}_Module().then(loadedModule => {
heavyModule = loadedModule;
moduleLoaded();
});
document.getElementById("transportButton").style.visibility = "hidden";
}
function onModuleLoaded() {
// instantiate the AudioLibLoader object
// instantiate the AudioLibLoader object
function moduleLoaded() {
loader = new heavyModule.AudioLibLoader();
document.getElementById("transportButton").style.visibility = "visible";
}
// this will set up the WebAudio context add a new audio node
loader.init({
blockSize: 2048, // number of samples on each audio processing block
printHook: onPrint, // callback for [print] messages, can be null
sendHook: onFloatMessage // callback for output parameters [s {name} @hv_param], can be null
});
// starting the processor
function start() {
if(!loader.webAudioContext) {
// this will set up the WebAudio context add a new audio node
loader.init({
blockSize: 2048, // number of samples on each audio processing block
printHook: onPrint, // callback for [print] messages, can be null
sendHook: onFloatMessage // callback for output parameters [s {name} @hv_param], can be null
});
}
loader.start();
}
// stopping the processor
function stop() {
loader.stop();
}
// print callback
Expand Down Expand Up @@ -110,6 +104,12 @@ The initial set up should look something like this:
// can use this to check if the patch is currently processing
loader.isPlaying
// which can be used to toggle the processor
function toggleTransport(element) {
(loader.isPlaying) ? stop() : start();
}
</script>
```

Expand All @@ -122,10 +122,18 @@ The JS target supports [exposing event and parameter](#02.getting_started#exposi
// ...
// send a bang to an event receiver called "Attack"
loader.audiolib.sendEvent("Attack");
// for AudioWorklet:
loader.sendEvent("Attack");
// for ScriptProcessorNode:
loader.audiolib.sendEvent("Attack");
// send a float value to a parameter receiver called "Distance"
loader.audiolib.setFloatParameter("Distance", 10);
// for AudioWorklet:
loader.sendFloatParameterToWorklet("Distance", 10);
// for ScriptProcessorNode:
loader.audiolib.setFloatParameter("Distance", 10);
</script>
```
Expand Down
2 changes: 2 additions & 0 deletions docs/09.supported_vanilla_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ metro
min
midiin
midiout
midirealtimein
mod
moses
mtof
Expand Down Expand Up @@ -89,6 +90,7 @@ send
sin
spigot
sqrt
stripnote
swap
symbol
symbolatom
Expand Down
2 changes: 0 additions & 2 deletions docs/10.unsupported_vanilla_objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ keyname
keyup
list
makefilename
midirealtimein
namecanvas
netreceive
netsend
Expand All @@ -51,7 +50,6 @@ set
setsize
soundfiler
stdout
stripenote
struct
switch
sysexin
Expand Down
Loading

0 comments on commit e58bd87

Please sign in to comment.