It's just playing a sound on the keypress, but each note in the song has an individual sound assigned to it that matches the song. In Beatmania iirc, the sound assigned to each note is the section of the song itself, meaning if you miss a note, the song stops playing until you hit a correct note.