Tip:
Each element in the array of parameter 3 represents one of the 128 tone types;
The MIDI channel is represented by 0 .. 15. For example, the channels 0 and 8 use the 0 tone, and The 0th elements of the array are $0101.
// Declaration: midioutcachepatches (hmidiout: hmidiout; {Device handle; this device should be an internal synthesizer} ubank: uint; {specifies the tone group; default value: 0} lpwpatcharray: pword; {tpatcharray array pointer; specifies the tone to be loaded or loaded in this array} uflags: uint {Option}): mmresult; {0 is returned successfully; possible error values:} mmsyserr_invalhandle = 5; {invalid device handle} mmsyserr_nomem = 7; {There is not enough space to load the tone} mmsyserr_notsupported = 8; {Device not supported} // lpwpatcharray related: ppatcharray = ^ tpatcharray; tpatcharray = array [0 .. MIDIPATCHSIZE-1] of word; {midipatchsize is a constant:} midipatchsize = 128; // uflags: midi_cache_all = 1; {load all specified sounds, if not all loaded, give up, clear the tone array, and return the mmsyserr_nomem} midi_cache_bestfit = 2; {load all specified sounds. If not all sounds are loaded, try to load them. Modify the tone array to indicate which sounds are installed, also, mmsyserr_nomem} midi_cache_query = 3; {modifying the tone array indicates which tone is being loaded} midi_uncache = 4; {loading and unloading the specified tone and clearing the tone array} is returned}
// Example: