After getting the MIDI capabilities, you must open a MIDI device to play or record MIDI messages. After using the device, you should close it to make it available to other applications. Use the following functions to open and close MIDI devices:
midiInOpen
Opens a MIDI input device for recording.
midiInClose
Closes a specified MIDI input device.
midiOutOpen
Opens a MIDI output device for playback.
midiOutClose
Closes a specified MIDI output device.