Skip to content

MetaModule

Heavy can automatically convert your patches for the 4ms MetaModule.

Since you can only provide a single input patch to HVCC it is currently limited to create only a single module as part of the generated plugin.

The generator can be activated using -g meta.

Inputs and Outputs

Exposed receive objects will automatically become a parameter for the module. You can also set a range.

It is currently not possible to set a specific type, so all parameters are floats.

Send objects will become LEDs on the panel. These can also have a range, but will be normalized so they are always 0-1 for their brightness.

All audio inputs and outputs will become jack sockets. Values are normalized from -10:10 to -1:1 and back to match typical PD audio operations with the MetaModule CV standard. You will need to do additional scaling in your patch if you want to use the raw CV values internally (e.g. for Pitch calculations).

Jack Detection

Using the receivers [r __mm_in_patched] and [r __mm_out_patched] you can get a tuple of input/output jack number and patched status (0 or 1).

Metadata

In order to set custom information you should supply a metadata.json using -m. We will use the meta subsection:

{
    "name": "testplugin",
    "meta": {
        "sdk_path": null,
        "slug": "plugin-slug",
        "name": "Plugin Name",
        "version": "1.0.0",
        "license": "GPL-3.0-only",
        "brand": "Heavy",
        "author": "Heavy User",
        "email": "user@brand.tld",
        "url": "https://brand.tld",
        "description": "Description of the plugin",
        "modules": [
            {
                "slug": "module-slug",
                "name": "Module Name",
                "description": "Description of the module",
                "tags": ["VCO"],
                "assets": null
            }
        ]
    }
}

You can optionally set the sdk_path to an absolute or relative path where you have your metamodule-plugin-sdk folder. By default this is expected one level above the root of the output folder. Make sure that it has a trailing slash /.

You can also optionally supply a dictionary of assets that make the panel, controls and sockets of your module. If you don't add the assets section a panel will be generated automatically. Make sure that your description here is exact and complete. You have to use the same names for all receivers and senders and use the correct amount of input and output IDs. Audio i/o IDs for the panel assets starts counting from 1 just like in PD.

    {
        "panel": {
            "image": "<path/to>/panel_image.png",
            "color": "#ff0000"
        },
        "knobs": [
            {
                "param": "<receiver_name>",
                "image": "<path/to>/knob_image.png",
                "x": 20,
                "y": 20
            }
        ],
        "inputs": [
            {
                "id": 1,
                "name": "input 1",
                "image": "<path/to>/socket_image.png",
                "x": 18,
                "y": 60
            }
        ],
        "outputs": [
            {
                "id": 1,
                "name": "output 1",
                "image": "<path/to>/socket_image.png",
                "x": 18,
                "y": 100
            }
        ],
        "leds": [
            {
                "led": "<sender_name>",
                "image": "<path/to>/led_image.png",
                "x": 25,
                "y": 40
            }
        ]
    }

Object positions are in pixel position relative to the top-left of the panel and top-left of the object image. The panel image height must always be 240px.

When only the optional panel.color is set, using either hexadecimal or an RGB tuple values, this will set the color of the generated panel.

An additional metaplugin/screenshot.png will be generated based on the panel, assets and their positions.

Building

In order to build the generated MetaModule project you need:

  • metamodule-plugin-sdk - either on the same level as the output directory or set using sdk_path
  • cmake version 3.22 or newer
  • arm-none-eabi-gcc version 15 in $PATH

After generating the project go to the output directory and build the plugin:

cd <output_dir>
cmake -B build
cmake --build build

This should result in a successful build:

copy from `<plugin_name>-debug.so' [elf32-littlearm] to `<output_dir>/build/metaplugin/<plugin_name>.so' [elf32-littlearm]
   text    data     bss     dec     hex filename
  48336    1776    2164   52276    cc34 <output_dir>/build/metaplugin/<plugin_name>.so
Checking if symbols in <output_dir>/build/metaplugin/<plugin_name>.so would be resolved
All symbols found!
------------------
Creating plugin at <output_dir>/metamodule-plugins/<plugin_name>.mmplugin
[ 90%] Built target plugin
[ 93%] Generating <plugin_name>-debug.so.readelf
[ 96%] Generating <plugin_name>-debug.so.nm
[100%] Built target debugelf

The resulting <output_dir>/metamodule-plugins/<plugin_name>.mmplugin binary can be copied to an sd-card and loaded onto the MetaModule device.