Need the formula of all unit in the compressor -- attack,hold, release
On the forum there are several places where the calculation is shown for the peak and RMS compressors.
For the standard compressor that looks like this:
This one the parameters are entered…
Which processor are you using?
Which compressor are you using?
This one the parameters are entered as milliseconds rather than dB per second.
For the Standard compressor, the parameter that is stored in the DSP is the same as all the other compressors which is derived from the dB/second number. What is different in this compressor is that you enter the number as a millisecond of attack or release. So what needs to be done is to translate the millisecond number to dBps (dB per second) then apply the formula to get the gain factor that is applied to every sample.
So here it is. I will separate these as two different calculations.
dBps = dB per second
X = the number entered into the GUI, in this case it is the time in milliseconds.
Tc = Time Constant that is entered into the DSP parameter memory location
ln = natural log. (This will be a constant, no need to calculate this every time.) ln(10)= 2.302585093 on my calculator
fs = sampling rate
Step 1: calculate the dBps
dBps = 20,000/ (X * ln(10))
Tc = 1.0- (10^ (dBps / (10*fs) ) )
Release = Release that is entered into the DSP parameter memory location
Release = dBps / (96*fs)
This is just the number of samples in integer format. It is used as a counter.
Hold = fs * X/1000
Now, when I calculate this using my calculator I get a slightly different number on the last few digits. This means that there is some round-off or truncation happening. For the purpose of attack and release times of a compressor this will not make an audible difference. The numbers are so close.