Tip:
Each element in the array of parameter 3 represents one of the 128 drums;
MIDI channels are represented by 0-15. For example, channels 9 and 15 use the tone on the 60 key. The 60th elements of the array are $8200.
// Declaration: midioutcachedrumpatches (hmidiout: hmidiout; {Device handle; this device should be an internal synthesizer} upatch: uint; {specifies the drum color number; default value: 0} lpwkeyarray: pword; {tkeyarray pointer; specifies the key number of the drum tone to be loaded or loaded} 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} // lpwkeyarray related: pkeyarray = ^ tkeyarray; tkeyarray = 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: