Plugin Instrument Async

Can plugin instruments be in an async state to keep the DSP alive until returning FMOD_ERR_DSP_DONTPROCESS? I think the plugin is now instantly released when the playhead gets outside.
For instance, for having a bell ring out, I’d check the loudness and then give it up to be freed under a certain threshold.
Maybe I also mix something up or overlook, how things are handled for instruments.

Hi,

What version of the FMOD engine are you using?

Could I please grab some more information?
Would it be possible to elaborate on the issue or provide some code that I can test? Is this a plugin instrument added to an FMOD Studio project or via code? What is the name of the plugin instrument?

Is there any specific behavior you are referring to?

If this is implemented in Studio, would it be possible to add a Loop Region (FMOD Studio | Glossary - Loop Region) around the instrument to keep the playhead over it until returning DONTPROCESS?

Thanks for the info.

Hi Connor,

Sorry for being so imprecise.
I’m using the header files from 2.02.20 for different wrappers for exported code from cycling74 rnbo and wasted-audio hvcc (pd). The resulting plugins I then use in an FMOD Studio project.
I thought, the best approach for managing the lifetime of an event, is to track, whether the plugin has any output and stop the processing after it became quiet. This works good for effects, but for Instruments I’m struggling, as the plugin is created on play and released as soon as the playhead exits.

In a simplified pseudo-code:

FMOD_RESULT F_CALLBACK FMOD_HEAVYPD_dspprocess(FMOD_DSP_STATE *dsp_state, unsigned int length, const FMOD_DSP_BUFFER_ARRAY *inbufferarray, FMOD_DSP_BUFFER_ARRAY *outbufferarray, FMOD_BOOL inputsidle, FMOD_DSP_PROCESS_OPERATION op)
{
    PluginState *pluginState = (PluginState*)dsp_state->pluginData;

    if(op == FMOD_DSP_PROCESS_QUERY)
    {
        if(pluginState->shouldGoIdle)
            return FMOD_ERR_DSP_DONTPROCESS;
    }

    pluginState->process(inbufferarray[0].buffers[0], outbufferarray[0].buffers[0], length);

    pluginState->shouldGoIdle = pluginState->checkIsSilent(outbufferarray[0].buffers[0]);

    return FMOD_OK;
}

Maybe the whole approach is not ideal or not how it is intended? Maybe there is also way to detect silence using some method from FMOD, but I haven’t found it.

For example I now have a synthesized bell, that plays upon creation and has an envelope-tail. I’d like to set it up, that when the plugin instrument is shorter than the envelope in the timeline, that the plugin finishes playing until it has become silent, also keeping the event alive.
I think, that it should be possible similar to the async mode for all the other instruments.

If i can clarify anything, let me know.
Thank you in advance!

1 Like

Thank you for the information.

Unfortunately, there isn’t a way to implement async for your plugin instrument as we currently have for our built-in instruments. However, I have passed this feature to our development team to investigate further.

There may be some workarounds that will provide the behavior you are looking for in the meantime:

  1. Adding ASDHR (FMOD Studio | Modulator Reference - AHDSR) modulator with the following settings:
    image
    will sustain the instrument for 60 seconds after the play head has moved past the instrument. This could be used in conjunction with a DSP capture to monitor the volume: we have an example setting one up in C# but it may have useful information: Unity Integration | Scripting Examples - DSP Capture.
  • An alternative is using a loop region with the DSP capture listen above and watching for silence to stop the event.

Hope this helps

Thank you for checking and the workaround. That makes sense.
It’s anyways a bit of a luxury problem, but would be cool to do.

1 Like