openmixer — generated API reference
    Preparing search index...

    Function pdcCompensation

    • Plugin-delay-compensation (PDC) math for one summing point (a bus). Given the insert latency (ms) of each channel feeding it, return the compensating delay each channel needs so every feed's total latency equals the busiest feed's — i.e. max(latencies) − latencyᵢ for each. The highest-latency channel gets 0; every lower-latency channel is padded up to the maximum, so all feeds arrive time-aligned at the sum (the Waves PDC idea). Order is preserved (one compensation per input, in the same order).

      A negative input latency is clamped to 0 (a latency is never negative); an empty input yields an empty result.

      Parameters

      • latencies: readonly number[]

        each feeding channel's insert latency in ms, in a stable order

      Returns number[]

      the per-channel compensating delay in ms (same length + order)