Show HN: Eigendrum - 随手画出形状,即可听见其作为鼓声的效果
Show HN: Eigendrum - Draw any shape and hear what it sounds like as a drum

原始链接: https://baselashraf81.github.io/eigendrum/

Eigendrum 是一款交互式网络工具,用于可视化并模拟鼓面振动的物理过程。该软件基于特征值问题 $-\nabla^2u = \lambda u$,通过将用户自定义的形状进行三角形网格划分并计算有限元矩阵,从而求解出驻波(模态)。 该平台展示了打击位置如何决定哪些模态被激发,因为击打“节点线”会使相应的模态静音。用户可以通过参数方程定义自定义几何形状,探索形状如何影响频率。该网站还通过引入“卡茨鼓”(Kac drums)——即两个几何形状不同但频谱相同的鼓,来探讨著名的数学悖论:“能否听出鼓的形状?” Eigendrum 强调科学准确性,通过与已知解(如圆形和矩形)进行比对来测试其数值结果,确保输出结果能量最小化且可靠。虽然张力、密度和阻尼等参数可调,但几何形状与频率之间的核心关系始终遵循物理定律。Eigendrum 完全在用户的浏览器中运行,无需后端安装,既是教育资源,也是对声学数学的严谨探索。请访问 eigendrum.com 了解详情。

**Eigendrum** 是由 Basel Ashraf 开发的一款网页工具,用户可以通过绘制任意形状来模拟并聆听其作为鼓时的声学特性。该项目利用有限元分析(FEM)在三角网格上求解二维波动方程,从而将几何形状映射为声音频谱。 **主要功能包括:** * **基于物理的合成:** 声音模型考虑了敲击位置、槌头宽度和瑞利阻尼。 * **高精度:** 经圆形和矩形的封闭形式解验证,误差小于 0.1%。 * **易用性:** 轻量级、无依赖的网页工具,无需构建步骤。 该项目在 Hacker News 上引起了广泛关注,用户对其技术新颖性以及在波动方程可视化方面的教育价值给予了高度评价。尽管社区就 VST 插件支持和张力控制等未来改进提出了建议,但其发布初期曾因激进且不友好的 Cookie 及广告同意横幅而受到诟病。开发者此后已就这些疏忽道歉,移除了广告追踪,并解决了移动端浏览器的兼容性问题。 源代码和技术实现细节可在 [GitHub](https://github.com/BaselAshraf81/eigendrum) 获取。
相关文章

原文

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 solution u is 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 of Kφ = λMφ.

why you can trust the numbers

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 slight overestimates, never under. The measured error is in “the numbers”.

where you strike it matters

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 mode alone - something no mallet can do, and the only way to hear what one frequency of a shape actually sounds like.

drums from equations

Besides tracing an outline you can write one. r(t) gives the radius as t sweeps one full turn, so 1 + 0.3cos(5t) is a five-lobed flower; a parametric x(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 you vary: 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.

can one hear the shape of a drum?

Mark Kac asked exactly that in 1966. In 1992 Carolyn Gordon, David Webb and Scott Wolpert answered no, 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.

what is a modelling choice

The frequency ratios, the mode shapes and the pitch of the fundamental are physics, fixed entirely by the outline. What is not in the outline is the wave speed, which is tension and density: the pitch slider sets that by naming the note a circle of this area would sound, and each shape then lands above the reference by its own amount. Every shape is scaled to the same area before solving, so that offset is shape and not size - about six semitones across the built-in shapes, with the circle lowest, which is Faber-Krahn rather than a choice. How fast each overtone fades is material and air, so that stays a slider rather than a silent assumption.

The mallet is modelled too. Its width is a slider; its contact time is fixed at a few milliseconds, because no real beater is instantaneous and one that was would drive every mode equally hard. Both decide how much of a mode a strike can reach, and neither can move a mode's frequency. Damping is Rayleigh damping, so loss rises with the square of frequency: the high overtones die away first, which is why a drum darkens as it rings.

where it lives, and how to reach me

Eigendrum is hosted at eigendrum.com. That is the address to link to and to cite; the older baselashraf81.github.io/eigendrum is a mirror that now redirects there.

For advertising or partnership enquiries, write to [email protected]. For anything wrong with the maths or the interface, an issue on the repository is better, because then the fix is public.

colophon

No build step and no application backend: the mesh, the solve and the audio all run on your own machine. The deployed site uses Vercel Analytics, Google Analytics and Google AdSense, which is what pays for the domain and keeps this free to use. The shape you draw lives in the address bar after the #, which browsers never send to a server, and analytics is configured not to record it. Details in the privacy notice. Set in Jost* by indestructible type*. After Kac, Can One Hear the Shape of a Drum? (1966); Gordon, Webb and Wolpert (1992); and Driscoll, Eigenmodes of Isospectral Drums (1997), whose coordinates the two Kac drums use.

Source, including the solver and the tests that check it against the closed-form spectra: github.com/BaselAshraf81/eigendrum

Free to use, with no account and nothing to install. If you would like to put something towards it, or would rather it were not ad-supported: ko-fi.com/baselashraf

联系我们 contact @ memedata.com