Algorythm memory fix

rewrote song analysis code to take far less memory and prevent potential
system errors.