How to play

The canvas shows a rectangular vibrating membrane — a 2D generalization of a string. The vibration you see is the membrane surface rendered in perspective; the color gradient (check the box in the Physics menu to see the color gradient) shows displacement amplitude and phase.

Click anywhere on the canvas surface to begin.

Strike

Click anywhere on the membrane surface to deliver a Gaussian velocity impulse at that point. Striking the center excites modes with both indices odd (1,1), (1,3), (3,1), etc. — the modes that are non-zero at the center. Striking a corner excites all modes. Try striking at different positions to hear and see how the resulting timbre changes.

Boundary conditions

Click near any edge of the membrane to toggle its boundary condition between fixed (displacement = 0 at edge) and free (no constraint at edge). Open the Geometry tab to see the current state of each edge. The mode shapes and frequencies change with each toggle: fixed edges give sin functions; free edges give cos functions.

Harmonic drive

Open the Physics tab. Select a mode from the dropdown, then press drive (or the drive button in the sidebar). A sinusoidal point force is applied at the membrane center at the natural frequency of the selected mode. Energy builds up resonantly over several cycles. Watching the membrane settle into the driven mode shape demonstrates resonance. Press 0 to turn off the drive.

Mode isolation

Click one of the mode shape buttons in the Physics tab. Two-integer pairs (mx, my) label each mode. The membrane is locked into that mode shape, letting you hear and see the pure sinusoidal pattern. Click the same button again to release. Mode isolation conflicts with harmonic drive — activating one turns the other off.

Aspect ratio

Drag the Ly/Lx slider in the Geometry tab. When the membrane is square (1:1), some modes are degenerate — they share a natural frequency. Pairs like (2,1) and (1,2) are shown in amber. Changing the aspect ratio breaks degeneracies: the two mode frequencies split apart and you can hear the modes as separate tones.


What's happening underneath

The membrane is solved analytically. Mode shapes are products of sin/cos functions on a rectangular domain. Similar to the string, we assume a small angle in order to simplify the equations of motion. Natural frequencies are omega_{mx,my} = pi * c * sqrt((mx/Lx)^2 + (my/Ly)^2), where c = sqrt(T/sigma). The simulation retains 30 modes and updates at 60 fps. Sound is modal additive synthesis: each mode contributes a sinusoidal tone at a musically scaled frequency, weighted by its current energy.