How to replace the built in reverb with another effect

System::setReverbProperties has the advantage that it connects all channels automatically and disconnects automatically when the channel stops.

If I want to change the internal reverb with another effect how do I do it?

If you wish to use a different effect with this functionality, say FMOD’s convolution reverb, or echo, or even a lowpass filter, use the following code

    {
        FMOD::ChannelGroup *mcg;
        int numinputs, count;
        FMOD::DSP *dsphead, *dspreverb;
        
        result = gSystem->getMasterChannelGroup(&mcg);
        ERRCHECK(result);

        result = mcg->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &dsphead);
        ERRCHECK(result);

        result = dsphead->getNumInputs(&numinputs);
        ERRCHECK(result);

        for (count=0; count < numinputs; count++)
        {
            FMOD_DSP_TYPE type;

            result = dsphead->getInput(count, &dspreverb, 0);
            ERRCHECK(result);

            result = dspreverb->getType(&type);
            ERRCHECK(result);

            if (type == FMOD_DSP_TYPE_SFXREVERB)
            {
                result = dsphead->disconnectFrom(dspreverb);
                ERRCHECK(result);

                result = dsphead->addInput(myeffect)
                ERRCHECK(result);

                result = myeffect->addInput(dspreverb);
                ERRCHECK(result);

                result = dspreverb->setBypass(true);
                ERRCHECK(result);

                result = myeffect->setActive(true);
                ERRCHECK(result);
            }
        }
    }

This code will insert your effect after it in the signal path, and disable the reverb.

If you want to post-process the reverb, you could use this code as well, just don’t bypass it.

1 Like