Thank you for the kind words!
The same but plays only drums at channel 10 (0x9)

P - play all drums
Esc - Exit

Code:
//Created by rojart 2009
#include <acknex.h>
#define API(name,lib)  #define PRAGMA_API name;lib!name
#define DECLARE_HANDLE(name) typedef HANDLE name
#define MIDI_MAPPER -1
#define CALLBACK_NULL 0x0

DECLARE_HANDLE(HMIDIOUT);
HMIDIOUT hMidiout;

DWORD __stdcall midiOutOpen(DWORD*,DWORD,DWORD,DWORD,DWORD);
DWORD __stdcall midiOutShortMsg(DWORD,DWORD);
DWORD __stdcall midiOutReset(DWORD);
DWORD __stdcall midiOutClose(DWORD);

API(midiOutOpen,winmm)
API(midiOutShortMsg,winmm)
API(midiOutReset,winmm)
API(midiOutClose,winmm)

int midiport = 0;

int on_p_event()
{
	int i; BYTE volume = 127;
	
	for(i=27;i<=89;i++)
	{
		midiOutShortMsg(hMidiout, (volume << 16) | (i << 8) | 0xC9);wait(1);    // Drum Sounds
		midiOutShortMsg(hMidiout, (volume << 16) | (i << 8) | 0x99);wait(-0.5); // Drum on
		midiOutShortMsg(hMidiout, (volume << 16) | (i << 8) | 0x89);wait(1);    // Drum off
	}
}

void main()
{
	//midiOutOpen(&hMidiout, MIDI_MAPPER, 0, 0, 0);
	//UINT result = midiOutOpen(&hMidiout, MIDI_MAPPER, 0, 0, 0);
	//if(result != MMSYSERR_NOERROR) printf("No MIDI output devices!",0);
	midiOutOpen(&hMidiout, midiport, 0, 0, CALLBACK_NULL);
}

void on_esc_event()
{
	wait(1);
	midiOutReset(hMidiout);wait(1);
	midiOutClose(hMidiout);wait(1);
	sys_exit(NULL);
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P