Zero-Asset Audio: How the Web Audio Synthesizer Works in This Portfolio
A walkthrough of how the UI clicks, chimes, and ambient modes (432Hz, Alpha 10Hz, Pink Noise) in this portfolio are synthesized via the native Web Audio API.
Experience the procedural mathematical synthesizers described in these notes. All audio is computed in real-time by your browser with 0KB network payload:
This note documents a neat detail built into this portfolio: none of the button clicks or ambient focus modes download MP3 or WAV files. Everything is synthesized live by the browser using the native Web Audio API.
Why Skip External Audio Files?
Loading MP3 clips for tiny UI clicks adds network requests and can introduce a slight delay before playback. Generating waveforms directly in code adds 0KB of audio assets and triggers immediately on interaction.
How a UI Click Is Synthesized
With the Web Audio API, an AudioContext pairs an oscillator (createOscillator) with a gain envelope (createGain) so the sound fades cleanly without harsh pops:
const ctx = new AudioContext();
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.type = "sine";
osc.frequency.setValueAtTime(600, ctx.currentTime);
osc.frequency.exponentialRampToValueAtTime(200, ctx.currentTime + 0.025);
gain.gain.setValueAtTime(0.04, ctx.currentTime);
gain.gain.exponentialRampToValueAtTime(0.0001, ctx.currentTime + 0.025);
osc.connect(gain);
gain.connect(ctx.destination);
osc.start();
osc.stop(ctx.currentTime + 0.025);Ambient Modes in the Telemetry Dock
The same engine also generates the three focus presets in the bottom dock: a 432Hz harmonic drone, a stereo Alpha 10Hz mode using ChannelMergerNode, and a procedural pink noise buffer—which you can test right in the playground above.
Miguel Riquelme
Front-end Engineer. Software Engineering MBA student at USP/Esalq.