# Prologue audio — candidate v1

## Start here

Open the review board's **Music / sound** section. Each A/B/C film contains the same 30-second top-down staging, footsteps, equipment and wind, with a different original musical arrangement. Switching films keeps the scene position. The study condenses entrances and departures for listening and adds no dialogue; it does not replace the book timeline.

| Candidate | Character | Length |
|---|---|---|
| A — Smoke over Malaz | Melodic JRPG: flute, harp, strings, cello | 26.67-second loop, 72 BPM |
| B — On the Battlement | Restrained chamber: English horn, viola, cello, harp | 30-second loop, 64 BPM |
| C — An Uneasy Empire | Dark ambient: low strings, contrabass, vibraphone, theme fragments | 30-second loop, 64 BPM |

All share an original rising D–E–F–A idea, arranged over D minor harmony. These are short direction sketches rendered with the installed FluidR3 GM samples. The naturalness of sustained instruments and the four-square phrasing are limitations to judge before expanding the score. B — Chamber / On the Battlement is the user-selected musical direction (17 October 2026). The sketch remains a draft recording; this preference does not approve every sound effect. The first pass does not yet have dedicated character themes, transition stingers or a separately recorded orchestral performance.

## In the game

- F3 opens audio choices and separate master, music, ambience, effects and dialogue/UI sliders. F3 or Escape closes it. The scene pauses while music and wind continue for listening.
- U mutes all audio. Dialogue text ticks default off; their option is in F3. Manual dialogue advance has a small confirm sound; autoplay does not trigger confirm sounds.
- A/B/C or music off crossfade over 0.8 seconds. Volume levels and the chosen music are saved in `user://audio_candidates.cfg`.
- Wind and music loop independently of reading speed. There is no dialogue timer synchronisation requirement.
- Actual movement emits foot contacts at the two contact phases per animation cycle. Idle/gallery previews do not emit footsteps. Fiddler's run uses its own cadence; the guards are quieter.
- Soldier contacts use light cloth/metal layers; the child's and robed characters' footsteps are softer. No fiddle notes are attached to movement.
- The rusty vane candidate plays once at source paragraphs describing its squeal/groan, without displaying narration. It is not continuously embedded in the wind.
- Surly's arrival reduces music by 2 dB, restored on departure. A separate dark musical layer remains a later direction choice.

No nearby battle, explosions or foreground fire have been added. The ambience candidate is wind only; harbour/city activity still needs a suitable distant recording. Full voice acting is absent.

## Source and rendering contract

Audio masters are 48 kHz. Music and wind are stereo Ogg Vorbis; short effects are PCM WAV. All candidates are deliberately quiet, leaving room for movement and future dialogue. Music drafts share a −25 dBFS RMS reference before bus levels; this is not perceptual loudness matching. The current A scene mix measured about −29.4 dBFS mean and −12.9 dBFS peak after encoding; final loudness is a later mix decision.

The MIDI source repeats its eight-bar score three times. Export takes the middle period, retaining instrument/reverb tails from the previous repetition, rather than fading both ends into silence. Runtime streams explicitly enable looping. Ambience uses an overlap seam. Each source, attribution, original licence, relevant hash and processed output is recorded in `audio/manifest.json` and `audio/CREDITS.md`.

## Reproduce

`tools/prepare_audio.py` requires Python with numpy/scipy, FluidSynth, FFmpeg, and a SoundFont. This machine already has FluidR3 GM at `/usr/share/sounds/sf2/FluidR3_GM.sf2`. Pass another SF2 with `--soundfont` if needed. It composes notes, writes editable MIDI/JSON, renders music, and prepares effects. Python edits audio only; no image assets are modified.

```bash
python3 tools/prepare_audio.py --ffmpeg /absolute/path/to/ffmpeg
```

Selected foley files and wind are bundled. The original Kenney archive may optionally be kept at `exports/audio-cache/kenney-rpg.zip`; the script can reuse the bundled selection if that ignored archive is absent.

For each candidate, capture the same staging with Godot Movie Maker:

```bash
xvfb-run -a godot --path . --rendering-method gl_compatibility \
  --audio-driver Dummy --disable-vsync \
  --write-movie exports/audio-cache/study.avi --fixed-fps 60 \
  -- --review-audio --audio-music=chamber
```

Use `jrpg`, `chamber`, or `ambient` as the candidate. AVI includes audio; retain it when converting to H.264/AAC. `--review-audio-panel` captures the F3 panel without running the book. `python3 tools/build_review_index.py` rebuilds the review board. These are asset-rendering paths; no new automated tests are included.
