Another hacked version for better beat detection