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

match file version 1.0.0 voice parsing bug #267

Closed
sildater opened this issue Jun 9, 2023 · 4 comments
Closed

match file version 1.0.0 voice parsing bug #267

sildater opened this issue Jun 9, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sildater
Copy link
Member

sildater commented Jun 9, 2023

in the newest match file version voice information is stored as scoreattribute number with a prefix "v". this is not correctly parsed in load_match, where the voice information is cast to integers. The loading doesn't break but all voice information is lost.

@sildater sildater added the bug Something isn't working label Jun 9, 2023
@sildater
Copy link
Member Author

I'll add it here: the match files for chopin excerpts in 4x22 contain note IDs without dashes, e.g., "n1", the others contain repeats and are identified with dashes, e.g., "n1-1". It would probably be good to have this consistent and append a suffix for the ones without repeats.

@huispaty huispaty self-assigned this Aug 8, 2023
@manoskary
Copy link
Member

Is this linked issue to any PR? Should it be scheduled for Release 1.3.2 ?

@sildater
Copy link
Member Author

@huispaty are you looking into this for the next release?

some more things I just checked:

  • voice information as part of the ScoreAttributesList is not documented in the match specification: https://cpjku.github.io/matchfile/
  • I think the problem stems from number_pattern = re.compile(r"\d+") and
            note_attributes["voice"] = next(
                (int(a) for a in note.ScoreAttributesList if number_pattern.match(a)),
                None,
            )

in importmatch.py

  • I'm not sure whether this regex for voice number is used anywhere else
  • I'm not sure whether earlier match files encoded voice information beyond the "s" tag.
  • my other comment about consistency in 4x22 might be moot because of the unfolding required foir Schubert and Mozart, just ignore it

@huispaty
Copy link
Collaborator

Hello! Yes I pushed a fix for this a few days ago into branch match_import -- I'll check again if number_pattern is used somewhere else and adapt my fix if necessary.
There was another fix for importing match (trill notes parsing for match version v0) -- when both are fixed I'll create a PR and link you!

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

4 participants