Skip to content

dssiactivate

Activates or deactivates a LADSPA or DSSI plugin instance.

These opcodes require the optional dssi4cs module on Linux. See DSSI and LADSPA plugins for build requirements and setup.

Syntax

dssiactivate(ihandle, kactive)
dssiactivate ihandle, kactive

Initialization

ihandle is the instance handle returned by dssiinit.

Performance

Use kactive = 1 to activate the instance and kactive = 0 to deactivate it. Keep the value at 0 or 1. The opcode changes state when needed, so a constant 1 does not repeatedly activate the plugin.

Activation allows dssiaudio to run the plugin. Deactivation makes that opcode output silence and stop calling the plugin's processing function. This is not an audio bypass.

The host calls the plugin's activation and deactivation callbacks when available. It also tracks the active state for plugins that have no such callbacks.

Place this call before dssiaudio so the change takes effect in the same control cycle. The active state belongs to the shared handle. Ending the instrument that calls dssiactivate does not itself deactivate the instance.

Examples

The example activates the SDK mono amplifier for the first two seconds, deactivates it for two seconds, then activates it again. The middle section is silent. It requires amp.so and the Linux setup.

dssiactivate example
<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 32
nchnls = 2
0dbfs = 1

giHandle = dssiinit("/usr/lib/ladspa/amp.so", 0, 1)

instr 1
  kTime = timeinsts()
  kActive = (kTime < 2 || kTime >= 4 ? 1 : 0)
  dssictls(giHandle, 0, 0.5, 1)
  dssiactivate(giHandle, kActive)
  aInput = oscili(0.1, 440)
  aOutput = dssiaudio(giHandle, aInput)
  out(aOutput, aOutput)
endin
</CsInstruments>
<CsScore>
i 1 0 6
e
</CsScore>
</CsoundSynthesizer>

See also

dssiinit, dssiactivate, dssictls, dssiaudio, dssilist, DSSI and LADSPA plugins

Credits

Author Andres Cabrera, 2005. Uses code from Richard Furse's LADSPA SDK.