garcia / simfile

A modern simfile parsing & editing library for Python 3
MIT License
62 stars 7 forks source link

simfile.convert: warps to negative BPMs and vice-versa #5

Open garcia opened 3 years ago

garcia commented 3 years ago

StepMania 3.9 infamously "supported" warp segments through a timing data exploit: setting the BPM to negative at some beat, then back to positive at a later beat, would warp the notes from the negative BPM change to... somewhere after the positive BPM change. To my knowledge, this exploit no longer works in StepMania 5, in part because the behavior is now officially supported through the WARPS timing data property. However, the StepMania editor still supports the legacy hack, converting any warps in the internal SSC data to negative BPMs when saving an SM file. This not only means that simfiles with warps created in SM5 will still work in 3.9, but that old files from the 3.9 era can be edited in SM5 non-destructively.

To achieve feature parity, simfile.convert.sm_to_ssc should convert negative BPMs to warps, and simfile.convert.ssc_to_sm should do the opposite (only for simfile warps - warps in the chart timing will raise an exception by default).