Volume, Pan, Frequency and Voice Allocation handling system
In every game, I've been fighting how to make complex sound operations, and not make them conflict. You know, imagine the scenario that you need to globally slow down the frequency of every sound by 50% - but you already have a lot of things affecting the frequency of various samples. Or, let's say you need a bomb to explode which is so loud that it "eats up" all the other sounds, then they slowly fade back - while not having that mess up all your other volume settings in your game.
This is the solution I finally came up with. When you need to play a sound, create a "sound emitter" object and configure all its settings. If you allocate a range of channels it'll play on, it'll pick a free channel, or if none is free, it'll pick the one that last began playing a new sound.
Now, let's say you've decided to put all your sound effects on channel 5-15, and you want to set the frequencies of all those channels to half. That's where the modifiers come in. Clone one of the modifier objects, or even create a new one at runtime. Set the range to 5-15 and set the frequency multiplier to 50% and the rest happens automatically!