typedef struct
	WORD wTag;
	DWORD dwTicks;
	BYTE Event; 
	BYTE DataSize;
		BYTE Data[4]; 
		LPBYTE lpData;

This structure is used to represent MIDI events in the API. It is more convenient than the MIDIEVENT structure provided by the Windows™ API.



Use the correct data size when creating MIDI files otherwise the sequence will be encoded incorrectly.

Short events are the ones with predefined sizes, generally zero, one or two bytes. Long events are the ones with variable sizes, such as names and texts inserted in the sequence. However, some events do have predefined sizes but are considered long events due to the MIDI specification. That is the case of tempo (0x51), which is three bytes long.


For an example of code, see MidiInsertTrackEvents

Further information

Released in November 19th, 2003
Updated in April 29th, 2004
Property of Breno de Lima Sarmento
Home page:
E-mail: [email protected]
ICQ: 78977999 ()