ToolsLightweight
Synthesized audio (WebAudio/Tone.js)
Sound made by code, no audio files.
Sound made by code in the browser: clicks, hums, chords, an ambient bed, with no audio files. It can follow the visuals exactly. Browsers require a click before any sound can play.
- Breaks when
- needs a user gesture before any sound plays
- Also called
- Tone.js, WebAudio synth, generative audio
Prompts
A UI that has a sound
Tone.js: a tiny sound palette for a page. Hover: a 2 ms click from a filtered noise burst. Toggle on: a sine blip 880 → 1320 Hz over 60 ms. Toggle off: 1320 → 880. Open a panel: a soft major-third chord (two triangle oscillators) through a 0.4 s release. Master volume −18 dB. Start the AudioContext on the first pointerdown anywhere and never before; store a mute preference in localStorage and honour prefers-reduced-motion by muting.
Generative ambient bed
WebAudio only: three detuned sawtooth oscillators (±7 cents) into a lowpass at 600 Hz with slow LFO on the cutoff (0.05 Hz), through a convolver with a procedurally generated 3 s impulse response (decaying noise). Notes from a pentatonic scale, chosen every 2–5 s with a seeded random, each with an ADSR of 0.6/0.4/0.5/2.0. A start button; a visualizer of the analyser’s waveform.
Sound tied to the scene
Map scene state to sound: particle count to a filter cutoff, camera speed to pitch of a drone, collisions in the physics world to short percussive hits with velocity → gain. Use Tone.js Signals for smooth parameter changes and keep the audio graph under 12 nodes. Provide a mute toggle in the corner.
Related
Resources · 1
- Tone.jsTonejssite · code · demoJul 18, 2026