Commit Graph

37 Commits

Author SHA1 Message Date
tyler 4c3c6a955a perf: unblock long-file loading; add collision detection and jump nav
Three things, all surfaced while working a multi-node protocol issue on a
5.7-hour capture.

**Loading was frame-paced, not compute-bound.** The STFT overview advanced
a fixed 200 segments per frame, so the frame limiter — not the FFT — set
the pace: 478k segments at ACTIVE_FPS meant over a minute spent waiting
between frames rather than computing. The tell was absurd: backgrounding
the window, which skips presenting entirely, loaded the same file in
seconds. The progress bar was slower precisely because you were watching
it. The overview is now computed in one blocking call after presenting the
loading panel, so focused load matches the unfocused speed. The panel says
the window will stop responding and drops the percentage, which could not
animate and would have read as a hang. ACTIVE_FPS 30 -> 60 while here;
idle still parks at ~0% CPU through the event-wait path.

Background work also no longer stops when the window loses focus. Pending
work now counts as "active" regardless of focus, so the loop doesn't block
in PollInputEvents waiting for input that isn't coming, and an unfocused
frame with work outstanding skips the draw pass entirely rather than
throttling the high-res fill to the refresh rate.

**Collision detection.** Annotations that overlap in both time and
frequency are flagged, merged into contiguous regions, and drawn as red
bands confined to the band the overlap occupies (padded, so a narrow
overlap stays findable) rather than spanning the full axis and hiding the
signal being pointed at. N / Shift+N and sidebar buttons jump between
regions, centring each without disturbing the current zoom.

Point markers are excluded: control events and assertions have no band and
zero duration, and treating a missing band as "whole spectrum" — which is
how they are *drawn* — made every marker collide with whatever it sat
inside. That was 38% of the reported collisions on a real capture. Only
things that actually occupy the air can interfere. Counts verified against
an independent reference implementation on two captures.

**Scope waveform via min/max summary.** The envelope rescanned every
visible sample every frame — ~245M reads, near 1 GB of memory traffic, on
a multi-hour file, measured at ~60 ms/frame for a few hundred pixel
columns. It now draws from 1024-sample buckets built once at load (60 ms,
1.9 MB), measured at ~0.07 ms/frame. Keeping both extremes per bucket
means single-sample transients still show at full zoom-out, which plain
decimation would drop; verified that no column ever understates a true
peak. Zoomed in past a bucket it falls back to raw samples, which is cheap
there by definition.

Also fixes ComputeCollisions never running for files opened through the
file browser, and moves the collision panel above the annotations dropdown
where it isn't pushed off the bottom of the sidebar.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ZWfr5XZyyDttvkhJUgHN
2026-08-12 13:58:58 -07:00
tyler 5c3c88dc22 feat: scale time zoom by duration, decouple the two axes
The minimum visible time window was a flat 2% of the file, but view.start
and view.end are normalized to the whole signal — so the achievable time
resolution scaled with file length. A 30-minute recording could never show
less than a 36-second span, while a 30-second one reached 0.6 s. Long
captures were effectively unreadable at the sample level no matter how far
you scrolled.

Derive the floor from the STFT hop instead (MinTimeViewWidth): segments sit
fftSize/HOP_RATIO samples apart, so the real limit is the point where only
a handful of segments span the viewport and further zoom would interpolate
rather than reveal. The floor is now a constant ~43 ms at 48 kHz/1024
regardless of duration — an 844x improvement on a 30-minute file, and it
tightens further with a smaller FFT. Guards cover the unloaded (sampleRate
0) and shorter-than-the-floor cases.

Zooming is also no longer forced to move both axes together. The bare wheel
keeps the existing coupled behaviour; Shift+wheel is time-only and
Ctrl+wheel frequency-only, so a long capture can be stretched along time
without collapsing the frequency range to match.

Time-axis labels now pick their precision from the span between adjacent
ticks (1 to 4 decimals, and m:ss.sss past a minute). At the spans this
change makes reachable the old fixed "%.1fs" printed the same value in
every slot, which read as a frozen axis.

Adds a `wheel X Y N [mod]` action to shot_input.sh for exercising zoom
headlessly, and known_bugs.md for behaviour that is unspecified rather
than broken.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8ZWfr5XZyyDttvkhJUgHN
2026-08-12 00:19:36 -07:00
tyler 398be34aaf build: document system deps, add check-deps, auto-glob web modules
- README: rewrite Build section for the hand-written Makefile (make /
  make DEBUG=1 / run / test / bench). Add a "System dependencies" table
  with the X11+GL dev packages per distro (apt/dnf/pacman/zypper/apk),
  since a clone won't build without them and the error is otherwise
  cryptic. Fix stale ./bin/Debug paths to ./bin/Release.
- Makefile: add `make check-deps` — probes for the required X11/GL dev
  headers and prints the install command for the detected distro on
  failure (via /etc/os-release).
- build_web.sh: auto-discover app modules from src/*.c (drop the
  hardcoded APP_MODULES list that had to be hand-synced), matching the
  desktop Makefile. Excludes the desktop platform backends. Remove the
  stale rspektrum.make reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 21:19:23 -07:00
tyler 3b2e5517bf Update README.md 2026-06-06 03:08:38 +00:00
tyler 7916e8a24e docs+chore: add screenshot to README; drop committed export PNGs and junk
- README: embed resources/Screenshot.png under the intro
- remove accidentally-committed app export outputs (spectrogram_full.png,
  spectrogram_export.png) and gitignore them so they don't return
- remove unused resources/wabbit_alpha.png and stray .qwen/settings.json.orig

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 15:51:12 -07:00
tyler 5c3c452133 docs: rewrite README as a fresh project overview + usage guide
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 15:40:44 -07:00
tyler fb7bc5486e feat: true no-X headless --render (CPU spectrogram bitmap + overlay)
Rewrite --render to compute the spectrogram and write a PNG entirely on the
CPU, with no window, no GL context, and no X server. Previously it opened a
hidden GL window and grabbed LoadImageFromScreen(), which still required an X
server (Xvfb); the output was a UI screenshot rather than the spectrogram data.

The new path (RunHeadlessRender) loads the WAV, computes the STFT, colorizes
the bitmap at native STFT resolution, bakes the mLnL annotation overlay onto
it, and exports — all CPU-only. render.c gains a GL-free colorize
(BuildSpectrogramImageCPU), a CPU font loader (LoadFontCPU), and a CPU overlay
drawer (DrawAnnotationsToImage).

Annotations draw outline + label only: mLnL captures contain many overlapping
full-band boxes whose translucent fills alpha-stack to opaque and bury the
signal. The outline marks each region while the spectrogram reads through; a
dark backing strip keeps labels legible. Note: MeasureTextEx/ImageText* bail
when font.texture.id == 0, so the CPU font sets a sentinel non-zero id (the
draw path reads glyph images, never the texture).

Render options: --annotation-opacity (overlay strength), --annotation-kinds
(comma-separated kind filter), --width (resize; default native). Removed the
obsolete --pane/--height window options and the screenshot workaround.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 22:37:38 -07:00
tyler 95be6f6c22 docs: rewrite README to characterize rspektrum accurately
Replaces the stale Unity-port README (wrong controls, premake build,
missing features). Documents the mLink/mLnL focus, real keybindings,
make-based build, headless --render mode, and the Xvfb GUI-driving
primer. Consolidates the old SPECTROGRAM_README.md into README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 23:50:29 -07:00
Jeffery Myers 4cf96e771f add info about software render target 2026-01-13 11:47:28 -08:00
Jeffery Myers c8e40f3845 Revise license section in README.md
Updated license information to reflect CC0 1.0.
2026-01-06 16:34:47 -08:00
Peter0x44 8853ece16a Update README.md 2026-01-06 23:18:43 +00:00
Jeffery Myers 31630dded8 add more clear description on how to get the template 2025-12-09 11:36:37 -08:00
Peter0x44 e5415bcb6e Add rename folder step to all platform sections
Fixes #30
2025-12-03 05:31:26 +00:00
Jeffery Myers 1861d659a5 tweaks to lib info 2025-11-20 15:47:24 -08:00
Youness SBAI cf453b5601 Add clarification on external library dependencies in README 2025-11-20 19:36:37 +01:00
Jeffery Myers 55b448e122 Update README.md 2025-07-17 10:53:07 -07:00
Jeffery Myers 284a5f8b42 update to premake5 beta 7
replace gmake2 with gmake
2025-07-14 11:14:09 -07:00
Jeffery Myers d218555489 Update README.md 2025-02-02 11:59:51 -08:00
Jeffery Myers 2edcc85178 Update README.md 2025-01-29 12:40:10 -08:00
Jeffery Myers f498cccb69 Update README.md 2025-01-29 12:39:53 -08:00
Jeffery Myers 589d8c5f8b Update README.md 2025-01-29 12:39:17 -08:00
Jeffery Myers 48f409b15c Update README.md 2025-01-29 09:11:04 -08:00
Jeffery Myers 6fa6fab5e9 note the obvious that you need a compiler for vscode. 2025-01-15 19:13:31 -08:00
Nathan Iszlaub 312433ae8b use code formatting for commands, files, and paths 2024-11-24 00:33:27 +08:00
Nathan Iszlaub ec8968b0f3 fix minor typos and adjust casing+punctuation for consistency 2024-11-24 00:32:28 +08:00
Jeffery Myers 94a0a75d69 typo 2024-11-18 15:48:51 -08:00
Zelwaris eb20ab2d56 Update README.md 2024-09-30 20:57:20 +02:00
Jeffery Myers f8fb323310 update readme to say it uses git main 2024-09-27 07:41:45 -07:00
Jeff Myers 3f9ed218fb Make clean on MinGW-W64 batch.
Add notes to readme for how to swap to C++ or use your own code.
2024-09-20 15:56:00 -07:00
Jeffery Myers e5b0c478bb update OSX docs, they don't use the same bin as linux. 2024-08-23 07:09:36 -07:00
Jeffery Myers 9049a646a1 Updates 2024-08-17 08:53:09 -07:00
Jeffery Myers 0523db4ad6 Update README.md 2024-08-16 08:24:54 -07:00
Jeffery Myers 134bb017ee Update README.md 2024-08-14 19:36:33 -07:00
Jeffery Myers d79c7ae9af Update README.md 2024-08-14 19:35:12 -07:00
Jeffery Myers 1c30e84c38 linux info, ignores 2024-08-14 19:33:30 -07:00
Jeff Myers 3f023baa2f inital code drop. 2024-08-14 17:09:43 -07:00
Jeffery Myers fe934db383 Initial commit 2024-08-14 17:08:10 -07:00