LADSPA UGen
2010 Jonatan Liljedahl <lijon@kymatica.com>
============================================

This UGen lets you run any LADSPA plugin inside SuperCollider.

BUILD:
------
You need to have the SuperCollider headers available.
You also need sndfile.h from libsndfile installed or in the current path.

On Linux:

    $ make SC_HEADERS=/path/to/SuperCollider/common/Headers

On Mac OS X:

    $ CFLAGS="-arch i386" make -f makefile.macosx SC_HEADERS=/path/to/SuperCollider/common/Headers

The arch flag is needed for dlopen to find the plugin libraries.

INSTALL:
--------
On Linux:

    $ cp LadspaUGen.so LadspaUGen.sc ~/share/SuperCollider/Extensions

On Mac OS X:

    $ cp LadspaUGen.scx LadspaUGen.sc ~/Library/Application\ Support/SuperCollider/Extensions/LadspaUGen.scx

Optionally, copy the included 'ladspalist' utility to somewhere in your PATH

Plugins are searched in the colon-separated LADSPA_PATH environment variable.
If this variable is not set, it looks in /usr/lib/ladspa or /usr/local/lib/ladspa
on Linux and /Library/Audio/Plug-Ins/LADSPA on Mac OS X.

If you have Ardour installed, you can find lots of plugins in /Applications/Ardour.app/Contents/Plugins

USAGE EXAMPLE:
--------------
Run the included 'ladspalist' in a shell to find the info about the plugin you want:

    $ ladspalist | less

for example, glame lowpass iir with ID 1891:

    # 1891 Glame Lowpass Filter
    > k: Cutoff Frequency (0.0001 to 0.45)
    > k: Stages(2 poles per stage) (1 to 10)
    > a: Input
    < a: Output

The meaning of the first two characters for each port are:
    '>' - input
    '<' - output
    'k' - controlrate
    'a' - audiorate

Use it in SuperCollider:

    play{ LADSPA.ar(1, 1891, 1000+LFNoise1.kr(10, 800), 2, WhiteNoise.ar(1!2)) }

Note that the first arg is the number of output audio channels, then the UniqueID, the rest is all the
inputs in the same order as shown in 'ladspalist'. Currently, controlrate outputs are ignored.

If the plugin doesn't provide the requested number of channels, the extra channels will be silenced.
If the plugin provides more than requested number of channels, the extra channels will be ignored.

WARNING:
--------
Some LADSPA plugins might not be real-time safe, if they allocate memory at initialization.
