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.



