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

Notes sometimes having impossible ties #432

Open
leleogere opened this issue Feb 26, 2025 · 0 comments
Open

Notes sometimes having impossible ties #432

leleogere opened this issue Feb 26, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@leleogere
Copy link
Collaborator

In some scores such as ASAP Schumann/Kreisleriana/3/xml_score.musicxml, a couple of notes are tied to an incorrect note, placed before them or in parallel to them:

from pathlib import Path
import partitura as pt
import partitura.score

path = Path("~/Documents/datasets/asap-dataset/Schumann/Kreisleriana/3/xml_score.musicxml").expanduser()

score = pt.load_musicxml(path)
part = score.parts[0]

measure_map = part.measure_number_map
for note in part.iter_all(cls=pt.score.Note):
    if note.tie_next and note.end.t > note.tie_next.start.t:
        print(f"Measure {measure_map(note.start.t)}:")
        print(f"   * {note}")
        print(f"  -> {note.tie_next}")
Measure 63:
   * 127232--127488 Note id=None voice=1 staff=1 type=16th tie_group=None+None pitch=Db4
  -> 125440--125696 Note id=None voice=2 staff=1 type=16th tie_group=None+None pitch=Db4
Measure 152:
   * 304640--305152 Note id=None voice=5 staff=2 type=eighth articulations=(accent) tie_group=None+None pitch=C3
  -> 303104--305152 Note id=None voice=6 staff=2 type=half tie_group=None+None pitch=C3
Measure 153:
   * 305152--307200 Note id=None voice=4 staff=2 type=half tie_group=None+None pitch=C3
  -> 305152--305664 Note id=None voice=5 staff=2 type=eighth tie_group=None+None pitch=C3

While I suppose that there are some encoding errors in the MusicXML (I haven't taken the time to dig the score and the tie-parsing code), I feel like those should be removed by Partitura when parsing the score (probably with a warning), because they do not really make sense. In a normal case, a tied note should only be allowed to start at of after note.end.t, not before.

@leleogere leleogere added the bug Something isn't working label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant