The MIDIEVENT structure describes a MIDI event in a stream buffer.
typedef struct {
DWORD dwDeltaTime;
DWORD dwStreamID;
DWORD dwEvent;
DWORD dwParms[];
} MIDIEVENT;
The high byte of this member contains flags and an event code. Either the MEVT_F_LONG or MEVT_F_SHORT flag must be specified. The MEVT_F_CALLBACK flag is optional. The following table describes these flags.
Flag | Meaning |
---|---|
MEVT_F_CALLBACK | The system generates a callback when the event is about to be executed. |
MEVT_F_LONG | The event is a long event. The low 24 bits of dwEvent contain the length of the event parameters included in dwParms. |
MEVT_F_SHORT | The event is a short event. The event parameters are contained in the low 24 bits of dwEvent. |
The remainder of the high byte contains one of the following event codes:
Event Code | Meaning |
---|---|
MEVT_COMMENT | Long event. The event data will be ignored. This event is intended to store commentary information about the stream that might be useful to authoring programs or sequencers if the stream data were to be stored in a file in stream format. In a buffer of this data, the zero byte identifies the comment class and subsequent bytes contain the comment data. |
MEVT_LONGMSG | Long event. The event data is transmitted verbatim. The event data is assumed to be system-exclusive data; that is, running status will be cleared when the event is executed and running status from any previous events will not be applied to any channel events in the event data. Using this event to send a group of channel messages at the same time is not recommended; a set of MEVT_SHORTMSG events with zero delta times should be used instead. |
MEVT_NOP | Short event. This event is a placeholder; it does nothing. The low 24 bits are ignored. This event will still generate a callback if MEVT_F_CALLBACK is set in dwEvent. |
MEVT_SHORTMSG | Short event. The data in the low 24 bits of dwEvent is a MIDI short message. (For a description of how a short message is packed into a doubleword value, see the midiOutShortMsg function.) |
MEVT_TEMPO | Short event. The data in the low 24 bits of dwEvent contain the new tempo for following events. The tempo is specified in the same format as it is for the tempo change meta-event in a MIDI file — that is, in microseconds per quarter note. (This event will have no affect if the time format specified for the stream is SMPTE time.) |
MEVT_VERSION | Long event. The event data must contain a MIDISTRMBUFFVER structure. |
If dwEvent specifies MEVT_F_SHORT, do not use this member in the stream buffer.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mmsystem.h.
Musical Instrument Digital Interface (MIDI) Overview, MIDI Structures, MEVT_EVENTTYPE, MEVT_EVENTPARM, midiOutShortMsg, MIDISTRMBUFFVER