Microsoft DirectX 8.1 (C++)

IDirectMusicInstrument8::GetPatch

The GetPatch method retrieves the patch number for the instrument. The patch number is an address composed of the MSB and LSB bank select and the MIDI patch (program change) number. An optional flag bit indicates that the instrument is a drum, rather than a melodic instrument.

Syntax

HRESULT GetPatch(
  DWORD* pdwPatch
);

Parameters

pdwPatch

Address of a variable that receives the patch number.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method can return one of the error values shown in the following table.

Return code
DMUS_E_NOT_INIT
E_POINTER

Remarks

The patch number returned at pdwPatch describes the full patch address, including the MIDI parameters for MSB and LSB bank select. In addition, the high bit is set if the instrument is specifically a drum kit, intended to be played on MIDI channel 10. This is a special tag for DLS Level 1, because DLS Level 1 always plays drums on MIDI channel 10. For more information, see MIDI Channel Messages.

Requirements

  Header: Declared in dmusicc.h.

See Also