On the theme of mult-effects for guitar, I have completed a stompbox-style feedback compressor. Here now for anybody who needs a compressor.
[EDIT] Added project to patchstorage[/EDIT]
Transfer Function, now that I got the ratio computation corrected:
Something to notice is a feedback compressor isn't log-linear above the threshold -- in fact the slope is always going to approach infinity:1 ratio as signal level gets large enough.
I have interpreted the ratio as the interception of feedback compressor curve and log-linear prototype at signal level 0dB, assuming threshold is always less than 0 dB. In other words, gain reduction applied to an input signal of 0 dB level will be the same for both the feedback compressor and the feedforward (log-linear) compressor. What happens between threshold and 0 dB differs according to plot above.
It becomes more and more a soft-knee compressor with an increasingly large radius as threshold is decreased. A higher threshold and ratio makes it tend to be more of a hard-knee compressor.
LIMITING | RELEASE | ATTACK
Implemented an envelope follower inspired by a circuit presented in an EDN article by Harry Bissel:
and block diagram
xn is the input
yo is the actual output which mirrors yn
yn is an internal control variable.
t = threshold
k = a constant derived from ratio
g = makeup gain
It's a little different from a typical stompbox compressor circuit. In a stompbox the peak detector would be in the feedback loop working on the output. This topology came about because it gave me a book keeping tool that worked for the way I think. There are several "right" ways to do this. This is an arbitrary selection one of them.