Attempt to fix beat detection, improved speed but inconsistent results