[square root of 2]······>amplitude compensation factor (so that a full blast sinusoid input, with a distortion amount of 1 [no distortion], is output as a ±1 signal and not as a ±0.707 signal).

INPUT: SINUSOID (distortion amount: 1, this means no distortion)

When you input a full blast sinusoidal test signal, you get the following readings:

[env~] ≈ 97

[dbtorms] ≈ 0.707

[* 1.4142] ≈ 1

INPUT: SQUARE WAVE (distortion amount: 1, this means no distortion)

That's all great...our input was ±1 and our scaling factor also became 1. But this is only valid for a sinusoid, not for other waveforms. When you input a full blast square wave test signal, you get the following readings:

[env~] ≈ 100

[dbtorms] ≈ 1

[* 1.4142] ≈ 1.4142

Is this 1.4142 scaling factor too big for our needs? Hm...

Our original square wave input becomes louder than it originally was. But this patch assumes that you are playing guitar, and that your guitar's signal will never be a full blast digital square wave (what kind of crazy guitar would that be?). So the 1.4142 scaling factor is right, in general.

So I imagine this satisfies your curiosity, multiplying by the square root of two is for amplitude compensation, for boosting the signal.

One could delete [* 1.4142] and forget completely about it. That's would be useful too. However, deleting [* 1.4142], and using instead the scaling factor produced by [dbtorms], would only produce a scaling factor of 0.707 (when your input is a full blast sinusoid)...0.707 is too small...I want a factor that is larger than 0.707. So my solution is multiplying 0.707 by 1.4142. In this way, (when your input is a full blast sinusoid) the scaling factor becomes 1, which is more useful than the weaker 0.707.

Another extra issue is the final clipping function, [clip~ -0.707 0.707]. I guess one should delete it, or set it to [clip~ -1 1]. Hm...