GSoC 2018: Score Comparison Tool — Week 8
Hello!
This week I worked mostly on the score comparison engine which I have started to develop during the last week. Last week ended for my work on the project with a problem of getting a semantically correct diff between MSCX (or, more generally, XML) documents. This week I finished a work on correcting a usual textual diff to be more correct from XML point of view (mostly to contain a whole number of full XML tags, if possible), but I found also that there are other solutions to the problem. Not sure whether I was right in choosing to complete the textual diff correcting algorithm but it seems to work well for now and makes potentially easier to take into account MSCX-specific format features.
After completing that part I have also improved an algorithm handling the produced textual diffs. Now it is able to handle more situations correctly although there are still some issues left. Anyway, it is able to track a context of the changes and distinguish between element insertion/deletion and properties changes. The MuseScore 3 properties system is used which largely simplifies the task of handling different properties which can be altered between scores but still performs not perfectly. For example, see a sample output of the score diff engine:
Measure 13: Chord: removed element Slur
Measure 16: Note: property pitch changed from 58 to 39
Measure 16: Note: property tpc changed from 12 to 11
Staff: removed element Measure
Measure 21: Staff Text: markup changes: pos
Staff: removed element Measure
Here the algorithm detected a slur removal, a measure removal (two times as the score has two staves, such diffs are not currently merged), a note pitch change and a change inside staff text. However pos
is not listed in MuseScore's properties list, Pid::USER_OFF
is already taken for offset
property but they have the same meaning. So pos
change was not handled as a property as it should have been done. The solution will probably be to rename pos
to offset
completely but this illustrates some issues that arise for the properties system. Other common issues are an absence of some information in the properties list and inability to convert some properties to string for printing — and even if some can be converted they are not necessarily human-readable (like pitch
and tpc
from the example output). These issues have to be resolved during the future work.
There is still a task on a creation of graphical interface for the score comparison tool. After some most prominent of the remaining issues with the score diff engine are fixed this work can also be started. That way I will probably plan a work for the next week: first resolving most important issues with the engine, then creation of some GUI for the tool. The latter should also simplify testing of the score diff engine in some cases.
Thanks for your attention!
Dmitri Ovodok
The currently developed branch is now this one.