It depends entirely on the contents of the MIDI file. If you are using a MIDI file that has a copyrighted melody for example, then it wouldn’t be royalty free. Using a MIDI file from a royalty free MIDI pack, however, would be royalty free.