A speaker drives a sound wave into a tube. Reflections from the far end interfere with the outgoing wave; when the tube length matches a resonant harmonic for the current end condition, a strong standing wave builds up with fixed pressure nodes and antinodes.
closed-closed / open-open: L = n * (lambda/2)
closed-open (one end closed): L = (2n-1) * (lambda/4)
lambda = v_sound / f (v_sound ~ 343 m/s)
- Driving frequency - sets the wavelength of the travelling wave inside the tube (shown as a moving column of instanced air-pressure spheres).
- Tube length - the physical cavity length; combined with the end condition it sets which frequencies resonate.
- Drive amplitude - scales how strongly the speaker pumps energy in, amplifying the standing-wave envelope at resonance.
- End condition toggle - closed end forces a pressure antinode there; open end forces a node, shifting the harmonic series between L=n(lambda/2) and L=(2n-1)(lambda/4).
Real-world application: this is exactly how organ pipes, wind instruments and exhaust/muffler resonators are tuned - and why room dimensions create audible standing-wave "modes" that room acoustics treatment tries to tame.