Physically based synthesis of the sound produced by an air bubble oscillating underwater, using Minnaert resonance, jet forcing, and three damping mechanisms. JavaScript remix of a Python demo originally written by Timothy Langlois in 2016.
When a bubble forms underwater, it oscillates radially and emits sound. The Minnaert frequency gives the natural resonance of a spherical gas bubble in an infinite fluid [1]. The actual frequency accounts for proximity to the water surface (depth correction via bubble capacitance) [2].
Three damping mechanisms attenuate the oscillation: radiation (sound energy radiated away), viscous (fluid viscosity), and thermal (heat conduction between gas and liquid) [3]. A jet forcing term models the initial collapse impulse [2].
In Rising mode, the bubble ascends at its terminal velocity [4], causing a characteristic upward pitch glide as depth decreases.
The ODE is integrated at 96 kHz using a 4th-order Runge-Kutta solver, producing one second of physically accurate bubble sound.