Using FMOD_DSP_PARAMETER_SIDECHAIN with a FMOD_DSP_TYPE_COMPRESSOR

Hey, I’d like to use a playing Channel as the sidechain on a Compressor DSP.

What I’m doing:
-I’m getting the DSP_TAIL of a channel, and adding it as a FMOD_DSPCONNECTION_TYPE_SIDECHAIN input on the compressor DSP.
-I’m enabling FMOD_DSP_COMPRESSOR_USESIDECHAIN on the compressor DSP.

Doing both of the above, adding the compressor dsp to my master group, and then playing a sound has no noticeable ducking sidechain effect. The code is below.

Questions:

  1. How are you supposed to connect the sidechain of a Compressor DSP? (If I added multiple inputs, which one would be used?)

  2. Is there any further documentation or examples on using the Compressor DSP?

  3. Is there any way to debug what is going on?

    FMOD::Sound* pulseSound;
    FMOD::Channel* pulseChannel;
    system->createSound(Common_MediaPath(“pulse.ogg”), FMOD_DEFAULT, 0, &pulseSound);
    system->playSound(pulseSound, pulseChannelGroup, true, &pulseChannel);
    pulseChannel->setLoopCount(-1);
    pulseChannel->setPaused(false);

    FMOD::DSP* dspcompressor;
    result = system->createDSPByType(FMOD_DSP_TYPE_COMPRESSOR, &dspcompressor);

    dspcompressor->setParameterFloat(FMOD_DSP_COMPRESSOR_THRESHOLD, 0);
    dspcompressor->setParameterFloat(FMOD_DSP_COMPRESSOR_ATTACK, 100);
    dspcompressor->setParameterFloat(FMOD_DSP_COMPRESSOR_RELEASE, 0);
    dspcompressor->setParameterFloat(FMOD_DSP_COMPRESSOR_GAINMAKEUP, 5);

    FMOD::DSP* pulseChannelTail;
    pulseChannel->getDSP(FMOD_CHANNELCONTROL_DSP_TAIL, &pulseChannelTail);

    FMOD::DSPConnection* pulseDSPConnection;
    dspcompressor->addInput(pulseChannelTail, &pulseDSPConnection, FMOD_DSPCONNECTION_TYPE_SIDECHAIN);

    FMOD_DSP_PARAMETER_SIDECHAIN useSideChain;
    useSideChain.sidechainenable = true;
    dspcompressor->setParameterData(FMOD_DSP_COMPRESSOR_USESIDECHAIN, &useSideChain, sizeof(useSideChain));

    // add dspcompressor to dsp list of master channel, etc

Hi ,
The compressor is designed to catch peaks above the FMOD_DSP_COMPRESSOR_THRESHOLD value, and compressed based on that.
By default it is 0db max, so that it catches loud volumes (from a non sidechain perspective) and compresses the signal down to avoid clipping.

If you want to use it in a ducking fashion from another signal (ie sidechain), you would need to lower your threshold to something lower, ie you can start with -60 and it should work.

1 Like