The Western canon of European classical music includes a substantial amount of scale-based, fingerstyle guitar music. When presented with a piece of sheet music, a classical guitarist must make a number of decisions regarding its performance. These decisions include notating the tablature, the left hand fingerings, and the right hand fingerings. This process, especially for right hand guitar fingerings, is often a trivial, yet cumbersome task.
For example, consider the III. Allegro Solemne movement from the 1921 piece "La Catedral" by Paraguayan composer Agustín Barrios. Due to its fast tempo, the performer must pay careful attention to the fingerings to adhere to proper technique while maintaining such a tempo. The problem then becomes how can we use math and computer science to determine optimal fingerings for this type of music?
Bernd Tahon began to answer this question with this 2017 Master's thesis Fingers to frets - A Mathematical Approach where he examined how to utilize math and computer science to optimize left hand finger assignments. In this project, we tackled the separate, yet related problem of right hand finger assignments.
In fingerstyle music, the guitar is played using the thumb, index, middle, and ring fingers (not the pinky). At present, there is a notion within the classical guitar community of "proper right hand technique" which can be thought of as a set of rules that describe the physically optimal way of using the right hand to play scale-based, fingerstyle guitar music. These rules can be summarized as follows:
- Do not repeat fingers on consecutive notes
- The thumb plays the bassline
- Fingers stay in natural resting position
- Avoid backwards crossings
- Avoid ring-middle-ring alternation
We decided to formulate this problem as an integer program where each of these rules are a constraint imposed by the model. The integer program, then, consists of a minimization of a sum of penalty terms that are incurred by violating the "soft" constraints. The complete integer program can be found below:
An explanation of this model as well as other information about this project can be found in this paper.
If you would like to use this model to determine RH fingerings for your own music, simply download the Python rhfingerings.py file. At the beginning of the code, there is a dictionary s. This dictionary is where one would input the ordered sequence of strings to be played. Use the following notation for each string:
- e string: 1
- B string: 2
- G string: 3
- D string: 4
- A string: 5
- E string: 6
Simply run the Python code and it will generate the .lp file that can then be used with Gurobi Optimizer to determine the optimal fingerings for your music.