Cymatics Plate — Sing into the Mic, Watch Sand Form Chladni Figures
getUserMedia plus an FFT plus the Chladni equation. Sing a note. Watch eight thousand sand grains crystallize into the standing-wave pattern of your voice.
What this is
A dark slate plate with eight thousand glowing sand grains scattered across it. Grant microphone access and sing — an FFT extracts the dominant frequency of your voice every frame, derives a pair of mode integers (n, m), and runs the analytic Chladni equation amp(x,y) = cos(nπx/L) · cos(mπy/L) ± cos(mπx/L) · cos(nπy/L) over a 256×256 grid. Each sand particle is pushed by the analytic gradient of |amp|², so grains migrate away from high-vibration regions and accumulate along the zero-amplitude nodal lines. The negative space draws the Chladni figure. A "Slider Mode" fallback sweeps frequencies from 50 Hz to 2 kHz if you decline the mic. Toggle "Show Field" to overlay the underlying amplitude heatmap. Mic level meter. Frequency display in Hz with note name.
Why this is mind-blowing
Eighteenth-century Ernst Chladni vibrated a plate with a violin bow and watched sand find the nodal lines. This is the same experiment, in your browser, driven by your voice. Sustain a note and within a second the chaotic dust crystallizes into a precise lattice — and as you climb in pitch, the lattice visibly densifies. It is real physics, not a simulation of one.
Single-file cymatics demo. Mic input via getUserMedia. FFT analysis to extract dominant frequency. Real Chladni equation running on a 256×256 grid — standing wave patterns where sand collects at nodes. Render as bright sand on a dark plate. Higher frequencies = denser intricate patterns. Sing higher to watch the pattern shift in real time.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Drive sand particles by the analytic gradient of the amplitude field, not by numerical differences. dx = -amp · ∂amp/∂x · dt sends every grain toward the nearest zero-crossing — that's how nodes form.
- The negative space is the figure. Render glowing sand and let the void draw the Chladni pattern, instead of trying to render the wave field directly.
- Sub-bin FFT accuracy comes free with parabolic interpolation across the peak and its two neighbors — three multiplies, sub-Hz precision.