Your computer handles many different data streams simultaneously. In order to avoid complications because of this, it must regulate the flow of information through buffers. Buffers save small amounts of data and release it precisely in order to maintain a smooth output. When data processing involves converting digital to analog and back, multiple buffers are at work. A larger buffer saves more data but creates more of a noticeable delay. A small buffer saves less data but leads to inconsistencies in processing. Many programs have options whereby you can regulate the buffer size. Therefore, if you are experiencing excessive MIDI latency, you can try to find an ideal buffer size.
The signals processed by your audio software are all managed by at least one clock. Clocks define the time between data processing in order to maintain the flow of information. If you are using multiple soundcards, there will be two different clocks at work. The MIDI input and audio output may be out of sync if this is the case. You may be able to specify one clock as the master clock and the other as a slave in order to reduce apparent signal latency. If this is an option, it can be accomplished in the setup of your audio device routing. You can usually access this directly in your system preferences or through the audio software that you are using.
One factor that interferes with the flow of MIDI messages is the actual strength of the MIDI connection. If you have a damaged cable or connection point, this can cause delay in the transmission of MIDI signals. If you have any intermediate connection points between your MIDI device and your computer, such as a MIDI to USB converter, these can also impede the MIDI signal. If you are sending a large amount of MIDI data into your computer, data bandwidth limits may also contribute to latency.
If your computer is running numerous tasks simultaneously, this will slow down the overall speed of most processes. If you are running numerous programs in addition to the MIDI-based program, close all of the uncritical programs to maximize processing power and random access memory. Sometimes, a complete reboot of your system is the most efficient way to clear up this processing power and ensure a stronger MIDI signal.
Any device that you connect to your computer requires a driver so that it may communicate effectively with your computer. If you do not use the driver specific to your MIDI device, your computer may automatically configure it with a generic driver. Using a generic driver can be insufficient and can be another cause of MIDI difficulty and latency. Use the most up-to-date drivers for your specific devices; device-specific drivers are available for download from the device manufacturer's website.