Compressor: shorter attack/release times?


Don’t know if this is the right place for a request like this, and if it’s not please accept my apologies.
I’ve been using Audacity 1.3.12 on Ubuntu 10.04 for some time now (.13 won’t compile correctly for some reason, but it’s OK) and I really like the default compressor effect, especially when using peak instead of RMS compression (the latter might bring less pumping in some cases, but it doesn’t make the overall volume much louder, and it tends to produce spikes). Anyway, I’d like to know why the minimum attack and release times are so slow, especially the latter. Although other compressors I’ve tried in the past (like Adobe Audition’s “dynamics processing”) are not as user-friendly, they do offer a wider range of attack and release times measured in milliseconds, which I think is much more logical and offers more possibilities for the user. I agree that too short attack times are killing music, but 0.1 seconds (100 milliseconds) is still too slow for some sources, especially those with prominent percussion. I’d like to try something intermediate, like 50-75 milliseconds for percussive sources, with 100-500 milliseconds release time (1 second release time is too slow too, IMHO).
Would it be a problem to add this little feature in some future version?
Thanks in advance! :wink:

Traditional processing chains use two devices: The first one is slow and sloppy and is used to set overall volume. The one after that is a peak limiter and is a good deal more aggressive.

CBS Audimax and Volumax for one early example.

This is a rolicking, free-wheeling radio talk show “Wait Wait” on the local NPR station.
Picture 1.png

It sounds perfectly natural – no pumping, ducking, or other annoying program artifacts. It’s also perfectly FM Legal and listenable in the car.

You can follow the gentle Compressor effect with the Leveler effect and get similar results. I think somebody posted an actual peak limiter with suitable controls.

I noticed in multiple postings that you never address the music. Right in the first paragraph of Chris’s Compressor he posts the reason for all the coding. He’s trying to listen to opera in the car.

The latest version of his work is 1.2.6 and runs very, very well.

– Chris’s Compressor

What is your goal?


We may be able to help you with that - in fact if you want to build from source then I’d recommend building from SVN (the current development code).
Audacity development is currently frozen (no new features, just bug fixes) until Audacity 2.0 is released, so I doubt that the Compressor will be changed until after 2.0 is released. However, if you build from source it may be possible to hack the code to achieve shorter attack / release times (I don’t know why it’s called “Decay” in Audacity, the correct term is “Release”).

There is a brief step-by-step guide to building Audacity on Ubuntu that should work: Missing features - Audacity Support
Have a go at that and if you hit any problems start a new post on the Linux board

If you want to test that the build works before installing, after the step “./configure” don’t do “sudo make install”. Instead, do:


Then wait (ages) for it to complete.
Assuming it completes without errors, you can launch the new build with:


After testing, assuming everything is OK you can uninstall 1.3.12 in using the package manager, then install the new version (1.3.14) by running:

sudo make install

The compressor in Audacity is designed to even out the volume across a recording that has a large dynamic range. It is not designed for maximising loudness. For maximising loudness you would want a faster Attack/Release and ideally also have a “limiter” (a second stage compressor with an extremely fast attack/decay and a very high ratio).
For evening out the volume without any noticeable compression, slow attack / release times are needed. It’s the same reason why “RMS” is the default rather than “Peak”.

Another feature of the Audacity Compressor is that it uses “lookahead”. That is, the compressor will start to kick in before the audio level crosses the “Threshold” level. This is useful in that when used with Peak detection, percussive peaks can be caught by the compressor even with slow attack times.

You can follow the gentle Compressor effect with the Leveler effect and get similar results. I think somebody posted an actual peak limiter with suitable controls.

I’ve tried the Leveller a few times and it distorts the sound quite a bit. Don’t really know what exactly that effect does, nor there is any documentation about it AFAIK, but as a compressor-limiter it is not what I am looking for. In some cases, even with gentle to moderate settings I got some ugly distortion, so I am not using that at the moment.

Right in the first paragraph of Chris’s Compressor he posts the reason for all the coding. He’s trying to listen to opera in the car.

I know Chris’s Compressor (RIP by the way; poor Chris passed away a few months ago) and it’s really good, especially for classical music and some progressive rock sources, but mainly “drum-less” music or without a prominent rhythmic track that creates aggressive transients. Not that you can get any pumping with it, because of its “look-ahead”, but if it finds a percussive transient it gradually reduces the volume and that may be a bit annoying sometimes. It’s good for, say, Ravel’s “Bolero” and Mike Oldfield’s “Tubular Bells”, but not for Metallica, if you know what I mean. One example would be the latter’s “Enter Sandman” song, on which Chris’ Compressor would gradually decrease the volume on the intro almost from the start to prevent the aggressive bass drum that follows, which makes the compressor unsuitable for this particular source.

I noticed in multiple postings that you never address the music. (…) What is your goal?

I like my music rich and dynamic… at home. I mainly use compression for music on my portable player/cell phone/car CD player, to listen to it in noisy environments like the train, the city streets, our car, etc. I’ve found really useful plugins that offer nice peak limiting without ugly distortion, but that is the last step for me. Because much of the music that I listen to has a wide dynamic range, in many cases I must apply compression before (or instead of) limiting to even the overall loudness a bit. I am perfectly happy with the way Audacity’s built-in compressor works… except for the attack and decay times, which are way slower than those on most software compressors (no idea about hardware compressors). With a 0.1 sec attack time I can hear the compressor working (slight pumping effect) in some transients, which would not happen if the attack/release times were a bit shorter (like they are on most plugins btw). Again, I get great results with Mike Oldfield’s “Tubular Bells” (which is unsuitable for portable playing without compression) and “Amarok”, but I can hear it more clearly in Led Zeppelin’s “In My Time of Dying”, when John Bonham’s powerful drums make their entrance after the soft, bluesy intro, or in Pink Floyd’s “Shine On You Crazy Diamond”, where I get a (very) slight pumping on the snare drum.

Hope I made myself a bit clearer this time. This is not a crucial request for me, as I am pretty much happy with how the compressor works, but it would be nice if it worked with milliseconds like most other compressors to avoid those small issues that I noticed. Maybe I’m a bit too fussy with DRC artifacts… :wink:


Sorry Steve, it seems you posted your reply while I was typing mine, so I didn’t get to see it on time. :slight_smile:
I know the compressor is not made for maximizing loudness, I found some useful plugins for that. There’s a nyquist plugin called “Broadcast Limiter III” which is very good (not to be confused with an earlier version called “Broadcast limiter II”, which adds some ugly distortion to the waveform).
I just would like the built-in compressor to be more ‘flexible’. Some compressors change from expander to compressor then to limiter (or “infinite compression”) gradually, if you know what I mean. I am not complaining about the way it works, I’m just asking for some extra tweaking that would make it more useful in some (few) cases.

There’s also a “soft clipping limiter” effect that works in a similar way to “Broadcast Limiter II / III” (they are all “wave shaper” effects). but it’s a bit less aggressive (less distortion) than either of the broadcast limiters. Obsolete version sclimiter.ny See later post for new version.

I know exactly what you mean and I quite agree.

Thanks for the plugin!
On a quick try it gives excellent results and it sounds awesome. But unlike the Broadcast Limiter III, it seems to allow some actual clipping (shown in red), whereas the BL-III seems to keep the top amplitude at around -0.3dB.
Anyway, I have to play more with it and on different sources, but it looks very promising. Thanks a lot!

Assuming that the selected audio is not greater than 0 dB, the output may touch 0 dB (and thus show a red line if Show Clipping is enabled) but will not be above 0 dB. If you want to limit peaks and leave the audio at the reduced level (without applying make-up gain), set “Apply make-up gain” to 0.

Update : I’ve spotted a minor bug in the plug-in. If the level of the final sample in the selection is high, then it may be amplified incorrectly and end up at a very high level. The bug is fixed in this version: sclimiter.ny

Thanks a lot, Steve!
The more I play with it, the more I like your limiter. I don’t know anything about Nyquist, but… why not use part of the code to make a general purpose compressor?

There are some limitations to what can be done with Nyquist plug-ins, particularly in terms of the user interface. It is not possible to display a graph like the Audacity Compressor does - it’s limited to just sliders, text input boxes and drop down menus (see the three types of “widgets” described here: ). Also, “Preview” is not available in Nyquist plug-ins so it would have to be used by trying it on a section, and using Undo if it’s not quite right then redoing with revised settings.

Other than that it is quite possible to create a compressor as a Nyquist plug-in, though creating a really good one is not an easy task.

A typical hardware compressor would have controls for Attack, Hold, Decay, Threshold, Ratio, Knee, Limit and Output Gain. A software version would often also have an option for lookahead in the main compression section and may have options for RMS detection rather than Peak, and Output Normalizing. Hardware compressors frequently implement lookahead for the limiter stage by delaying the output signal by a few milliseconds but can’t implement a long lookahead as the audio would need to be delayed too much.

A Nyquist interface for a traditional general purpose Compressor might look something like this. Do you think something like this would be useful or is it too complicated?

Just as a point of interest, this is the code for the mock-up compressor.
dummycompressor.ny (953 Bytes)

If you could write the code to implement that interface I would be very interested in trying it. I’d love a simulation of a traditional hardware compressor without the quirks of the Audacity Compresser and Leveller, and with more adjustment than Chris’s Compressor.

I don’t think I’ve ever encountered a “Hold” control on a hardware compressor.

– Bill

Yep, I think that would make a really cool compressor (except for the fact that it, just like Audacity’s built-in compressor, shows attack and release times in seconds instead of milliseconds, but I see it offers ‘o’ as a possibility). I don’t care about the graph, as I never really look at it. I only care about understandable controls, and those definitely are.
I’d love to try that compressor of yours when it’s finished. The fact that it lets you choose between RMS/Peak and Soft/Hard knee is a good point. I’ve never seen the “Hold” control before. What is it?

When audio crosses the threshold level, the gain (amplification) of the audio is reduced so that the audio gets louder to a lesser degree.
When the audio drops below the threshold, the gain goes back to unity (1:1) so that the audio below the threshold is unchanged.

If there are a series of high peaks, the gain will start to drop when it hits the first peak then start to rise back to unity after the peak, then start to drop again due to the next peak, and so on. Although setting a slow release time will lessen this, there may still be audible “pumping” unless the delay time is set very long, which may not be desirable.

The “Hold” parameter tells the compressor that after the threshold has been crossed and the gain reduced, the gain should remain at the reduced level for a certain length of time. There is a delay before the Release stage occurs. In the case of a series of peaks setting the Hold parameter to a little longer than the space between the peaks will keep the gain at a constant level between the peaks so there will be no “pumping” effect.

Hold is particularly useful if compressing low bass and using fast Attack / Release times. In such a case, without “Hold” the compressor will start to kick in on each peak and will distort the waveform, thus changing the tone of the sound. The “Hold” duration can be set to a time longer than a cycle of the lowest frequency, thus preventing gain changes between the peaks of the waveform (50 ms is sufficient for frequencies down to 20 Hz).

The Hold parameter is the least common of these controls and I don’t know if there is a “standard” way to implement it. For example, the Hold control could be a set delay before the Release stage, or it could be a minimum period between the Attack and Release stages. Although it can be useful, as it may be unfamiliar to many, it may be more user friendly to leave it out?

An alternative approach could be to do away with most of the controls and have presets for different types of job.

For example:

Classical: → Slow Attack / Decay times to even out gradual changes in RMS level.
Dialogue: → Medium Attack/Decay/Hold times to even out levels between different voices in a conversation.
Rock: → Similar to Classical but with a Limiter
Dance: → Fast Attack plus Limiter
Hard Maximize: → Fast Attack/Decay plus Limiter

And then just two controls, one for Threshold and one for Ratio.

No, I would keep the Hold slider. If I didn’t want to use it, I’d set it to zero and that’s it.
About presets, I would only include them if there is also a manual alternative. Presets + threshold + ratio would reduce the user’s options IMHO. I am not a fan of presets, honestly. They’re good for beginners, but once you have experimented for a while you feel there should be more options. And they may be confusing, as there are rock music sources that really need a fast attack, (prominent, aggressive drums on most metal recordings, for instance).
I would keep it just the way it is now. Yum!

Anyway you don’t have to do this, Steve. I’ll be glad to use it if you do, but it looks like a lot of work. My suggestion was for the built-in compressor, I never asked for a new nyquist compressor from scratch… But if you succeed, I’ll start campaigning for it as the new Audacity built-in compressor!

Yes it would be quite a lot of work, but it could be an interesting and worthwhile project. Don’t expect it quickly :wink:

Have you looked again at building from source?

Yes I did, but same thing happened. “Configure” runs fine, but I get errors while doing “make”. Until I find a solution, .12 works perfectly fine for me.