Closed frm-dsp closed 2 months ago
Looks good. Please give me some time before I merge, as I'm on a journey for a week. I'll checkout when I'm back
Okay, I've some headache with the introduced latency. Given that the limiter is only meant as a last resort indicate that your gain staging have issues, not something to relay on or us as a effect (My usual reaction is when it kicks in to rework my gain staging) . Keep in mind it runs for ever, means, for a lot of users it may introduce latency while they never ever reach the state were the limiter interact. That will become more notable when using guitarix as vst plugin. There even a latency of some samples may already introduce a phasing issue. Don't get me wrong, I like your attempt for a limiter, but, I would prefer to adapt it as a effect (plugin) instead replace the hardlim.
I have been playing with it over the last week and tend to agree with the latency being an annoyance. If you are playing with the code directly, try setting "min_input_frequency=75;" or even higher. I find that much more playable. I even tried up to about 250. I don't have a bass to test really low frequency, but I suspect it would work. I think the compromise for lower latency is more distortion on each initial attack of the limiter. In practice, I found the trade of faster attack (higher min freq) to be almost unnoticeable with the soft clipper.
As you say, if you are hitting the limiter, you should probably fix something earlier in the path.
In addition to your separate plugin idea, another option would be add an either a couple of preset buttons, or maybe "attack" and "release" knobs on to the left of the limiter bargraph, and then it is up to the user.
In any case, something should be done to fix the poping and clicking.
I didn't follow your comment on phasing on my first read. I think it will be difficult to get a limiter that does not introduce distortion in only a few samples.
Is is possible to tell the plugin host (the DAW I am thinking) that the plugin has a fixed delay and let it take care of compensating for it?
Original issue resolved by merged pull request #175
The new limiter uses a different envelope following technique, followed by a soft clipper. The timing of the limiter envelope is also now synchronized with input signal by appropriately delaying the output. The latency is configurable based on lowest expected signal frequency content.