added beat detection to the music handler
now it detects beat at hopefully the correct time