#
Audio LV2 / Calf Plugins

LV25 is an open standard for audio plugins using a simple interface with extensions which add functionality to support audio software. These plugins were written by external developers and provide additional audio effects to CINELERRA-GG audio without having to change CINELERRA-GG every time. Because the LV2 plugins are separate from CINELERRA-GG Infinity, if one fails or does not perform as expected, CINELERRA-GG should stay running and you will have to contact the programmers responsible for that plugin for a fix.

Typically, a user OS has specialized package groups installed. It is difficult to create one build of CINELERRA-GG to accommodate all potential LV2 plugins. Specifically for the Calf-Studio LV2 plugins, you should install the Calf Plugins package. The user’s computer must have gtk-2-runtime installed, which seems to be automatically done already for most distros. For users doing their own builds, you can build CINELERRA-GG without LV2 support by including --without-lv2 in the configure step. The default build is --with-lv2=yes and requires that GTK-2-devel must be installed or the build will fail and notify you. In addition for some newer distros, you will need to install lv2-calf-plugins-gui; for example Fedora version 32.

LV2 plugins have their own category in the Audio Plugins Visibility as lv2. There is a simple text interface which is available via the usual Show controls button when the plugin is attached to the audio track. This window has a Reset button to get back to the default settings. To change a value of one of the parameters, highlight that parameter and type in the new value in the topmost text box and then hit Apply to take effect – the reason for requiring hitting apply is so that the audio is not moving all over the place while you are still typing a value. More easily, you can just move the pot dial or the slider bar which take effect automatically.

CINELERRA-GG’s buffer size setting may cause a delay in activation of the changes you make taking effect, so you can lessen the time by using a small buffer. Notice that 1024 samples at 48000 samples per sec is only th a second. This is not a lot of time to shuffle a bunch of stuff. Short buffers produce low latency, but no time for complex programs or lots of stacked effects. Bigger buffers allow for more complex setups.

To set the buffer size:

Settings → Preferences → tab Playback A → section Audio Out → variable Playback buffer samples

However, be forewarned that due to variability in the lv2 plugin programming code, some of the plugins only work with the minimum buffer size of 1024. In these cases, what you will see is the main track canvas cursor just bounces back and forth over a very small area in the timeline. This does not crash CINELERRA-GG but you will have to remove the plugin to continue working. You can specify a certain set of LV2 plugins to use by setting LV2_PATH as shown below before starting CINELERRA-GG – include a colon (:) separator for multiple paths. The default path for most operating systems is /usr/lib64/lv2. To list the system installed lv2 plugins key in: lv2ls.

    export LV2_PATH=/tmp/j/balance.lv2/usr/local/lib/lv2/:/usr/local/lv2

If there is no default LV2_PATH set automatically, the value will be $CIN_DAT/
lv2, which is a placeholder only so that no lv2 plugins will be loaded. When there is no system LV2_PATH set it is important to note, that if you do want lv2 plugins loaded, you must set the correct path in:

Settings → Preferences → Interface tab → Default LV2 → directory path name

When you change this field, cin will automatically restart and load the newly specified lv2 plugins. If when switching LV2_PATH or if the lv2 audio plugins are not displayed/usable in the Resources window, you can execute a reload via:

Settings → Preferences → Interface tab → Reload plugin index or else before you bring up CINELERRA-GG, delete $HOME/.bcast5/CINELERRA-GG_
plugins so that the plugins get properly reloaded.

There are some lv2 plugins that display a glitzy UI (User Interface); for example the Calf plugins. For these LV2 plugins, if you want that to automatically come up without having to click on the UI button on the simplified UI interface, there is a flag to enable that. It is at:

Settings → Preferences → Operations tab

then check the Auto start lv2 gui Flag

Below is a screencast showing the auto start gui flag and the LV2_PATH default directory path on the bottom line. Note the highlighted Reload plugin index which will be executed if OKed (figure 10.23).

Figure 10.23: Reload plugin index in yellow and Auto start lv2 gui unchecked

There is also a blacklist that prevents known problematic-for-CINELERRA-GG lv2 plugins from loading to avoid crashes. If others are found to have problems, once informed about them, they will be added to this blacklist. In order to determine which lv2 plugin causes a SEGV on CINELERRA-GG startup, you can start from a terminal window and you will see each plugin that is being loaded and the last one shown before the crash is a bad plugin. However, many of the plugins causing a crash are due to not having been compiled on your current system with the current compiler so may actually work correctly on other user systems and so will not be added to the CINELERRA-GG-wide blacklist. You can either recompile the problematic plugin, or modify your own blacklist which you will have to maintain and save so as not to be written over when loading a new build.

Note the UI button in the upper right hand corner above the Reset button (figure 10.24). If you click this button, a glitzy interface window comes up (if available) for changing variable values. It is possible that a bug in the LV2 plugin causes the glitzy window to appear as blank and then die, but in that case the original simple text window might still work – in either case, if the timeline movement hangs, just detach the plugin to continue your current session. There is an environment variable that you can set, BC_TRAP_LV2_SEGV, to get a dump of the failure which may be helpful for debugging.

Figure 10.24: Screencast of simple text interface in the middle of the screen for a Calf LV2 plugin

When the glitzy ui is up, the simple text window remains up also since it is the CINELERRA-GG side and keeps track of the value changes so they remain in effect for further usage of the plugin. Changes to one or the other will occur in both with the exception of certain features in the glitzy window which are not communicated correctly back to CINELERRA-GG; for example a reset button – the simple interface Reset button must be used instead. To change values in the glitzy window you use the mouse and move up or down unlike a knob that turns! (Figure 10.25)

Figure 10.25: Screencast with a Calf plugin glitzy window that appears when clicking the simple interface UI button.

In order to test a particular plugin without bringing up CINELERRA-GG, especially for ones that do not operate, it is possible to manually display an lv2ui gui with:
/cin-path/lv2ui <lv2-uri>
For example:

    /tmp/cinelerra-5.1/bin/lv2ui http://calf.sourceforge.net/plugins/Flanger

If using the AppImage version and the Calf/LV2 plugins are not working for you, try doing the following which has been shown to work on Ubuntu 16.

1. Copy the "calf" and "lv2" folders from /usr/lib/ to /home/user/plugins_lv2-calf_for_Cin/.
2. After starting up CINELERRA-GG, change Settings-> Preferences...-> Interface tab, Default LV2_PATH to $HOME/plugins_lv2-calf_for_Cin/lv2 .
3. In the /home/user/plugins_lv2-calf_for_Cin/lv2/ directory remove any of the plugins that do not seem to work.

#### Footnotes

...LV2 5
  Optional Feature - OS dependent