Primary Cause of Latency in USB MIDI Setups
When musicians experience a delay between pressing a key on a MIDI controller and hearing the sound from their computer, they often blame the USB cable or the MIDI protocol itself. However, the primary cause of latency in software-based USB MIDI setups is almost exclusively the audio output buffer size in the digital audio workstation (DAW) or virtual instrument host, rather than the transmission speed of the MIDI data. This article breaks down why audio buffering causes this delay, the minor role played by USB bus polling, and how to effectively eliminate the lag.
Audio Buffer Latency vs. MIDI Transmission
A standard MIDI note-on message is tiny—typically just three bytes of data. Modern USB connections transmit this data in under 1 to 2 milliseconds. Therefore, the MIDI signal reaches the computer almost instantaneously.
The real delay occurs after the computer receives the signal. Once the virtual instrument (VST) generates the audio waveform, that audio data must be processed and placed into an audio buffer before being sent to the digital-to-analog converter (DAC) in your speakers or headphones.
If the audio buffer is set too large, noticeable latency occurs:
- 1024 samples (at 44.1 kHz): ~23 ms of output latency (very noticeable delay).
- 512 samples: ~11.6 ms of output latency (noticeable to most players).
- 128 samples: ~2.9 ms of output latency (generally feels instantaneous).
- 64 samples: ~1.4 ms of output latency (near-zero perceptual delay).
When combined with internal plugin processing delays and hardware conversion times, a high buffer size makes real-time playing feel sluggish and unresponsive.
The Role of Audio Drivers
Operating systems handle audio differently depending on the driver architecture:
- Windows: Default system drivers (MME or DirectSound) introduce massive latency, often exceeding 50 to 100 milliseconds. To achieve low latency, users must utilize dedicated ASIO (Audio Stream Input/Output) drivers provided by their audio interface manufacturer.
- macOS: Apple's Core Audio architecture natively supports low-latency performance without third-party drivers, though the buffer size must still be configured correctly inside the host application.
Secondary Cause: USB Polling and Jitter
While audio buffering is the main bottleneck, the USB bus itself contributes a minor amount of delay and timing irregularity (jitter). USB operates on a polling system where the computer queries connected devices at set intervals:
- USB Full Speed (1.1/2.0 standard polling): Polls devices every 1 millisecond, introducing 1 to 2 ms of baseline transmission time.
- USB Hubs and Shared Buses: If a MIDI keyboard shares a USB hub with high-bandwidth devices (such as external hard drives or webcams), polling interruptions can introduce jitter, making the timing of notes feel inconsistent rather than just delayed.
How to Eliminate USB MIDI Latency
To achieve immediate, hardware-like response from software instruments:
- Lower Audio Buffer Size: Set the DAW or standalone instrument buffer to 128 or 64 samples. If the CPU produces clicks or pops, increase it to 256 samples.
- Use Dedicated ASIO Drivers (Windows): Always select your interface’s proprietary ASIO driver rather than generic Windows audio drivers.
- Connect Directly to the Motherboard: Avoid unpowered USB hubs. Plug the MIDI controller directly into a dedicated USB port on the computer to prevent polling bottlenecks.
- Disable High-Latency Plugins: Turn off linear-phase equalizers, lookahead limiters, or heavy mastering processors on the master bus while tracking live MIDI.