cuthbertLab / music21

music21 is a Toolkit for Computational Musicology
https://www.music21.org/
Other
2.04k stars 388 forks source link

expandRepeats don't work as expected #1713

Open miniil opened 1 month ago

miniil commented 1 month ago

music21 version

9.8.7

Problem summary

I have got a musicxml file with 10 measures one repetition from 5 to 10. I parse my file with convert.parse and then expandRepeats music21 repeat from measure repeat 5 to 10 correctly and then do another 1 to 10 - 5 to 10

Paste minimal code example here. Most issues can be reproduced with just a few elements.
Attach external files only after attempting to reproduce using a simple stream.
 score = converter.parse(filepath, format='musicxml')
    score = score.expandRepeats()
    measures = score.recurse().getElementsByClass('Measure')
    score.write("musicxml", fp="file.xml")

Expected vs. actual behavior

Expected : Not repeat one more time

miniil commented 1 month ago

musicxml file new PB.txt the result of expandRepeats file.txt