You need the board to be connected to the internet.

Start off installing the python package manager:

apt-get install -y python-pip python-setuptools

then, (almost) straight off the hvcc readme:

git clone https://github.com/giuliomoro/hvcc.git
cd hvcc/
pip install -r requirements.txt

Done.

Usage:

python2.7 ~/hvcc/hvcc.py /path/to/source/project/_main.pd -o /tmp/hvtmp -n bela -g c
mkdir -p ~/Bela/projects/HeavyProjectName
rsync -av ~/Bela/scripts/hvresources/render.cpp /tmp/hvtmp/c/* ~/Bela/projects/HeavyProjectName/
make -C ~/Bela PROJECT=HeavyProjectName COMPILER=gcc run

just replace /path/to/source/project/ with the path to the source project, e.g.: ~/Bela/examples/08-PureData/rubberDuckie/ and HeavyProjectName with the name of the project you want to create containing the heavy stuff.

With this approach, you have two different folders: /path/to/source/project that contains the _main.pd file and
~/Bela/projects/HeavyProjectName that contains the generated C++ code. You could for instance access the first from the IDE (to drag and drop Pd patches) and the second one through the terminal ( in fact the last command above runs it in the terminal).

At some point we are going to implement a toggle switch in the IDE to build a project as either libpd or Heavy, but that will have to wait a bit.

EDIT: on 26/12/2018 I edited this post to clone from github.com/giuliomoro/hvcc instead of github.com/enzienaudio/hvcc

    12 days later

    so, i installed per instructions, and everything seems to have compiled fine.

    now, my actual problem: i have a custom render.cpp file that i had to put into a heavy folder (for use with the online service). what is the procedure now? i uploaded my pd-patches _main.pd and two sub patches into a directory i created in the IDE via "New project". I can't seem to upload directories though (the heavy directory that contains the render.cpp) can i just put it into the same directory as the pd-patches?

    sorry if this is all obvious...

    in this line

    rsync -av ~/Bela/scripts/hvresources/render.cpp /tmp/hvtmp/c/* ~/Bela/projects/HeavyProjectName/

    you can replace the first path ~/Bela/scripts/hvresources/render.cpp with the path to your custom render.cpp file.

    In the implementation with the script, your custom render.cpp file was never leaving your computer: only the pd patches were sent to the server, and then we would copy the retrieved files to your board and add in any file in the heavy/ subfolder in the project.

      hey thanks giuliomoro this works perfectly! i actually and honestly like this solution far better then the online service, since i often work on this stuff abroad in the train or in a bus while driving to a gig. thanks heaps!!

      Great. There is something else that needs to be said: if you want to make the process even faster, you can run hvcc on your own computer.

      Preparation:

      • Search online for instructions to install python2.7 and pip (on Mac, python is already installed*)
      • install hvcc, same as above:
        git clone https://github.com/giuliomoro/hvcc.git
        cd hvcc/
        pip install -r requirements.txt

      Usage (almost same as above):

      python2.7 ~/hvcc/hvcc.py /path/to/source/project/_main.pd -o /tmp/hvtmp -n bela -g c
      ssh root@192.168.7.2 mkdir -p Bela/projects/HeavyProjectName
      rsync -av /path/to/Bela/scripts/hvresources/render.cpp /tmp/hvtmp/c/* root@192.168.7.2:Bela/projects/HeavyProjectName/
      ssh root@192.168.7.2 make -C Bela PROJECT=HeavyProjectName COMPILER=gcc run

      make sure you bring up a page with the IDE at least once after every reboot of the board before you run the above, so that the date is set appropriately on the board and you avoid problems during the build.

      * On my Mac, I have two versions of python 2.7, not sure how that happened, but pip installs packages for the one I invoke by calling python, and not for the one I obtain calling python2.7.

      EDIT: on 26/12/2018 I edited this post to clone from github.com/giuliomoro/hvcc instead of github.com/enzienaudio/hvcc

        thanks for the further instructions. will try them as well at some point. right now i am happy with the onboard solution, the speed is decent.

        2 months later

        Does someone have the table of all the supported pd objects from the Enzienaudio website?
        The link given on the Github site doesn't work of course anymore because the Enzienaudio homepage is down.

        And of course didn't cross my mind to do it myself when they were ending the support of the Heavy..

        20 days later

        Hi,

        I am having some difficulties using the hvcc on my laptop. I haven't tried yet it on the board.

        When I did the last ssh make -C command I got this error:

        ''' Linking...
        ./build/core/default_main.o: In function main':
        core/default_main.cpp:(.text+0x2ec): undefined reference to
        setup'
        core/default_main.cpp🙁.text+0x2f0): undefined reference to render'
        core/default_main.cpp:(.text+0x2f4): undefined reference to
        cleanup'
        collect2: error: ld returned 1 exit status
        Makefile:479: recipe for target '/root/Bela/projects/HeavyProjectName/HeavyProjectName' failed
        make: *** [/root/Bela/projects/HeavyProjectName/HeavyProjectName] Error 1
        make: Leaving directory '/root/Bela' '''

        also I am getting this kind of message in IDE:

        ''' In file arm_acle.h: expected identifier or '(' column: 1, line: 142In file arm_acle.h: expected ')' column: 1, line: 142In file included from /root/Bela/projects/kokeilu/HvLightPipe.c:24:/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/arm_acle.h:142:1: error: expected identifier or '('clz(uint32_t t) {/usr/xenomai/include/boilerplate/compiler.h:87:3: note: expanded from macro 'clz' ({ \ In file included from /root/Bela/projects/kokeilu/HvLightPipe.c:24:/usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/arm_acle.h:142:1: error: expected ')'/usr/xenomai/include/boilerplate/compiler.h:87:3: note: expanded from macro 'clz' ({ \ /usr/lib/llvm-3.9/bin/../lib/clang/3.9.1/include/arm_acle.h:142:1: note: to match this '('/usr/xenomai/include/boilerplate/compiler.h:87:2: note: expanded from macro '__clz' ({ \ 2 errors generated.make: *** [/root/Bela/projects/kokeilu/build/HvLightPipe.o] Error 1 '''

        This happens also with pd patches that have been previously compiled with Heavy compiler and have worked quite ok. I'd be really happy with any tips! Thanks!

        ps. sorry it looks my message looks really messy..

        The first error is due to the fact that you didn't add the file Bela/scripts/hvresources/render.cpp (or a customized version if it) to the project. What commands did you use?

        The second error, about arm_acle.h is because you need to compile the project using gcc as a compiler. This is achieved passing COMPILER=gcc to the Make command. This is already included in the commands above, but when you build through the IDE you have to specify it in the 'Make parameters' box in the IDE. You should clean the project after you switch compiler.

          giuliomoro

          Thanks, yes the problem was as you mentioned. Dumb me, I was using terminal and didn't pay attention enough to the commands above.

          But now instead I've run into trouble with the patch. I get strange behaviour. IDE console gives me "underrun detected" all the time. This use to happen earlier if running pd patches compiled with heavy with say 16 blocksize. It usually was fixed when changing to 64 blocksize. However, that doesn't work now. Also some parts of the patch seems to not working since for example debouncing of hardware switches which I have done in PD is completely all over the place. This is a patch that is identical to the patch that I used to have in it with the Heavy online version.

          I updated the board yesterday. But probably nothing to do with that. Could there be some changes in the Heavy from the version that was running online?

          Actually seems to be something to do with updating the Bela. Now that I got back to previous version that I had running on the board things settled and the patch seems to work.

            lokki

            the older version that I got back in is "Bela image, v0.3.1, 8 November 2017" and I updated to the current bela-master.

            hmmm. Can you send an example patch and the heavy-generated files and all the steps to reproduce your issue? Probably the publicly available hvcc is more up to date than the one that was used by Bela until their server went offline.

              Right, are these Heavy files generated with the publicly available hvcc? Do you have an older version of those, generated by the online version of hvcc?

              And you are saying that with the older version of Bela this code was running fine, but not with the latest update from master, correct?

              How did you compile the project? With the IDE or with a script? Did you specify COMPILER=gcc ?

                giuliomoro

                The ones that I sent in the latter message are generated with publicly available hvcc.
                I have the older versions that were generated with online version. And you can download them from here: https://we.tl/t-Vj498MSns0

                It seems so that the latest update wasn't running correctly the patch that I generated with publicly available hvcc. I haven't yet try to strip down the patch and find exactly in which objects the problem is situated. Some how the part that I use to debounce the digital ins doesn't work. Also IDE gives a lot of the underrun message and the CPU percentage was way higher than it should be. Underrun messages appear also with the older version of Bela again if I make the blocksize less than 64.

                I have compiled the project earlier and now with a script. And I've basically been copy pasting the commands from here and earlier from the Bela instructions for heavy.

                hmm one thing that I see is that you are running the project with 2 analog channels. This is not really supported by Heavy on Bela, and it never was. In fact, you'd have to run it with 8 analog channels for it to work correctly (we should add code to the heavy render file to check for that). I see that if I reduce the channel count to 8, the CPU usage is around 58% for both patches (this is both on the latest version of the Bela code, and on an old one (from about the time your old image was released), with 64 samples per block), with no dropouts.

                I am not sure where the performance hit comes in when running with 2 analog channels, but that seems to be the cause of your issues

                Finally, it seems that you are using a fairly old render.cpp file for your heavy patch. This is not the cause of your issue, and the above mentioned warning is not in there yet. However, keep in mind for the future that, whenever you update your Bela code, you should always use the same version of the code on the board and on your computer, if you are generating a Heavy project and using the hvresources/render.cpp file from your computer.