|
Gin
|
Zero crossing maximizer. More...
#include <gin_maximizer.h>
Public Member Functions | |
| Maximizer ()=default | |
| ~Maximizer ()=default | |
| void | setSampleRate (double sr) |
| void | setNumChannels (int ch) |
| void | setThreshold (float db) |
| Level the half cycle peaks are scaled back to, in dB. | |
| void | setCeiling (float db) |
| Output ceiling in dB. | |
| void | setRelease (float seconds) |
| How long the gain takes to recover 6 dB, in seconds. | |
| void | setMaxCycleLength (float seconds) |
| The longest half cycle the maximizer will hold, in seconds, which is also its latency. | |
| int | getLatencySamples () const |
| Latency in samples. | |
| void | reset () |
| void | process (juce::AudioSampleBuffer &buffer) |
Zero crossing maximizer.
Not a lookahead limiter. Audio is buffered a half cycle at a time - from one zero crossing to the next - and the peak of that half cycle is measured as it goes by. At the crossing, if the peak overshot the threshold, the whole half cycle that was just buffered is scaled back so its peak lands exactly on the threshold, and the output is caught up from the buffer.
The point is where the gain changes happen: only ever at a zero crossing, where the signal is silent, so there is no step in the middle of a waveform to hear. A conventional limiter has to move its gain while the waveform is doing something, and spends attack and release time trying to make that inaudible.
Latency is one buffer - see setMaxCycleLength(), which sets how long a half cycle can be before the maximizer gives up and restarts on it.
Key Features:
Usage:
|
default |
|
default |
References setRelease().
Output ceiling in dB.
Everything between threshold and ceiling is made up automatically, which is where the loudness comes from.
How long the gain takes to recover 6 dB, in seconds.
0 disables the release entirely, so every half cycle is scaled on its own merits.
Referenced by setSampleRate().
The longest half cycle the maximizer will hold, in seconds, which is also its latency.
The default 50 ms covers everything down to 10 Hz. Anything longer is restarted mid cycle, which is audible, so raise this rather than lower it if the source has real subsonic content.
| int Maximizer::getLatencySamples | ( | ) | const |
Latency in samples.
One slot short of the buffer, because the sample being written is the one read out a whole buffer later.
| void Maximizer::reset | ( | ) |
| void Maximizer::process | ( | juce::AudioSampleBuffer & | buffer | ) |