Consolidate midi file / stream reading state machines