at blocksize 128 and 18 filters CPU is 84%
at blocksize 128 and 15 filters CPU is 72%

at blocksize 64 and 15 filters CPU is 74%
at blocksize 32 and 15 filters CPU is 78%

I landed at at blocksize 128 and 16 filters with CPU around 78%.
The patch keeps on running fine but vocoded result is of course less recognisable.
I'll probably erase some more bands as I need outgoing CV for this patch too.

Maybe somehow this patch can be made much lighter?

Or will there ever be a Bela shield for a board with more processing power?
For example do the same processing in stereo and use mire heavier audio processing.

    Floris Or will there ever be a Bela shield for a board with more processing power?

    Hopefully soon!

    Floris he patch keeps on running fine but vocoded result is of course less recognisable.

    16 bands is more than most analog vocoders had! :-)

    Floris Maybe somehow this patch can be made much lighter?

    You could add the command-line option --high-performance-mode which gives you some more CPU time, at the expense of the IDE becoming completely unaccessible while running with high CPU (but if you are already stopping with a button, that won't be a problem for you).

    Also, I see that apart from the file loading [readsf~], the patch would compile with hvcc (aka "heavy"), so that's a possible huge source of CPU saving. I will try and build it with hvcc tomorrow.

      For my patch, I use [adc~] in stead of [readsf~] for input.

      I'll have multiple Pd patches to play different pieces in next concerts.
      In a live situation, between two pieces, the reset button I soldered is used to switch between Pd patches.

      And more general,what's the best practice to optimize a Pd patch?
      Apart from heavy compiling, deleting number boxes, and slowing down metro objects.

        Using hvcc you get about 55% CPU usage with the full 28 voices. For some unknown (to me) reason, it only works well at blocksize 64 or 128.

        Floris And more general,what's the best practice to optimize a Pd patch?

        Well in this case there is not much that can be done, as it's essentially just many [bp~] and [env~] objects. Maybe (and I say maybe) using [pack f f] instead of [$1 23( to go into the [line~] object could also help.

        I have two patches ready for an upcoming concert series, both run nicely in the IDE is connected, but fail when tried in to play on booth as loop.

        How low on CPU should I go for not getting stuck in reboot loop?

        Can anybody help compiling these? I'll upload my Pd patches here: https://www.florisvanhoof.com/bela
        I tried an online Pd to C + + compiler, but there's errors on both patches.
        This is what I get from the vocoder patch for example.
        Patch Compilation Failed
        StdoutStderr
        1) [91mError[0m pd2hv: trill in "main.pd/trill" @ (x:20, y:2): Don't know how to parse object "list". Is it an object supported by Heavy? Is it an abstraction? Have the search paths been correctly configured?
        2) [91mError[0m pd2hv: trill in "
        main.pd/trill" @ (x:20, y:2): There was an error while connecting two objects. Have all objects been correctly instantiated? Have all inlets and outlets been declared?
        3) [91mError[0m pd2hv: [comment text] in "main.pd/trill" @ (x:0, y:0): Connection made to non-existent inlet at [comment {u'text': 'null object placeholder (list)'}]:0.
        1) [93mWarning[0m pd2hv: [msg remote local] in "
        main.pd/2 vocoder" @ (x:209, y:-37): Message boxes don't yet support remote messages. These messages will be ignored.

          Floris 1) [91mError[0m pd2hv: trill in "main.pd/trill" @ (x:20, y:2): Don't know how to parse object "list". Is it an object supported by Heavy? Is it an abstraction? Have the search paths been correctly configured?
          2) [91mError[0m pd2hv: trill in "main.pd/trill" @ (x:20, y:2): There was an error while connecting two objects. Have all objects been correctly instantiated? Have all inlets and outlets been declared?
          3) [91mError[0m pd2hv: [comment text] in "main.pd/trill" @ (x:0, y:0): Connection made to non-existent inlet at [comment {u'text': 'null object placeholder (list)'}]:0.

          these are because you have the [list] object in your patch, which is unsupported by hvcc.

          alt text

          You can simply remove those objects as they are not doing anything there.

          The other patch has some more issues:

          • it uses that same [list] which you can similarly delete
          • it uses [vline~] and [expr~ $v1 > $v2]. These can be replaced by heavylib's [hv.vline] and [hv.gt], respectively.

          The recommended workflow to build a program with heavy/hvcc is:

          • install this version of hvcc on your computer https://github.com/giuliomoro/hvcc/ (requires git, python 3.7 and pip3). From a terminal run:
            git clone https://github.com/giuliomoro/hvcc.git
            cd hvcc/
            pip3 install -e .
          • then get a copy of the Bela repository (dev branch) on your computer and update the code on Bela:
            git clone https://github.com/BelaPlatform/Bela.git
            cd Bela
            git checkout dev
            ./scripts/update_board -y
          • once the above is done you can run the following script to build Pd patches into a Bela project. From within the Bela folder, run:
            scripts/build_pd_hvcc.sh  path/to/your/vocoder_main.pd -c "-p64" -p PROJECTNAME

          Update instructions: in case you already have done the above but want to update to the latest hvcc and Bela support for hvcc:

          • get into your local hvcc folder and do:
            git fetch
            git reset --hard origin/master-Bela
            pip3 install -e .
          • get into your local Bela folder and do:
            git pull
            ./scripts/update_board -y

          NOTE: after updating the Bela core code (as done above when running update_board), the next time you build any project may take a long time.
          ANOTHER NOTE: the first time you build a project created with hvcc, it will take a long time to build. Successive builds will be faster, but still take around 30-40 seconds.

          However, currently there is no Trill support on Bela+hvcc. Let me add it right now and get back to you.

          Hi! thanks for the help. The last script gets this error :

          1) Error hvcc: Unknown input path /Users/Floris/hvcc/Bela/desktop/_main.pd
          MacBook-Pro-van-Floris:Bela Floris$

          is the path correct? The "desktop" in there is suspicious...

          What does

          ls /Users/Floris/hvcc/Bela/desktop/_main.pd

          return?

          ls: /Users/Floris/hvcc/Bela/desktop/_main.pd: No such file or directory
          MacBook-Pro-van-Floris:~ Floris$

          yup, then the path is wrong. Where is the file located? If it is on your desktop, then path would be something like: /Users/Floris/Desktop/_main.pd

          no idea what I'm doing wrong:

          MacBook-Pro-van-Floris:~ Floris$ scripts/build_pd_hvcc.sh /Users/Floris/Desktop/_main.pd -c "-p64" -p PROJECTNAME
          -bash: scripts/build_pd_hvcc.sh: No such file or directory
          MacBook-Pro-van-Floris:~ Floris$

          Thanks for the help, I would love to learn compiling, but as I leave for the first conczrt tomorrow, I'd better go practice my music with a simplified Pd patch (just a few vocoder bands to get the CPU% down)

          But now, after the terminal stuff, when I try to load a simple patch into the Bela IDE, it takes ages. (still not ready)
          Here's a part of the report. What's happening?
          Building Mmap.cpp...
          ...done
          Building RTAudio.cpp...
          ...done
          Building pru/pru_rtaudio.p...
          ...done
          Building pru/pru_rtaudio_irq.p...
          ...done
          Building PruBinary.cpp...
          ...done
          Building RTAudioCommandLine.cpp...
          ...done
          Building Mcasp.cpp...
          ...done
          Building AuxTaskNonRT.cpp...
          ...done
          Building JSONValue.cpp...
          ...done
          Building board_detect.cpp...
          ...done
          Building WSServer.cpp...
          ...done
          Building AuxiliaryTasks.cpp...
          ...done

            I made the Pd patches simpler, between 60 and 70% CPU usage, to run uncompiled.
            Still the patches won't start when the IDE is disconnected.
            here's the error:
            Makefile:612: recipe for target 'runonly' failed
            Aug 09 20:54:03 bela stdbuf[242]: make: *** [runonly] Error 127
            Aug 09 20:54:03 bela stdbuf[242]: make: Leaving directory '/root/Bela'

            After making the patches even lighter, they work in loop : )

            Floris -bash: scripts/build_pd_hvcc.sh: No such file or directory

            you need to run this from within the Bela folder on your computer.

            Floris Here's a part of the report. What's happening?

            It is rebuilding the Bela core code after the update. This is expected and it's a one-off event after the update. Successive builds will go back to the regular build times.

            Still the patches won't start when the IDE is disconnected.

            OK that's weird.

            here's the error:
            Makefile:612: recipe for target 'runonly' failed
            Aug 09 20:54:03 bela stdbuf[242]: make: *** [runonly] Error 127
            Aug 09 20:54:03 bela stdbuf[242]: make: Leaving directory '/root/Bela'

            Is there anything above those lines? These don't all us much.

            OK, I added support for Trill when building Pd patches with hvcc following the workflow above. I also amended the instructions above to explain how to update your current copies of the repos in order to use my latest changes.

            Now, building your patches should require the changes mentioned above and in addition you need to change

            [s bela_setTrill]

            to

            [s bela_setTrill @hv_param] 

            When building a patch that requires heavylib (as your grain patch does with the changes listed above), you further need to clone heavylib and pass it as the first option to build_pd_hvcc.sh. E.g.:

            ./scripts/build_pd_hvcc.sh -p path/to/heavylib path/to/file.pd -c "-p64" -p PROJECTNAME
            6 months later

            Floris Or will there ever be a Bela shield for a board with more processing power?

            giuliomoro Hopefully soon!

            Very interesting! Do we have some news about it?