Is it possible to create a FMOD Echo effect with a EQ that only affects the audio copies?

Hi,

I’m applying in Unity (on runtime) a FMOD.Echo effect to a specific track of a specific event, I’m doing the things this way.


FMOD.Studio.EventInstance myEventInstance = new FMOD.Studio.EventInstance();
        int _trackIndex = 1;
        //some no relevant code here...
        FMODUnity.RuntimeManager.CoreSystem.createDSPByType(FMOD.DSP_TYPE.ECHO, out FMOD.DSP delay_FmodDSP);
        delay_FmodDSP.setParameterFloat((int)FMOD.DSP_ECHO.WETLEVEL, -40.0f);
        delay_FmodDSP.setParameterFloat((int)FMOD.DSP_ECHO.DELAY, 500.0f);
        delay_FmodDSP.setActive(true);
        myEventInstance.getChannelGroup(out FMOD.ChannelGroup channelGroup_Master);
        channelGroup_Master.getGroup(0, out FMOD.ChannelGroup channelGroup_Track);
        channelGroup_Track.addDSP(_trackIndex, delay_FmodDSP);

It works well, but now I want to ad a EQ effect ONLY ON THE WET SIGNAL, I’m applying the EQ effect signal like this, but it is affecting both, WET and DRY signal/

FMODUnity.RuntimeManager.CoreSystem.createDSPByType(FMOD.DSP_TYPE.MULTIBAND_EQ, out FMOD.DSP delay_FmodDSP);
        delay_FmodDSP.setParameterInt(((int)FMOD.DSP_MULTIBAND_EQ.A_FILTER), (int)FMOD.DSP_MULTIBAND_EQ_FILTER_TYPE.HIGHPASS_24DB);
        delay_FmodDSP.setParameterFloat(((int)FMOD.DSP_MULTIBAND_EQ.A_FREQUENCY), 5_000.0f);
        delay_FmodDSP.setParameterInt(((int)FMOD.DSP_MULTIBAND_EQ.B_FILTER), (int)FMOD.DSP_MULTIBAND_EQ_FILTER_TYPE.LOWPASS_24DB);
        delay_FmodDSP.setParameterFloat(((int)FMOD.DSP_MULTIBAND_EQ.B_FREQUENCY), 2_000.0f);
        delay_FmodDSP.setActive(true);
        myEventInstance.getChannelGroup(out FMOD.ChannelGroup channelGroup_Master);
        channelGroup_Master.getGroup(0, out FMOD.ChannelGroup channelGroup_Track);
        channelGroup_Track.addDSP(_trackIndex, delay_FmodDSP);

What can I do to solve this issue? thanks in advance FMOD guys!

1 Like

Hi,

Thank you for the code. Could I please grab your FMOD integration version?

An option may be using FMOD Engine | Core API Reference - DSP::addInput to divert the signal to a new chain where we can remove the dry signal and only pass the wet signal to the EQ:


(This image was captured using the FMOD Core profiler which is included with the FMOD Studio install)

// I am returing the effected signal to the final fader, but this can be any point you want
FMODUnity.RuntimeManager.CoreSystem.getMasterChannelGroup(out FMOD.ChannelGroup mcg);
mcg.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.FADER, out FMOD.DSP masterFader);

myEventInstance.getChannelGroup(out FMOD.ChannelGroup channelGroup_Master);
channelGroup_Master.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.FADER, out FMOD.DSP channelFader);

delay_FmodDSP.addInput(channelFader);
// I noticed you are using the same DSP twice, I am just using a new DSP for the EQ
// FMODUnity.RuntimeManager.CoreSystem.createDSPByType(FMOD.DSP_TYPE.MULTIBAND_EQ, out EQ_FmodDSP)
EQ_FmodDSP.addInput(delay_FmodDSP);
masterFader.addInput(EQ_FmodDSP);

I would also suggest adding FMOD_RESULT checks to your FMOD functions to aid in debugging:

FMOD_RESULT result = masterFader.addInput(EQ_FmodDSP);
if (result != FMOD_OK)
{
    //FMOD function failed so could add a debug log or run other code
}

FMOD Engine | Core API Reference - Common
I hope this helps!