Neskol / MaichartConverter

A format converter for maimai related charts
GNU General Public License v2.0
153 stars 10 forks source link

CompileSimai: Duration of slides on different BPM regions is not correctly calculated #25

Open Littlebluemoon opened 1 month ago

Littlebluemoon commented 1 month ago

While using CompileSimai to convert a simai chart to ma2, if for example, a slide's "tap" and "slide" action lies in different BPMs, the slide duration won't be calculated correctly, resulting in dramatically lower or higher slide durations.

Example

Given this simai expression:

(199)6,7,6,7,6,7,6-1[16:1],7,6,7,6,7,
(12.4375){32}6bz2[128:1],,,{256},,,,,6,5,4,

Expected output

The slide 6-1[16:1] is exactly one beat from the first tick where BPM is changed to 12.4375, at which the "slide" action is performed. Hence, the slide duration need to be divided by 16 (=199/12.4375) to accomodate this change.

Below is an example of how this would work:

[...]
NMSTR    4    0    5
NMSI_    4    0    5    96    2    0    || 24/16 = 1.5, rounded

Actual output

The slide duration is not divided to accomodate the BPM changes. Below is the actual result that the program produce.

[...]
NMSTR    4    0    5
NMSI_    4    0    5    96    24    0

As such, the slide duration is increased by 16 times when rendered in-game, which is an incorrect output.