rncbc / drumkv1

drumkv1 - an old-school drum-kit sampler
https://drumkv1.sourceforge.io
GNU General Public License v2.0
35 stars 6 forks source link

making sense of reverb's "width" meaning #29

Closed marado closed 4 years ago

marado commented 4 years ago

I've been puzzled with the behavior of drumkv1's reverb, which, I finally realized, is caused with my lack of understanding of the meaning of it's "width". This is the code that causes the (to me) odd behavior:

            if (width < 0.0f) {
                out0 = tmp0 * (1.0f + width) - tmp1 * width;
                out1 = tmp1 * (1.0f + width) - tmp0 * width;
            } else {
                out0 = tmp0 * width + tmp1 * (1.0f - width);
                out1 = tmp1 * width + tmp0 * (1.0f - width);
            }

Width can be a value from -1 to 1 (which might be the first source of my confusion, I don't know what to make of the concept of "negative width").

With this code:

To better illustrate, here's the effect of this code, with different width values:

tmp0 is 0, tmp1 is 10
width: -1  , out0 10, out1 0
width: -0.9, out0 9, out1 1
width: -0.8, out0 8, out1 2
width: -0.7, out0 7, out1 3
width: -0.6, out0 6, out1 4
width: -0.5, out0 5, out1 5
width: -0.4, out0 4, out1 6
width: -0.3, out0 3, out1 7
width: -0.2, out0 2, out1 8
width: -0.1, out0 1, out1 9
width: 0  , out0 10, out1 0
width: 0.1, out0 9, out1 1
width: 0.2, out0 8, out1 2
width: 0.3, out0 7, out1 3
width: 0.4, out0 6, out1 4
width: 0.5, out0 5, out1 5
width: 0.6, out0 4, out1 6
width: 0.7, out0 3, out1 7
width: 0.8, out0 2, out1 8
width: 0.9, out0 1, out1 9
width: 1  , out0 0, out1 10

Is this the expected behavior?

rncbc commented 4 years ago

"width" in this context means "stereo width" and yes it's all intended behavior. you probably have to look at it as a M/S (Mid/Side) transformation; negative values (width < 0) means towards the "left" while positive (width > 0) means to the"right". hth. cheers

marado commented 4 years ago

Thanks for the pointers, and sorry for the false issue ;-)