You load a MIDI file into RAM by calling MIDIOpenFile() once. MIDIOpenFile() is passed the name of the MIDI file to load. This name can contain a full path, if desired. If MIDIOpenFile() is successful, then it will return an empty string. Otherwise, it will return a string that describes the reason for the failure.

For example, here we open the MIDI file named "blort.mid" and check if it successfully loads into RAM. If not, we display the error message:

err = MIDIOpenFile("blort.mid")
IF err \== "" THEN SAY "ERROR opening blort.mid:" err
Here we open the MIDI file named "c:\mydir\blort.mid":
err = MIDIOpenFile("c:\mydir\blort.mid")
IF err \== "" THEN SAY "ERROR opening c:\mydir\blort.mid:" err
You should check the return string from MIDIOpenFile(). If you attempt to call certain other RxMIDI functions before MIDIOpenFile() has been called successfully, then a SYNTAX condition will be raised.