2026-09-14. Feature: realtime tachometer (feat/realtime-tacho). Follows
the layout and visualization-library discussion.
With the gauge to be hand-drawn, it needs a scale, and until there are
per-vehicle presets that scale has to suit every user. The question turned out
to be less about what a motorcycle does than about what the estimator can say:
autocorr.ts searches 8–100 pulses/s, which with REVS_PER_PULSE = 2 is
960–12,000 rpm, so the dial's honest span was already decided by a pair of
constants nobody had looked at in product terms. Both ends were then
re-examined. The ceiling is arbitrary and should follow the gauge rather than
lead it — one MAX_RPM the detector derives its rate limit from, so the app can
never compute a number it cannot draw. The floor turned out to be a floor of
convenience: all seven ground-truth clips idle well above 960, but a Royal
Enfield idles at 800–1,000, a mistuned bike hunting at 600–700 is precisely the
case someone opens this app for, and a half-speed generator sits at 1,500 or
1,800. The floor moves to MIN_RATE = 5, or 600 rpm, which still holds five
periods inside the 1 s analysis window.
MAX_RPM, with 12,000 the working value — it covers the
110–155 cc singles the app is aimed at (Click, Sniper, Raider redline at
9.5–11 k) and nothing sold in that class goes past it.MAX_RPM is the single source of truth. MAX_RATE is derived from it
(MAX_RPM / 60 / REVS_PER_PULSE), not stated independently, so the estimator
can never return a value the dial cannot show.WINDOW_S = 1 means the window has to
hold two or three periods for autocorrelation to find one.MIN_RATE moves from 8 to 5 — 960 rpm to 600 rpm. Five periods still fit
the 1 s window. 960 was never a measured limit, only the bottom of the
ground-truth set.resolveOctave now has a wider band to be wrong in: with a 600 rpm floor, a
1,200 rpm idle has a half-octave that is no longer out of bounds.MAX_RPM constant and derive MAX_RATE from it, so no computed
value can fall outside what the gauge can display.MIN_RATE from 8 to 5 (600 rpm), and check every test asserting the
960 rpm boundary.