The audio stuff was not going as planned. There are two main reasons.
First, I found some audios online that are going at 100 BPM (beats per minute), such as Justin Biber’s Sorry. However, even if the music is 100 BPM, the first beat may not start at 0ms or a multiple of 600ms. So I wanted to write a program that auto-detect the first beat, which turned out to be quite hard. I guess if we have full control over the music (making the basic rhymic ourselves) this will be less of an issue.
Second, if we play a note when the player presses a key, then it may not sync with the beats and sounds weird. A solution to this is to delay playing the note to the next beat if it’s on beat. This works for a player input that is before the beat, but what about an input that is after the beat which may still be on beat (within a range around the beat)?