# Implementation notes

Built from this folder's prompt.txt and the supplied audio manifest. No other experiment, slides, or source project was consulted.

## Choices

- Supplied source: `Forest_Loop_Light-rain_20s.mp3`, declared as a 20-second loop in the manifest.
- Generated alternative: a deterministic 4-second filtered-noise pad with a rising tone and a deliberate endpoint offset. It has an obvious hard join without relying on the recording to be imperfect.
- A loops the decoded source directly. B overlaps the last and first portions with cosine/sine equal-power envelopes, then loops that mixed buffer. B's repeat interval is source duration minus overlap length.
- Both buffers are matched by whole-cycle RMS, then share a peak cap of 0.7. The master volume starts at 45%. This matches average signal energy, not measured perceptual loudness.
- Crossfade length is 0.10 to 1.50 seconds, starting at 0.60 seconds.
- A/B switching preserves the remaining time to the next seam. The shortcut starts playback one second before that seam.
- A waveform, playhead, seam marker, countdown, and B overlap region identify the boundary. Transport actions have a short gain ramp to avoid introducing their own clicks.
- AudioContext creation and resume happen only after a Play or jump click. Source selection is silent.
- Native HTML controls, focus indicators, labels, responsive layout, and status text support direct use without reading code.

## Checks and limits

- JavaScript syntax checked using `node --check`.
- Asset filename checked against the supplied manifest and asset directory.
- No external requests, dependencies, or services. The supplied file is fetched by a relative local path.
- Browser interaction and actual listening are delegated to the parent task. They have not been verified in this implementation pass.
- Use the local preview server. Opening the HTML with file:// may block the recording fetch; the page reports the loading error.
- Already seamless source audio can make the A/B difference subtle. The page explains this and offers the generated poor join.
- Matching whole-cycle RMS does not ensure identical moment-to-moment or perceived loudness, particularly during an overlap.

## Preserved first attempt

`attempts/001/` contains the first complete index.html, style.css, and app.js. Its asset resolver supports that nested path. The current stylesheet only removes an unused empty data-URL import from that first copy.

All changes are local to this experiment folder. No shared files, Git state, servers, or browser tools were changed.
