compression is a form of dynamics control and may be one of the most important processing tools. in the world of digital processing, it's easy to slap processors on your tracks and not really know exactly how they are affecting your signal. so let's get a better understanding of just what exactly is going on when we wiggle those settings knobs, shall we?
*quick note: these examples are necessarily simplifications. audio rarely works in such linear and simple ways, nor have I drawn these in any scientific or exacting way - the scales aren't properly logarithmic, time does not flow evenly, nothing is measured, &c. these are merely to encourage a better understanding of the basic principles of compression.
try this exercise: record some midi into your daw with a wide range of velocity. then, select all of those notes and increase their velocity until they start to "max out" at 127, one at a time. finally, pull them back down to one of their "starting points". a la:
this is basically what we're doing with compression, but sort of in reverse. usually with compression we pull the "ceiling" down to flatten out our peaks and then raise the levels back up. but functionally, it works about the same (have a look at the meter on the right...much more flat-topped):
so what's going on here, really? and what do those settings mean? let's slow things way down and have a look:
as you notice in the legend, the yellow line represents the unprocessed signal and the blue line represents the signal as affected by the compressor. with the current settings, the compressor is letting the signal pass unaltered.
now, we pull down the threshold below our signal's peak...
...and nothing has changed. this is because the amount the compressor "works" is determined by the ratio. you can think of the ratio as a "percentage reducer" - that is, it will reduce the amplitude of the signal by a given percentage when it crosses the threshold.
if ratio's are a little unintuitive, think of it as a fraction: if the ratio is set to x:1, 1/x of the "power" of the signal will be preserved above the threshold and the gain reduction will be 1-1/x. let's look at an example:
the ratio is set to 2:1, so once it crosses the threshold (in this case -10) the signal is only 1/2 as strong above that threshold. notice how the compressor is only concerned with what falls in the "red zone" above the threshold. it's as if the signal doesn't exist to the compressor unless it goes above the threshold. therefore, with the 2:1 ratio the compressor doesn't reduce the entire signal by half but only the amount which crosses the threshold. in this case, we went 10db above the threshold and so our 2:1 ratio reduces this signal by 5db.
Let's exaggerate this effect:
with a lower threshold, more of the signal crosses over into the "reduction zone" but still the compressor only affects what goes above the threshold. because of our harsh settings, everything that goes above is reduced by half.
let's continue to look at the extremes by cranking the ratio:
a compressor with an infinite ratio is commonly called a limiter. in this case, nothing is allowed to pass the threshold because only 1/∞ of the signal is allowed to cross this point, per the rules of the ratio, and that is effectively and actually zero.
as always, the compressor only affects what crosses it's threshold. except when it doesn't:
the knee can be thought of as a sort of gradation of the threshold point. it makes the threshold line fuzzy and grey, instead of a binary hard-line system. with our knee set to 10db, the compressor starts to look for amplitude within 10db of the threshold and allows the compressor to act some upon that part of the signal. this has the effect of being "gentler" and more natural and transparent.
up til now, we've ignored the attack and release, some of the most important settings of the compressor:
the attack isn't quite how long the compressor "waits" to work but rather the amount of time it takes to work at full capacity or behave the way it "ought." the exact way this plays out in terms of delay and linearity varies from device to device and this in a large part contributes to the overall "character" of a given compressor, but in most cases the attack is the compressor's way of asking "how long do you want me to spend ramping up to fully-functioning?". used appropriately, the attack setting can preserve the attack of your signal and give your sounds more attack.
I think the easiest way to understand release is to look at sidechain compression:
sidechaining simply means the compressor will perform by responding to a signal different than the one it is affecting. in this case, the green line is the sidechained signal. notice how the compressor is responding to that rather than our yellow input -- when green crosses the threshold, the compressor reacts and "turns on the reducer" according to the amount that green crosses over (16db in this case ... 20/5 means only 4db will make it passed the threshold). but rather than reducing green, the compressor reduces yellow by this amount.
back to release. these animations aren't quite right about when the release "starts", but the basic principle is there: release produces a kind of "pumping" effect. with a longer release, we get more "pump":
compression is your personal android whose single task is to move your tracks' faders with superhuman speed, accuracy, and foresight. she'll follow your instructions to a t but nothing else. there's only a few instructions to give and they're worth understanding to take full advantage of your incredibly powerful and useful partner in music making. but all she can do is wiggle that fader really fast and the rest is up to you!
there's much more to know about compression beyond the scope of this article. here are some good places to start if you want to know more:
iZotope - multiband compression
I mentioned that a lot of my examples are in many cases simplifications of what's really going on inside your processor. this article painstakingly explains some of this in technical detail.