Matt Skarha

10 object(s)
 

Integer Programming for Optimal Right Hand Guitar Fingerings

Integer Programming for Optimal Right Hand Guitar Fingerings

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:

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:

\text{minimize}
\sum_{i=1}^{n} p^{BC}_i + p^T_i + \frac{1}{2} p^F_i
\text{subject to:}
b_i*f_i<4+p^T_i \qquad \forall \ i
|f_i-s_i| - (t_i*M) \leq p_i^F \qquad \forall \ i
-(s_i-s_{i+1})(f_i-f_{i+1})\leq M*p^{BC}_i \qquad \forall \ i < n-1
f_i + f_{i+1} + f_{i+2} \geq 5 \qquad \forall \ i < n-2
|f_i-f_{i+1}| \geq 1 \qquad \forall \ i < n-1

An explanation of this model as well as other information about this project can be found in this paper.

We implemented the model with Gurobi Optimizer and tested it on some selected measures of “La Catedral”. Below are some examples of the results. The f i correspond to the finger assignment of each note as returned by our model and the f i* correspond to the optimal finger assignment.

drawing drawing drawing

Click here to access the Github repository of the Python code used to generate the .lp file in order to use our model on your own music.