GSoC: Week 1

Posted 8 years ago

The first week of GSoC 2016 is over now and I already have created a PR.

Last week

My first goal for GSoC was to not allow gaps in the MuseScore implementation any more. I added a new attribute of rests called 'trulyInvisible'. If you are deleting a rest, it isn't erased in the timeline, it just gets the attribute trulyInvisible. This means, that the rest isn't selectable by clicking on it or navigating to it with the cursor. So the top principle of MuseScore 'WYSIWYG' is kept.

This has some advantages in comparison with the current 'gap design':
- If you want to check if the current rest is a 'deleted' one you can easily check whether it is 'trulyInvisible' or not.
- The internal timeline is consistent, you don't have to expand voices every time you want to add something, because the rests are already there.

There have been several things which have to be done to create a similar behavior as we have in 2.0.3:
First thing was the navigation.
This was solved by changing the way of the current implementation of navigation with cursor. The idea is to create a check if the actual element is a rest and then if it is trulyInvisible (tI), so we will skip this element.
Second thing I worked on was the selection and the layout.
This was solved similar to the navigation, if it is a tI rest skip it else do the same as always has be done. This provides to use the current implementation in nearly every case and just in some subcases you have to implement something different.

After the layout and navigation issues I was working on the deletion itself. If you imagine to have a lot of rests which are only 1/32 long you would create much unused rests which are time consuming in navigation and useless, so the idea was to combine deleted rests to at best case one single rest. This was implemented directly after the deletion of a rest. So by deleting a rest it always looks, how the deleted rests could be combined to get a minimum of tI rests.

Last thing I was looking for was copy/paste and import/export
For this I implemented a method checkMeasure which is checking after each import or paste whether the measure has gaps and if it has the method automatically fills them with tI rests in the same way as it is done by deleting, so we also get a minimum of tI rests here.

After that I created a PR to check some layout differences between the actual behavior with gaps in 2.0.3 and master and my new implementation. The problem is that actually the deleted rests are also included in the calculation of the distance between two neighbor elements with a tI rest between them. So the distance is a bit bigger than in 2.0.3. There are actually some discussions on this, but we will see if we have to take the tI rests out from the distance calculation or not. The difference is not this big but it would be visible: layout score 2_0_3.png Behavior in 2.0.3 layout score 3_0.png Behavior in my PR

Next Week

In the next week I will fix some issues with my actual PR, because actually it is failing in some tests which are assuming that MuseScore is implemented with gaps. But I quickly want to go over to my main topic the new excerptsdialog which will be able to make excerpts of specific voices of a instrument/stave. My first aim for next two weeks will be to get a working implementation of a tool which creates a new excerpt for every voice of an instrument.

I made a timeline to don't get caught on a specific topic too long, so I can finish in the given time of GSoC. It could also be a guideline for you so you can see when I plan to finish specific elements:

GSoC16.png
Until next week,
Felix