Overview of work this week

Last week I wrote a bit about the slur functionality I was working on, and had a solution which needed further testing. I’ve now done all that and edited the solution a little as appropriate, which handles the case that was highlighted in bug #22128 which caused that bug to be re-opened. We should now be able to close this bug. The issue here was that Guitar Pro has different ways of representing slurs/hammer-ons/pull-offs, and one of these cases was not handled correctly causing some cases to fail, but it’s fixed now.

Most of the time this week has been spent looking at bug #22604, which describes the situation we have where slides are not imported. Guitar Pro specifies six kinds of slide, and I’ll talk a bit how I’ve implemented support for these below:

  • Shift slide. This is represented as a glissando with a straight line and no text, which works great.
  • Legato slide. Displayed the same as a shift slide but with the addition of a slur. I have not implemented support for this kind of slide yet, as we do not currently have support for slurs in Guitar Pro 6. This will be one of the areas of work I will look at next week.
  • Slide in from above. A line with a negative gradient placed to the left of a note. The way rendering is done for this and the following three kinds of slides above is a variation inside glissando.cpp, as it made sense to keep all the slide implementation together. To create the straight glissando in the previous cases, we take the start and finish notes, add rotations to the painter to take into account the difference in pitch, then draw a straight line equal to the length of the hypotenuse from the information of the difference in width and height of beginning and end notes on the score. With these slides, the gradient of the line is constant, and there is only one note which is affected, and so the only variable in the angle of straight gissando is what kind of slide we are drawing, rather than pitch information of the affected note. Rotation in the painter is only done after we have checked whether we are drawing these kinds of slide, otherwise we draw a straight line with a positive gradient, or negative gradient, beside whichever note is annotated with such a slide. This is all now implemented.
  • Slide in from below. A line with a positive gradient placed to the left of a note. This has been implemented in a similar way as described above.
  • Slide out upwards. A line with a positive gradient placed to the right of a note. This has been implemented.
  • Slide out downwards. A line with a negative gradient placed to the right of a note. This has also now been implemented.

The vast majority of this is done now for all available formats including the GPX format, and I’ll be able to finish this off once I’ve added support for slurs in Guitar Pro 6.

In the GPX format I’ve also made some edits to reduce the number of warnings that I print to stdout when I encounter any nodes I don’t handle (by either handling them or ignoring them as necessary). I haven’t added any new functionality with the exception of slides to this format, and testing the grace note and slur implementations which are now complete (though recent changes to the master branch may mean that I need to look again at grace notes). I’ll be spending more time on adding new features to this format this week anyway when I add support for slurs.

I’ve also spent a bit of time hunting down empty segments that were being generated in the Guitar Pro 5 (and below) formats. It transpired that we are importing empty segments as that’s actually what’s specified in the file, as Guitar Pro 5 allows this. We don’t want these in Musescore, so I’ve added invisible rests to fill any segments which are empty in order to fix this problem. In cases where the bar is at the end of the score, there are some cases where empty segments are created outside of the score, in which case we simply ignore such segments and just remove them from the score.

Key tasks that stalled

None this week.

Overview of work for next week

I’ll take a look at slurs in the Guitar Pro 6 format and get them completed. From there, I’ll finish support for slides by adding in the legato slide, and that will fix bug #22604. After this, I’m going to look at the previous versions of the Guitar Pro and try to find other things to handle, as I’m sure there’s still a few features which aren’t implemented yet (slap & pop for example?). After building a full list of things still to be handled in those versions I’ll start working through that list, and adding further support to Guitar Pro 6 as normal. I’ll also take a look at grace notes and if the way that they should be implemented has now changed I’ll modify the Guitar Pro implementation appropriately.