v0.53.0: Kaleidostrobe, the 2002 iTunes visualizer, as the fourth style

Reverse-engineered from its PowerPC binary and checked against the original
running under emulation: textures byte for byte and every triangle, over
3,600 frames. 25 fps like the plugin; its colour maps and wave images are
extracted from its own code; tests/kaleidostrobe_golden.npz was recorded
from the original.
This commit is contained in:
2026-10-14 12:02:22 -07:00
parent 6178f5d0f7
commit e38c751e39
21 changed files with 2109 additions and 3 deletions
+28
View File
@@ -258,6 +258,34 @@ persistence) → GUI (Qt widgets that read the manager and connect to its signal
`highlight_palette` overrides a slot, and `theme.highlight_color` reads
through `theme.highlight_palette`, so nothing else needs to know.
- **`lintunes/kaleidostrobe/`** + **`gui/visualizer_kaleido.py`** — the
fourth visualizer style (Round 84): Kaleidostrobe, the 2002 iTunes plugin
by Shehryar Lasi, **reverse-engineered from its PowerPC Mach-O** (symbols
intact) to be identical, not "inspired by". Method: capstone listings, and
the original running under a **Unicorn PPC emulator** through its own
VisualPluginHandler (imports answered in Python, GL calls recorded) as the
oracle. `engine.py` is the Qt-free port, routine by routine, with `f32` /
`math.fma` wherever the PPC rounded to single or fused a multiply-add
(a palette index on `x.5` depends on it), `ParkMiller` = Darwin 6's
`rand()` (RAND_MAX 2³¹−1). `tables.npz` holds what the original computes
deterministically, extracted by running *its* code: 22 colour maps and 23
base wave images (before their random `transform()`, which is ported, as
are the 16 live `calcDelta` warps — each with its **own** static counters
per layer). Quirks kept on purpose: `flipDiag`'s off-by-one. Facts that
shape the port: the plugin renders only after 39,999 µs, so it ran at
**25 fps** and counts frames for rotation and switching — the renderer
steps the engine on its own 25 Hz clock, never the widget's 60 Hz timer;
beat timing is in TickCount (1/60 s). The original's Color/Flash settings
were Apple SDK leftovers its code never read, so the style has none. It
reads only iTunes' **spectrum** bytes (never the waveform); iTunes' byte
scale was never published, so `itunes_spectrum` (√magnitude, 43 Hz bins)
is the one calibrated stand-in. Painting: each GL triangle is planar, so
it is drawn in texture space through a projective **world** transform
(Qt mis-draws a strongly projective *brush* transform); the top cone is
always nearer, so painter's order is the depth test.
`tests/kaleidostrobe_golden.npz` was recorded from the emulated original
and `test_round84` holds the port to it byte for byte.
- **`lintunes/importers/itunes_importer.py`** — parses the iTunes XML plist.
Remaps Mac `file:///Volumes/...` paths to the local `--music-root` with
case/Unicode-normalization fuzzy matching (macOS is case-insensitive + NFD vs