Desmos 3D: Falling Metal Pipe WITH SOUND

*CLANGALANGGLALANGANGANG*

Click to play
WARNING: Loud
According to Know Your Meme, The Metal Pipe Falling Sound Effect, also known as Destruction​_​Metal​_​Pole​_​L​_​Wave​_​2_0_0.wav, refers to the sound of a long metal pipe falling and hitting the ground. On YouTube and TikTok, among other video meme platforms like iFunny, the metal pipe falling sound has been used as a random punchline to various ironic memes.

But why, and more importantly HOW have I reproduced it in Desmos?

Recently, Desmos added a new function called tone().  It plays sine waves of specific amplitude and frequency depending on the parameters you pass.  So I got to thinkingwhat if I found the frequencies and amplitudes of a really goofy sound and played those back through tone()? As it turns out, exactly what you might have expected happensyou get the original sound back...more or less!

How did I find the frequencies and amplitudes though, you ask...well, I used a fascinating piece of math called the Fourier Transform! It was invented by Joseph Fourier in the 1800's and designed exactly for this purpose.  Like an auditory prism, it can be used to split a complicated waveform into its constituent frequencies.

What you hear when you unmute this graph (click the speaker icon in the top left) is the result of running the Fast Fourier Transform on 4096-sample chunks of the metal pipe sound effect every 33ms, then playing back the 32 most prominent frequencies from each chunk at their respective amplitudes.  I could have done more than this, but 32 tones at once is actually rather stressful for lower-end machines.

If you want to learn more, also check out this video by 3Blue1Brown that covers the Fourier Transform in depth.