It works by gathering statistics on the entire file over all time. This implementation is not designed for incremental updates to the transition matrix. You can write a MIDI file and then use it as the basis for an HMM (just not continuously, while you are in the process of writing it).