D2 log 064 – Audio improvements

Before recording new sound effects and adding music, I want to improve the audio engine a little bit.

In this first part, I implemented some fundamentals.

  1. Envelopes. Automated adjustments of gain, pitch or pan etc. Already replaced old code for fading music in and out.
  2. Audio bus hierarchy. Apply parameters to all related sounds in one place.
  3. Lowpass/highpass filter. This has been on my wishlist since Superforce and I finally got around to it. I used this article as inspiration but the code is 100% rewritten for clarity & performance.
  4. Limiter. Safety guard to avoid clipping.

The big payoff for these features will be ducking. To make important sounds stand out, I want to suppress the less important ones. This can be done with gain but also applying the lowpass filter could make it sound even better.