Implemented threading for MIDI reading. Now reads into a global buffer.