Plugins

LADSPA plugins are optional separate programs that provide additional audio effects. It is possible to compile and use them on other platforms, but at this time support is only provided for Linux usage.

Installation

To install a base LADSPA system and several batches of plugins, enter

sudo apt-get install ladspa-sdk swh-plugins tap-plugins wah-plugins

To compile and install patchcord.so, which is used for mixing channels to outputs, go to the src/ folder and enter

sudo gcc -shared patchcord.c -o /usr/lib/ladspa/patchcord.so

Setup

To enable plugins, set the fluidsetting synth.ladspa.active: 1 in the config file, and set plugindir to the location where plugins are stored (most Linux distributions put them in /usr/lib/ladspa by default). The fluidsetting synth.audio-groups can be used to create separate effects mixing channels. The audio generated by each MIDI channel is assigned to an audio group in order, wrapping around if there are fewer groups than MIDI channels.

bankdir: config/banks
plugindir: /usr/lib/ladspa
fluidsettings:
  midi.autoconnect: 1
  player.reset-synth: 0
  synth.audio.groups: 16
  synth.ladspa.active: 1
currentbank: bank1.yaml

Usage

To add plugins to a bank file, create a ladspafx section as described in Creating Banks and add a named section for each plugin. Setting the parameters correctly requires knowing some details about the plugin, which can be found using the analyseplugin command provided by the LADSPA SDK. Enter the command, followed by the full path to the plugin file. Here is the output for the amp plugin file:

$ analyseplugin /usr/lib/ladspa/amp.so

Plugin Name: "Mono Amplifier"
Plugin Label: "amp_mono"
Plugin Unique ID: 1048
Maker: "Richard Furse (LADSPA example plugins)"
Copyright: "None"
Must Run Real-Time: No
Has activate() Function: No
Has deactivate() Function: No
Has run_adding() Function: No
Environment: Normal or Hard Real-Time
Ports:  "Gain" input, control, 0 to ..., default 1, logarithmic
        "Input" input, audio
        "Output" output, audio

Plugin Name: "Stereo Amplifier"
Plugin Label: "amp_stereo"
Plugin Unique ID: 1049
Maker: "Richard Furse (LADSPA example plugins)"
Copyright: "None"
Must Run Real-Time: No
Has activate() Function: No
Has deactivate() Function: No
Has run_adding() Function: No
Environment: Normal or Hard Real-Time
Ports:  "Gain" input, control, 0 to ..., default 1, logarithmic
        "Input (Left)" input, audio
        "Output (Left)" output, audio
        "Input (Right)" input, audio
        "Output (Right)" output, audio

As in the example above, some plugin files contain multiple plugins. The plugin parameter is used to set the label of the desired plugin. To route audio through the plugin, the audio parameter needs to be a list of the audio port names. List the inputs first, followed by the outputs. Part of the name can be used, as long as it is a unique match. The alias mono sets the ports to Input, Output, and stereo sets them to Input L, Input R, Output L, Output R. The control port names are used to set initial values with the val parameter, or connect router rules.

The group parameter is a list of the audio groups to route through the plugin. The number of groups is set in the config file as described above, and numbering begins with 1. Multiple audio groups can be sent through a plugin and are not mixed, but each additional group increases CPU load.

The bank file snippet below sets up the amp_stereo plugin and a router rule to control its Gain using CC# 13:

ladspafx:
  Stereo Amp:
    lib: amp
    plugin: amp_stereo
    audio: Input (L, Input (R, Output (L, Output (R
    vals:
      Gain: 0.5
    group: 3
router_rules:
  - {type: cc, par1: 13, ladspafx: Stereo Amp, port: Gain, par2: 0-127=0-1}

If synth.audio-groups were set to 4, and assuming there are 16 MIDI channels, this plugin would affect audio from channels 3, 7, 11, and 15.