Share via


Ensuring Timely Band Changes

Windows Media Encoder SDK banner art

By default, all bands are given an offset of -1 tick from the beat where they are inserted. The reason is that if any two MIDI events occur simultaneously, there is no way to predict which event will occur first. If a band change were timed to coincide exactly with the first note of a measure, the note might not play on the correct instrument.

Note When you import a MIDI file as a segment, you must take special care when the MIDI file contains GM or GS resets at the start of the file. Because a band imported with a MIDI file is placed at tick –1, any GM/GS reset at measure 1, beat 1 will occur after the band, and will override the band at the beginning of the segment.

A band given a negative tick offset still plays when the segment loops back to the beat where it occurs, because it logically belongs to that beat. For more information, see Belongs to Beat.