Paste: Example MIDI Thing

Author: Serre
Mode: c
Date: Mon, 13 Jul 2026 02:04:59
Plain Text |
#include <windows.h>
#include <stdio.h>

#pragma comment(lib, "winmm.lib")

int main(void) {
int mahNotes[] = { 0x007f3c90, 0x007f4090, 0x007f4390, 0x007f3c80, 0x007f4080, 0x007f4380 };
HMIDIOUT hMidiOut;
int i ;
// Open device
midiOutOpen(&hMidiOut, MIDI_MAPPER, 0, 0, CALLBACK_NULL);
// Send Note On message
for(i = 0; i <= 5; i++){ 
	printf("Note Sent: %x\n",mahNotes[i]);
	midiOutShortMsg(hMidiOut, mahNotes[i]) ;
	Sleep(200) ;
}
// Close device
midiOutClose(hMidiOut);
Sleep(3000) ;
}

New Annotation

Summary:
Author:
Mode:
Body: