my project is now a success and I could find an algorithm to make the record button record the sounds of the piano keys, only record the last sound track, if we press (do) and then (mi), it will only record the ( mi) and if we only press (do) it will only record this one. apart from this I turned it into an advanced piano because combining sound tracks makes the rhythm of the music sound very bad, so I put a loop editor and player keys, in the loop editor it is possible to change the seconds so that Repeat again and again each key, (G1) is do (G2) is re, the same with all, and finally the reproduction of the keys that animates the corresponding keys as the (fa) or better explained animates the keys to the rhythm of the song in this way you can know which key is the one that is causing the sound, or which key is causing a bad sound rhythm, only with the loop editor we make the music have a rhythm. these are all the features that are already developed, there are many more tools to form a better sound.