Skip to content

Animated 2D Hands in Synthesia Clone

Prestissimo

PASHKULI

I have enough programming experience to give detailed technical instructions to my exact specifications. And Pygame engine is something I'm familiar with but never knew it could be taken this far. But if you're asking for a roadmap, I'm just going with the flow. I'm thinking of adding the ability for 3 or more hands or multiple pianos for the next major version 26.2.xx


PASHKULI

Prestissimo

Before you go on that a bit bloated tangent (to include 3, 4 hands — why?) can you do some reiteration on current design:
• refresh rate of MIDI piano roll — can it go to at least 48fps or better even 60fps?
• hands to get shortened to about just behind wrist — gives more height for MIDI piano roll and "zoom in" time (larger MIDI notes\blocks)
• better size of finger numbers on MIDI notes
• the .mid file export — each hand's notes to separate channels (the most anticipated of all)

It is getting to 90%+ perfect.


Prestissimo

PASHKULI

Can you elaborate on the second point? What do you mean by shortening the hands?


PASHKULI

Just to have more space for the MIDI roll notes


Prestissimo

PASHKULI

Ohhhh, okay! I'll have that as a setting in a new general settings menu in the main menu. That's definitely worth implementing!


Prestissimo

Implemented your suggestions as well as the ability to choose your soundfont. Dev build is here: https://github.com/V9011N/pygame-piano-animator/tree/equal-key

Steps:

Click on Code, then Download ZIP. Extract file to a location on your PC.

Install latest Python

Right click inside the folder where all the .py folders are at and Open in Terminal

First time only:

pip install -r requirements.txt
pip install --no-deps tinysoundfont

Then:

python main.py

For those curious about FPS performance, there is an option in settings to show FPS and frametime graph in the corner, as well as set an FPS cap (uncapped all the way to the right). Let me know what your performance is, I get 150-250 FPS in a 1080p window while a MIDI playing.


Gan122

Oh wow! I was actually working on a similar project a few days ago—though mine only involved finger tracking without animation, and I’m not very skilled at programming. Now I don't need to develop it myself anymore; I’ll definitely star your project on GitHub. Thank you for creating this open-source software—I really love it.


PASHKULI

Right, had to install Python 3.14 from MS Store (as they say from Python 3.16 there will be no installers for Windows):

Then had to run:

py -m pip install -r requirements.txt

py -m pip install --no-deps tinysoundfont

otherwise it complained: 'pip' is not recognized.
Keyboard position to bottom works fine.

→ FPS though seem to have no effect whatsoever. Even at 120fps or uncapped the finger numbers and MIDI blocks are still jittering on the screen. Have to press - (minus) to slow them down to read them but then shorter (duration) notes become too tiny.
Everything seems to work ok. A few

→ In all fairness the 'equal' key tail and black widths are not quite there; I guess that is because pixel perfect alignment got a priority.
→ similarly for the heads D, E compared to C
→ F, A, B compared to G (heads)
I screenshotted from 2k screen (2560 width × 1440), could it be 'pixel perf' alignment to avoid anti‑aliasing of edges?

Obsessing over it because then it obviously reflects on the midi roll lanes (notes) as pointed by the red arrows.
I am sure it can get perfect for those widths and the gaps between MIDI blocks will be also spot on.
Yes, C₈ will have its tail equal to its head (obviously). So the tail for A₀ will be the remainder from window width - all widths and gaps for 88 keys.

Can the code use .svg files? If yes, that will be great.

→ Would be great Handtasia to remember recent (latest) loaded midi file (also possibly the soundfont) no matter how many times I go to tweak settings and get back to 'play roll view'!


Prestissimo

PASHKULI

New dev build with your suggestions is out. There's now a "Recent" button on the main menu and the equal keys are now anti-aliased to preserve equal key width at all resolutions. Soundfont player is now built in so you no longer need tinysoundfont, just the requirements.txt libraries. For the high FPS performance, I couldn't reproduce it on my end, it looks fine at 150+ fps, you'll just have to do 60fps lock if it's giving you issues. Just focus on finding bugs now, it's time for another proper release.


PASHKULI

Great update.
Though still it does not 'continue' with the recently chosen midi file (asks to load it again when Esc, go to settings, return back to… continue).

FPS, I think the visibility (jitter) on those italic tiny finger numbers on MIDI notes will are jittering because italic is not pixel friendly especially with outlines and tiny size.

Here is a very simple suggestion:

Yes, some fingering behaviour needs edit, let me see:

Yes, managed to edit that finger to RH‑index end the exported midi now respects the requirement each hand to go on separate channel (just checked in Reaper as import midi)!

This is golden!

Please, change the fingering font: that is the main purpose of this app anyway → to see the upcoming finger
No outline, no italic → will improve legibility especially constantly moving (falling) pixel by pixel!

Ah, it will be great to somehow be able to "submit" finger changes\edits to a 'pool' of data export: composer, piece, hands (LH, RH), fingers (LHindex, LHthumb, etc.).
Will eventually accumulate to a alternative to PIG (database) or something but for Handtasia users. Or could be open‑type of exported (as edited) database

Ah, one more thing…

In the editor we can drag the time line (MIDI "hand" editor roll) and the hands play back and forth.
Would be even greater if we could do such "pause" and drag up down in the play window (main play MIDI roll).


Prestissimo

PASHKULI

You're clearly very invested in this, you wanna talk on Discord or something so we're not flooding this page?


PASHKULI

Prestissimo

No probs, of course I am invested. Been like that for 20+ years because I see what other things it could do.
Where is the Discord invite (channel)? Could not find any such info on your Github page.


Prestissimo

Discord invite link is now on the GitHub page


Grabowski

Hello, is it possible to re-use your code in my project? Is there some licence mentioned on your GitHub page I can refer to?
Awesome work!


PitchTempoAndriy

Grabowski, I checked the current main-branch file list and README: I could not find a licence for the application code there. The SIL Open Font License mentioned under Credits applies to the bundled Source Sans Pro font; it is not a licence for the whole program.

GitHub’s licensing guide explains the distinction between a public repository and code licensed for reuse. Prestissimo would need to confirm the intended permission for the code you want to use. A project-level LICENSE file and a short README note would make that much clearer for future contributors too.


Cosmolyoh

I’d love to have a small feature: a custom background image behind the falling notes. Right now the background is a solid fill with lane lines; being able to specify a picture (PNG/JPG) in the settings — maybe with an opacity slider — would make the exported videos feel much more personal.

Keep up the great work!

Also, the Discord invite link on GitHub is expired: discord.gg/HDRX89mQ9


« Previous Page