Skip to content

Add expanded Spectrum window - #97

Merged
chrislaupama merged 2 commits into
mainfrom
device-windows-11
Nov 16, 2026
Merged

chrislaupama merged 2 commits into
mainfrom
device-windows-11

Conversation

@chrislaupama

Copy link
Copy Markdown
Collaborator

What changes

  • Spectrum opens a 1200 pt window with three views, picked in its top bar:
    • 2D: the spectrum, its peak hold and the slope guide on a dB ladder with the frequency axis.
    • 3D: a waterfall of the analyser's history (32 to 256 frames, from the History picker), the newest at the front, each line hiding those behind it.
    • Split: the 2D picture over a spectrogram of the same history.
  • Caption: the loudest peak, "stopped" while the transport is stopped, and the tilt.
  • Top bar: Color and History pickers (History is inert in 2D), Hold view (freezes the history), Reset (clears it). One card: FFT, Window, Channel | Slope, Ceiling, Range | Smoothing, Averaging, Peak Hold, Decay. One Level meter.
  • Frames sit at their age, so a history still filling up starts at the front of the waterfall and at the top of the spectrogram.
  • Curve drawing in every expanded window got cheaper: path() and the spectrogram write one-decimal coordinates with an integer writer instead of the float formatter (push_tenths, tested against {:.1}).
  • The window review signal polls the analyser after each step, and Spectrum pre-rolls long enough to fill its history (new states review-window-spectrum-2d and review-window-spectrum-split).
  • Tests: spectrum_window_draws_each_view_from_its_history, history_takes_each_sequence_once_and_keeps_the_depth, a_short_history_sits_at_its_age, decimate_keeps_the_loudest_band_of_each_span, tenths_match_the_float_formatter. Spectrum is in the window bench.
  • README, docs/devices.md and CHANGELOG updated.

Screenshots

Before (card in the floating panel):

before

After, 3D:

3D

After, 2D:

2D

After, Split:

Split

Benchmark

bench_dynamics_windows (release, Linux cloud container), per build, with a full 128-frame history:

Spectrum Time
Card 31.6 µs
Window, 2D 68 µs
Window, 3D (first cut, float formatter, 40 lines) 792 µs
Window, 3D (this PR) 189 µs
Window, Split 148 µs

Other windows with the integer coordinate writer (window build, main → this PR; this container is noisy, within about ±15 %):

Window main This PR
Distortion 272 µs 191 µs
Tape Saturation 262 µs 187 µs
Bit Crusher 330 µs 206 µs
Stereo Widener 71 µs 38 µs

Generated by Claude Code

…e float formatter

The waterfall and spectrogram lay frames out by the History depth, so a history still filling up starts at the front (3D) or grows down from the top (Split). The waterfall draws up to 32 lines. path() and the spectrogram write one-decimal coordinates with an integer writer, which makes curve drawing in every expanded window about three times cheaper. The review signal polls the analyser and pre-rolls Spectrum long enough to fill its history. Docs updated.
@chrislaupama
chrislaupama marked this pull request as ready for review November 16, 2026 01:41
@chrislaupama
chrislaupama merged commit 71c2480 into main Nov 16, 2026
13 checks passed
@chrislaupama
chrislaupama deleted the device-windows-11 branch November 16, 2026 01:41
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