Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to delete equal successive tempo / time sig changes #66

Merged
merged 7 commits into from
Aug 17, 2023

Conversation

Natooz
Copy link
Owner

@Natooz Natooz commented Aug 14, 2023

When preprocessing a MIDI files, the previous version automatically deleted the successive tempo changes and time signature changes that had the same value.
Although this can make sense and reduce the nb of tokens, it can also reduce the recurrence of this information in sequences of tokens, where an user could on the other hand want to repeat it at recurrent intervals, especially with tokenizations such as TSD or MIDILike.

This option allows to decide wether or not to delete these identical successive changes.

@Natooz
Copy link
Owner Author

Natooz commented Aug 14, 2023

Still changes to do towards Octuple and CPWord, in order to robustly test their tempo and time signature encoding / decoding.

@Natooz
Copy link
Owner Author

Natooz commented Aug 15, 2023

@ilya16

After analyzing 5k MMD files + the Maestro + POP909 datasets, here is the count of Time signatures :

(3, 1): 1 (0.01 %)
(20, 32): 1 (0.01 %)
(10, 32): 1 (0.01 %)
(17, 16): 1 (0.01 %)
(18, 16): 1 (0.01 %)
(14, 16): 1 (0.01 %)
(3, 16): 1 (0.01 %)
(2, 16): 1 (0.01 %)
(6, 2): 1 (0.01 %)
(1, 2): 1 (0.01 %)
(7, 16): 1 (0.01 %)
(17, 8): 1 (0.01 %)
(1, 1): 1 (0.01 %)
(16, 8): 1 (0.01 %)
(14, 8): 1 (0.01 %)
(12, 16): 2 (0.02 %)
(16, 16): 2 (0.02 %)
(9, 4): 2 (0.02 %)
(16, 4): 2 (0.02 %)
(13, 8): 2 (0.02 %)
(4, 1): 2 (0.02 %)
(1, 16): 2 (0.02 %)
(14, 4): 2 (0.02 %)
(9, 16): 3 (0.04 %)
(11, 8): 3 (0.04 %)
(15, 8): 3 (0.04 %)
(8, 8): 4 (0.05 %)
(1, 8): 5 (0.06 %)
(4, 2): 6 (0.07 %)
(3, 2): 6 (0.07 %)
(11, 16): 6 (0.07 %)
(10, 8): 6 (0.07 %)
(4, 8): 8 (0.10 %)
(2, 8): 8 (0.10 %)
(7, 4): 11 (0.14 %)
(2, 2): 14 (0.17 %)
(5, 8): 14 (0.17 %)
(8, 4): 14 (0.17 %)
(7, 8): 21 (0.26 %)
(9, 8): 24 (0.30 %)
(3, 8): 52 (0.65 %)
(12, 8): 56 (0.70 %)
(5, 4): 65 (0.81 %)
(6, 4): 80 (0.99 %)
(6, 8): 126 (1.56 %)
(3, 4): 209 (2.59 %)
(2, 4): 521 (6.47 %)
(1, 4): 743 (9.22 %)
(4, 4): 6018 (74.69 %)
Time signature above 0.5%:
[(3, 8), (12, 8), (5, 4), (6, 4), (6, 8), (3, 4), (2, 4), (1, 4), (4, 4)]
{8: [3, 12, 6], 4: [5, 6, 3, 2, 1, 4]}

At the end, I printed the TS which represent at least 0.5% of all TSs. I resorted to keep these values for now. Should we add some more ?

@ilya16
Copy link
Contributor

ilya16 commented Aug 16, 2023

These seem to be the most common ones. I can also refer to the time signature analysis of Lakh MIDI Dataset.

Maybe adding 2/2, 9/8, 5/8, and 7/8 will make a nearly complete list.

…moved, CPWord handling Time Signature, fixes in tempo and time sig decoding for MIDILike & REMI & TSD when one_token_stream is False, common TIME_SIGNATURE_RANGE set in constants, fixes in tests than now also test all time signature and tempo changes
@Natooz Natooz marked this pull request as ready for review August 16, 2023 17:35
@Natooz Natooz merged commit 3f33a12 into main Aug 17, 2023
12 checks passed
@Natooz Natooz deleted the time-sig-tempo-changes-deduplication-option branch August 17, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants