Hacker News new | ask | show | jobs
by dandotway 1696 days ago
Does this book cover how to figure out finger numbering for sheet music that doesn't have finger numbering?

By finger numbering I mean the standard scheme where thumb=1, index=2, ..., pinky=5, and the notes on the sheet music have these numbers.

This is the biggest mystery to me. I understand there is not a One True Canonical Fingering for a given sequence of notes. But some fingerings make the music much easier than others.

Wish some HN coder genius would write a program that given sheet music as input, outputs the top 1-3 recommended fingerings for that music with explanations for which rules were applied.

14 comments

> how to figure out finger numbering for sheet music that doesn't have finger numbering

It is one reason why instrumentalists spend so much time practicing things like scales and arpeggios. Because in practice 90% of music is made of these or small variations on them, so once these are "muscle memory" you truly don't think about fingerings any more.

I agree with this. Scales more or less have an accepted fingering so if you practice these a lot, you'll gain some natural muscle intuition for when you see variations on scales and arpeggios in the wild.

When I took classical piano lessons, each week we'd have a new key assignment and we'd have to practice scales, chords, and arpeggios in that key.

My piano teacher hand crafted a very nice sheet that listed all scale and arpeggio fingering for all keys, but that is buried somewhere in storage. This website [1] seems to have the same info.

[1] https://www.pianoscales.org/major.html

This seems to provide a solution: https://github.com/marcomusy/pianoplayer
The fingerings in the example in the readme are completely non-intuitive for me. I've played piano for a few years and never encountered such fingering. My guess is that the algorithm is optimizing for the wrong metric.
What particular fingering looks odd to you? The only one I see, for the Invention in D, is basically the same as what's given in the Alfred edition of the inventions (and the Henle, and others...).
I just had a look at their example (BWV 775) and the first thing I noted was this: Second finger on the Bb in bar 8 makes no sense (there's no reason to not use the thumb there, especially as the following interval is a seventh).

I hope the internet won't become flooded with sheet music that has bad auto-generated fingering, because it's something that you really trust. If I encounter some strange fingering I trust that the composer knew something that I don't that I maybe should work hard to apply to my own technique, obviously this will damage your technique if it's nonsensical.

> Second finger on the Bb in bar 8 makes no sense

It seems all the more illogical as very similar patterns occur in bar 2, 6, and 10, and the thumb is used every time there.

(Not a pianist myself)

This is really cool, and probably deserves its own HN submission :)
>Wish some HN coder genius would write a program that given sheet music as input, outputs the top 1-3 recommended fingerings for that music with explanations for which rules were applied.

While I am NOT claiming to be "some coder genius", a program that does exactly this is something on my "projects to-do" list. My partner (who's improving her piano skills) keeps crying out for more sheet music with fingerings...

Is there already a canonical set of rules to apply? My approach is to find fingerings through a sort of beam search, using a utility function for how hard it is to move between points in a 10 dimensional "finger space".

I'm sure this approach is Probably Wrong or at least Overkill, but it's the most mathematically interesting way... :)

I was working on a similar project for nearly a year. I ran into trouble finding the correct fingerings and considered a very similar approach to the one you're taking - that is a simplified hand model with a cost-based heuristic.

My personal interest was more along the lines of acquiring statistical data from expert play. I'm supremely interested in this problem from a mathematical standpoint, but the data-set did not exist and I shelved the project as I'm a novice player.

I don't think the data-set would be very hard or very expensive to construct, given several experts and a program to generate note sequences. One could also sample from a large population of players, but then you have the bootstrap problem of attracting them before you offer enough value.

There are some very promising pathways for this developing if you're interested in the statistical approach. In any case I'd love to keep up with your project if you continue on.

I think it's probably not overkill, and actually I think it may need to be more complex than that (though simple methods may prove to work well enough in practice, so try them first!). There's all sorts of stuff do do with momentum, wrist angle, position back or forward on the keys, etc., so it depends on where on the keyboard the notes are and what notes are at the same time or before and after them, and so on. To look for optimal fingerings I'd probably model a hand and arm geometrically, with fingers on notes being constraints for a trajectory through hand-arm space.
> actually I think it may need to be more complex than that...

I like the way you think. thumbs up

Going the other way from mkl, I wonder if you don't really need beam search. Approximate as a finite state space, use https://en.wikipedia.org/wiki/Viterbi_algorithm
I've seen some papers about optimizing piano fingering on arxiv before. They used various kinds of machine learning. Some papers dealing with guitar fingering, too.
MIT OCW 6.006 talks about this (in much higher resolution than when I last saw!): https://youtu.be/TDo3r5M1LNo?t=2806

An optimal fingering for n notes played one at a time by an F fingered hand can be found in nF^2 time, or I believe n(F^F)^2 if you allow F note chords. "Optimal" in the sense of minimizing a cost function defined in terms of state transitions: c(t, f, t', f') is the cost of playing note t with finger f, followed by note t' with finger f'. E.g. c(a3, 1, b3, 2) < c(a3, 1, b3, 5) because it's unpleasant to scrunch your pinky (5) that close to your thumb. (Notably, t/t' do not mean t_i and t_j, two notes in the piece.) There are papers quantifying such cost functions, apparently.

Side rant -

Having grown up on violin, but learning piano as an adult, (and as a programmer), it kills me to index fingers from 1 (thumb) to 5 (pinky). Violin doesn't use the thumb, so the pointer to pinky are 1->4! Worse, as a Suzuki violinist, I hear (to some approximation) the number of the finger I'm thinking about while playing. Worse yet, I read bass by "adding two" notes to treble, so I get a nice off-by-two to think about with my off-by-one.

I should, uh, probably get a teacher.

Fingering is largely a planning problem. If your RH thumb is on C and the next note is D, it's obvious you play it with 2. But if the next note is the B below, you'd have to do something awkward to play it. So having your RH thumb on C is wrong and you need 2 on that to play the B with your thumb. Unless the next note is the A below. :-)

If you look ahead a bit at a line of music, you can sort of anticipate how many fingers you'll need in the direction you're going and that helps plan which ones to use. But as others have said, knowing how to play scales contributes a lot to your planning skills.

It's usually not too hard to figure out a fingering that works. Just don't do anything that feels really bizarre or involves stretching in a weird way. As you get into harder music you have to have an open mind -- it's not unheard of to do weird finger-crossing (like having a scale end with 4-5-4) or playing a line with some of the notes covered by both hands or crossing hands. But for the most part it only takes a few seconds to find a natural way to play any particular passage.
> Wish some HN coder genius would write a program that given sheet music as input, outputs the top 1-3 recommended fingerings for that music with explanations for which rules were applied.

You must first access the corpus of data on fingerings. AFAICT that is an oral history passed among piano teachers.

Even then, you must account for how different fingering approaches quantize to various tempo changes. E.g., there's a tempo beyond which I can start throwing my thumb (well, my arm) past my pinky in the development section of the last movement of Beethoven's Appassionata sonata. Below that tempo the fingering is basically nonsense.

You could probably put together some basic set of rules for recommended amateur fingerings. Even there, I think the quantization to tempo is sufficiently complicated that you'd risk creating something like an ML algo that merely improves at persuasively rationalizing arbitrary fingerings.

Edit: I just looked back at the passage and it's actually throwing my index finger past my ring finger. Funny enough, I tried the same passage throwing my thumb past my pinky-- it works fairly well at a fast enough tempo and is awkward and error prone if played too slowly. In either case, the same logic applies.

Hand size, too. I have big fuckin' hands, and I can comfortably manage chords in eg Chopin pieces that my (small, female) piano teachers had to roll. Conversely, they could more easily do some of the arpeggiation that I'd almost literally fat-finger at non-practice tempo.

I'll also add my anecdata to the parent's thoughts on quantization of fingerings to tempos. I like ragtime, and I've grown to notice that playing it properly (that is, slowly, as Joplin is always going on about in the margins) often requires what is essentially more difficult fingering than that which is required to play it quickly (that is, the !!FUN!! way). Someone in another subthread mentioned having to physically model the arm and hand. I think that's essentially correct.

>You must first access the corpus of data on fingerings. AFAICT that is an oral history passed among piano teachers.

At the risk of a vague digression, I'd also like to point out the difficulty the parent had in extracting exactly what their hand was doing outside of the context of "sitting in front of a piano, playing the notes in question". The whole point of fingerings being added to a difficult section -- whether by the publisher or the performer -- is to aid the speedy automatization of that difficult section, with the aim of converting it into an uncontroversially straightforward section, like those in the rest of the piece that don't need fingerings. The best piano teacher I ever had, when working out fingerings for a difficult unlabelled section, would play it slowly a few times while looking at, and thinking about, her finger position. Then, she'd try to play it at as close to full speed as she could, and observe what her hand was doing. That is, leverage the automatization that fingerings are supposed to supplement. It's not just piano teacher oral histories one should ought to digitize, it's also piano teacher premotor cortices!

> ... and the notes on the sheet music have these numbers.

I grew up with a piano in the house, have had sheet music for loads of instruments (played sax, piano, guitar, family had trumpet/clarinet/misc in house too). Have taken music theory classes, performed in bands in middle/high schools and college.

I've never seen sheet music have 'fingering' info ever.

Can someone point me to examples of what is being referred to here?

When I was young and learning piano my teacher would use pencil to write in the suggested finger number above notes. Thumb=1 pinky=5. This was a good reminder when reading the sheet music of where on the keyboard my hands should be positioned.

Image search returns some examples: https://ddg.gg/?q=piano+sheet+music+fingering&ia=images&iax=...

It's also very common for string instruments, even at higher levels for difficult passages.
> I've never seen sheet music have 'fingering' info ever.

Classical guitar sheet music often has markings for fingering. See the first example on this page. http://lilypond.org/doc/v2.21/Documentation/snippets/fretted...

Beginner piano books often have fingering hints, it’s just finger numbers beside the notes. It makes playing easier when you can’t sight read but is not so useful after that. So it’s not surprising you haven’t seen it.

I’d contend finger numbering is more about learning the notes of a piece easily for beginners rather than about actual fingering.

Having the same struggle as an adult learning piano.

How do highly-skilled pianist come up with fingering? Are there any kind of rules? I think there are. But it may be so automatic that they don't actively think about them.

On the other hand, if we have a large quantity of high-quality sheets with fingering labeled, we can train a transformer which is supposed to learn the implicit rules pretty well.

I have an undergrad degree in piano. The problem is that at higher levels it becomes more dependent on your own biology. Some of it is hand size, some of it is the layout of the tendons in your hands - some people get tendon click in ways that other people don't.

Practicing includes the identification of the fingerings that can work for you. I don't think AI will ever get you all the way there. Sure, you can put in some beginning rules like don't cross your thumb under from a white key to a black key, but there's always going to be a fingering that is ideal for one pianist that won't work for another.

Thanks for the insights.

For casual adult playing though, I'd never reach" high level" playing. All I want is to play easy songs I like (I'm sure there are plenty of people like me), for which I think an automatic algorithm is pretty likely to work.

(Pianist here) But there is no objectively correct fingering, it's just what feels best/easiest/smoothest for you, personally. Having to read the fingering as well as the notes just seems to make it more complicated.

Even for the simplest music, say a C major triad chord in the right hand - C-E-G - you could play it 1-3-5, 1-2-4, 1-2-3, 2-3-5 etc. I have big hands, so 1-3-5 feels the least comfortable of those, although it may be the 'automatic' choice. I agree with what others have said, that learning scales and arpeggios teaches you almost all you need to know about sensible fingerings on piano, and then having fingering pre-written on any music is entirely unnecessary. Books of scales and arpeggios have fingering written in, which you should learn.

The automatic algorithm can definitely take hand size into account.

I often feel that the fingering I come up with myself as a beginner is suboptimal. What I usually do is to watch youtube videos repeatedly to study what experts do. And that really helps me correct some bad adhoc fingering. I'm sure it's an experience thing - I can totally understand why experts would consider fingering on a sheet as useless. But for beginners it can make a huge difference. You probably don't care about beginners. But that is a huge market with strong needs unsatisfied (besides auto-fingering, auto-transcription of popular songs is another one).

> You probably don't care about beginners

My second paragraph was about beginners and what seems to me their best course, not sure why you say that. (TAB for guitarist beginners similarly "can make a huge difference" I'm sure, but also it keeps you a beginner.) It seems you ignored what I said about scales and arpeggios. I wrote my previous comment because it seemed you similarly ignored what the person you replied to said before. But sure, whatever works for you. Good luck!

(1) Keep a couple of pencils on the piano to write your fingering on the manuscript, (2) Feel free to ignore the editor's fingering if it's clunky for you, (3) No premature optimisation. Play through sections multiple times before deciding on fingering. If there are two apparent solutions to some fingering problem you might need to try both and then sleep on it, (4) Once you've decided on a fingering, stick to it, because otherwise you risk tripping up by regressing onto a previous fingering.
The difficult jumps are usually write tge changes, but once there, it would seem redundant to keep numbering as it's obvious to someone at that level playing.

If you're learning on your own as an adult, I highly recommend "Alfred's Basic Piano Course" book 1. You start from the very start, and by the end of the book, you'll be able to sight read

It appears to be experience -- highly skilled pianists have played similar passages for pretty much any sheet music you could give them, and select fingerings from experience. This breaks down for music that's deliberately difficult to finger, or has usual repetition (think Ravel's Ondine, or Islamey).
Experience, sight-reading skill, and experimentation. My piano teacher used to play passages that needed fingering at full speed several times with different fingerings to find one that would work for me.
You pick up relatively quickly fingerings that work. It's a matter of intuition and pattern matching.
> I think there are. But it may be so automatic that they don't actively think about them.

That is, unfortunately for someone trying to learn, the entire goal of learning to play piano in a way. To turn the entire process from looking at a sheet (or hearing it in your head) to sounds happening to become essentially instinct.

The best way to do this is repetition. This is what scales and arpeggios and excercises are for. By internalizing the scales you build up what feels correct, based on your hands, the length of your fingers, the different strengths and weaknesses of every single joint and bone and muscle and tendon. You have to use the repetition to find out what each transition and different motions feel like, and interpolate that to what's in front of you.

I am leaning to play piano on a disguarded Hammond CMS-103. (Someone put this out by the curb with a free sign. It was originaly over 7 grand. Why did I include this. Because I'm shocked at what people toss.)

Anyway, I labeled all the keys on my machine. C-D-G-F-G-A

I memorized C for chopsticks. (C will always be the white key to the left of the two black keys.)

I memorized F for Fork. (F will always be to left of three black keys.)

I then found a song I liked on Google with chords.

I picked a Ronny Millsap song, and played it over, and over again.

Am I any good--hell no, but keeping piano/guitar simple helped me.

Eddie Van Halen saw that his son was having a very hard time learning to play bass guitar. Wolfe told his father their are just too many chords. Eddie gave him some great fatherly advice.

"You don't need to learn all the chords. 11 chords will allow you to play a lot of songs."

A lot of Country, and rock, songs only have a few chords.

I've played almost 25 years, including some professional.

To answer you... I don't come up with fingering. I just do what my hands do. The fingerings in printed music are guidelines for pedagogy.

Honestly I'm not even sure I explicitly practice fingering. It's just repetition. I frequently think I change it though.

That being said as someone whos played so long it's like an extension of my arm, don't take my word for it. Experts are notoriously bad at explaining their techniques. I do think it's just practice though. No secret

The same applies to guitar fretboard where I think it's a really interesting graph theory problem. I think I saw someone post about it on HN a while ago.
It's similar but maybe slightly different. At least with bass guitar, the different positions you can play the notes will end up with the notes sounding slightly differently even if it's the same fundamental frequency (particularly open strings sound dramatically different, but even outside of that each string has its own sound). Also there might be a consideration about how the transition between two notes sounds which could be affected by whether the 2nd note is played on the same string or a different string than the first. I expect most (if not all) of these concerns would apply to any stringed instrument where the length of the string changes. It's not something a beginner would need to worry about generally but that might be why such a thing doesn't exist already - the pros all have their own unique methods for determining fingerings.
Not to mention that there are multiple schools of thought on fingering. I'm a 1-2-4 player, likewise on double bass.
I don't play piano, but double bass and cello. A challenge that I see is that a great deal of sheet music is still not available in computer readable form. So there's no data, much less labelled data. And the pace of introducing new material is painfully slow.

A problem may be that once fingering becomes intuitive, then there's no incentive to write it down, and you might not even be able to articulate why you chose a particular finger.

I only think about it when I'm trying to work out a difficult passage, and then I'm usually thinking of intervals and shifts that afford me the best chance of playing in tune. Fortunately that's not an issue on the piano, but the idea of finding an ergonomic and less mistake-prone fingering is probably a similarity.

On the other hand you might be surprised at how little it might cost to have a pianist or piano student number some music for you. At least on cello and bass music, when material has fingerings, they only need to indicate the ones that are non-obvious.

I'm a collaborative pianist by profession. The discussion of fingering here is interesting. Much can be said about fingering but first and foremost it has to serve the musical intent and I would be surprised if any algorithm could surface those intents because (thankfully) they come from a place that is highly personal and emotive, e.g. the 1st finger (thumb) doesn't belong here because it's too heavy and falls on the end of a delicate appoggiatura.

That said, many fingering choices are practical and dictated by the geography of the keyboard and the oddities of our hand anatomy. Armed with a knowledge of the fingering of all of the major and minor scales, the patterns and paradigms encountered in actual compositions become clearer. I recommend MacFarren's scale book but there are others. Beyond pattern recognition and an attempt to understand the musical intent, there's just trial and error. When approaching a new work, I'll spend quite a bit of time trying options in ambiguous passages. It's time well-spent. Pro-tip: don't write in every single finger number. It creates too much visual distraction on the page. Write in only when there's an inflection point. If you have a descending passage in the RH that is 5-4-3-2-1-3-2-1, let's say, just write the 5...1-3 or possibly just 5...3. String players are the absolute best at this concept, only annotating finger numbers when there's a shift of position or an odd extension.

A voice of reason in a sea of STEM bro self indulgence
I think you're looking at this as an optimization problem, and while to a reasonably large extent it is, it's also a question of interpretation, because where you put your emphasis depends on where you start you're phrases and how you contour the phrase, and if there's multiple lines happening on a single hand what's the main line, if there is one?
> I understand there is not a One True Canonical Fingering for a given sequence of notes.

True. For any given passage, there are at least two different One True Canonical Fingerings, and no matter what you do you will be Wrong and criticized without mercy for your ridiculous incompetence.