A compressor's role is to reduce the dynamic (volume) range of the audio file or instrument onto which one is inserted, effectively lessening the volume gap between a part's quietest and loudest moments. It's easiest to think about this when a compressor is applied to a long, dynamic part such as a lead vocal, though of course an individual drum sound has a dynamic range too—these start with a loud initial hit and fade to silence, so drums have a wide dynamic range, it's just that this range plays out over a short period of time. We'll see how compressors can help shape drum sounds a little later, but first let's see what they do for longer parts with less predictable dynamics.
To understand how compressors work, it's worth analyzing their key parameters to understand how these combine to reduce dynamic range. In this picture, you can see how volume rises if a sound starts from silence and grows to maximum volume along a linear path.
The first parameter common to all compressors is Threshold which sets the point above which dynamic change will occur. By placing the Threshold point in the middle of this volume rise, the quieter section of the sound will remain uncompressed, while the upper section will have its dynamics compressed.
The extent to which the level of the audio above the Threshold Point is reduced in volume is set by the Ratio. A Ratio of 2:1 will ensure that the volume above the Threshold only grows to half its original volume, whereas a Ratio of 4:1 will reduce the volume to a quarter of its original. The greater the Ratio "number," the greater the volume reduction applied to the compressed section of the audio file, as you can see here.
What this means is that the overall dynamic range of the sound changes. Whereas the original dynamic range is "total," the new dynamic ranges are smaller. If you set the Threshold point in the middle of a linear volume rise like this and set a ratio of 2:1, the new dynamic range will be 75% of the original. If you set a ratio of 4:1 it will be 62.5% of the original.
You can see the colour-coded new dynamic ranges for these compression values over on the right-hand side. As these show, using Threshold to determine the point above which compression occurs and any Ratio value above 1:1 (where no compression would be applied), the dynamic range and the volume of the sound decrease. Often, producers use compression to ensure that volumes appear "louder" than their uncompressed equivalents. So how does that work? If compressors reduce volume, surely the processed audio will be even less easy to hear than the original?
To understand how compressors "add" volume, we need to jump to their final parameter, that of Output Gain. The final stage of any compressor allows you to "make up" volume levels to restore the loudest moment back to the level you want. In this image, you can see that by boosting Output level—often referred to as Make-Up Gain—both the Yellow and Orange compressed signals have been returned to their original volumes so that their loudest points match those of the original, uncompressed signal.
Crucially, you can see how much of the original dynamic range is removed altogether by noting the "lost volume" dotted lines at the bottom. Effectively this means that this portion of the original dynamic range simply no longer exists in the compressed versions of this sound, meaning that the quietest parts of these linear sounds start at 25% of maximum level (2:1 Ratio) and 37.5% of maximum level (4:1 Ratio). In turn, this means that the quietest moments of the compressed sound will be easier to hear, as their levels are boosted, while the loudest moments remain as loud as they were in the original. So, average volume levels have been boosted in both compressed versions of the sound.
Now let's look a more extreme version of compression. Again, let's start with a sound which fades in from silence to maximum volume but this time we're setting Threshold much lower so that almost as soon as the volume is heard the compressor sets to work. We're also setting a higher ratio of 8:1 so that the amount of compression applied is high.
You can see the vast difference in the dynamic ranges between the compressed and uncompressed signals on the right, where the compressed level represents a tiny proportion of the original's full range. Applying Make-Up Gain here produces an incredible amount of "lost volume," meaning that as the loudest moment is restored to maximum volume, a huge amount of the quietest parts of the signal are also substantially boosted in volume.
Again, this means that the audio file will always be heard. If a sound with this amount of original dynamic range featured within a track alongside other instruments, it's inevitable that the quietest parts of its volume would be drowned out by competing elements within the mix. After such heavy compression, it would be audible at all times.
Extreme forms of compression like this are referred to as Limiting and if the DAW you use features a dedicated Limiter, you now know that it applies an extremely high Ratio (perhaps even as high as infinity:1) to levels above a Threshold Point to prevent them getting any louder than this level, before automatically or manually allowing you to boost volume to bring levels up. This "flat line" approach to dynamics reduction can be hugely effective on certain parts of a mix but it would be wrong to think that the answer to balancing levels in your track is simply to squash dynamics on every part. Dynamics play a huge role in ensuring the parts within your mix ebb and flow and sound natural and mix headroom will be compromised hugely if everything is simply made as loud as possible.
Of course, it's also true that it's highly unlikely that parts within your mix will start from silence and fade up to maximum volume. While the above graphs demonstrate how compressors would work with signals with predictable amplitude rises, most audio files rise and fall in less predictable ways. Vocal parts, in particular, frequently register on the "fairly quiet to fairly loud" scale, with phrases and individual notes rising and falling depending on the strength of the performance, their recorded level and the demands of the backing track over which they have been recorded.
Now that we know how Threshold, Ratio and Make-Up Gain work, we can start to think about compression settings for parts like this. Again, it helps to work backwards from the loudest moments in a performance. Frequently, vocals suffer from having levels which are too quiet in some places but too loud in others, so that while some sections of a performance dip below a level to render them unintelligible, other notes might stick out too much. The best way to approach vocal compression, then, is to place the Threshold somewhere towards the middle of the overall dynamic range, while setting a Ratio level which provides adequate volume drop to pull down the level of the louder notes. Lastly, use sufficient make-up gain to bring up the levels of the quieter sections which are being drowned by competing tracks.
There's no way to specify exactly which settings will work best as the variables of the style of music you're making, the recording levels of the vocal performance and the competition for space within a mix are just a few key components which make providing default settings impossible. In this way, be hugely careful about loading compression settings from preset menus—as no preset list can analyze your track's needs. You'll achieve much better results configuring compressors yourself rather than hoping a preset will achieve a better result.
The other parameters within more comprehensive compressors extend to Attack, Release and Knee levels. All three of these allow you to determine how "naturally" compression settings will be applied. In the grabs above, you can see how the volume increase lines sharply change at the Threshold point, with obvious deviations above this level as the sound moves from uncompressed to compressed. This point is referred to as Knee as, like a real knee, you can either see a steep, acute angle at this point (imagine your leg in a sitting position), or a more gradual slope (including your knee-cap) if your leg is stretched out in front of you. Compressors refer to Hard Knee and Soft Knee to describe these approaches, the latter of which allows for the volume to briefly continue along its original, uncompressed path, before bending in the direction of the Ratio level as you can see in this image.
Attack and Release times set the speed at which compression settings are applied as the sound passes through the Threshold point as it gets louder (Attack) and as it converts back to uncompressed from compressed as it gets quieter (Release). These controls can have a radical approach to the resulting sound.
Let's suppose you have a kick drum which features quick Attack and an even Decay speed so that over a total period of 500ms the sound attacks and decays to silence. You want to use a compressor to "lengthen" the sound by compressing the Decay period so that as the volume naturally tails away, the compressor fights this volume drop, pushing up its level in the process. Obviously, having Threshold and Ratio controls alone wouldn't achieve this goal, as the sound would be compressed instantly, thereby compressing the initial Attack as much as the subsequent Release. However, by setting a longer Attack time the hit point at the start of the kick will be ignored altogether by the compressor, with its parameters only starting to work on the sound later on, achieving the result you want.
By setting the Attack Time at 100ms, the whole of the beginning of the sound would remain uncompressed, while the following 400ms of the sound would have its dynamics processed in accordance with your compressor's settings.
This is how producers use compression to shape the sounds of their drums by choosing bespoke settings for each percussive element in turn. Remember, for best results, each drum hit will need to be on its own channel. You'll get a different result compressing a kick drum separately from a channel which features both kick and snare simultaneously, for instance, as the compressor will only have one sound to process rather than two.
Of course, like most effects processes, as well as having a literal role to play, compressors regularly have their parameters creatively abused by producers to produce alternative effects. Compression is one of those effects which, when used literally is barely heard. As it's rare for an individual sound to be heard both compressed and uncompressed within a mix, the listener isn't treated to before and after versions of compression within a track. As an alternative, consider how changing levels of reverb are regularly applied through a track, or the way that delay effects might be switched on and off to highlight particular phrases or words.
However, some of the more alternative treatments using compression are designed to reverse the naturally transparent nature of compression. The best example of this is side-chain compression which is now a common trick used in many genres of dance music. Usually, this works by inserting a compressor into the output channel of a mix so that the entire mix is subjected to dynamic range treatments. However, rather than simply allowing the compressor to respond to the natural dynamic contours of the track, it receives a separate input via a side-chain channel. In this way, it "listens" to the secondary input and responds dynamically to this instead. You can, of course, feed any signal in as a side-chain trigger but the most common use of this trick sees the kick drum part used so that every time the kick plays the output of the compressor (which, remember, will affect the entire mix if used in the output channel) ducks, producing an obvious level drop. This technique is clearly heard in tracks like Eric Prydz's "Call On Me" but it's been used on thousands of other tracks too, producing a deliberately warped, sucky result. You can hear before and after examples of how such tricks can be effective below.
So now you know how compressors work, you can go forth and apply them literally, or with deliberate, dynamically-oriented creativity in mind. One last point: While compressors are fantastic tools for lessening dynamic range, it would be wrong to think that, in most cases, a compressor alone will provide such smooth dynamics that every word or phrase within a vocal part, in particular, will be perfectly balanced from start to finish using compression alone. The reason DAWs feature volume automation tools is because they are nearly always needed—alongside compression—to create the illusion of perfect level balance throughout a track. If you find you still have words or phrases poking out of your mix, don't assume your compression settings are wrong. If you've found a compression treatment which works for a good proportion of your mix, you've got it right and volume automation will happily help you balance the remaining trouble spots.