Page 1 of 1

Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 1:30 am
by Paul L
Look at this picture, and this code:

Code: Select all

(cond
 ((arrayp s)
  (let*
      ((tiny (db-to-linear -200))
       (ceiling (db-to-linear -0.01))
       (quotient (prod (s-max tiny (s-abs (aref s 0)))
                       (recip (s-max tiny (s-abs (aref s 1))))))
       (left (s-min ceiling quotient))
       (right (s-min ceiling (recip quotient))))
    (vector left right)))
 (t "Stereo sound please!"))

See what I did? Using Audacity's compressor, but I could do this to examine the behavior of other compressors and limiters too.

Re: Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 2:55 am
by steve
Nice :)

By the way, Robert has a nice way of writing a very small number:

Code: Select all

1e-15

Re: Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 3:18 am
by Paul L
So compressors with "soft knees" ought to make less angular curves. Does it make a difference to trained ears?

Re: Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 10:04 am
by steve
The more gradual the change in gain, the less noticeable it should be. However, we need to make compromises. If a limiter changes the gain over a period of many seconds, then the effect will be virtually imperceptible, however, it will not then be acting as a "limiter". For a limiter effect we want the gain to change rapidly.

Re: Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 3:43 pm
by Paul L
I was using the shortest attack (.1 s) and release (1 s) available in Compressor. The first affects the upward slope of the curve (which are regions of decreasing gain) and the other the downward. Threshold, ratio, and makeup all influence the extremes the curve moves between. Attack and release are the shortest times permitted for moving up or down from one extreme to the other.

I don't like it how noise is brought up more after quiet words than after loud words.

I know from reading the code, and this diagram confirms, that the effect of noise floor is to make the curve stop falling when sound is low -- but it has no effect on just where that curve plateaus, thus noise comes up more, if what preceded noise was under the threshold for nearly a second.

It's not working like an expander combined with a compressor.

Re: Reverse-engineering your compressor

Posted: Fri Jul 18, 2014 8:02 pm
by Paul L
steve wrote:The more gradual the change in gain, the less noticeable it should be.
I think that's a matter of the slopes of the gain curve I plotted, whereas a soft knee means making that slope change continuously when the curve hits its bottom. Is that really important too?