[claude] Add ambient sound and notification audio (#5) #14

Closed
claude wants to merge 1 commits from claude/the-matrix:claude/issue-5 into main
First-time contributor

Fixes #5

What this adds

  • js/audio.js — new Web Audio API module:

    • Ambient synthwave drone: 4 sine oscillators (A1/E2/A2/E3) with gentle chorus detune
    • Lookahead arpeggio scheduler: A-minor pentatonic pattern at 80 BPM using precise Web Audio timing
    • Synthesized 2-tone chime (playNotification()) on agent job completion
    • Volume and mute state persisted in localStorage
    • Muted by default on touch/mobile (pointer: coarse)
    • Ambient starts on first user interaction (browser autoplay policy compliant)
  • index.html — audio controls widget in the HUD overlay:

    • ♪ mute toggle button with matrix-green styling
    • Volume range slider (0–100)
  • js/websocket.jsplayNotification() called on every job_completed event

  • js/main.jsinitAudio() called during firstInit

  • js/ui.jsinitAudioControls() wires button and slider to audio module

No audio files needed — everything is synthesized via Web Audio API oscillators.

Fixes #5 ## What this adds - **`js/audio.js`** — new Web Audio API module: - Ambient synthwave drone: 4 sine oscillators (A1/E2/A2/E3) with gentle chorus detune - Lookahead arpeggio scheduler: A-minor pentatonic pattern at 80 BPM using precise Web Audio timing - Synthesized 2-tone chime (`playNotification()`) on agent job completion - Volume and mute state persisted in `localStorage` - Muted by default on touch/mobile (`pointer: coarse`) - Ambient starts on first user interaction (browser autoplay policy compliant) - **`index.html`** — audio controls widget in the HUD overlay: - ♪ mute toggle button with matrix-green styling - Volume range slider (0–100) - **`js/websocket.js`** — `playNotification()` called on every `job_completed` event - **`js/main.js`** — `initAudio()` called during `firstInit` - **`js/ui.js`** — `initAudioControls()` wires button and slider to audio module No audio files needed — everything is synthesized via Web Audio API oscillators.
claude added 1 commit 2026-03-23 18:08:50 +00:00
- New js/audio.js: synthesized ambient drone (A-minor, 4 oscillators) +
  lookahead arpeggio scheduler; notification chime on job completion
- Ambient music starts on first user interaction (browser autoplay policy)
- Muted by default on touch/mobile; volume + mute persisted in localStorage
- Audio controls widget (♪ mute button + volume slider) added to HUD overlay
- websocket.js: playNotification() fires on every job_completed event
- ui.js: initAudioControls() wires mute toggle and volume slider
- main.js: initAudio() called during firstInit

Fixes #5

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timmy closed this pull request 2026-04-05 00:13:45 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/the-matrix#14