Preloading Patches with Internal MIDI Synthesizers

Some internal MIDI synthesizer devices can't keep all of their patches loaded simultaneously. These devices must preload their patch data.

The Multimedia extensions provide the following functions to request that a synthesizer preload and cache specified patches:

midiOutCachePatches

Requests that an internal MIDI synthesizer device preload and cache specified melodic patches.

midiOutCacheDrumPatches

Requests that an internal MIDI synthesizer device preload and cache specified key-based percussion patches.

Summary: The PATCHARRAY Data Type

The midiOutCachePatches function takes a pointer to a PATCHARRAY to indicate the patches to be cached. The MMSYSTEM.H file defines the PATCHARRAY data type as follows:

typedef WORD PATCHARRAY[128];

Each element in the array corresponds to a patch with each of the 16 bits representing one of the 16 MIDI channels. Bits are set for each of the channels that use that particular patch. For example, if patch number 0 is used by physical MIDI channels 0 and 8, set element 0 of the array to 0x0101:

Summary: The KEYARRAY Data Type

The midiOutCacheDrumPatches function takes a pointer to a KEYARRAY to indicate the key-based percussion patches to be cached. The MMSYSTEM.H file defines the KEYARRAY data type as follows:

typedef WORD KEYARRAY[128];

Each element in the array corresponds to a key-based percussion patch with each of the 16 bits representing one of the 16 MIDI channels. Bits are set for each of the channels that use that particular patch. For example, if the percussion patch for key number 60 is used by physical MIDI channels 9 and 15, set element 60 of the array to 0x8200: