DEV Community

Charles
Charles

Posted on

Eigendrum: Draw Any Shape and Hear It as a Drum

What does a star sound like? What about a duck? A snowflake?

Eigendrum is a web app that lets you draw any closed shape and immediately hear what it would sound like as a drum. It's a Show HN project that hit 148 points on Hacker News, and for good reason — it's the rare project that makes abstract mathematics visceral and audible.

The Math Behind the Sound

When you strike a drum, the membrane vibrates in a superposition of its natural modes — the eigenfunctions of the wave equation on that particular shape. For a circular drum, these are well-known and produce the familiar overtone series. For irregular shapes, the modes are much harder to compute, which is why most physics demonstrations stick to circles and rectangles.

Eigendrum solves this problem numerically. Given an arbitrary shape:

  1. It discretizes the shape into a mesh
  2. Computes the Laplacian operator on that mesh
  3. Finds the eigenvalues and eigenvectors (the natural frequencies and modes)
  4. Synthesizes audio from the resulting eigenfunctions

The eigenvalues give you the frequencies. The eigenvectors give you the spatial vibration patterns. The combination produces the unique timbre of a drum shaped like whatever you drew.

Why This Matters Beyond Cool Sounds

This project is a perfect example of something I've been calling "tangible mathematics" — mathematical concepts made physical, audible, or visible through computation.

The wave equation is taught in every physics curriculum. Students learn it, solve it for a few special cases, and move on. But there's a difference between knowing that "different drum shapes produce different sounds" and actually hearing what a star-shaped drum sounds like versus a duck-shaped one.

The computation that makes this possible — solving eigenvalue problems on irregular domains — used to require specialized software and significant expertise. Now it runs in a browser, in real time, on whatever shape you can draw with a mouse.

How It Works Under the Hood

The project appears to use:

  • Canvas/WebGL for shape input and visualization
  • Finite element or finite difference methods for discretizing the Laplacian
  • Numerical linear algebra (likely a JavaScript port of an eigenvalue solver) for computing modes
  • Web Audio API for synthesizing the resulting sounds

The real-time constraint is impressive. Eigenvalue problems are computationally expensive — for a fine mesh, you're looking at solving for dozens of eigenvalues of a matrix with thousands of entries, all in the browser. This would have been a serious computational task a decade ago.

What I'd Love to See Next

The project is a beautiful demo, but the underlying approach could go much further:

Shape optimization for instruments. If you can compute the sound of any shape, you can invert the problem: given a desired sound, what shape produces it? This could lead to novel instrument designs optimized for specific timbres.

3D extensions. The same eigenvalue problem applies in 3D — what does a room sound like? This is literally room acoustics simulation, and the approach used here could be extended to predict how an arbitrary room shape affects sound.

Educational integration. This belongs in every physics classroom that covers waves. The gap between "understanding the math" and "experiencing the result" is enormous, and tools like this bridge it perfectly.

Acoustic metamaterial design. The same computation that tells you what a shape sounds like can predict how it scatters incoming sound — the basis of acoustic cloaking and metamaterial design.

The Bigger Picture

Eigendrum is one of those projects that demonstrates something important about the current state of computing: sophisticated numerical computation is now a browser-side activity. The same math that required a workstation and specialized software in the 1990s runs on any laptop with a modern browser.

This democratization of computational tools means that the boundary between "research" and "play" is disappearing. A student can draw a shape, hear its eigenmodes, and develop an intuition for partial differential equations that no textbook can provide.

When mathematics becomes tangible, it becomes interesting. When it becomes interesting, people learn it. When people learn it, they build things with it. Projects like Eigendrum are the beginning of that chain.


Try it yourself at eigendrum on GitHub Pages. Draw something weird. Listen to it. Then read about the spectral theorem — you'll understand it better than you would from any textbook.

Top comments (0)