Latency

This is the desired MIDI latency during playback, in milliseconds. The shorter the latency is, the less the user interface lags behind playback, and the closer the application is to being in real time. On the other hand, the shorter the latency is, the more often the application runs, and the less time it has to do its work. For example if the latency is 10, the application has at most 10 milliseconds to prepare each chunk of the sequence for output. If the latency is too short, underruns may occur. Underruns can't occur in exported MIDI files because the export can take as long as it needs.

IssueSymptoms
Latency too shortUnderrun errors; erratic timing of output MIDI messages; audible gaps in sequence
Latency too longUser interface lags behind playback; delay between your actions and their effects

Underruns

During playback, the MIDI sequence is prepared ahead of time in chunks. The length of the chunks is determined by the Latency setting. Ideally the application prepares the next chunk while the previous chunk is being played, and thus stays ahead of demand. But if a chunk takes too long to prepare, the previous chunk may run out before the next chunk can be delivered. This situation is called an underrun.

An underrun means that the sequencer took too long and failed to keep up. It can occur because the sequence is too dense, or the latency is too short, or CPU power is lacking, or the output device is too slow, or any combination of these. An underrun can affect the timing of the output MIDI messages, and in extreme cases may cause an audible gap in the sequence. If it's the first underrun since playback started, an error message is displayed. Subsequent underruns are counted, but the error message is suppressed. To solve underrun errors, do one or more of the following:

If you're using MIDI hardware, be advised that a serial MIDI interface is limited to roughly a thousand MIDI messages per second, and approaching this limit may cause underrun errors. This is less likely to be a problem if the hardware is connected to the computer via USB, or if the output device is a software synth or virtual MIDI port.