garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/notes/city-soundscape.md

raw


topic: city-soundscape triggers: [ambience, city sound, splash sound, fountain sound, assets/sounds/water, background sound, footsteps, footstep surface, recorded sound, freesound, assets/sounds, systems::ambience, ambience.rs, soundscape.rs, PavingIndex, paving_at, drivable_near, step echo, --clip walk, walk video] updated: 2026-11-29

The city's sound: recordings, chosen by the map

Started 2026-10-20 after the user asked for a GTA / Red Dead feel on foot. The earlier soundscape was all synthesis, and every complaint about it was a synthesis artefact: walking "sounded like a wind tunnel" (a clipped low-pass rush), the steps were "cheap" and then a metronome, and the road hum "did not sound like traffic" and was removed for its per-frame cost (avatar-game-feel.md, ambient-traffic.md). The user chose recordings from free libraries over recording Groningen themselves.

What it is

The loops are a texture over real data, like a stone pattern on a pavement; they place nothing. A sound tied to one spot (a bell, a gull) is a placement, and only for a source the data names (world-content-from-real-data-only).

Constraints found on the way

How the files were cut, and how it is checked without a speaker

This container has no audio device, so nothing here was tuned by ear by the agent. The steps were found by onset detection on the recordings (a take is rejected if anything in its tail reaches half its peak or it rises late) and checked as waveform pictures; the loops are the steadiest 33 s of each take, loudness-normalised to −20 LUFS and crossfaded end-into-start over 3 s.

To hear a change, render a walk: --clip walk --frames N with two or more --at walks the avatar along the path (frames spaced by distance, the clip's phase from distance over the pack's stride), and RUST_LOG=cartopolis::ambience=debug logs what the game chose at each frame, from which a soundtrack is built and muxed under the frames. Measured on the Deck, 2026-10-20: 407 frames at 1280×720 in 17 min (~2.5 s a frame) for a 34 s walk at 12 fps. Pick the path from OSM's way geometry, not address points (those sit on facades), and check the turns with a still first — the first try walked into a building, which the sampler duly reported as indoors.

Water: splashes, strokes, lapping and fountains (2026-11-16)

Fourteen more CC0 recordings in assets/sounds/water/, chosen and cut the same way (Freesound HQ previews, onset detection, waveform and spectrum checks, credited in assets/sounds/LICENSE.md); played by systems::splashes (water-splashes.md). A splash or stroke is a one-shot at its place, heard by splashes::water_level — full within 3 m, a point source's 6 dB a doubling past it, faded out by 45 m. Two loops start silent with the beds: tread (close water round a swimmer, full while the own avatar swims, by distance for others) and fountain (the nearest jet: full within 4 m, gone at 60 m). A fountain is a sound tied to one spot, so only where the data names a fountain in the water. Footsteps stop and the landing thud is skipped while swimming.

The weakest takes, by the analysis rather than by ear: tread is somebody swimming with a stroke every ~0.35 s rather than treading, and needed 9 dB of peak limiting to reach −20 LUFS; the strokes are a lake swimmer recorded from the shore; fountain carries light city rumble under 150 Hz.