You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I've been testing the new version 3.0.0, particularly with MIDIs that feature multiple time signature changes.
There seems to be a regression related to the time_signature_range parameter. An issue arises when supporting more time signatures than those present in a song. In this case, the time signatures are incorrectly placed.
Steps to Reproduce
Instatiate any tokenizer that supports time signatures. (I've tested with REMI+ and TSD)
Configure it to support all the song time signatures and an extra one.
cfg=TokenizerConfig(
use_tempos=True,
use_programs=True,
use_time_signatures=True,
time_signature_range={4: [7, 4, 2], 8: [2]} # Here, 2/8 being the one not present in the song.
)
Open the output file in any MIDI viewer, and compare with the original.
As you can see, the first signature (2/2) in the original song lasts 2 beats, but in the processed file, it now lasts for 4.
If we remove the extra signature from the configuration, the problem is fixed.
This issue is also present in different signatures and songs.
Thank you very much for the bug report! 🙏
It's fixed in #132, I'll wait for the tests to pass and merge it!
You then will be able to get the fix by installing from git: pip install -U git+https://github.com/Natooz/MidiTok
The error came from the time division used in the time signature preprocessing method. It used the tokenisers one (which is used when decoding tokens for example) instead of the MIDi's one, which can be different, resulting in the time signature shifts.
Recently, I've been testing the new version 3.0.0, particularly with MIDIs that feature multiple time signature changes.
There seems to be a regression related to the
time_signature_range
parameter. An issue arises when supporting more time signatures than those present in a song. In this case, the time signatures are incorrectly placed.Steps to Reproduce
As you can see, the first signature (2/2) in the original song lasts 2 beats, but in the processed file, it now lasts for 4.
If we remove the extra signature from the configuration, the problem is fixed.
This issue is also present in different signatures and songs.
example_song.zip
The text was updated successfully, but these errors were encountered: