# Is it possible to leverge built-in DSPs when creating a DSP plugin?

**URL:** <https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311>\
**Category:** FMOD Engine\
**Created:** [June 14, 2023, 1:04am UTC](https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311 "2023-06-14T01:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrane](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chrane](https://qa.fmod.com/u/chrane)\
**Post date:** [June 14, 2023, 1:04am UTC](https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311/1 "2023-06-14T01:04:13Z")

</div>

Say I want to make a multiband compressor and want to leverage the filter and compressor plugin that comes with FMOD, is it possible?

The DSP API seems to only support routing signals to it and doesn’t have a way to pass in audio buffers directly. (I could be totally wrong)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 16, 2023, 12:23am UTC](https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311/2 "2023-06-16T00:23:48Z")

</div>

Hi,

Could you elaborate on how you wish to use this DSP? This may help guide you in the right direction.

---

<div class="post-metadata">

**Author:** ![chrane](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@chrane](https://qa.fmod.com/u/chrane)\
**Post date:** [June 16, 2023, 2:26am UTC](https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311/3 "2023-06-16T02:26:14Z")

</div>

In JUCE the DSPs have a `process` function that takes an audio buffer reference and process it. So to make a multiband compressor in theory the programmer doesn’t have to re-write the compressor and filters. They can make it by: (assuming 3 bands)

1. Construct 3 filters
2. Construct 3 compressors
3. For every buffer block, copy the block 2 more times, pass them into each filter, call `filter->process(buffer)` to get the bands
4. Pass the bands into compressors, call `compressor->process(buffer)`
5. Combine the output buffers from the compressors

Here is an example:

> <https://github.com/matkatmusic/SimpleMultiBandComp/blob/master/Source/PluginProcessor.cpp>

(File `PluginProcessor.cpp`, key functions: `SimpleMBCompAudioProcessor::splitBands` and `SimpleMBCompAudioProcessor::processBlock `)

Does FMOD DSPs also have something similar to the `process` function that takes an audio buffer and outputs the processed result. (Or a way to add DSP callbacks to the out-of-box DSPs)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [June 20, 2023, 11:33pm UTC](https://qa.fmod.com/t/is-it-possible-to-leverge-built-in-dsps-when-creating-a-dsp-plugin/20311/4 "2023-06-20T23:33:48Z")

</div>

Hi,

Thank you for the explanation, while yes this is possible it will be rather messy.

> [@chrane](#):
>
> Does FMOD DSPs also have something similar to the `process` function

Yes, we do. Both the `FMOD_DSP_READ_CALLBACK` and the `FMOD_DSP_PROCESS_CALLBACK` ([FMOD API | Plugin API Reference - DSP](https://fmod.com/docs/2.02/api/plugin-api-dsp.html#fmod_dsp_process_callback)) which allow you to process an audio buffer.

This is the part where it will get messy:

> [@chrane](#):
>
> - Construct 3 filters
> - Construct 3 compressors

It would be possible to pass either a built DSP into another or pass the `System` object which will allow you to build DSP within the ‘top-level’ DSP. However, this could cause race condition issues and other unexpected behavior. In summary, while it is possible to do so, I wouldn’t recommend it - since you’re familiar with JUCE, you may find it easier to implement the filters and compressors yourself, and connect them to the DSP parameters"

I hope this helps
