Hi there,

I was wondering if it was possible to use LADSPA plugins within Pure Data on the Bela.

Thanks

Well, it would require writing a ladspa host in Bela, which should be as simple as calling the LADSPA dsp callback from within render(), plus a lot of ancillary stuff.
Have a look at the Bela/examples/08-PureData/customRender/render.cpp file, that is an example of how to interface with an existing library. All the stuff in render() is simply placing the inputs in the appropriate buffer, then the callback libpd_process_sys() gets called and then after that pd's outputs are put back into Bela's buffers.
There is some more (rather verbose) stuff for MIDI and digital messaging in there, but that does not necessarily have to be there.

Wanna give it a try?

    giuliomoro I cannot. Have no idea how to do what you want me to try 🙂 However, since this is possible, it would be great if someone did it. This would turn Bela into a great effects processor with its low-latency audio (crucial for live signal processing)

    Well surely a plugin host would be a nice addition. Actually, more than a single-plugin host, a standalone host for multiple plugins (and different plugin types (vst, ladspa, lv2)) would be great ...

    5 months later

    I needed to run an lv2 plugin on Bela, so I ported jalv (a Jack or PortAudio stand-alone host) to work on Bela as well.
    In the longer run this will probably make its way into the Bela image, meantime I am available to help anyone who'd be willing to help testing/developing.

    https://github.com/giuliomoro/jalv

      giuliomoro changed the title to LV2/LADSPA Plugins .
      3 years later

      hi giuliomoro

      will this plugin host work with "all" lv2 plugins? i would like to run x42 autotune on it. is this included in the newest bela image?

      giuliomoro cool, willook into it. so you think autotune will work with that (probably fft for pitch estimation etc)?

        unfortunately, i cannot install all missing files, i get this if i run apt-get install:

        Err:1 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libpng16-16 armhf 1.6.28-1
          404  Not Found [IP: 151.101.112.204 80]
        Err:2 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libtiff5 armhf 4.0.8-2+deb9u2
          404  Not Found [IP: 151.101.112.204 80]
        Err:3 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libcups2 armhf 2.2.1-8+deb9u1
          404  Not Found [IP: 151.101.112.204 80]
        Err:4 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libxcursor1 armhf 1:1.1.14-1+deb9u1
          404  Not Found [IP: 151.101.112.204 80]
        Err:5 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libx11-xcb1 armhf 2:1.6.4-3
          404  Not Found [IP: 151.101.112.204 80]
        Err:6 http://cdn-fastly.deb.debian.org/debian stretch/main armhf libjs-jquery all 3.1.1-2
          404  Not Found [IP: 151.101.112.204 80]

        one of the apt suggestions is to do an apt get-update, but i am a bit hesitant, will this break anything on the bela side?

          lokki one of the apt suggestions is to do an apt get-update, but i am a bit hesitant, will this break anything on the bela side?

          apt-get update will only update the URLs that will be used to try and install the packages with apt-get install. It will not update any of the already installed packages, as far as I understand. Definitely try that.

          lokki so you think autotune will work with that (probably fft for pitch estimation etc)?

          This is a minimal host. While several plugins work with it, there are some features that are not implemented. I don't even know which ones they are, but I believe that lv2 allows for a "worker thread" to perform computation off of the audio thread. If your plugin uses FFT, you'd hope they'd be running off the audio thread, so maybe that feature is required. The only thing to do is try it out, it should fail at runtime if not all the required features are implemented by the host. You can also try and look up the docs for your plugin and see what features it requires.

          ok, that worked! thank you. i now have the example working. looking at it, i don't quite get, where i would put the plugin name in to test if mine works, all i see in render.cpp (and some of the other files i checked) is a URL mention of the plugins that it loads. so not sure where i would put in my plugin there.

          but, first things first, here is the GitHub of the autotune plugin:

          https://github.com/x42/fat1.lv2

          when i try to compile it on the BELA it drops a lot of missing library errors. i was able to install quite a few but i need a libpango-dev as well, i guess this is named differently on the BBB/Bela. any ideas?

          also, actually i would not need to compile all the graphics stuff of the plugin, but for the moment i am not sure how to do that...

            lokki URL mention of the plugins that it loads. so not sure where i would put in my plugin there.

            That's how it works with lv2: use lv2ls from the command line to retrieve the URI of the plugin and put it in there.

            lokki guess this is named differently on the BBB/Bela. any ideas

            The Bela distro is just regular Debian Stretch, nothing special about it. I don't know about this particular library though.

            lokki , actually i would not need to compile all the graphics stuff of the plugin, but for the moment i am not sure how to do that...

            That's usually the best solution. The plugin developer may have made available a flag to pass to the build system to avoid building the GUI. If reading the docs doesn't help then maybe inspecting the Makefile will

            ok, got that sorted out, compiles fine now and i have also found a arm-hf version on the x42-plugins site that should work :-)

            on to the next question, where do i set my plugin to be inserted into the lv2host? those URLs can't be it...

              sorry x-post. will try your advice, thanks!

              lokki ok, got that sorted out, compiles fine now and i have also found a arm-hf version on the x42-plugins site that should work :-)

              Good. Looking at the Makefile it looks like you can pass MOD=1 to make to disable the gui and standalone jack app.

              lokki those URLs can't be it...

              Yes! See above

              hmm, i get this:

              Port 0 has unsupported type
              Fat1.lv2 error: Host does not support urid:map
              error: Unable to instantiate plugin `http://gareus.org/oss/lv2/fat1'
              Segmentation fault

              Missing feature of the host. I will need to have a look. It seems that it is only used for performance reason, so maybe it is optional and there is a way to disable it in the plugin?