--bad code ahead--
this is how the images are stored
first the score then the texture right under
the program first scans the top image to a buffer from a pointer to some pixels ahead
we also update the pointer every 2 beats of the first sfx channel using stat(), this way the speed of the pointer follows the speed of the song (this method could be used to follow odd time signatures/rhytms by using %3 for example)
if we press a key we check the buffer at the right spot to check if you got the note right
if so, we paint a dedicated piece of the spritesheet with the right texture and set the buffer with a "empty" note
if you press a wrong note, we also paint it with the texture but with offset colors, and put a "wrong" note on the buffer
if you press on empty you paint the texture and set a "not empty" note
Once the song ends we just check the score textures and keep count of the errors
if black, is the end texture black?
if B or Y, is the end texture and img texture the same color?
and to do the medals you just peek and poke at the designated hex
and that's basically the whole mechanic, to create "expasion packs" it's just a matter of drawing over the textures, or creating new music but i've drawn too much already lol