externalizing the buffer operation from the midi.file class