GSoC work product

Posted 3 years ago

For this year’s Google Summer of Code project I was working with MuseScore. My project was to improve the already existing features in MuseScore listed below.

Links:
- merged commits
- open Pull Requests
- Part tool
- Implode
- Explode

Basics

explain.png

Part tool

It wasn‘t possible to create parts of a score for single voices of a staff. In music, it is common to write more than one instrument voice in the same staff to save space. The aim was to extend the part creation tool so it can create parts for every voice of a staff because this is an often requested feature for MuseScore and helps the musicians playing music written with MuseScore.

Implementation

To create a new part a new score is created and only the selected instrument staves are copied to the destination staff. It‘s not a normal copy and paste it‘s more something we call a linked clone, so the part is linked to the master score. This is an important feature, because you‘re able to work in the part score or in master score and changes to parts will be reflected in master and vice versa. This was and is sometimes a problem, because it isn‘t enough to simply clone just the selected voice to the part and leave everything as it is. There is a mechanism which checks if a recently added element to a score has to be added in another score. This algorithm was modified so it doesn‘t just check if the actual input staff is linked to a part but also if the element is a voice of the linked part, so we don‘t get elements in a part of voice two which are added to another voice of the source staff. The general idea was to have a track map which contains every linked source score tracks as keys and the associated tracks of the parts as keys. The map itself is an attribute of every part. This makes it possible to check which voices are really linked. For this improvement I also had to change the GUI to give the user the ability to select the voices and instruments he want in his part.
parts_ges1.png

Work product

The work on this tool was done in this PR and is finished from the general implementation side. But as MuseScore is a software for many use cases I‘m not able to check them all. The most common use cases should be covered but maybe more will come up in the future.

Implode tool

This tool does implode (merge) the selected staffs to the topmost staff. Before I was working on it the tool was only usable if you had staves with only the first voice and all notes you want to implode must have the same rhythm as the first voice in the destination staff. The aim was to improve the implode tool so it is possible to merge voices with different rhythms.

Implementation

The tool should take the first four voices in the selection and copy them to the top selected staff. It wasn‘t possible to have more voices because MuseScore provides actually just four voices in one staff. My algorithm first checks which voices should be cloned to the top staff and creates an array with the first four voices and copies this four voices to the topmost staff. For this copy a new method cloneVoice was introduced. This method is used in every of my three PR‘s and does simply clone every voice of a given source voice to a destination voice. The source and destination can be in different scores. Actually this method doesn‘t clone every element, because in the use case of Implode some basic elements as dynamics would have been cloned multiple times to different voices which doesn‘t make sense at all in most use cases this isn‘t very important at all. The old feature was able to combine the voices of a staff when only one staff was selected. This tool is still available but can only deal with same rhythms in the four voices. This wasn‘t investigated during my GSoC project, but is a point to start further work on this topic.
implode.png

Work product

As already mentioned the work on an implode tool which implodes the voices of different staffs is already finished in this PR but for single staff implode there might be still work to do.

Explode tool

The explode tool is kind of the opposite to the Implode tool. The tool before my work could explode the notes of voice one to the staffs below. It does explode the top note of the source staff to the source staff itself the second to the staff directly below the next to the second staff below and so on. My improvement on this tool was to make it possible to explode complete voices other than voice one to the staves below.

Implementation

This was implemented quite similar to the implode tool. First it‘s checked how many voices there are in the topmost staff of a selection. If there‘s just one the current algorithm is used to explode this one voice to the staves below. If there are more voices then we look at the staves below and check in every staff where we have the first free voice and save them in an array. Then we use the cloneVoice method and copy all the important information of that voice to the voices saved in the array.
explode.png

Work product

Work on this tool is finished and you can see the commits here. At the moment I can’t imagine of further things to do.


Comments

Hurray! I can hardly wait for all this, especially the part extraction.

I actually have a couple more thoughts that might improve the UI of the Parts dialog:

  • Part title should not be under the "Instruments in Part" quadrant. Bring it out to above both bottom sections.
  • New All, New, and Delete buttons are kind of lost in the middle of the window. Move them out to the right edge, and move the Up/Down buttons to the left side.
  • Add the word "Voices:" to the tree in front of the row of checkboxes.

  • Maybe (not included in this mockup): Put an "Edit Part" group box around the "Part title" field and both sections below.

    partsui.png

Attachment Size
partsui.png 128.77 KB