GSoC 2018: Score Comparison Tool — Week 4

Posted 6 years ago

Hello again!

This week, not too straight, but moved my work close to the end of the first part of my project. I finished my work on tuplets storage without IDs but after some discussions with Peter Jonas (shoogle) we concluded that it is better to store beams and tuplets in another way. In brief, beams and tuplets are always contained within one measure and within one voice and do not overlap (though tuplets can be nested). Even if beam or tuplet visually appears to span between the staves such an effect is achieved in a bit other way. That is, we are not bound to store beams and tuplets like spanners which can have their endpoints in almost every place of the score but use some simpler ways to mark their start and end points, or even limit ourselves to marking only a start point like it can be done for beams. More technical details I'll probably leave for my forum post which I anyway will make to describe the (almost) final version of changes I have implemented to MSCX format.

The other changed point concerns multliple <track> tags which are placed around probably almost every MSCX file. The main concern about them is, as in other cases, that track numbering is absolute and may shift if someone inserts or removes a staff or voice within the score. The proposed solution (thanks again to shoogle :)) goes a bit beyond the scope of the problem: <move> tags previously used for denoting a shift in the currently read position in the score are to be used also for denoting a shift in the track (they were anyway used mostly when a track change occurred). Also, just for the sake of uniformity, this <move> tag is also to be used in chords to denote their staff move property and in the new <Spanner> tag when describing other endpoint's position in <prev> or <next> properties. The new <move> tag is able to contain an information which is needed to identify a position in the score, parameters with default values are not written. So it looks now approximately like that:

<move>
  <voices>1</voices>
  <fractions>-1/1</fractions>
  </move>

In combination with switching off mandatory writing track number for slurs and forcing beams to never write this number (as it is anyway reassigned during the score layout) those <track> tags can be almost completely eliminated.

Finally, I have also finished the work on synchronizing Score::pasteStaff function with my recent changes to MSCX format so copy-pasting large parts of staff does not get broken and implemented a broken connectors reconnection procedure so MSCX files can be edited outside MuseScore with less risk of some spanners being corrupted. That "less" is compared to the previous state of my MuseScore fork though: the previous ID-based spanners were probably more friendly to manual file editing, but now it should not be usually a problem too.

So, to write that all in a more organized way, a brief list of this week's main results:
1. (Re)implemented storing beams and tuplets without using IDs.
2. Added a universal <move> tag for denoting position shifts in various contexts.
3. Fixed Score::pasteStaff to work after the recent changes to MSCX format.
4. Implemented a procedure for broken spanners reconnection during a score file reading.

Next week is thus planned for polishing results of this part of a work and preparations for my work to be merged to the main MuseScore branch.

Thank you!
Dmitri Ovodok
The new currently developed branch