johentsch / ms3

A parser for annotated MuseScore 3 files.
https://ms3.readthedocs.io
GNU General Public License v3.0
42 stars 3 forks source link

Error IndexError: tuple index out of range when parsing score #26

Closed martianbug closed 1 year ago

martianbug commented 2 years ago

Hi! We are facing an error when parsing a mscx file and still no clue what can be causing the issue. The error takes place at line 292 in annotations.py when trying to expand labels. It believe it has to do with repetition signs maybe, but the file seems to be right by looking at it. The code used to parse the score is: msc3_score = ms3.score.Score(file_path.strip(), logger_cfg={'level': 'ERROR'}) harmonic_analysis = msc3_score.mscx.expanded mn = ms3.parse.next2sequence(msc3_score.mscx.measures.set_index('mc').next) mn = pd.Series(mn, name='mc_playthrough') harmonic_analysis = ms3.parse.unfold_repeats(harmonic_analysis, mn) Any advice on this woud be really appreciated! I'll leave the example file here to run some tests. Archivos.zip Thanks in advance!

johentsch commented 2 years ago

Hmm, unable to reproduce the error with version 0.4.10. Could you please paste the text from or a screenshot of the error's stacktrace?

Btw, unless there is a specific reason why you're unfolding 'manually', it could be more straightforward to do

from ms3 import Parse
p = Parse('.', file_re='^Ale')
p.parse_mscx()
p.expanded(unfold=True)