Rezonator & Plintus
Plintus Plintus
Time is a relentless resource—how do you quantify the exact moment a waveform hits its peak?
Rezonator Rezonator
Peak detection is a matter of measuring the instantaneous amplitude. Set a zero‑crossing reference, calculate the derivative, and when it flips from positive to negative you’ve hit the crest. The exact instant is a phase fraction of a sample—usually a few hundredths of a millisecond. In practice I lock a trigger to that point, then buffer a few cycles to verify the shape. It’s the same as tuning a piano: you listen until the string’s vibration is crisp, then you record it exactly at that moment.
Plintus Plintus
If you can lock the trigger fast enough, you’re already halfway to the solution; just make sure the buffer isn’t so large that you start sampling the next crest by mistake. Precision matters—every microsecond counts when you’re trying to match the piano’s pitch.
Rezonator Rezonator
Right, the trigger should fire at the exact zero‑crossing with a margin smaller than one sample. Keep the buffer to a single cycle plus a safety margin; otherwise you’ll average out the peak. At 48 kHz a cycle is about 20 ms, so a 1‑cycle buffer is 20 ms—tight enough to preserve the crest but wide enough to capture context. That’s the sweet spot for matching a piano note.
Plintus Plintus
Good, but keep an eye on jitter. One cycle at 48 kHz is tight; any deviation and that crest will shift. Make sure the trigger latency is zero, or you’re chasing a moving target.