Page 1 of 1

Adding two decimal places to the swing quantization percentage

Posted: Wed Oct 30, 2019 11:51 am
by GoldenSwing

I'd like to give a more precise value to the swing quantization.

At this point, we can define a whole number value, expressed in percentage. This means that if we want to give a real number, we have to round it.

The formula used in the software to calculate the swing is a linear function, where 0% swing = 1/2 ratio (straight swing) and 100% swing = 2/3 ratio (triplet swing). We can express it by f(x) = 1/2 + (x/100)/6, where x is the swing percentage the software user can give, and f(x) the actual ratio between the beat grid and the swing grid.

The maximum error between a real number and its rounded value in percentage without decimals is:
max_error = |f(x+α*0.5) - f(x)|, where α is 1 or -1
max_error = |1/2 + (x/100)/6 - (1/2 + ((x+α*0.5)/100)/6)|
max_error = 1/1200

We can calculate how many samples this error represents. For example, at 48 kHz, if we define a swing value to half notes at 60 bpm, this error is a difference of 48000/1200 = 40 samples!

This problem would be resolved by adding two decimal places to the swing quantization percentage. In this case, the error would be only 0.4 sample, less than 1 sample.

To explain why I'd like a more precise swing, it is because I think the perfect swing might be the golden mean. We can calculate it :
f(x) = (1+sqrt(5))/2 - 1
1/2 + (x/100)/6 = (1+sqrt(5))/2 - 1
x = 70.82 %

Its approximation is 71%, and to my ears, it is like it was revealing the truth behind the mystery of the swing and the mystery of the blues!

Adding two decimal places to the swing quantization percentage would be perfect.

Thank you!