Skip to main content

Overview

The [plugin_latency] object reports latency compensation values to the DAW. This is essential for plugins that introduce processing delay, such as lookahead compressors, linear-phase filters, or any algorithm that requires buffering audio before processing. When you report latency to the DAW, it will automatically compensate by delaying other tracks to keep everything in sync.

Inlets

float
Set DAW latency compensation value for the plugin, measured in samples.The DAW will delay all other tracks by this amount to compensate for the processing delay introduced by your plugin.

Usage Example

Basic Latency Reporting

Lookahead Limiter with Latency Compensation

Variable Latency with Oversampling

Important Notes

Latency values must be reported in samples, not milliseconds or seconds.
  • Changing latency during playback can cause audio glitches in most DAWs
  • Set latency once during plugin initialization (use [loadbang])
  • If you must change latency dynamically, be aware that the DAW may need to rebuffer

Calculating Latency

From Milliseconds

From Buffer Size

Combined Latencies

Common Use Cases

  1. Lookahead Processing: Compressors, limiters, gates that need to “see” the future signal
  2. Linear Phase Filters: FIR filters that introduce latency for phase-linear response
  3. FFT Processing: Spectral effects that require buffering for frequency domain processing
  4. Oversampling: Upsampling filters that add latency
  5. Analysis Windows: Any processing requiring buffered analysis before output

See Also

  • [block~] - Set DSP block size
  • [samplerate~] - Get current sample rate
  • [delread~] / [delwrite~] - Delay line for lookahead