15 May 2007

dynamics

dynamics

This block is a versatile dynamics processing block that, depending on the parameters on its inlets is a limiter, compressor, expander or noise gate. It can compress, suppress and expand at the same time. Four regions can be chosen, each with their own behaviour. One has to use an argument when using multiple instances of this block in the same patch.

version

v1.0: built 14/05/2007 with Pd v0.40-2 [pd][pdf]

interface

Input 1: the (mono) audio signal input
Input 2, 3, 4: The different thresholds expressed in a dB scale ranging from 0dB to 100dB. (this means that a threshold of -20dB equals 80dB in this scaling)
Input 5, 6, 7, 8: The different ratios R that indicate the behaviour of what happens if the signal level reaches that part.
limiter
R = infinity
compressor
1 < R < infinity
linear
R = 1
expander
0 < R < 1
noise gate
R = 0

Output1: the output audio signal

Display:
In the abstraction itself one can see the input signal level compared to the output signal level and compared to the unity level 100dB (or 0dB). Also g(k) is displayed against unity.

implementation


We use a scheme based on DAFx (p37). The level of the signal is measured to obtain the instantaneous RMS in dB with the env~ block. We take an RMS over 2048 samples. Some moses blocks route X(dB) the right way. Then the following calculation is done:
g(k) = [th + ( X(dB)-th )/R] / X(dB)
The float object f does nothing else but collecting the four routes.
The delay on the original signal is meant to align the samples but is now set on 0, because we haven't made a method yet to discover how long the delay in the other leg is. There is a certain drift anyway, because the gain factor g(k) is often greater than 1 even when all ratios R are 1. TODO

No comments: