From 1b1dabafb8a8a8dda2dc9f4384f916700383bf9f Mon Sep 17 00:00:00 2001 From: Veikko Sariola Date: Thu, 12 Nov 2020 19:46:37 +0200 Subject: [PATCH] fix(asm): Change the scaling to 29 in the speed unti (29 increments = double speed). The old speed scaling of 24 was ill-chosen so that triplets resulted in a minor buffer overflow error. This was never caught by anyone until Visual Studio 2019 in debug mode. Presumably all compilers allocate some extra space so this didn't matter. Now 29 increments = double speed and speeds with alternating 52 and 81 result in triplets that are just slightly faster then ordinary bpm i.e. the buffer will be slightly underrun, which probably is unnoticable to the user. --- include/sointu/footer.inc | 2 +- tests/expected_output/test_speed.raw | Bin 1693440 -> 1693440 bytes tests/test_renderer.c | 2 ++ tests/test_speed.asm | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/sointu/footer.inc b/include/sointu/footer.inc index 39d8a64..3ae66fe 100644 --- a/include/sointu/footer.inc +++ b/include/sointu/footer.inc @@ -546,7 +546,7 @@ c_freq_normalize dd 0.000092696138 ; // 220.0/(2^(69/12)) / 44100.0 %endif %ifdef USE_C_BPMSCALE - c_bpmscale dd 2.666666666666 ; 64/24, 24 values will be double speed, so you can go from ~ 1/2.5 speed to 2.5x speed + c_bpmscale dd 2.206896551724138 ; 64/29, 29 values will be double speed, so you can go from ~ 1/2.2 speed to 2.2x speed %endif %ifdef USE_C_16 diff --git a/tests/expected_output/test_speed.raw b/tests/expected_output/test_speed.raw index b6ca883a0127fa63df22853c2478e06024c0cd32..a6be26446da65124097da45b9978fc2c5759cddd 100644 GIT binary patch delta 159 zcmZozm)-zGEsQNpEzB(}EvzkUE$l5EEu1Y}E!-_UTXo2amTsMJI<|efipK? bWs;~sz>j;!x$P14TtL&{Y@iu%c7Zzpc56?` delta 211 zcmZozm)-zGEsQNpEzB(}EvzkUE$l5EEu1Y}E!-_UTX