part 47
Previews in the settings: music, the live picture and the numbers
The last preview step, music and the live picture, was added on 3 November 2026 (change log entry 0.102). It is described from a later state of the game, together with the numbers of the build, the traps and the mutants.
The previous article on previews ended with step P5: the music and the live picture were waiting for a function that plays four bars, and decision D10 postponed them. The step was built on 3 November 2026 and is in the change log as version 0.102. This article describes it from a later state of the game, from 16 November 2026 (version 0.190.2). Where it matters when each part was added, the text says so.
The article also contains the numbers of the build (the registry, the estimate against the actual size), the traps and the mutants.
Why P5 waited
Step P5 is called "Music and the live picture" in the plan and is marked as optional (SETTINGS-PREVIEW §5): the ▶ Listen button for the three music settings (style, density, volume) and a sample picture for the live picture. It needs a function that plays four bars of the chosen style, and that did not exist in the game: grep -rn audition js found nothing (0 hits, 3 November 2026, on top of game 0.97.1). The estimate in the plan is 1 to 1.5 days.
Why it waited: decision D10 of 1 November postponed the music to P5, and the volume was allowed to use a tone. P5 therefore did not fail; it was postponed in advance. A peculiarity: not even the tone for the volume was built, although D10 allowed it; the volume waited together with the others. Four settings waited: livePicture, musicStyle, musicDensity, musicVolume. Of the original 10 live pictures and 7 demos, therefore, 9 and 4 are built.
Music: ▶ Listen
Music had three settings: style, density and volume. For those there was nothing to show except sound. Decision D10 of 1 November postponed them, because the function that plays four bars was missing. Meanwhile the volume was allowed to use a tone. No tone was built for the volume: the volume plays the same live music as the other two settings.
The ▶ Listen button belongs to all three rows and plays four bars of the live music in the chosen style, density and volume. The demo is the same live music that the game would play under the effects, that is, quieter than the music bed itself, and not a tone or the piece after the game. The density row shows the number of notes, and the volume row the gain in decibels against the usual volume.
The sound never starts on its own, only on a click. It plays until the bars have run out. It stops with the Stop button; when the style or the density changes (a new piece is a new click); when the game's sound or its live music takes over the sound; when the panel switches to a row without a sample; and when the window is closed. The volume is tracked while it plays, so the slider is the way to find the right level. The button is disabled and says why when sound is not possible: sound turned off in the settings, the game's music playing (the demo would sound over it), or a browser without sound.

This is verified by tests on a fake audio context: what gets scheduled, what the volume is and when the demo ends are all followed. Sound in a real browser was not verified in this article.
Live picture
The Live picture row shows a sample game: a recording of 740 bytes in which three seats play seven rounds on a small map and the player wins. The recording is played back by the same collector that draws the live picture in the game, and the picture grows round by round. With the switch on, the picture grows about half a second per round. The Show button lets the picture grow again. With the switch off the scene is empty, and it says so. With reduced motion set in the system, the picture is complete straight away.
The game's documentation gives 600 bytes. The code has 740 bytes, and the code is what counts. The picture is not the dots picture from the mockup. It is the live picture's own mechanism, so the preview and the game draw with the same code.

Registry: how many values have a line
Two things were counted under "rows of the registry": the decisions in the registry (the rows of Settings.PREVIEWS) and the values with a line under the panel. A value has a line if Settings.captionOf is not empty. The slider is one value; Player colour has 14 values and Language 10.
| State | Settings | Decisions in the registry | Drawn | "None" | Waiting | Values with a line |
|---|---|---|---|---|---|---|
| before the first step (game 0.80.1) | 23 | 0 | 0 | 0 | 0 | 50 of 88 |
| P1 | 23 | 23 | 4 | 4 | 15 | 55 of 88 |
| P2 | 24 | 24 | 9 | 4 | 11 | 75 of 90 |
| P3 | 24 | 24 | 13 | 4 | 7 | 87 of 90 |
| P4 | 24 | 24 | 16 | 4 | 4 | 87 of 90 |
| P6 (state of 3 Nov, before P5) | 24 | 24 | 16 | 4 | 4 | 88 of 90 |
"Drawn" is a decision with a scene and no step; "waiting" is a decision with a step. The row P1 is the commit of the step before the merge with 0.81.2; in version 0.82.2 the registry had 24 decisions after the merge. At the start the registry did not exist. After P6, 22 of the 24 settings had a line, and only the two values from P5 were missing: "Live picture: Off" and "Music density: Normal". They got their captions in P5.
Per setting, before the first step 8 of 23 settings had a line for every value (6 explaining every value, and 2 with a hint: Language and Music volume), and 7 had no text at all; this agrees with draft No. 39 (7 without text, 2 with a hint, 6 with all). Of the 38 values without a line at the start (88 − 50), 36 got one and 2 remain (my own calculation). Two values of the new Avatar movement had one at once. Behind this are 14 written captions: 13 from appendix A of the analysis and "Live music: Off" from P6. Seven captions are for a whole setting and cover 29 values (Player colour 14, Speed 4, Sound 2, Theme 3, Show numbers 2, Palette 2, Avatar in the corner 2), and seven for one value (7 + 29 = 36). A one-off script over the js/ trees from git archive counted it.
What it cost compared with the estimate
The estimate is from SETTINGS-PREVIEW §3.4 and §3.6; the actual is the wc over the game's tree at version 0.97.1, that is before the music and the live picture. The sums are my own calculation.
| File | Estimate (lines) | Actual (lines) | Bytes |
|---|---|---|---|
js/ui/settings-preview.js | 220 | 302 | 21,130 |
js/ui/preview-board.js | 70 | 97 | 5,831 |
js/realms/kastgard/ui/previews.js | 90 | 321 | 21,769 |
js/realms/rokgard/ui/previews.js | 40 | 93 | 5,988 |
| total | 420 | 813 | 54,718 |
The actual size is 1.94 times the estimate by lines and about 2.7 times the estimated "about 20 KB" by bytes. The Kastgard file grew the most, from 74 lines in the first step to 321 (P3 added 191 lines, P4 54). The estimate came from the mockup; the document does not say where it went wrong. CSS: estimated 60 lines, actual 91 added. Texts: estimated 29 keys, actual 31 keys and 279 strings in nine languages. Two test files were estimated; there are four, with 53 tests. ConfigPane stayed as it was: js/ui/config-pane.js has 53 lines and did not change from the state before the first step.
Traps from building the steps
- A composed text key does not pass the key test. The fragment guard rejects a key built from a variable (the name of the mode inside the key), so the three fight labels are three literal keys. Likewise the gender sentence had to be a literal key.
- A key that only a realm file reads is moved into the realm's catalogue. The guard then reports an error. The keys of the Kastgard previews are written straight under
kastgard.previews. - Chapter numbers in the documentation collide. Steps P3 to P6 carried chapters 136 to 138, but during the work another chapter took those numbers, and at the merge they were renumbered to 137 to 139.
Mutants and tests
The tests of steps P3 to P6 were attacked with 84 mutants: a copy of the tree, one change at a time, and only the tests of this part. The first run left 9 mutants alive. Four were holes in the tests: a demo that would change a territory was never looked for; the warning was never tried without a remaining attack; a 60% chance was never tried; Hud.showRoll was never measured for time. After pins and further tests, 83 are caught and one is equivalent. Mutants measure the quality of the tests, not the correctness of the demos. The first full verification found one more thing: the prefix of the previews texts was among the places that the gender lint does not read.
Step P5 has its own tests: the recording of the demo is pinned by a test (it plays, and it is what the recipe produces), and the sound is tested on a fake audio context.
What I take from it
- Sound must not start on its own. The button is the only way the demo sounds, and a test pins it.
- A picture from the game's own mechanism is better than an imitation. The preview and the game draw with the same code, so they cannot disagree.
- "It exists" and "it is true" are two tests. The claim "every value has a line" found a value that the decisions had not found.
- Mutants show the holes in tests. Of 84, nine survived the first run, and four were real gaps.
- The estimate from the mockup was a little more than half of the actual size (420 of 813 lines, my own calculation).
Sources and notes
- Game documents:
docs/SETTINGS-PREVIEW.md(step P5 in the plan and in the state),docs/DESIGN.md§144 for P5. - Change log: entry 0.102 (3 Nov 2026) with the Listen button and the sample game of the live picture.
- Code: the scenes
listenandpicture(previews-music.js,previews-picture.js),audition.js; the recording of the demo has 740 bytes. - Screenshots of the game from 16 Nov 2026, version 0.190.2. Other numbers are from state 0.97.1 unless stated otherwise.
- Related articles: Previews in the settings: what a preview is and how it was built, Previews in the settings.