If you use MIDIFileWithTimeIndex to play the MIDI file, the time index will continue computing and progressing even during the WaitUntil. On the other hand, if you ever do want progress through the MIDI file to stop with a WaitUntil, use a MIDIVoice instead of a MIDIFileWithTimeIndex.