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:
-
How are you supposed to connect the sidechain of a Compressor DSP? (If I added multiple inputs, which one would be used?)
-
Is there any further documentation or examples on using the Compressor DSP?
-
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