Add a warning when tuplet.start_note.voice != tuplet.end_note.voice #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #420, the start and end notes of a tuplet are a good indicator of an XML encoding error. This happens when there is a missing tag
<tuplet type="start">
or<tuplet type="stop">
. For instance, it is the case in the score Chopin/Sonata_2/1st_no_repeat in ASAP (see fix at fosfrancesco/asap-dataset#14).This PR adds a warning when this happens, providing information to the user that there might be a missing tuplet tag.
MuseScore is able to fix this kind of encoding error, should we try too? Here is an overview of a naive approach presented in #420:
However, there might be more complex cases that wouldn't be covered by this approach (I think of nested tuplets, but there might be other weird cases).
For reference, here is a related part of the code of MuseScore:
https://github.com/musescore/MuseScore/blob/559bf1eb46e467a000a64a36b13173f3e58e2a32/src/importexport/musicxml/internal/musicxml/import/musicxmltupletstate.cpp#L344-L366
I'm not really used to C++, but it might be worth to have a look at what's happening in here.
One thing they seem to do (among others) it to keep track of the time in the tuplet, which might be a lot of work to include in Partitura if we choose that way.