Closed jrigg closed 7 years ago
The spot shows exactly the state of the compression when a frame is rendered on screen. Try turning up Release and see that it starts getting steady. If we add some kind of envelope to smooth it out it wouldn't show its real processing anymore.
The Compressor (stereo) shows a stationary spot when the same sine wave is connected to the input with the same nominal settings. I realise the algorithm for the Mono Compressor is different, but I wouldn't expect such a dramatic difference on the display. It flickers over a 10dB range with a 1kHz input, rising to 20dB range with a 100Hz input. If the compression was varying that much I'd expect to see severe distortion in the spectrum analyser, but the output signal is very clean. (I'm using jaaa to generate the sine input and analyse the output).
The spot does not become steady when the release is turned up to maximum, even at 10kHz input.
I just noticed something else that could be relevant. If I set the input frequency to a 1/(2^n) sub-harmonic of the sample rate (eg. 3kHz, 6kHz, 12kHz etc. at 48kHz SR) the spot is much steadier.
Jaaa produces the cleanest sine waves at these frequencies. At others there's some phase noise (jitter) visible in the analyser, but it's below -100dB, which is so small I wouldn't expect it to have a visible effect on the compressor display.
I can confirm this behaviour. Mono Compressor's graph jumps around like crazy.
After short code inspection it looks like a bug to me.
The stereo compressor does the signal amplitude estimation (including filtering) first, so it gets a clean signal level that is used for the X coordinate of the graph, and the Y coordinate is calculated from that based on compression curve.
The mono compressor computes the point on the curve based on the instantaneous sample, and the filters the output of that using the attack/release stage. The X coordinate is based on desired signal level passed through a simple IIR lowpass with fixed coefficient of 0.5 regardless of attack/release and the sample rate.
Also, the Peak/RMS setting doesn't seem to do anything in terms of audio output.
I'm trying to come up with a decent way to recover the signal level from the existing data, but haven't found anything sensible yet.
I've changed the way the dot location is calculated in 60701371ec62af6798943a069808d9b299497d4d. It's still mostly fiction, but it's more useful fiction this time.
The spot on the line graph display in the Mono Compressor flickers randomly up and down the line, making the graph unusable. This is with a constant amplitude sine wave input, in both calfjackhost and LV2/jalv.gtk. The compressor appears to work OK and the bar meters look fine. Calf compiled from current git on Debian 8 amd64.