You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently added the option to skip some invisible objects when parsing a score in #401.
While it seems to work the majority of times, I've found a specific case where it triggers an assertion error, in the ASAP score Chopin/Etudes_op_25/2, measure 118:
This is a very weird case, I can't really understand the purpose of this notation, but the thing is that only part of the chord is invisible, and therefore, it can trigger the following assertion error:
# this note starts at the same position as the previous note, and has
# same duration
assertprev_noteisnotNone
position=prev_note.start.t
I did not investigate deeply, but I guess that the first note of the chord is invisible, therefore skipped. Then the parser gets to the next note, that has the tag <chord/>, and therefore the parser expects that it also has the attribute prev_note pointing to the first note of the chord. However, as it has been skipped, this attribute is still None, and the assertions fails.
I do not really see in which cases one would mark invisible only parts of a chord, but it can definitely happen, and I do not really know how we could deal with that.
Do you have any idea on how this could be managed? I guess that the best way would be a clean implementation of a visible tag, resulting in always parsing all elements and marking their visibility status in an attribute, allowing the user to skip them manually. However, this would require far more work than the simple approach I took in #401.
The text was updated successfully, but these errors were encountered:
leleogere
changed the title
Parsing error when skipping invisible objects in a specific case
Parsing error when skipping invisible objects in partially invisible chords
Jan 22, 2025
I recently added the option to skip some invisible objects when parsing a score in #401.
While it seems to work the majority of times, I've found a specific case where it triggers an assertion error, in the ASAP score

Chopin/Etudes_op_25/2, measure 118:
This is a very weird case, I can't really understand the purpose of this notation, but the thing is that only part of the chord is invisible, and therefore, it can trigger the following assertion error:
partitura/partitura/io/importmusicxml.py
Lines 1225 to 1230 in 76f18c1
I did not investigate deeply, but I guess that the first note of the chord is invisible, therefore skipped. Then the parser gets to the next note, that has the tag
<chord/>
, and therefore the parser expects that it also has the attributeprev_note
pointing to the first note of the chord. However, as it has been skipped, this attribute is stillNone
, and the assertions fails.I do not really see in which cases one would mark invisible only parts of a chord, but it can definitely happen, and I do not really know how we could deal with that.
Do you have any idea on how this could be managed? I guess that the best way would be a clean implementation of a
visible
tag, resulting in always parsing all elements and marking their visibility status in an attribute, allowing the user to skip them manually. However, this would require far more work than the simple approach I took in #401.The text was updated successfully, but these errors were encountered: