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.
- Envelopes. Automated adjustments of gain, pitch or pan etc. Already replaced old code for fading music in and out.
- Audio bus hierarchy. Apply parameters to all related sounds in one place.
- 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.
- 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.