MidiEventSet

QWORD WINAPI MidiEventSet
(
	HANDLE hSequence, 
	WORD wTrack, 
	DWORD dwEvent, 
	DWORD dwWhat, 
	QWORD qwValue
);

This function sets properties of an event.

Parameters

Return values

Returns the previous value of the event property or BRELS_ERROR (0xFFFFFFFFFFFFFFFF) if an error occurred. The reasons for an error are an invalid sequence handle, an invalid track or event index, an invalid property constant or an invalid property value.

Remarks

Currently, only EVENT_TAG is supported. It is an user-defined WORD value with no influence on the behaviour of the API. The following example sets the tag of each note:

Example

HANDLE Sequence;
DWORD i;
BYTE Event;

// Open the sequence
MidiOpen("test1.mid", NO_DEVICE, &Sequence);

// Set the tag of each note
for (i = 0; i < MidiGet(Sequence, EVENT_COUNT); i++)
{
	Event = MidiEventGet(Sequence, 0, i, EVENT_EVENT);
	if ((Event >= 0x80) && (Event <= 0x90))
		MidiEventSet(Sequence, 0, i, EVENT_TAG, 666);
};

// Close the sequence
MidiClose(Sequence);

Further information

Released in November 19th, 2003
Updated in April 29th, 2004
Property of Breno de Lima Sarmento
Home page: http://www27.brinkster.com/brels
E-mail: breno_sarmento@hotmail.com
ICQ: 78977999 ()