What Are Sound Waves?
Sound waves are mechanical waves that travel through the air or other media by causing particles of the medium to vibrate back and forth from their equilibrium positions. These vibrations create areas of high pressure (compressions) and low pressure (rarefactions), which propagate as a wave.
In the context of the 2D piano keys simulation, each key press generates a sound wave that travels through the air in a plane, creating ripples or disturbances that can be observed visually.
How Sound Waves Propagate
Sound waves propagate through the medium by causing particles to oscillate. The speed of sound depends on the properties of the medium; for example, it travels faster in solids than in gases due to higher particle density and stronger intermolecular forces.
In the simulation, adjusting the tempo changes the frequency of the sound waves, which affects their wavelength and the rate at which ripples expand across the 2D plane.
Interference Patterns
When two or more sound waves meet in a medium, they can interfere with each other. This interference can result in constructive (amplification) or destructive (cancellation) effects depending on their phase difference.
In the 2D piano keys simulation, pressing multiple keys simultaneously creates overlapping ripples that demonstrate both constructive and destructive interference patterns.
Frequency and Pitch
The frequency of a sound wave determines its pitch. Higher frequencies correspond to higher pitches, while lower frequencies correspond to lower pitches.
In the simulation, different keys represent different notes with varying frequencies, allowing users to explore how changes in frequency affect the visual representation of sound waves.
Frequently asked questions
How does changing the tempo affect the sound and ripples?
Changing the tempo alters the frequency of the sound wave generated by each key press, which affects both the pitch of the sound and the rate at which the ripples expand across the 2D plane.
What causes constructive and destructive interference in the simulation?
Constructive interference occurs when the peaks (or troughs) of two overlapping waves align, amplifying the resulting disturbance. Destructive interference happens when a peak from one wave aligns with a trough from another, canceling out the disturbance.
Why are different keys color-coded in the simulation?
Color-coding helps distinguish between different notes and their corresponding sound waves, making it easier to visualize how each key press generates unique ripples on the 2D plane.
How does the chord-chance slider affect the simulation?
The chord-chance slider determines the probability of multiple keys being pressed simultaneously, creating complex patterns of overlapping sound waves and ripples that demonstrate interference effects.
Try it live
Everything above runs in your browser — open Piano Keys and Sound Ripples (2D) and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Piano Keys and Sound Ripples (2D) simulation