Inspiration

Eigendrum was born from a simple question: What does a shape sound like? In physics, the frequencies at which a structure naturally vibrates are its eigenvalues. While software like MATLAB can calculate these statically, I wanted to build an instantaneous, interactive sandbox. I wanted to create a playground where anyone could draw an arbitrary 2D shape with their mouse and immediately see and hear the physical wave propagation in real-time right inside a web browser.

How I Built It

The application is built entirely with a high-performance frontend stack using standard web standards:

  • HTML5 Canvas: Handles the real-time visual grid rendering, drawing inputs, and fluid propagation animations at 60 FPS.
  • Web Audio API: Generates and modulates spatialized audio nodes dynamically based on the kinetic energy calculations across the canvas boundary points.
  • Vanilla JavaScript: Implemented the core engine directly in clean JS to eliminate framework overhead and maximize numerical computation speeds.

The Mathematics Behind the Engine

At its core, Eigendrum solves the continuous two-dimensional wave equation:

$$ \frac{\partial^2 u}{\partial t^2} = c^2 \nabla^2 u = c^2 \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \right) $$

To make this calculate instantaneously on a user's screen, I discretized the domain into a 2D lattice grid. By applying a finite difference time domain (FDTD) approximation, the displacement $u_{i,j}$ at the next time step $(n+1)$ is derived from the current and previous states:

$$ u^{n+1}{i,j} = 2u^n{i,j} - u^{n-1}{i,j} + r^2 \left( u^n{i+1,j} + u^n_{i-1,j} + u^n_{i,j+1} + u^n_{i,j-1} - 4u^n_{i,j} \right) $$

Where \( r = \frac{c \cdot \Delta t}{\Delta x} \) is the Courant stability factor. Dirichlet boundary conditions are dynamically enforced ( \( u = 0 \) at the perimeter) along whatever custom geometry the user draws, mimicking a clamped drum skin.

Challenges I Faced

  1. Mathematical Stability vs. User Freedom: If a user draws sharp, single-pixel corners or erratic geometries, the finite difference approximation can rapidly blow up to infinity. Keeping the simulation mathematically stable under arbitrary boundaries required strict capping of the Courant number and implementing boundary smoothing algorithms.
  2. Audio/Visual Synchronicity: Extracting wave amplitude data from the canvas array and piping it cleanly into the Web Audio API without causing audio crackling or dropped visual frames was incredibly difficult. I had to balance memory allocations and avoid garbage collection spikes by utilizing pre-allocated typed arrays.

What I Learned

I learned the immense power of raw browser APIs. Building Eigendrum proved that you do not need heavy native desktop software like Ansys or MATLAB to run accessible, complex physics simulations. It forced me to dig deep into numerical analysis, discrete wave mechanics, and micro-optimizations for the JavaScript runtime engine.

Built With

Share this project:

Updates

posted an update —

Here is a tracked list of the exact platforms, popular culture blogs, and prominent internet figures who have featured and shared Eigendrum since its launch:

1. High-Traffic Blogs & Newsletters

  • Jason Kottke (Kottke.org): Legendary long-running design and culture blogger Jason Kottke featured your project on Kottke, highlighting it under the title "Draw any shape and hear it as a drum". His endorsement immediately brought huge cross-disciplinary web traffic to your physics simulation.
  • Bookofjoe: This long-running, highly active tech/science blog shared the canonical web app link out to their widespread curation network, praising the direct finite element calculations.

2. Social Aggregators & Forums

  • Hacker News (Y Combinator): The epicenter of your initial launch. Your official thread, "Show HN: Eigendrum - Draw any shape and hear what it sounds like as a drum," generated hundreds of points and deep technical commentary from software architects globally on the Hacker News Launch Thread.
  • Hacker News Meta-Post (Bookofjoe): The community loved it so much that a secondary viral thread was started on Hacker News right after, driving secondary waves of server traffic.
  • Reddit (r/hackernews): Automated aggregates and independent redditors mirrored your launch thread directly on Reddit to extend the discussion across social hubs.
  • VKontakte (VK Public Tech Threads): International developer communities translated and cataloged Eigendrum on tech compilation threads, as seen highlighted next to elite firms on the VK Tech Wall.

3. Open Source & Developer Archives

  • GitHub (Official Repository): Your source code and mathematical explanation for the continuous 2D wave equations are officially hosted and linked heavily on the BaselAshraf81 Eigendrum Repository.
  • Heaton Moor Park Ecosystem (X / Twitter): Community accounts and micro-bloggers heavily signal-boosted the canvas physics toy natively across X using various geometric configurations.

Log in or sign up for Devpost to join the conversation.

Submission history