Quick Info


The MIDIEVENT structure describes a MIDI event in a stream buffer.

typedef struct {

DWORD dwDeltaTime;

DWORD dwStreamID;

DWORD dwEvent;

DWORD dwParms[];




Time, in MIDI ticks, between the previous event and the current event. The length of a tick is defined by the time format and possibly the tempo associated with the stream. (The definition is identical to the specification for a tick in a standard MIDI file.)


Reserved; must be zero.


Event code and event parameters or length. To parse this information, use the MEVT_EVENTTYPE and MEVT_EVENTPARM macros.

The high byte of this member contains one or more of the following flags and an event code:


The system generates a callback when the event is about to be executed.


The event is a long event. The low 24 bits of dwEvent contain the length of the event parameters.


The event is a short event. The event parameters are contained in the low 24 bits of dwEvent.

Either MEVT_F_LONG or MEVT_F_SHORT must be specified, but MEVT_F_CALLBACK is optional.

The remainder of the high byte contains one of the following event codes:


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.


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.


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.


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.)


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 pics/MMEDIA00090001.gif that is, in microseconds per quarter note. (This event will have no affect if the time format specified for the stream is SMPTE time.)


Long event. The event data must contain a MIDISTRMBUFFVER structure.


Parameters for the event, if dwEvent specifies MEVT_F_LONG and the length of the buffer. This parameter data must be padded with zeros so that an integral number of doubleword values are stored. For example, if the event data is five bytes long, three pad bytes must follow the data for a total of eight bytes. In this case, the low 24 bits of dwEvent would contain the value 5.

See Also


Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database