Pianoplayer: Automatic fingering generator for piano scores
github.com
github.com
I recently came across a score, Debussy or similar I think, where the left hand is following a pattern of a base note, then ascending by something like a fifth, and then again by something like another octave; and in the first roughly four bars, the recommended fingering was along the lines of 3-1-5—yes, it had you turning your hand upside down to finish the run each bar. Then something or other happened after those first few bars so that that wouldn’t work any more (perhaps the third note of the sequence became some chord?), and it switched to the more typical 1-3-5 (or similar), so that I wonder whether it was really worth the fuss of the unusual fingering and hand placement for just the first few bars. Perhaps it is, given that those notes are the focus in those first few bars, and 3-1-5 will let you play it more smoothly, so long as you can contort your hand appropriately.
And that makes me think of Für Elise too: in the section with the rapid repeated A₂, I’ve seen fingerings suggesting rotating through three fingers, but as soon as you get the the D₂/A₂ chords, that’s no longer tenable, and so I wonder whether it was worth the bother in the first place. (My conclusion there is that it actually depends on the piano. On a grand, probably, on an upright, probably not. And indeed when a few weeks ago I seriously played on a halfway decent grand piano for the first time since I was a rank beginner, I found myself finally understanding the reasoning of a few fingerings that I’d never liked. And now I won’t be satisfied until I have a grand piano of my own. I can see I’m doomed to be one of those guys that ends up with half a dozen pianos of various types, as well as half a dozen recumbent tricycles of various types.)
(A grand piano wouldn’t work at all upside down. An upright… hmm, I haven’t tried it but I suspect that you could actually get a little bit of sound out of some normally-inferior actions.)
Unrelatedly they also had a trick piano where the whole backside and frame with strings would detach at the climax of the song and come crashing down to the floor on cue. Apparently they didn't need to tune the piano used for that an abnormal amount.
This is a bad optimization. Because fingering should be a function of the desired musical effect. Speed can be one of them but most of the time others effects like articulation, phrasing, dynamics, timing etc. and their combination are much more important.
Piano fingering is an art. Whole books are written about this topic. Such a primitive algorithm can never produce good results. Better is to learn from the masters. The Henle App can display different fingerings from different master pianists for the same piece. There is a lot one can learn from those masters, but not from a speed optimization algorithm.
It's a Dunning-Kruger algorithm. Instead of demonstrating algorithmic supremacy it formalises a poor understanding of the problem and the domain, but still labels it "solved."
Just as an example, one of the first things I learned from my Russian master teacher was to never put the thumbs on the black keys.
That's _unless_ it's absolutely neccessary to do so in some of the more advanced fingerings. It also all depends on how large your hands are.
So there's really no one-size-fits-all solution, but I could imagine a transformer architecture trained on master fingerings might actually be able to figure it out.
Ugh. I'm hard pressed to even reach an octave using only pinky and index. You probably have bigger hands.
Anyway, if the acoustic is dry and you want to play legato, for example, you can end up choosing to use a fair number of finger substitutions and to use thumbing [1] in order to avoid some gaps between notes – which goes to show that the choice is both a function of artistic interpretation as well as locale, on top of comfort or efficiency.
I believe (but I may be misremembering) that in some historical practices, as well, there are fingering practices deliberately chosen so as to naturally create phrasing (e.g. try playing a scale as evenly as possible with just fingers 2 and 3 and you will inescapably get some rhythm).
[1] A technique where you smoothly move to an adjacent note with your thumb by see-sawing between the knuckle and fingertip, which works because key velocity matters much less than on a piano (and for electric action, not at all). In fact, you can smoothly play an entire scale this way with just your thumb. "Thumbing down" can also refer to playing notes on a lower manual (keyboard) with your thumb while the rest of your fingers play on an upper manual.
For midi and lilypond files, check https://www.mutopiaproject.org/
https://github.com/benkaiser/learn-piano
It lets you select from a midi file and play with your midi keyboard. You can even select a note to split on.
I need to add more intuitive controls (i.e. tempo is controlled by a random slider on my midi keyboard), but the core of it works.
It gets better with time. Just like a programming language with a quirky syntax, your mind eventually compensates for it.
IMHO, staff notation really not bad when you consider how else to pack that much information into limited horizontal and vertical space.