Press D, F, J and/or K when you see the note that corresponds the letter fall. Hit it at the right time, just before it touches the button. Click on green flag to get ready and when you're ready, click on the stage to start the music.
Inspired from O2Jam games. Created for CS50x (2020). *Disclaimer: the accuracy of sensing hit and miss notes could be improved.