Open monetjoe opened 3 weeks ago
Hi Joe. Thanks for using the system. I'm afraid I'll need more than "the code I wrote doesn't work on a piece I found". What's different about this piece and what things have you tried and what errors remain ?
Hi Joe. Thanks for using the system. I'm afraid I'll need more than "the code I wrote doesn't work on a piece I found". What's different about this piece and what things have you tried and what errors remain ?
I have no idea about the difference of this piece, because all the scores come from one dataset called VGMIDI with paper, I batch slice the scores in this dataset, however, when processing this specific sheet music, the program enters an infinite loop and cannot move on to the next piece. I set breakpoints to investigate and found that the program gets stuck in an infinite loop after reaching the .write step. Removing this sheet music from the dataset can resolve the issue.
It doesn't show any error messages; it just gets stuck in an infinite loop inside the .write function. The sheet music causing the infinite loop has been identified and is included in the attached zip file.
I tried to change the slice measure number 20 to 35, the endless loop disappeared, but it showed a key error:
lib\site-packages\music21\stream\iterator.py", line 421, in __getitem__
raise KeyError(k)
KeyError: '3'
which was raised at following line 421:
It seems that the score piece causing endless loop locates at measure 21-34 of the musicxml I gave to you. By the way, the error KeyError: '3' happens very often, I jumped this error before, however, this score drops the program into the endless loop, that's why I pay attention to it at present.
I wrote a script with music21 for slicing xmls as follow:
Its function is to slice the sheet music every 20 measures and export each slice as a MusicXML file, and it works well for normal scores.
However, the code hangs at the last line of the function (
.write
) without throwing an error or exiting, when processing the following sheet music: Q2_d2ac39b583bc66b1a397de2832ca05ec.zipPlease help identify what might be causing the
.write
method to hang.music21 version
9.1.0
Problem summary
Steps to reproduce
Expected vs. actual behavior
More information