GSoC 2021 - Work Product - Smart Tempo

Posted 1 month ago

This page is a summary of all the work done as a part of GSoC 2021 for the Smart Tempo project.
Find more information about the project at:

Weekly blog posts
Project Proposal

Code Changes

All of the code that is part of the project exists in two Pull Requests - #8308, #8524


  • Allowed opening a popup under specific elements when editing is triggered
  • Created a general popup, which can be filled dynamically based on the selected element
  • Created an empty Tempo Popup


  • Added UI and functionality for the 3 tabs - Tempo, Equation, Code
  • Added the parentheses row
  • Added the equation visibility toggle
  • Created a new DurationPicker component to be used in those tabs
  • Refactored the TempoText class to use the “equation” as the primary source of truth for other variables
  • Refactored the TempoText class to remove any static tempo patterns which limit the possible markings
  • Rewrote the tabs in Tempo Popup to use the new QML TabBar and StackLayout in place of the deprecated TabView
  • Implemented the ability to customize cursor behaviour, specifically movement and text deletion on a per-element basis
  • Removed the ability to move the cursor through the equation, select the equation using the mouse, or delete the equation in the tempo text
  • Allowed the element popup to reposition itself, if the element is to close to the bottom of the screen, so it doesn’t go off-screen
  • Allowed the popup to disable rendering of the cursor in the tempo element, if any text input in the popup has active focus
  • Refactored the tempo palette code to be smaller and cleaner
  • Added the ability for the TempoText element to “remember” the location of the tempo equation when equation visibility is toggled off and on again.
  • Refactored the import/export code for TempoText across most formats
  • Changed existing unit tests to allow for the additional data that the TempoText element now exports


The project met all of the goals detailed in the proposal about the tempo popup. There were also a lot of improvements related to the TempoText class that were not included in the proposal - Removing limitations on possible tempo markings, improvements to the tempo palette, refactoring import/export of tempo markings and numerous other minor changes to the popup that together have a big effect on the user’s experience of notating tempo. These changes make notating tempo much simpler and faster, without the user having to resort to replacing the tempo element, or using the special characters panel simply to change the note value in the metronome marking. Since these additional changes took up more time than anticipated initially, the project did not implement the Rubato feature that was outlined in the proposal.

Future Goals

There is still some work that needs to be done to improve the “Code” tab in the tempo popup. This will involve, at the very least, setting up some restrictions to user input through the code tab. Additionally, once more symbols are available in the Leland and Bravura fonts, it will involve adding support for much more complicated markings through the code tab, such as those part of metrico. I also have an unpublished branch, containing some of the work I have done toward the implementation of Rubato, and has laid some very basic groundwork for the feature, and I hope to work on this some time in the future.