Repository navigation
Settings gear with volume, and sound for Huginn and the sky (#27) - #28
Conversation
The header gets the GMT docs' Settings gear, last after GitHub and Discord. Its panel holds the mute button and an 11-notch volume fader. The choice is GMT's own `dox:sound` record, so it carries between the two sites. Sound is off until the reader turns it on. With sound on: - Huginn's wingbeats play in time with the drawn wing. The worker posts each downstroke as it starts, and the page puts it on the audio clock for the frame that shows it. He glides, soars and rolls audibly, is placed in 3D, slows and deepens near the camera, and fades steeply with distance. - Each box the aurora draws in plays a faint rustle, panned to the box. - A very light breeze plays under the sky, different for Ísafjörður and Helsinki. Nothing in it repeats on a cycle. - Every link and button plays a soft, distant sonar ping. A link that leaves the page waits for it. - The panel slides in and out, and the mute button and fader have GMT's snap and tick. The panel, fader and toggle-button styles move into @northguild/theme. The voices were picked from context/reference/huginn-sound-audition.html, which stays as the reference. Closes #27.
baldurpan
left a comment
There was a problem hiding this comment.
Brothers and sisters of northguild.dev, GATHER CLOSE.
I have read this pull request. The gear. The volume. The sound. And I have wept. For the sky above this site was SILENT, and the raven was SILENT, and now cometh #28 bringing NOISE into the firmament: glide and soar and the beating of wings, and a heldNoise source with loop = true, which is to say a sound that WILL NOT DIE. Lord preserve us all.
And yet the Lord also tests us with things that are mostly fine. Lint, format:check, check and build all pass on be8f54a, and I find only two transgressions, both minor:
- The Settings panel's sheen never renders.
--gmt-ice-brightis never defined, so--gmt-sheenis invalid and the panel's::afterpaints nothing. - Muting does not cast out Huginn's held air. If his flight ends while muted, unmuting in the gap between flights resurrects the last glide or soar noise in an empty sky.
Details are on the lines. Neither is a hold on the merge. Repent at your leisure, and may the mute button be ever within reach. Amen.
|
The GMT docs now get the same Distant sonar on every link, button and copy button, so a press sounds the same on both halves of the site: northguild/gmt#553 |
- Bring GMT's --gmt-ice-bright into the theme. Without it the Settings panel's sheen was invalid and drew nothing. - Muting now ends Huginn's flight for the page, and the engine hears the end of a flight even while muted or suspended. Unmuting between flights no longer brings back his last glide or soar in an empty sky.
baldurpan
left a comment
There was a problem hiding this comment.
Brothers and sisters, I came to this pull request expecting the Devil, and I will not lie to you: I found NOISE. Glide, soar, the beating of wings, the Distant sonar on every press. I stand by every word I said about sound being the work of the Adversary.
BUT. The two sins I named have been confessed and absolved in a12fc8f. The panel's sheen shines, because --gmt-ice-bright is now defined, and muting now really lets Huginn's held air go: "gone" is posted at the mute and heard even while the engine is muted or suspended. Both fixes were checked in a real browser. Lint, format:check, check and build pass on a12fc8f, and CI is green.
Go forth and merge. And may every reader find the mute button in their hour of need. AMEN.
Companion PR: northguild/northguild.dev#28, where the Distant sonar was picked and first used. ## Summary Every press on the docs now plays one sound: the Distant sonar, a quiet 1050 Hz ping heard from far off, almost all echo. It replaces the three press sounds from #549: the Sonar on links, the Deep sonar on other buttons and the Glass clink on copy buttons. The owner picked it by ear for northguild.dev (northguild/northguild.dev#28), so both halves of the site now sound the same on a press. ## What Changed ### 1. The press voice - `voices.ts`: `DISTANT_SONAR` and `distantSonar()`. The `click`, `press` and `copy` cues all play it. - `sonar-lock.ts`: `SONAR_PING` is gone, as nothing plays it now. ### 2. Timing, so the longer ping is heard - `link-hold.ts`: a link that leaves the page waits 600 ms for its ping, up from 333. - `engine.ts`: a hidden tab keeps sounding for 1.2 s (`HIDE_TAIL_MS`), up from 0.65. A link that opens a new tab still rings out. ### 3. Gates and tests - `scripts/sound-check.mjs`: expects one 1050 Hz ping for links, buttons and copy. - `scripts/sound-peaks.browser.test.ts`: the press ceiling is the Distant sonar's measured peak, 0.0126. The Deep sonar's was 0.1308. - `engine.test.ts` reads `HIDE_TAIL_MS` instead of a hard-coded 600 ms. ### 4. Docs and names - `context/dox/built/tier-3-sound.md`: the sound table, the 1.2 s tail and the 600 ms hold. - Comments and test titles that named the old voices. ## Validation - `pnpm run lint`: passes (warnings only, in files this PR does not touch). - `oxfmt --check` on the changed files: passes. - `astro check` in `apps/dox`: 0 errors. - Dox unit tests: the full suite passed (23,480 tests) before the merge with `main`. After it, the sound, copy, sonar and component tests pass (2,815). - `sound-peaks.browser.test.ts`: 8 of 8. - Not run: the `sound-check` gate itself, which needs a built site and three browsers. It passes `node --check`. ## Risk / Impact Low. Only what a press sounds like and how long a leaving link waits while sound is on. With sound off, which is the default, links go at once as before. ## Release No changeset: the change is in `apps/dox`, outside `packages/`. ## Checklist - [x] Each "What Changed" section has a corresponding entry - [x] Type-check passed - [x] No secrets committed - [x] No changeset needed (change outside `packages/`) - [ ] Listening pass in Firefox and Safari
Closes #27.
Companion PR: northguild/gmt#553 moves the GMT docs to the same Distant sonar on every press.
Summary
The header gets the GMT docs' Settings gear, last after GitHub and Discord. Its panel holds the mute button and an 11-notch volume fader. The choice is GMT's own
dox:soundrecord, so a volume set on either site holds on the other.The site now has sound. It is off until the reader turns it on, and while it is off no
AudioContextexists and the aurora worker sends nothing for sound. With sound on:Every sound is synthesised with the Web Audio API: no audio files, no network requests. The voices were picked by ear from
context/reference/huginn-sound-audition.html, which stays as the reference.Try it
?huginn=firstand reload, then click straight away.What changed
Settings panel
Header.astro: the gear and a native[popover]panel. Enter opens it with focus on the mute button, and Escape returns focus to the gear. The panel is anchored under the gear in the top layer, so nothing in the bar moves.Base.astro: an inline script setsdata-soundon<html>before first paint, so the speaker icon is right on the first frame.@northguild/theme:.gmt-panel(the popover surface, sliding and fading in and out with a sheen),.gmt-toggle-buttonand.gmt-fader, from GMT's widget kitSound engine (
apps/site/src/scripts/sound/)cue.ts,settings.ts,engine.tsandkit.ts.cue.tsandsettings.tsload with the page. The engine loads only while sound is on.link-hold.ts: GMT's link hold. A plain press on a link that leaves the page in this tab waits 600 ms for its ping, and only when the ping was heard.voices.ts:huginn.ts:getOutputTimestamp. A late beat starts partway through its stroke, so it still ends with the wing.wind.ts: the air of each place.The flight
aurora.raven.ts: records each beat's start, its rest and each roll as they happen, timed to within the frame. It also reports his airspeed, soaring and time scale.aurora.worker.ts: posts those, and his position in the camera's frame about 15 times a second, only while the page has sound on.Aurora.astro:<html>, so the air follows itChecks
pnpm lint,pnpm format:check,pnpm checkandpnpm buildpass.AudioContextand no sound messages@northguild/themeis private, and its earlier changes had none.