This is a demonstrator for the "bunching up" of waves in a longitudinal/compression wave, since the diagram used in class didn't accurately show it, not the translation of waves through a medium. Press the green flag to activate! The amplitude and frequency can be changed using the slider, but I wouldn't drop the amplitude too low or too high, else the effect becomes a bit harder to see.
This project uses a linear and sine function to produce the wave-like effect. Enjoy!