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

Weird side effects while parsing Fanny Mendelssohn Hensel score #17

Closed
napulen opened this issue Mar 3, 2021 · 4 comments
Closed

Weird side effects while parsing Fanny Mendelssohn Hensel score #17

napulen opened this issue Mar 3, 2021 · 4 comments

Comments

@napulen
Copy link
Contributor

napulen commented Mar 3, 2021

This is related to "Corpus/OpenScore-LiederCorpus/Hensel,_Fanny_(Mendelssohn)/6_Lieder,_Op.1/2_Wanderlied/score.mxl".

There is a MusicXML (and MuseScore) score included for this annotation, which looks like this when opened on MuseScore
image

When parsing and .show()ing with music21, the resulting score has most duration values corrupted.

image

It's difficult to tell what exactly went wrong, because it is a silent fail. The score doesn't show any warnings or errors when show()ed; one exception is when running .expandRepeats(), in that case, it does crash with the following error:

>>> s.expandRepeats().show()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/napulen/dev/AugmentedNet/.env/lib/python3.8/site-packages/music21/stream/__init__.py", line 13042, in expandRepeats
    post.insert(0, p.expandRepeats(copySpanners=False))
  File "/home/napulen/dev/AugmentedNet/.env/lib/python3.8/site-packages/music21/stream/__init__.py", line 8562, in expandRepeats
    post = ex.process()
  File "/home/napulen/dev/AugmentedNet/.env/lib/python3.8/site-packages/music21/repeat.py", line 770, in process
    raise ExpanderException(
music21.repeat.ExpanderException: cannot expand Stream: badly formed repeats or repeat expressions

If I have to guess, it may be that the triplets on the right hand were moved to the lower staff at the beginning (in fact, I didn't know that was possible to encode in MuseScore!) and that's confusing music21.

@napulen napulen changed the title Weird side effects while parsing Mendelssohn score Weird side effects while parsing Fanny Mendelssohn Hensel score Mar 3, 2021
@jacobtylerwalls
Copy link

Hiya @napulen, doomscrolling on Github led me to happen across this. Clearly this is an issue in music21. You can raise it there if you like. music21 rips apart piano music into separate Part objects, so you have gaps in the left hand. Those gaps then get filled on export to make a nicer display, but if you have a gap that happens to equal a 1.0 QL, you'll just get weird things like an incomplete tuplet (0.16 QL) followed by a quarter rest, then another incomplete tuplet (0.16 QL) -- and then when you open a musicXML reader, all bets are off with how they decide to display that. Finale's representation of this looks less like modern art, but it's still junk.

I've been tackling another broken-tuplet scenario in cuthbertLab/music21#763, but that's moving slowly because it might create tuplets people don't want. There's a TupletFixer in the duration module I haven't toyed with yet. Maybe that can help with this issue and with the PR I just mentioned. It would be great to see somebody work on this for v7 of music21.

@jacobtylerwalls
Copy link

The reason I looked into this was to verify my recent keyboard features didn't affect this -- "good" news is I can reproduce on 5.7.2, so it wasn't me!

@napulen
Copy link
Contributor Author

napulen commented Mar 8, 2021

Hey @jacobtylerwalls, sorry to hear you doomscrolled all the way here! But thanks for jumping in nonetheless.

I was briefly looking at the thread of issues you pointed to, it seems this is quite messy to fix. Keep pinging me on new things there, just in case I decide to be brave and open the code editor to help with this.

@MarkGotham
Copy link
Owner

Thank you both, @napulen and @jacobtylerwalls !

This repo is fast becoming a tricky but useful testing suite for music21 in general, RomanText specifically, and more.

I'm focussing on the harmony side but am happy to roam into other areas if I can be helpful so do ask.

Thanks in any case for your help in flagging and and organising issues -- much appreciated!

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

3 participants