A 1 s 440 Hz tone is shortened to 0.8× by both tiers.
pitchBasedCompress is an honest record-speed resample — pitch and
tempo move together, so the tone must measure ≈550 Hz (440 ÷ 0.8).
tempoBasedCompress is a real phase-vocoder time stretch — same
length, but the tone must still measure ≈440 Hz. Badges assert the exact
length contract (17640 samples) and the measured zero-crossing pitch of each
output; the buttons make the difference audible. The same asserts run
headless in examples/node/compression.mjs.
| signal | length | measured pitch |
|---|