Skip to content

Conversation

@brainrake
Copy link

@brainrake brainrake commented Jan 20, 2026

This PR adds a new filter type: Lookahead Limiter. Draft since I'm still testing.

It delays the signal by the attack time, detects peaks in advance and smoothly ramps gain reduction
to reach the required level exactly when the peak arrives. After the peak passes, the gain
is restored using an exponential release curve.

One second buffer is always reserved to avoid runtime buffer growth, so attack is limited to this maximum.

@HEnquist
Copy link
Owner

HEnquist commented Jan 20, 2026

Thanks, is is a useful addition!
The way it's done now would work just fine in a stereo setup, where you would want the same limiter settings on both channels. But I'm thinking a little about how to handle the case when using this on a multiway-system. For example one might want different limiter parameters on a subwoofer than the rest of the system. Now the delay is the same as the look-ahead time, so in order to have different limiter settings on different channels, one would need to add some delay filters to compensate (and remember to adjust them when needed) . It could be useful to have an optional delay setting for the limiter. That way you could, if you want, have a fixed (longer) delay that isn't linked to the limiting parameters.

I'm working on finishing up version 4 of CamillaDSP in branch next31. Could you change the target to that branch? I don't think there are any changes that would cause trouble.

@brainrake
Copy link
Author

Cool! Multiway speaker system is my use case. I was going to use a custom UI and do delay compensation in there. If more is needed, I'd rather look into pipeline-level delay compensation as found in DAWs instead of a single-component fix, but there might be blockers.
I'll change the target.
I found some bugs while testing (clipping lol) so I need to go over it again and maybe add more test cases.
I also want to optimize the component so it scans each chunk only once for peaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants