GSoC 2018: Score Comparison Tool — Week 2

Posted 6 years ago

Hello!

This week I worked on changing MSCX fileformat, so to describe my work this weekly report will probably contain a bit more technical details. The main idea of the planned changes, as is mentioned also in the discussion on the forum, is to make all parts of the score which is written to the file be less dependent on each other and on the global state of the score. Probably the most common case of such dependence is a presence of IDs for every slur, tie and lots of other elements which lead to large differences between the written MSCX files if even one such slur is added to the score or removed from it. Making MSCX fileformat more suitable to use with textual diff tools requires a set of changes, and avoiding usage of IDs in most of situations is one of those requirements. This is what I have been working on this week.

Here is a brief list of changes that I implemented this week:
1. Stop writing measure numbers.
In case someone needs them in the file, they are written in the form of XML comments if MuseScore is launched in debug mode.
2. Use 2 tags for storing slurs instead of 3.
This was a bit intermediate task not too valuable itself but useful for making further changes. Most of other extended elements (spanners) used two tags for their storage: the first described its properties and marked the start of the element, the second denoted the end of the element. For slurs the start tag and the tag describing the slur's properties were separate. I joined them thus making things a bit more unified.
3. Make a small set of helper classes for storing connecting elements not using IDs.
This mechanism is planned to be applied then not only to the previously described spanners but also to beams and tuplets thus removing a need for IDs in a large class of situations. The developed mechanism has also another useful side effect eliminating the need for MSCX reading routines to handle specially situations when the end of the connecting element is met before its start, since the connecting element can now be added to the score only after all its endpoints are met and the element is thus completed.
This mechanism still requires though some modifications and corrections but it is already able to work.
4. Applying the developed connectors storage mechanism to all spanners and remove IDs for them.

Next week I plan to start with applying the developed approach to beams and tuplets as well as making some necessary corrections related to the changes implemented during this week. Other minor changes to MSCX fileformat may also be needed but it is better to decide this when coming to the end of this stage of the work.

The developed branch of MuseScore can be found here.

Thanks for your attention!
Dmitri Ovodok