[music-dsp] Soft-knee algo & implementation

Citizen Chunk citizenchunk at nyc.rr.com
Sun Jan 4 15:12:01 EST 2004


thanks for the reply, Steve. do you have a version of this in purely 
linear values (i.e. not dB)?

On Jan 4, 2004, at 5:25 PM, Steve Harris wrote:

> On Sun, Jan 04, 2004 at 04:42:24 -0500, Citizen Chunk wrote:
>> Soft is a parameter that controls the width of the soft-knee. at Soft 
>> =
>> 0, the knee is nonexistent, and hence, "hard". at Soft = 1, the knee
>> extends from the threshold^2 (in dB, this would be double the
>> threshold) to some intersection above the threshold. i can't seem to
>> figure out a formular for this intersection, which would be my
>> softThreshHi.
>
> FWIW, I use:
>
> 	  rs = (ratio - 1.0f) / ratio;
>
> 	  if (env <= knee_min) {
> 	    gain = 0.0f;
> 	  } else if (env < knee_max) {
> 	    x = -(threshold - knee - lin2db(env)) / knee;
> 	    gain = -knee * rs * x * x * 0.25f;
> 	  } else {
> 	    gain = (threshold - lin2db(env)) * rs;
> 	  }
>
> (gain is in dB's, knee is the knee radius in dB's)
>
> I dont remember exactly how I came to that, but if I remember 
> correctrly
> its continuous for env = knee_min and env = knee_max, its a simple
> quadratic expression.
>
> - Steve
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book 
> reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>




More information about the music-dsp mailing list