Keys C, D, E, F and G belong to the left Cap1188 chip which has an Alert Pin that's connected to GPIO 4 on the Raspberry Pi ( http://pinout.xyz/pinout/pin7_gpio4 ), and the remaining keys belong to the right Cap1188 chip, the Alert Pin of which is connected to GPIO 27 on the Pi ( http://pinout.xyz/pinout/pin13_gpio27 ).
The Piano HAT library uses these alert pins to get a better response rate when you hit the keys ( more playable, yay ) so I suspect there's something wrong with the connections on the latter.
Looking at the schematic, there's no pull-up on these lines so there could be a few things happening:
- The pin/pull up of GPIO 27 on your Pi might be fried for some reason
or ( more likely )
- One of the solder joints, either on the header, or the very top right most pin on the chip, is dry/flaky and not making a good connection
Have a look at the top pins on the right-most Cap1188 chip on your Piano HAT and let me know if anything looks amiss.
Similarly look at the header connection, the 7th pin from the right along the bottom edge of the header when you look at the back of the Piano HAT with the header at the top.
Sorry for all the potentially confusing and inane debugging steps! I get a little carried away when there's a mystery to solve.