moved analysis stuff to its own module, havent fixed the onsets yet.