Show HN: Eigendrum – Draw any shape and hear what it sounds like as a drum

An interactive drumhead. Press Enter or Space to strike it at the marked point, and use
the arrow keys to move that point. While drawing is switched on, drag with a pointer to
trace a new outline.

Every mode is a standing wave this outline permits, and no other. Tap anywhere: the
modes with a nodal line under the mallet stay silent, which is why the same drum sounds
different depending on where you hit it.

Pitch here is areference: the note a circle of this area would sound. Tension
and density are yours, and so is fade, which is material and air. Where each shape’s own
fundamental lands above that reference is not yours, and neither is any overtoneratio. Both are computed.

A drumhead clamped at its rim can only vibrate in certain shapes, at certain frequencies.
Those shapes and frequencies are the solutions of

−∇²u = λu  inside the shape,  u = 0 on the edge

Each solutionuis a mode, a standing wave, and each λ gives a frequency
proportional to √λ. This is an eigenvalue problem, and for almost every shape it has no
formula. So Eigendrum solves it numerically: it covers your shape with a mesh of
triangles, builds the finite element stiffness and mass matrices, and finds the smallest
eigenvalues ofKφ = λMφ.

A few shapes have spectra that can be written down exactly, and the solver is tested
against them on every change. A circle’s frequencies are the zeros of Bessel functions; a
rectangle’s areπ²(m²/a² + n²/b²). The solver reproduces both to
better than a tenth of a percent, and because a conforming finite element method minimises
energy over a restricted space, its answers are guaranteed slightoverestimates, never under. The measured error is in “the numbers”.

Striking a spot drives each mode in proportion to how much that mode moves there. Hit a
line where a mode stands still and you cannot excite it at all. That was not programmed
in; it falls out of projecting the mallet onto the modes.

So a strike is never one mode: it is every mode at once, in a mixture set by where your
mallet landed. The rules along the mode list are that mixture, and the modes marked with a
square were the ones your mallet could not reach. Pressing a row instead plays that single
modealone- something no mallet can do, and the only way to hear what one
frequency of a shape actually sounds like.

Besides tracing an outline you can write one.r(t)gives the
radius astsweeps one full turn, so1 + 0.3cos(5t)is a five-lobed flower; a parametricx(t), y(t)pair reaches the closed curves polar cannot, like a
nephroid or an egg. This is not a shortcut for drawing. It reaches shapes no hand traces
accurately – eleven even lobes, a superellipse partway between a circle and a square – and
it makes a shape something youvary: change one number and hear what moved.

A written shape travels as its own text. The link for a formula holds the formula, so it
is something you can read and retype rather than a few hundred characters of encoded
outline, and editing it in the address bar works. Anything too thin to mesh honestly is
refused rather than answered, because a sliver would still return numbers and they would
be wrong.

Mark Kac asked exactly that in 1966. In 1992 Carolyn Gordon, David Webb and Scott Wolpert
answeredno, by building two different shapes with identical spectra.
Both are in the form list as Kac drum I and II. Each is made from the same seven
triangles, rearranged. They enclose the same area and the same perimeter, and every
frequency matches. Switch between them and listen: the outlines are plainly different and
the sound is not.