Tell us about yourself!
To detect beats in music you need fft analysis. You can use Processing and code above with little adjustments to the code. For beat detect you can look here for some idea https://processing.org/discourse/beta/num_12305970... and here http://code.compartmental.net/minim/beatdetect_cla... In BeatDetect class you have method detect witch accepting buffer as a parameter, you can pass Arduino input (audio signal that come from analog input) and then use methods isKick, isSnare, isHat for detection. PS: you need to scale input signal in detect to be in range from -128 to 127.