Hacker News new | past | comments | ask | show | jobs | submit login
Pianoplayer: Automatic fingering generator for piano scores (github.com/marcomusy)
79 points by ofou on Oct 31, 2021 | hide | past | favorite | 24 comments



When you get up to more advanced music, suggested fingerings often become more initially surprising, though normally you’ll eventually figure out why they suggested it.

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.)


Do you mind explaining why one fingering would be awkward on an upright but natural on a grand? I always assumed the human-piano interface was basically the same on uprights and grands, all the difference lying behind the keys.


On the modern grand you do no have to lift the key fully up to press it again. Therefore, you can play better legato without the pedal, and you can hit the same key faster. The dynamic force distribution on the key travel is also different. Key travel has a completely different feeling.


This is correct. If you’re interested in learning more, the key term to research is action. https://en.wikipedia.org/wiki/Action_(piano) is a decent overview with a couple of diagrams, though fairly dry. Simplifying drastically, grands strike upwards and gravity returns the action to its base position, whereas uprights strike sideways, have shorter pivot points, and in the end have less weight making the action return, plus they often depend on fabric straps to help it to return in a timely fashion, which still results in significantly inferior key repeat rates.

(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.)


I've been to a concert that had an upright piano rolling around the stage, being upside down at several points. Apparently getting it to work involved installing some extra springs in the piano.

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.


"The algorithm minimizes the fingers speed needed to play a sequence of notes "

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.


I'm an organist, and I think these problems become even more severe when playing the organ. Every instrument is different, both because the organ itself is usually unique and because the room will be different. Some organs are large enough that it's best to think of the instrument as the organ plus the room (the strings and the hollow body, respectively, if we thought of it like a violin).

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.


Perhaps a machine learning model trained on the masters would be a better approach.


Or just read the fingering of the masters?


It's more complicated than that, as you want to transfer the learning to new pieces. In the end, it's really close to machine learning, as you want to create a rather complex loss function.

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.


Yes I know this rule: no thumb on black keys. My teacher says it is dumb, and I agree. It depends on the musical context. Thumb on black key can be a disaster or a brilliant solution. There a no rules and a lot of factors to consider. Good fingering is very subjective and depends foremost on musical understanding of the desired emotional outcome. I do not understand what statistics or machine learning can add here.


> 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.

Ugh. I'm hard pressed to even reach an octave using only pinky and index. You probably have bigger hands.


Yes - this algo lacks the insight required to really solve the problem.

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."


I suppose this was submitted because of https://news.ycombinator.com/item?id=29052747 (Fundamentals of Piano Practice) and specifically this comment: https://news.ycombinator.com/item?id=29053520


That Invention's fingering looks good, although left hand, bar 10, first note, I think I'd try 4 over 3 (and then 3-2-1 instead of 2-1-3).

For midi and lilypond files, check https://www.mutopiaproject.org/


Where do you get the .xml sheet music files?


Any site that supports MusicXML files. See a list of providers here: https://www.musicxml.com/music-in-musicxml/


I wish there was something open source and cross-platform like Synthesia. I find staff notation very frustrating but still want to learn to play existing music, at times.


Checkout my open source web version:

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.


Thanks, friend.


> I find staff notation very frustrating

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.


I wish Synthesia could allow user uploads and sharing.


I write a super basic open source version that lets you select a midi file:

https://github.com/benkaiser/learn-piano


The left hand fingering of the example puts the thumb on a black key and trills fingers 4 and 5: not good.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: