MIDIEVENT  TN97S9 

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

typedef struct { 

    DWORD dwDeltaTime;

    DWORD dwStreamID;

    DWORD dwEvent;

    DWORD dwParms[];

} MIDIEVENT;

 

Members

dwDeltaTime

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

dwStreamID

Reserved; must be zero.

dwEvent

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

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

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.

MEVT_F_SHORT

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:

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 midiOutShortMsgH.83QQ 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.

 

dwParms

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

MEVT_EVENTTYPE, MEVT_EVENTPARM, midiOutShortMsg, MIDISTRMBUFFVER