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

all of the bpm of musicxml after detokenizer are 120 #1

Open
Chunyuan-Li opened this issue Jul 30, 2023 · 4 comments
Open

all of the bpm of musicxml after detokenizer are 120 #1

Chunyuan-Li opened this issue Jul 30, 2023 · 4 comments

Comments

@Chunyuan-Li
Copy link

Chunyuan-Li commented Jul 30, 2023

I noticed that in the direction element of MusicXML, there is a per-minute attribute within the direction-type element used to describe beats per minute (BPM). However, this attribute is missing in both the tokenizer and detokenizer processes. As a result, after detokenization, all the BPM values in the resulting MXL file are set to 120, which is clearly problematic.

@Chunyuan-Li Chunyuan-Li changed the title The 'repeat' element has not been taken into account The 'direction' element has not been taken into account Aug 14, 2023
@Chunyuan-Li Chunyuan-Li changed the title The 'direction' element has not been taken into account all of the bpm of musicxml after detokenizer are 120 Aug 14, 2023
@suzuqn
Copy link
Owner

suzuqn commented Dec 3, 2023

Sorry for my super late response.
Currently, the tools are not considering elements related to BPM or tempo, because these elements do not directly involved in the MIDI to Score conversion.

If these elements are necessary for your use case, I suggest considering custom extensions to the tokenizer and detokenizer:

  • Tokenizer (score_to_tokens.py): You can add the necessary elements to attribute_to_token(), while modifying attributes_to_tokens() as well.
  • Detokenizer (tokens_to_score.py): You can add the conversion to the music21 elements to single_token_to_obj().

@Chunyuan-Li
Copy link
Author

Chunyuan-Li commented Dec 6, 2023

Yes, I did try that as well. However, I found that the model struggles to predict the bpm accurately, regardless of whether I explicitly specify bpm in the midi tokens (from midi tempo changes). Eventually, I removed the bpm indicators.

Additionally, I encountered another issue on the model side: when training with non-standard midis (typically converted from audio) and standard musicxml as data pairs, the model's prediction performance deteriorated significantly, often leading to missing notes. Do you have any suggestions?

@suzuqn
Copy link
Owner

suzuqn commented Dec 16, 2023

If your goal is to transcribe BPM from MIDI to Score, I think it's not necessary to include it in the token conversion process. Instead, you could simply append the BPM read from the MIDI as a tempo object to the transcribed score.

Your issue with "non-standard midis" seems similar to the case of unquantized (noisy) input described in Section 6.5 of my paper. The key might be in augmentation, regarding note timing and duration.

@Chunyuan-Li
Copy link
Author

Indeed, it bears a resemblance to the addition of noise discussed in Section 6.5 of the paper. I conducted a comparison using standard MIDI files, altering parameters such as noise ratio and range (duration). I observed that as noise increased, the model gradually started forgetting notes in musicxml. Additionally, in non-standard MIDI files, there were instances of note errors, making it seemingly more challenging for the model to learn. In light of this situation, do you have any suggestions for effective solutions?

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

No branches or pull requests

2 participants