Skip to content

Animated 2D Hands in Synthesia Clone

Prestissimo

Hello everyone!

I've always wished Synthesia and other MIDI visualizers out there had actual animated hands zooming around playing, so with all this talk of Claude Opus 5.5 coding abilities, I've finally brought this idea to fruition despite my limited Python knowledge. Made entirely in Pygame, it features the well known falling notes of many MIDI visualizers that have taken storm on YouTube but now including not only the lively animated hands, but the ability to customize their looks and behavior, from finger curvature, wrist rotation, wrist bounce, note anticipation, and more. The fingering algorithm was developed using my own knowledge as a hobbyist pianist of almost 20 years, the Hanon exercises, and the PIG dataset (https://beam.kisarazu.ac.jp/research/PianoFingeringDataset/) featuring many pieces fingered by experienced pianists, and it pretty much matches published statistical models. Despite this, it still does funny things here and there, which is why this project also includes a fingering editor for MIDI files so you can fix and fine tune whatever the algorithm produces. It features a "sequential fingering mode" similar to what's in Musescore where you can finger using key presses and it automatically advances to the next note or chord, and you can bake that into a new exported MIDI file.

GitHub repo link for more details and to try it yourself: https://github.com/V9011N/pygame-piano-animator

### Sample Vids Showing the Different Hand Skins

Bach Solfeggietto Example with Skeleton Hands

Bach Solfeggietto with Skeleton Hands

Beethoven Waldstein Example with Robot Hands

Beethoven Waldstein with Robot Hands

Debussy Arabesque Example with Human Hands

Debussy Arabesque with Human Hands

Cuphead Show Example with White Gloves

From The Cuphead Show with White Gloves

I'd love some feedback from a technically minded pianist community on how this looks and functions. Let me know if you have any suggestions for more realistic hand kinematics, more intelligent fingering, or new features.


David B

Pretty cool. I've never used Synthesia to learn anything, but I might try someday, and I can see how the hands would make the process easier for me. Thanks for sharing.

God Bless,
David


PASHKULI

This is amazing effort.
Next step could be smoothing out the animations for the fingers with S curve: easy‑in and easy‑out so the moves look more natural.

Years ago (more than a decade) I had this idea to have sensors (tiny) on a pianist's hands in order to track their movement for similar purpose. To play some of the well known compositions in various styles — so different players to be involved.

The downside was the money needed to pay those players and the possible inconvenience of having wires + sensors attached to their fingers whilst playing. To bad they used such opportunity as an effects controller:

This one was more like it:

• yes, very much inconvenient with all those wires but the idea was worth it (albeit a bit expensive)

Originally, I intended it for guitarists to automatically write TAB (tablature) notation but those wire would have been even more of inconvenience for guitarists obviosly.

This asks for a 3D rig model in Blender + the sensors for tracking + mapping the movements. Then imported into Synthesia or SeeMusic, Neothesia.
I mean, just look what people have done:


Prestissimo

PASHKULI

I've had the exact same idea for years as well! Partly built off of the frustration of the camera panning away from the fingers during technically demanding parts, and partly because it could be used as training for a AI piano teacher that can just look at your hands and correct your technique. But with how much camera recognition has improved, you probably won't need sensors on the pianist's hands, just well placed HD cameras and MIDI data should be all you need to reconstruct the exact performance. What do you think?

I'll be continuously improving this project, current version already looks better than the videos.


CyberGene

This is a very cool project! If you ask me for some feedback, watching the fingers from above doesn't make it apparent that they are pressing the keys. You may want to think of some way to accentuate this more, like e.g. keys showing a shadow when pressed, fingers getting shorter or just randomly moving a bit when pressing keys, etc.


PASHKULI

Prestissimo

That AI real time recognition and correction as a "teacher" might not happen that smooth.
The idea with the sensors on pianists fingers to play some few pieces from each style is to teach the AI (or ML) to get a good idea how to "move" the virtual hands (ideally those hands should be as the Blender model of a hand in 3D). In my third piano article published a couple of months ago I modeled a basic 3D hand (far from the one above) to show some of my ideas behind wavy piano keys. It was a pain to rig all fingers and move them. With a sensor "glove" would take seconds!

I am really impressed how much you have advanced with just this "from top projection" model. The fingers might need to be a bit less thick though. Some moves "stretch" a finger unnaturally, but is really great how it turnes out, because this is just the beginning for you, right?
Do you know about Neothesia or SeeMusic? Or just prefer to develop the whole piano roll interface on your own?
I can suggest some design adjustments, mostly to equalize the widths for the keys to match the falling notes' lanes. I can see you have gone the usual way where the wider ("white") notes also touch the "black" at the lighting line of the keyboard. I think notes should be same width and if you need a hint to whether it is "white" note to have a line of that color at the front, something like this (the "black" notes do not need it):

• or just a white line at the start of note
• piano roll slight shading is also much appreciated (at least to me), very gentle though (I over exaggerated it there)
• hope you get the idea


PASHKULI

Here is how to separate the keys and set equal tail (Xt) to "blacks" (b):

• yes, the heads of the "white" keys are different as grouped but do not worry, most MIDI rolls in DAWs (Reaper for example) are also like that
• the hardware synth Osmose (by Expressive E) also has these proportions
• if you'd like to have equal respective widths the setup is much more intricate but for such UIs is not that crucial

t — tail width
b — "black" width
h — head width
g — gap width

• gaps you can set them as 1px (one pixel) or 2px, 3px depending on the resolution of the display (SD and HD displays g = 1px is ok)
All Xt = b and lets say they will be = 30px (exceptions will be the tails at each end for keys\notes A₀ and C₈), so

86 tails + C₈h + 87 gaps = ScreenWidth - A₀t

ScreenWidth (for full screen) can also be WindowWidth if you'd like it scaled.
We know the gaps, let g = 2px (or 1px) and the tails to be 30px (for 2K monitors) or 25px (for HD monitors) or whatever.
On average t = 14g or 15g or 16g… if g = 1px then t = 20g or 22g (dark gaps might make "black" keys look wider but "white" keys emit the pixels' light so will get balanced).
Length of "blacks" are about ⅔ × the whole length of "white".
Anyway, take a look at .svg attached or you might draw it with a code, you can see the basic structure above and try it from there.

I mean, tell me it is not perfect. Only if you know about the width discrepancy you could spot that the white heads are not equal where explained as constructed.
Whet keys → white finger number symbol. Black → black number. I think it is very simple and meaningful this way.


PASHKULI

Here is a version with "standard" width (not narrow) HD format 1920×1080 resolution:


here is the corresponding .svg


PASHKULI

Final fancy version in .svg (opens great in Inkscape, the recent one) with shadows, rounded edges, reflections.
Keep in mind shadows are tricky: for example if E and F arpe pressed together then F should loose the shadow from E (E will have the deeper shadows from the keys on its left).
If black and next to the right white are pressed together then the deeper shadow from the black should be off.


Prestissimo

Implemented the equal keys as an optional toggle in the main menu, as well as other features like glissandos and the ability to sync rendered audio to the animations. There's now also an .exe release on the GitHub page, so no need for Python if you just want to run it https://github.com/V9011N/pygame-piano-animator/releases/tag/Executable

Gonna leave this one alone for now, it was a nice experiment, but I think if you want to make convincing procedurally animated hands you HAVE to go 3D.



PASHKULI

Prestissimo

Brother, do not leave so fast. This tool is almost magnificent.
I loaded it some of those single channel midi files from Rousseau and it "split" the hands… well not perfect but well enough! It is much better than that "Split" paid tool which I reviewed in the other thread and it was terrible.

Here me out:
• now we can get a MIDI export function, but each hand (blue and green) needs to get assigned to their own MIDI channels (1 and 2, or 3 and 4)
• this will get some very tedious manual work done to at least 80% (yes, it does not match the hand's finger moves of Rousseau to 100%) but it is there very close!
• midi editor is there
• the hands (forearms do not need to be so long) → it will be great the keyboard to get closer to bottom edge of screen (see screenshots) → will leave more space for shorter notes to get larger in size and time scope

You got no idea but I have been looking for such tool for probably 20 years!
Your work is not done yet: the midi channels separation (export) per hand is a must!

I understand it is "vibe‑coded" with Claude but squeeze that AI bot a bit more (a lot more!) for the sake of comprehensiveness this tool should be able too pull off.


jenpal

I use Notation Composer (by Notation Software) to split my piano recording from MIDI below. It’s not accurate, but I think it’s okay. Then I use the Synthesia app to show the falling notes with left and right hands in different colours, but it doesn’t show the animated hands, though.


PASHKULI

jenpal I use Notation Composer (by Notation Software) to split my piano recording from MIDI below. It’s not accurate, but I think it’s okay.

The question is, do you split them yourself by selecting and so on? If so, you do not need a special software — you can do that with any free MIDI editor or such within a DAW: Reaper DAW (somewhat free, but not expensive) is what I typically use or Cubase (rather quite expensive).
In fact there is no really good dedicated MIDI editor for that purpose but some free are not that bad such as http://www.midieditor.org/.

The idea behind 'hand split' should come from real score (scanned, recognized and digitized). Typically bass clef is = left hand, treble clef = right hand (regardless whether the pianist is right or left handed → pianos are ignorant about that fact of human nature).

So, typically such score editors (most of them paid) such as Sibelius, Dorico, Finale (r.i.p.), MuseScore (free but the score base is a subscription), have their own formats and export to MIDI should be able to separate the hands into 2 separate MIDI channels. Bu most people today record their performances directly from a keyboard controller to a piano roll and do not bother to separate the hands (first they need to 'split' the hardware keyboard output typically at C₄ = 'middle C'). Some notes will have to be assigned in post‑recording edits (crossing hands and such). This 'split' on the output should be default behaviour, at least when piano\organ sounds are involved.

Scanning scores is also an option but is the most expensive one: you need good scanner, ScoreScan software, great condition score books. I have experimented with such and it is very time consuming and also needs edits in post.

@Pianissimo so far has done almost 90% of the job in a single app. It can not guess perfectly, but it is about 80% there. Just needs channel separation on the guessed hands.
I hope he adds this to the functionality. It is there, just needs to be finished.


Prestissimo

PASHKULI

Fear not, just my usual bout of self-doubt embarking on new, especially experimental projects like this. As you may have noticed on the GitHub I am still updating this. I'll keep up with this page and keep reading your suggestions. Please, please be nitpicky about anything that seems off with the hands, that's the hardest part to even verbalize to Claude to implement.


PASHKULI

Prestissimo

Unfortunately, I am not a pianists, therefore my finger assignment related questions (prompts) to Claude would be pointless. More so, because I think the left hand notes direction on piano should be… flipped. Essentially making learning piano 4 to 5 times faster\easier more intuitive for the brain, muscles.

But please, let Claude know that the left hand notes should get exported to the next MIDI channel out. If right hand is on channel one, left hand notes should get exported (Save as… midi) to channel 2. This will be the best really and I have been looking for such a feature for 20 years, which is a (hopefully you can make it) biproduct of your Handthesia.
I really prefer to call your app Handtasia (from hand and fantasia).


Prestissimo

PASHKULI

Yeah, that's a good name for it too!


jenpal

PASHKULI The question is, do you split them yourself by selecting and so on? If so, you do not need a special software — you can do that with any free MIDI editor or such within a DAW: Reaper DAW (somewhat free, but not expensive) is what I typically use or Cubase (rather quite expensive).

The Notation software I use automatically splits the right and left hands, but not accurately, though. I’m hoping AI will improve this or at least eventually.

Thanks for mentioning manual splitting in DAWs and other free software. I haven’t explored that yet and might try it with my Ableton Live if it has that feature and if it is easy to use.

When I made my tutorial video above, I considered manually splitting it, but my notation software presented it as sheet music, which I can’t read, or at least not easily. I prefer visual falling notes with simulated hands and would like to easily modify hand assignments as I work through the piece and adjust the tempo as necessary.


PASHKULI

jenpal

Yes, I searched about this 'Notation Composer' scoring software (German?). It seems to not support MIDI roll view and does not have a MIDI editor.
I can only recommend you using Overture 5.x (it does it all). It offers a cross‑grade discount if you fill in the current scoring program you use (ah, sorry it does not mention 'Notation Composer', oh well).
It does hands (bass and treble staves) to MIDI channels export.

Yes, Ableton has great and extensive MIDI edit and import\export support.

I have Overture 5.x alongside MuseScore (free) and Notion 6 (by Presonus, recently acquired by Fender). The problem with score notation programs is that they all have their own format file, which is a pain for exchange. Using MusicXML as interchangeable export format works only partially (for simple scores).


PASHKULI

Prestissimo

Brother, I just tweaked the hand anatomy editor. Really great stuff! As far as UI, seems you did full Synthesia workflow with more improved MIDI roll background.
I mean Synthesia might go in the archives soon.

Are you a programmer? I would like to use Claude and tried for a few ideas but it was total garbage. I mean, probably my prompts were.
If you do not mind, give us more info on the dev. as Hand‑thesia is now in version 26.x from what I can see.


Next Page »