Do you recommend creating 1000 DSPs in advance?

I promise this is my last question!
I need to decide what to do until this weekend, so I’m asking now.

Let’s say I have an app that does these :

  1. Multiple (short) sounds keep being played randomly with random DSPs. (Think of gunshots on the battlefield)
  2. Maximally 1000 sounds can be triggered at the same time.
  3. Two DSPs (eg. distortion, flange) are added to each sound, and those two are all the DSPs in the app.
  4. But the number of the DSP variants (with different values dynamically determined) can be 1000 max.

So my question is :
A. Should I create appropriate DSPs at runtime and release them right after use or
B. Create all the possible DSPs in advance at startup and release them later when the app is closed?

As for the second one, I’m thinking of adding DSPs to the channel group instead of the channel.
So I need to create 1000 channel groups in advance for that as well.
But adding and removing DSPs are no more required in this case because each sound is played on the channel group with the right DSPs already added, whereas the first option requires adding and removing along with creating and releasing at runtime.

I think the first option requires more load time and memory but can perform better with lower latency and less battery power (which I’m more focused on).

Or, the combination of the two can be another option.
Like, creating only when a DSP with specific settings needed and keeping and reusing it until the app is closed.

What do you think?

Ultimately, the best way to know would be to do both and profile the performance characteristics.

I would lean towards creating them on demand though - even sounds as short as gunshots would still be multiple “frames” in duration, and I would not expect those two dsps to have considerable initialisation costs in comparison to their dsp update costs.

1 Like

I see, thanks :slight_smile: