Skip to content

feat(LevelHistory): scrolling peak-history strip + calibration grid (crew-hardened) - #17

Merged
tsyma merged 5 commits into
mainfrom
feat/level-history
Jul 17, 2026
Merged

feat(LevelHistory): scrolling peak-history strip + calibration grid (crew-hardened)#17
tsyma merged 5 commits into
mainfrom
feat/level-history

Conversation

@tsyma

@tsyma tsyma commented Jul 17, 2026

Copy link
Copy Markdown
Member

What

Adds felitronics/appkit/LevelHistory.h — a header-only juce::Component scrolling dBFS peak-history strip for the family's capture calibrators (generalized from OrbitCapture's per-mic MicHistory), and finishes it with the fixed calibration-grid surface that the OrbitCapture per-take level UI actually drives. Plus small LevelMeter.h additions to match.

LevelHistory

  • push(linearPeak) scrolls one column per GUI tick; visible window = capacityTicks / feed rate. peakDb() holds ~1.5 s then decays. setRange() zooms the dBFS window.
  • setRefLines({(dB,colour)…}) — the primary calibrator surface: dashed reference lines that never move, trace fill/stroke gradient-tinted to match (endpoints picked by dB, so entry order is irrelevant).
  • setNoiseFloor(dB) — a black room-quiet line. setCurrentDb(dB) — a live corner readout. setClipCeiling(dB) — full-height red bar for every over-ceiling column; in the legacy setGreenZone corridor it also opens a yellow warn band.

LevelMeter

  • setRefLines fixed grid, setClipCeiling yellow warn-band + red line, clickable clip-lamp cap (setClipLatched/onClipClick). The cap paints only when the clip-lamp feature is engaged, so existing OrbitCab IN/OUT meters are unaffected.

Consumer

orbit-nam-capture (feat/calibrator) consumes this: setRange/setRefLines/setNoiseFloor/push/setCurrentDb (history) and setRange/setRefLines/onClipClick/setLevel/setClipLatched (meter). ConsumerCompileCheck now exercises that exact call set.

Crew-hardened

Adversarial crew pass (codex + Fable-xhigh, verified against pinned JUCE 8.0.14). Fixed: order-dependent gradient endpoints; setRefLines NaN → debug-assert; unconditional clip-cap breaking backward-compat; unfalsified clip-bar/grid geometry; ULP-fragile boundary probes; unbounded peak-age. Argued-down: degenerate clip ≤ green-top (documented).

Verification

  • Full JUCE test tier 18/18 green, warning-clean under the repo's strict -Werror set.
  • LevelHistory falsify 35 checks / 0, LevelMeter falsify 30 / 0; ConsumerCompileCheck green.
  • README table updated with the LevelHistory.h row.

tsyma added 5 commits July 17, 2026 14:50
…rridor

Generalize OrbitCapture's per-mic MicHistory (fixed -21/-9 thresholds) into
a family widget for the calibrators: push(linearPeak) per GUI tick scrolls
one column (capacityTicks window), peak-hold sticks 30 ticks then walks
down 0.8 dB/tick and is exposed via peakDb() for readouts/verdicts,
setRange() zooms the dBFS window, setGreenZone(lo, hi) draws the corridor
as dashed floor/ceiling lines and tints the trace/fill around it (grey in
the noise, green inside, red above); an invalid pair clears back to a
plain grey trace. Falsify suite reads the trace geometry off paint()
through a recording context (affine dB->y map, scroll-out, corridor
add/clear) and pins the hold ballistics through peakDb().
…-ceiling columns

setClipCeiling(db) marks a "too hot" line independent of the displayed
green zone: any history column whose peak broke it is painted a
full-height red bar, so a single-tick overload spike stays visible
instead of hiding down in the trace. NaN clears it. The red bars are
fillRect draws (not trace paths), so the ballistics/trace math and the
falsify path counts are untouched.
…oor + current-dB overlay

LevelHistory: setRefLines (fixed dashed dBFS grid) + setNoiseFloor (black
room-quiet line) + setCurrentDb (live corner readout) — the fixed-grid
calibrator the ONC per-take level UI drives, replacing the moving corridor.
Clip-ceiling now opens a yellow band up to the ceiling. LevelMeter: setRefLines
grid + clip-ceiling warn-zone falsification coverage.
…+ ship-gate

- LevelHistoryFalsifyTests: add ref-line-grid (dashed segment per reference dB;
  empty clears) and noise-floor (full-width fillRect at dBFS; non-finite hides)
  groups; a separate rects recorder keeps the trace path-count assertions intact.
- ConsumerCompileCheck: exercise setRefLines/setNoiseFloor/setCurrentDb — the
  fixed-grid calibrator API the ONC per-take level UI actually drives.
- LevelHistory/LevelMeter header docs rewritten for the ref-line-grid mode;
  fix the setCurrentDb doc (corner readout, not centred). README: add LevelHistory row.
- Ref-line gradient endpoints picked by dB (min/max), not vector position — an
  unsorted grid no longer inverts the fill above the hottest / below the coldest
  line. Order-independence covered by a new falsification case.
- setRefLines drops non-finite dB entries (they corrupted the top gradient stop
  and tripped a debug assert in ColourGradient).
- LevelMeter clip cap paints only once the clip-lamp feature is engaged
  (clipLatched_ || onClipClick) — meters that never use it keep their full bar,
  so existing OrbitCab consumers are unaffected.
- LevelHistory falsify: assert the clip red-bar geometry (one full-height bar on
  the newest column) and the grid-mode fill reaches the floor — the shipped
  features were previously unfalsified.
- LevelMeter zone boundary probes moved off the exact float edge (±0.05 dB) to
  survive a one-ULP libm difference off macOS. Doc: setClipCeiling expects a
  value above the green band. LevelHistory peak-age capped (no unbounded growth).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant