Implements a Hidden Markov Model for analysing key at a given beat.