libfluidsynth  2.3.5
Effect - LADSPA

Functions for configuring the LADSPA effects unit. More...

Functions

int fluid_ladspa_activate (fluid_ladspa_fx_t *fx)
 Activate the LADSPA fx instance and each configured effect. More...
 
int fluid_ladspa_add_buffer (fluid_ladspa_fx_t *fx, const char *name)
 Create and add a new audio buffer. More...
 
int fluid_ladspa_add_effect (fluid_ladspa_fx_t *fx, const char *effect_name, const char *lib_name, const char *plugin_name)
 Create an instance of a LADSPA plugin as an effect. More...
 
int fluid_ladspa_buffer_exists (fluid_ladspa_fx_t *fx, const char *name)
 Check if a named user buffer exists. More...
 
int fluid_ladspa_check (fluid_ladspa_fx_t *fx, char *err, int err_size)
 Do a sanity check for problems in the LADSPA setup. More...
 
int fluid_ladspa_deactivate (fluid_ladspa_fx_t *fx)
 Deactivate a LADSPA fx instance and all configured effects. More...
 
int fluid_ladspa_effect_can_mix (fluid_ladspa_fx_t *fx, const char *name)
 Check if the effect plugin supports the run_adding and set_run_adding_gain interfaces necessary for output mixing. More...
 
int fluid_ladspa_effect_link (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name, const char *name)
 Connect an effect audio port to a host port or buffer. More...
 
int fluid_ladspa_effect_port_exists (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name)
 Check if the named port exists on an effect. More...
 
int fluid_ladspa_effect_set_control (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name, float val)
 Set the value of an effect control port. More...
 
int fluid_ladspa_effect_set_mix (fluid_ladspa_fx_t *fx, const char *name, int mix, float gain)
 Set if the effect should replace everything in the output buffers (mix = 0, default) or add to the buffers with a fixed gain (mix = 1). More...
 
int fluid_ladspa_host_port_exists (fluid_ladspa_fx_t *fx, const char *name)
 Check if a named host port exists. More...
 
int fluid_ladspa_is_active (fluid_ladspa_fx_t *fx)
 Check if the LADSPA engine is currently used to render audio. More...
 
int fluid_ladspa_reset (fluid_ladspa_fx_t *fx)
 Reset the LADSPA effects engine. More...
 
fluid_ladspa_fx_tfluid_synth_get_ladspa_fx (fluid_synth_t *synth)
 Return the LADSPA effects instance used by FluidSynth. More...
 

Detailed Description

Functions for configuring the LADSPA effects unit.

This header defines useful functions for programmatically manipulating the ladspa effects unit of the synth that can be retrieved via fluid_synth_get_ladspa_fx().

Using any of those functions requires fluidsynth to be compiled with LADSPA support. Else all of those functions are useless dummies.

Function Documentation

◆ fluid_ladspa_activate()

int fluid_ladspa_activate ( fluid_ladspa_fx_t fx)

Activate the LADSPA fx instance and each configured effect.

Parameters
fxLADSPA fx instance
Returns
FLUID_OK if activation succeeded or already active, otherwise FLUID_FAILED

◆ fluid_ladspa_add_buffer()

int fluid_ladspa_add_buffer ( fluid_ladspa_fx_t fx,
const char *  name 
)

Create and add a new audio buffer.

Parameters
fxLADSPA effects instance
namename of the new buffer
Returns
FLUID_OK on success, FLUID_FAILED on error

◆ fluid_ladspa_add_effect()

int fluid_ladspa_add_effect ( fluid_ladspa_fx_t fx,
const char *  effect_name,
const char *  lib_name,
const char *  plugin_name 
)

Create an instance of a LADSPA plugin as an effect.

Parameters
fxLADSPA effects instance
effect_namename of the effect
lib_namefilename of ladspa plugin library
plugin_nameoptional, plugin name if there is more than one plugin in the library
Returns
FLUID_OK on success, otherwise FLUID_FAILED

◆ fluid_ladspa_buffer_exists()

int fluid_ladspa_buffer_exists ( fluid_ladspa_fx_t fx,
const char *  name 
)

Check if a named user buffer exists.

Parameters
fxLADSPA fx instance
namethe buffer name
Returns
TRUE if the buffer exists, otherwise FALSE

◆ fluid_ladspa_check()

int fluid_ladspa_check ( fluid_ladspa_fx_t fx,
char *  err,
int  err_size 
)

Do a sanity check for problems in the LADSPA setup.

Parameters
fxLADSPA fx instance
errexternally provided buffer for the error message. Set to NULL if you don't need an error message.
err_sizesize of the err buffer
Returns
FLUID_OK if setup is valid, otherwise FLUID_FAILED (err will contain the error message)

If the check detects problems and the err pointer is not NULL, a description of the first found problem is written to that string (up to err_size - 1 characters).

◆ fluid_ladspa_deactivate()

int fluid_ladspa_deactivate ( fluid_ladspa_fx_t fx)

Deactivate a LADSPA fx instance and all configured effects.

Parameters
fxLADSPA fx instance
Returns
FLUID_OK if deactivation succeeded, otherwise FLUID_FAILED
Note
This function may sleep.

◆ fluid_ladspa_effect_can_mix()

int fluid_ladspa_effect_can_mix ( fluid_ladspa_fx_t fx,
const char *  name 
)

Check if the effect plugin supports the run_adding and set_run_adding_gain interfaces necessary for output mixing.

Parameters
fxLADSPA fx
namethe name of the effect
Returns
TRUE if mix mode is supported, otherwise FALSE

◆ fluid_ladspa_effect_link()

int fluid_ladspa_effect_link ( fluid_ladspa_fx_t fx,
const char *  effect_name,
const char *  port_name,
const char *  name 
)

Connect an effect audio port to a host port or buffer.

Parameters
fxLADSPA effects instance
effect_namename of the effect
port_namethe audio port name to connect to (case-insensitive prefix match)
namethe host port or buffer to connect to (case-insensitive)
Returns
FLUID_OK on success, otherwise FLUID_FAILED
Note
There is no corresponding disconnect function. If the connections need to be changed, clear everything with fluid_ladspa_reset and start again from scratch.

◆ fluid_ladspa_effect_port_exists()

int fluid_ladspa_effect_port_exists ( fluid_ladspa_fx_t fx,
const char *  effect_name,
const char *  port_name 
)

Check if the named port exists on an effect.

Parameters
fxLADSPA fx instance
effect_namename of the effect
port_namethe port name
Returns
TRUE if port was found, otherwise FALSE

◆ fluid_ladspa_effect_set_control()

int fluid_ladspa_effect_set_control ( fluid_ladspa_fx_t fx,
const char *  effect_name,
const char *  port_name,
float  val 
)

Set the value of an effect control port.

Parameters
fxLADSPA fx instance
effect_namename of the effect
port_namename of the port
valfloating point value
Returns
FLUID_OK on success, FLUID_FAILED on error

◆ fluid_ladspa_effect_set_mix()

int fluid_ladspa_effect_set_mix ( fluid_ladspa_fx_t fx,
const char *  name,
int  mix,
float  gain 
)

Set if the effect should replace everything in the output buffers (mix = 0, default) or add to the buffers with a fixed gain (mix = 1).

Parameters
fxLADSPA fx instance
namethe name of the effect
mix(boolean) if to enable mix mode
gainthe gain to apply to the effect output before adding to output.
Returns
FLUID_OK on success, otherwise FLUID_FAILED

◆ fluid_ladspa_host_port_exists()

int fluid_ladspa_host_port_exists ( fluid_ladspa_fx_t fx,
const char *  name 
)

Check if a named host port exists.

Parameters
fxLADSPA fx instance
namethe port name
Returns
TRUE if the host port exists, otherwise FALSE

◆ fluid_ladspa_is_active()

int fluid_ladspa_is_active ( fluid_ladspa_fx_t fx)

Check if the LADSPA engine is currently used to render audio.

Parameters
fxLADSPA fx instance
Returns
TRUE if LADSPA effects engine is active, otherwise FALSE

If an engine is active, the only allowed user actions are deactivation or setting values of control ports on effects. Anything else, especially adding or removing effects, buffers or ports, is only allowed in deactivated state.

◆ fluid_ladspa_reset()

int fluid_ladspa_reset ( fluid_ladspa_fx_t fx)

Reset the LADSPA effects engine.

Parameters
fxLADSPA fx instance
Returns
FLUID_OK on success, otherwise FLUID_FAILED

Deactivate LADSPA if currently active, remove all effects, remove all user nodes and unload all libraries.

◆ fluid_synth_get_ladspa_fx()

fluid_ladspa_fx_t* fluid_synth_get_ladspa_fx ( fluid_synth_t synth)

Return the LADSPA effects instance used by FluidSynth.

Parameters
synthFluidSynth instance
Returns
pointer to LADSPA fx or NULL if compiled without LADSPA support or LADSPA is not active