Understanding compressor.cpp

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Understanding compressor.cpp

Post by Paul L » Tue Jul 08, 2014 5:15 pm

I am trying to understand the math in compressor.cpp. It isn't hard and I think I understand Compressor's settings much better now.

However there is a dependency on the sizes of buffers in the crucial function Follow. What determines that size?

kozikowski
Forum Staff
Posts: 69357
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Understanding compressor.cpp

Post by kozikowski » Wed Jul 09, 2014 1:55 am

You may be hampered significantly by the fact that developers don't appear on the forum. Gale may know how to post to the developers areas. Koz

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Understanding compressor.cpp

Post by steve » Wed Jul 09, 2014 2:30 am

The size of the buffers are determined by the largest block size of the selected audio, but it is not critical to the compression algorithm because the two buffers are used in circular fashion, rotated as necessary.

See also: http://www.cs.cmu.edu/~rbd/doc/nyquist/ ... l#index286
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: Understanding compressor.cpp

Post by Paul L » Wed Jul 09, 2014 6:38 am

Where do the developers hang out? Nabble?

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: Understanding compressor.cpp

Post by Paul L » Wed Jul 09, 2014 6:41 am

I get it that lookahead in the Nyquist function corresponds to the length of two buffers. But telling me that buffer length is the "block size" doesn't explain it to me. That is not some natural, user visible setting, is it? I'd like to know a typical number.

Nyquist's follow is limited by lookahead when it must correct for a sudden spike -- and it may compromise by defining an envelope that respects the attack and decay times but fails to ride above the peak of the signal. I understand the same can happen with Compressor.

The block size also enters into the determination of the initial value of the envelope -- some comment says this corrects for a sudden spike near the beginning. However, I suspect this has an undesirable effect when I use compressor.

Typically I have the acx standard 1/2 second of silence, then "Chapter 1" or whatever, a pause, and narration. I find that "Chap" is too little amplified and the room noise before it is not raised as much as noise elsewhere.

I think the initial envelope value should not equal the peak found in the first buffer, but rather be less according to the time of the peak and the attack rate, so that the envelope can rise to meet that peak.

Post Reply