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.
Heavy, Pd and Enzienaudio
Here is the whole PD patch that I am running and the heavy files that I downloaded through the IDE.
https://we.tl/t-rTBGTCs6z6
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
?
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.
- Edited
HI I try to run hvcc on a tinker board, it work but I have some errors. In fact hvcc doesn't now the object "readsf~". I am suprise because is pretty basic in PD, is not attach an external library.
hvcc
only understands a subset of the Pd-vanilla objects. Here is a full list: https://github.com/CarloCattano/hvcc/blob/master/docs/14.Supported_vanilla_objects.md
[readsf~]
is not there. A good way to replace it is to manage the file loading in the wrapping code for your language/environment of choice, and maybe pass it in as one of the audio streams input [adc~]
.
Thanks for putting your time in. I didn't know that analog channel thing for sure. Also in my project it's pretty irrelevant if it's 2 or 8. So I'll start using 8 from now on!
Jukkapoika Also in my project it's pretty irrelevant if it's 2 or 8
We should really enforce it in the C++ wrapper, to minimize the chance of user error ...
hello, I tried to compile as described on 22Aug by giuliomoro, but running the last line (make -C ~/Bela PROJECT=HeavyProjectName COMPILER=gcc run) I got this error:
make: *** No rule to make target `run'. Stop.
I noticed the /Bela/projects/HeavyProjectName has been created and populated by a bunch of folders, but this is just the source code, shouldnt I be taking a single .cpp file or something so I can upload it to bela with the IDE? (sorry I am not a programmer and feel totally lost at sea...) btw I am on a Mac.
any help would be very appreciated!
I take it you are referring to the following instructions:
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
These are meant to be run directly on the board after installing the needed tools as explained earlier in that post (those tools are already available in Bela images version v0.3.6 or above).
It sounds like you are running them on the host computer just now?
There are also instructions to be run on the host computer, just a few posts down: see here https://forum.bela.io/d/636-heavy-pd-and-enzienaudio/12 . Running them on the host makes the setup easier and the compilation faster.
- Edited
giuliomoro
Grazie mille Giulio!
Yes, I was running them on the host computer (!!) will try the correct instructions as soon as life permits.
thanks again for the reply,
C.
Thank you so much for the clarification Giulio,
I finally managed to compile the heavy file!!
As of today, I created a master-bela
branch on https://github.com/giuliomoro/hvcc where I merged a couple of fixes for MIDI (now MIDI outputs work) and for Xenomai (now you can compile with clang
instead of gcc
, so compilation time can get significantly faster). I will try to keep this as up to date as possible (that is: every fix I know of will go in there), so I'd recommend everyone on Bela to use this instead of https://github.com/enzienaudio/hvcc. However, please note that I am not the new maintainer of hvcc
, so please don't ask for features, as they will not be implemented (by me).
How do you get a PD patch compiled using RebelTech's on-line Heavy compiler to run on the Bela?
The code it's generated seems to be missing a render.cpp file. Does it need one? And what should be in it?
I have never used it, I think you may need this, however it depends on the "patch name" given to the compiler. If the patch name is not "bela", then the included file Heavy_bela.h
will not exist.
(my recommendations to use the Heavy compiler without relying on an online compiler are above.)
- Edited
Hi Giuliomoro, thanks for replying!
I tried following your instructions. I got the render.cpp file you mentioned in your reply just now and made a Bela/scripts/hvresources directory and put it in there.
It looked like it nearly worked but had the following error while compiling:
/root/Bela/projects/WindchimeHeavy/render.cpp:85:13: error: ‘class Midi’ has no member named ‘isInputEnabled’
midi[n]->isInputEnabled() ? "x" : "_",
^
/root/Bela/projects/WindchimeHeavy/render.cpp:86:13: error: ‘class Midi’ has no member named ‘isOutputEnabled’
midi[n]->isOutputEnabled() ? "x" : "_",
^
/root/Bela/projects/WindchimeHeavy/render.cpp: In function ‘Midi* openMidiDevice(std::string, bool, bool)’:
/root/Bela/projects/WindchimeHeavy/render.cpp:100:14: error: ‘class Midi’ has no member named ‘isOutputEnabled’
if(newMidi->isOutputEnabled())
^
/root/Bela/projects/WindchimeHeavy/render.cpp:105:14: error: ‘class Midi’ has no member named ‘isInputEnabled’
if(newMidi->isInputEnabled())
^
/root/Bela/projects/WindchimeHeavy/render.cpp:110:15: error: ‘class Midi’ has no member named ‘isInputEnabled’
if(!newMidi->isInputEnabled() && !newMidi->isOutputEnabled())
^
/root/Bela/projects/WindchimeHeavy/render.cpp:110:45: error: ‘class Midi’ has no member named ‘isOutputEnabled’
if(!newMidi->isInputEnabled() && !newMidi->isOutputEnabled())
I've commented out the lines in render.cpp that reference isInputEnabled
and isOutputEnabled
and it seems to be compiling now.
I'm guessing I've got some kind of version mismatch between this render.cpp and what I've got installed on the Bela.
On your board,at the path /root/Bela/scripts/hvresources/render.cpp
you should have a wrapper for heavy that should be compatible with your version of the Bela core core.
giuliomoro Thanks for your instructions!
I am having some trouble installing the files from the requirements.txt on my laptop (I am working with ubuntu 18.04) could you help me?
I have python 2.7 and 3.6 on my laptop. (I set 2.7 as default).
i get the following errors:
ERROR: Command errored out with exit status 1:
command: /home/yannick/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c2abhcn_/enum/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c2abhcn_/enum/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-c2abhcn_/enum/pip-egg-info
cwd: /tmp/pip-install-c2abhcn_/enum/
Complete output (11 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/yannick/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 6, in <module>
import distutils.core
File "/home/yannick/anaconda3/lib/python3.6/distutils/core.py", line 16, in <module>
from distutils.dist import Distribution
File "/home/yannick/anaconda3/lib/python3.6/distutils/dist.py", line 9, in <module>
import re
File "/home/yannick/anaconda3/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info
i tried installing jinja2 separately, it installs succesfully, but I still get an error:
ERROR: flask 1.0.2 has requirement Jinja2>=2.10, but you'll have jinja2 2.7.3 which is incompatible. (do you know if I could just try to upgrade jinja2 to a higher version, or I need to create a situation where I can run 2.7.3?)