TypeError when building Pure Data patch for Lich

I’m trying to build a Pure data patch locally using Heavy, but I’m having some problems with the
The target platform is Lich, but I’m unsure if that’s relevant.

The build succeeds for basic patches with a few objects and I can run them on the Lich. The problem occurs when I include any receive-objects for the potentiometer or gate inputs.

A simple patch that fails is:
image
The error I get is

root@4cbe9c067f0e:/OwlProgram# make clean
root@4cbe9c067f0e:/OwlProgram# make HEAVY=simple patch
Traceback (most recent call last):
  File "./Tools/build_send_receive_constants.py", line 101, in <module>
    main()
  File "./Tools/build_send_receive_constants.py", line 91, in main
    outputText = template.render(jdata=jdata)  # this is where to put args to the template renderer
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/OwlProgram/Tools/Heavy_owl_constants.tpl.h", line 2, in top-level template code
    // {{param}} {{name}} {{typ}} {{namehash}} {{minvalue}} {{maxvalue}} {{defvalue}} {{(defvalue-minvalue)/(maxvalue-minvalue)}}
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
heavy.mk:17: recipe for target 'Build/Source/Heavy_owl.h' failed
make[1]: *** [Build/Source/Heavy_owl.h] Error 1
Makefile:128: recipe for target 'heavy' failed
make: *** [heavy] Error 2

If I remove the [r Pot_A @owl A] object the build succeeds.

Could this be a problem with my build environment? I’m running it in a Docker container built with the file

FROM ubuntu:18.04
RUN apt-get update \
 && apt-get install -y \
     python \
     python-pip \
     python-enum34 \
     python-jinja2 \
     python-nose2 \
     build-essential \
     git \
     curl \
     pkg-config \
     make \
     cmake \
     gcc-arm-none-eabi \
 && rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/pingdynasty/hvcc.git && cd hvcc/ && pip install -r requirements.txt && cd ..
RUN git clone --recurse-submodules https://github.com/RebelTechnology/OwlProgram.git \
 && cd OwlProgram \
 && git checkout release/v21.1

based on https://github.com/yrn1/owlbuilder but with the Heavy compiler installed instead of the Faust dependencies.

I would appreciate any suggestions for how to troubleshoot!

You will need to add min/max/default values to the receiver:

[r Pot_A @owl A 0 1 0.5]

I also recommend using a [line~] object here:

2025-01-03_18-06

That solved it! Thank you!

Do these min/max/default values have to be explicitly defined because I’m using the local build environment? I’m asking, because previously I was using the patch server, and it seemed to implicitly use the values min = 0.0, max = 1.0, and default = 0.5.

This is not specific for the local build env, no.

You can also use the “traditional” [r A @hv_param] definition where you can omit the min/max/default (which is then set to 0/1/0.5).

But then you will have to use the correct receiver name for the internal OWL parameter, instead of the “friendly name”.

[edit: actually, looking at the code the defaults should already be 0.0/1.0/0.5 → https://github.com/pingdynasty/hvcc/blob/548f94c57617a51a2f4cd6bd1643f7291d61dc40/interpreters/pd2hv/pdowl.py#L26-L29
So I’m not sure why it’s not working for you.]

Maybe try to checkout develop branch instead of default for hvcc repo, it seems to have some changes related to this that weren’t committed to master.

Okay, I will check how it works with the development branch.

I see that in the fix it sets the default to 0.0 if it’s not set.

Not sure this is the prettiest fix: don't set default @owl parameter values unless one is specified in th… · enzienaudio/hvcc@548f94c · GitHub