= General

[#pdc]
== Plugin delay compensation (PDC)

FX (an effect or instrument) may add latency to a track due to internal processing. This can happen even with FX that's not on the track itself, but somewhere downstream in the signal flow, e.g. on the master track.

REAPER and Playtime apply plug-in delay compensation (PDC) in order to fix the timing. That means they start processing content ahead of time in order to make up for the latency. PDC ensures that all tracks stay perfectly synchronized by delaying other tracks to match the plugin's latency. This prevents timing issues and maintains phase alignment in your project, ensuring accurate playback and mixing.

[#latency-compensation]
== Latency compensation during recording

When recording in DAWs, it is important to account for certain types of latencies. Playtime compensates or doesn't compensate latencies during recording, depending on a multitude of factors. Here's the overview:

|===
|Input monitoring|Start timing|Kind|Compensation|Comment

|Off|Immediately|Any|Off|

|Off|Quantized|Audio|Audio output latency + audio input latency|

|Off|Quantized|MIDI (normal)|Audio output latency + block size (new)|

|Off|Quantized|MIDI (overdub)|Audio output latency + block size + PDC read-ahead (new)|Results not too good when using high buffer sizes, but okay for now.

|On|Any|Audio|Audio input latency|

|On|Any|MIDI (any)|Off|
|===

=== When does this matter?

In general, those things should only matter when using high buffer sizes, since only then the delays introduced by latency become musically sensible.

=== Why compensate output latency only if input monitoring is off?

When input monitoring is off::
If you don't enable input monitoring in the DAW (or in Playtime, it's the same), Playtime assumes that you are using some kind of zero-latency monitoring. In case of audio, this might be direct monitoring via audio interface or just listening to the instrument/voice itself. In case of MIDI, this might be an external hardware synthesizer with Local Mode being On or no monitoring at all (just pressing the keys at the right moment).
+
In that case, what counts in terms of timing is the actual key press (keyboard), strum (guitar), beat (drums), etc. This needs output latency compensation!

When input monitoring is on::
If you enable input monitoring in the DAW, Playtime assumes that the player adjusts his playing according to what he hears coming out from the DAW and expects that this is the timing that ends up in the recording.
+
This means that output latency compensation is not necessary. Having input monitoring on in the DAW is usually only bearable when using low buffer sizes, otherwise it's super confusing.