
If you have a mix running and some vocal phrases are too loud, yet others are too quiet, you've probably tried to compensate by adjusting the vocal level using the mixer's channel fader. This is know as gain riding, and what your brain is doing here is setting a notional level above which the vocal level is considered too loud, after which it sends a signal to the hand telling it to pull the level down. Conversely, if the vocal is too quiet, the brain makes a decision to push the fader up. Conceptually, a compressor is simply a fader controlled by a robot capable of making decisions regarding the level of an audio signal.
An actual compressor has at its heart an electronic gain control device of some kind, which may be a voltage controlled amplifier, a field effect transistor, a tube or a lamp and photocell arrangement. In digital compressors, this is all done algorithmically but the outcome is the same. This gain element takes the place of our fader as it is easier for an electronic circuit to control an electronic gain element than a physical fader.
The decisions as to when to turn the gain down are made in a piece of the compressor's circuitry called the side-chain, which essentially monitors the incoming audio level in much the same was as a person's ears/brain would. The big difference is that being electronic, it can react much more quickly and precisely than a person. However we still need a person at the controls to set the level of the threshold above which the audio is deemed to be too loud. Normally this is done by adjusting the level of the quieter parts of the track so that it is subjectively the right level when compared with the rest of the mix, then setting the threshold value just above this. Unless the audio is too loud, nothing at all happens to it, but when it does rise above the threshold that we've decided upon, the circuitry steps in and turns it down. On most compressors, there's a meter calibrated in dBs that shows how much the signal level is being turned down during compression.
At its simplest, that's it, but most conventional compressors have additional controls called something like attack, release, ratio and make-up gain. Attack is simply another way of saying reaction time, and sets how long the compressor takes to apply gain reduction once the sound has exceeded the threshold. With vocals we want the level brought under control very quickly so we tend to use a fast attack time, but with something like a guitar, bass or drum, we might want to set a longer attack time so that some of the start of the note can sneak through before the compressor has time to react. This has the effect of emphasising the start of the note because it ends up being louder than the compressed sound that follows it. Values of 10 to 20ms are typical in such applications where we're using the compressor to create an effect rather than simply to look after the levels.
Release time is how long the compressor takes to return the gain to normal after the sound level drops back below the threshold. Too short and the abrupt gain change will become noticeable, but set it too long and the gain may still be turned down when the next quieter note comes along so it won't be heard as loudly as it should. An initial release time of around 100ms is usually not too far off the mark, but in most instances, you'll then want to trim this to be as short as possible but without making it so short that obvious gain 'pumping' is audible. Unless of course you want to use gain pumping as effect, which is fair enough!
Ratio simply determines by how much the audio level will be turned down once the track level has exceeded the threshold. The ratio itself is expressed as the number of dB increase in the input needed to get 1dB increase in output level, so if you set the Ratio to 4:1, a signal peak rising 4dB above the threshold will cause the output level to rise by just 1dB. Higher ratios apply more assertive control, and when you set ratios in excess of 10:1 or so, no matter how high the input rises, the output can only exceed the threshold by a very small amount. If you set an infinitely high ratio, you have a limiter where nothing gets past the threshold level at all, but in practice, any ratio over 10:1 has much the same subjective effect.
That leaves us with the make-up gain control. The compressor has been turning down the peak levels of the audio every time it sticks its head above the threshold so we may now wish to turn up the level of the entire compressor output to rebalance the subjective level of the compressed part against the rest of the track. Note that if we turn up the make-up gain so that the peak levels are the same as before, the quieter sections of the audio will also be turned up by the same amount so the effect is the same as keeping the peak levels as they were before and making the quieter sounds louder. It doesn't matter how you look at it providing that you understand that what the compressor is really doing is reducing the difference in level between the loudest and quietest sounds on the track being processed.