0
0

Hi,

I’ve just noticed that the FMOD_EVENTPROPERTY_EFFECTS_AFFECT_REVERB when set to TRUE on an event only actually works with single events that have got an effect applied to them. It works fine if I’ve got a single event with say a filter, its cutoff controlled by distance and ambient reverb on. If the property is set to TRUE then the filter will also affect the reverb, if not then reverb is left unaffected and only the dry signal gets filtered.

However if I create the same filter in code and attach it to a channel group and have ambient reverb on, then the reverb is not affected by the filter regardless the value set on the events FMOD_EVENTPROPERTY_EFFECTS_AFFECT_REVERB.

In our game we’ve got particular situations when we want to filter the whole thing down (going deaf effect) so we get the master submix and attach a FMOD_LOWPASS_SIMPLE to it and regulate the cutoff frequency. Since we’ve got reverbs active we end up with this dreamy reverb whenever the filtering is triggered as only the dry signal gets affected. What we really want is that both paths get filtered.

Are we missing something? Any ideas on this?

Thank you,
Pedro

  • You must to post comments
0
0

Can anyone shed any light on this?

Thanks.

  • You must to post comments
0
0

The reverb signals go through a separate signal path, so applying a filter to the master category won’t affect it, as you’ve discovered. To apply a filter to the whole mix, use System::addDSP.

The "FMOD Ex advanced DSP engine" topic in the Tutorials section of the API documentation has a diagram at the end that should make this clearer. You can see that the signals going through the SFX Reverb node are completely separate from the signals going through the channelgroup hierarchy.

  • You must to post comments
0
0

Thanks ben. The diagram makes sense, I thought that FMOD_EVENTPROPERTY_EFFECTS_AFFECT_REVERB would change the routing path.

In the game we’ve got this kind of ducking states so that for example when there’s an explosion and we want the "going deaf" effect the designers define different ducking percentages per category, like music is not supposed to be ducked, gunshots go about 40%, ambiences 70%, etc. So filtering the master only doesn’t allow this kind of flexibility.

Would there be any chance (or feature request) that effects attached to submixes could also affect reverberation?

Thank you,
Pedro

  • You must to post comments
0
0

[quote="pcorvo":1r5itqnc]The diagram makes sense, I thought that FMOD_EVENTPROPERTY_EFFECTS_AFFECT_REVERB would change the routing path.[/quote:1r5itqnc]
It does change the routing path, but only the part that’s internal to individual events. It doesn’t affect the routing path at the category tree level.

[quote="pcorvo":1r5itqnc]Would there be any chance (or feature request) that effects attached to submixes could also affect reverberation?[/quote:1r5itqnc]
At the moment you’d need to set this up yourself, as follows:
[list=1:1r5itqnc]
[:1r5itqnc] Set the relevant events’ reverb wet level to -60 in Designer so they don’t go directly to the reverb[/:m:1r5itqnc]
[:1r5itqnc] Call System::setReverbProperties so that the global reverb unit is created[/:m:1r5itqnc]
[:1r5itqnc] Get the reverb DSP unit:
[list=a:1r5itqnc]
[
:1r5itqnc] Get the head node of the DSP tree with System::getDSPHead (this will be the soundcard unit)[/:m:1r5itqnc]
[
:1r5itqnc] Get the first input of the head node (this will be the channelgroup target unit)[/:m:1r5itqnc]
[
:1r5itqnc] Scan the inputs of the channelgroup target unit, calling DSP::getInfo to get the unit named "SFX Reverb"[/:m:1r5itqnc][/list:o:1r5itqnc][/:m:1r5itqnc]
[:1r5itqnc] For each event category that should go through the reverb ([color=yellow:1r5itqnc][b:1r5itqnc]Don’t change the order of these steps! See below for an explanation[/b:1r5itqnc][/color:1r5itqnc]):
[list=a:1r5itqnc]
[
:1r5itqnc] Add the appropriate filter DSP units to the category’s channelgroup[/:m:1r5itqnc]
[
:1r5itqnc] Get the category’s channelgroup DSP with ChannelGroup::getDSPHead[/:m:1r5itqnc]
[
:1r5itqnc] Add the category’s channelgroup DSP as an input to the reverb unit with DSP::addInput[/:m:1r5itqnc][/list:o:1r5itqnc][/:m:1r5itqnc][/list:o:1r5itqnc]
[color=yellow:1r5itqnc][b:1r5itqnc]Make sure you don’t change the order of steps 3a through 3c[/b:1r5itqnc][/color:1r5itqnc]. If you do, the connections will be different, and the reverb will get the un-filtered signal. For example, if you change the order of steps 3a and 3b, you will get http://52.88.2.202/files/reverb_effects_bad.png instead of http://52.88.2.202/files/reverb_effects_good.png .

Below is some example code that can be pasted into the simple_event example that comes with the programmer’s API. It requires some modifications to examples.fdp:
[list:1r5itqnc]
[:1r5itqnc] Add a category called "sfx"[/:m:1r5itqnc]
[:1r5itqnc] Move the FeatureDemonstration/SequencingAndStitching/LoopLogic event into the sfx category[/:m:1r5itqnc]
[:1r5itqnc] Set the LoopLogic event’s Reverb Wet Level to -60 dB[/:m:1r5itqnc][/list:u:1r5itqnc]

[code:1r5itqnc]
ERRCHECK(result = eventsystem->setMediaPath("..\media\"));
ERRCHECK(result = eventsystem->load("examples.fev", 0, 0));
ERRCHECK(result = eventsystem->getEvent("examples/FeatureDemonstration/SequencingAndStitching/LoopLogic",
FMOD_EVENT_DEFAULT, &event));

FMOD::System *system;
ERRCHECK(eventsystem->getSystemObject(&system));

FMOD_REVERB_PROPERTIES reverbProps = FMOD_PRESET_GENERIC;
ERRCHECK(system->setReverbProperties(&reverbProps));

FMOD::DSP *reverb = 0;

// Get the reverb DSP unit
{
    FMOD::DSP *systemhead;

    // this gets the soundcard unit
    ERRCHECK(system->getDSPHead(&systemhead));

    // this gets the ChannelGroup Target unit
    ERRCHECK(systemhead->getInput(0, &systemhead, 0));

    int numinputs;
    ERRCHECK(systemhead->getNumInputs(&numinputs));

    for(int i = 0; i < numinputs && !reverb; ++i)
    {
        FMOD::DSP *tmp;
        ERRCHECK(systemhead->getInput(i, &tmp, 0));

        char name[33] = {0};
        ERRCHECK(tmp->getInfo(name, 0, 0, 0, 0));

        if(strcmp(name, "SFX Reverb") == 0)
        {
            reverb = tmp;
        }
    }
}

FMOD::ChannelGroup *sfxGroup = 0;

{
    FMOD::EventCategory *category;
    ERRCHECK(eventsystem->getCategory("sfx", &category));

    ERRCHECK(category->getChannelGroup(&sfxGroup));
}

// Add a highpass to the sfx category
FMOD::DSP *highpass;
ERRCHECK(system->createDSPByType(FMOD_DSP_TYPE_HIGHPASS, &highpass));

ERRCHECK(sfxGroup->addDSP(highpass, 0));

// Add the sfx category's DSP to the reverb
{
    FMOD::DSP *sfxNode;
    ERRCHECK(sfxGroup->getDSPHead(&sfxNode));
    ERRCHECK(reverb->addInput(sfxNode, 0));
}

{
    // start the music
    FMOD::Event *music;
    ERRCHECK(eventsystem->getEvent("examples/AdvancedTechniques/MultiChannelMusic",
                                   FMOD_EVENT_DEFAULT, &music));

    FMOD::EventParameter *param;
    ERRCHECK(music->getParameter("param00", &param));
    ERRCHECK(param->setValue(2.5f));

    ERRCHECK(music->setVolume(0.25f));
    ERRCHECK(music->start());
}

printf("======================================================================\n");
printf("Press SPACE to play the event.\n");

[/code:1r5itqnc]

  • You must to post comments
0
0

Great stuff! Thank you for the clear explanation!

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.