r/howdidtheycodeit • u/SnappierSoap318 • Jul 07 '22
Question OG Windows media player visualization?
How did they make those trippy visualization of audio? Is there any open source/ alternative to learn these type of visualization tools?
33
Upvotes
19
u/nvec ProProgrammer Jul 07 '22
I don't know any tools in specific for this but if you end up needing to code at a low level then know that underneath all of the shiny graphics it's some fairly hardcore maths.
As the audio plays the waveform is fed into various signal processing algorithms which extract information from it, the most common probably being Fourier Analysis (also known as Spectrum Analysis) which breaks the sound into their component frequencies and is the basis of EQ meters as it lets you see how the sound breaks down into high, medium, and low frequencies.
Other techniques such as just looking at how loud the audio is (Add the absolute magnitude of the sample to a volume counter, then multiply the count by a number just below zero so that it 'forgets' over time), or more complex things such as Beat Analysis which lets you know the tempo of the music and where the beats are can also be used but Fourier is the main trick.
There are some open source libraries to do this but I've not used any myself so can't recommend any in particular, but Google should know. A useful search term here is 'FFT' which is Fast Fourier Transform and is one common way of implementing Fourier Analysis.
With this you basically have a set of numbers then you need to write the graphics, here libraries such as LibSDL can provide a decent framework with bindings to most popular languages.
If you decide to go heavy then you may want to consider actually getting a game engine involved, whether a lighter one such as Godot or one of the bigger Unity/Unreal ones. Pretty sure you'll find audio analysis tools in their asset stores, and I know Unreal does have basic Spectrum Analysis and other tricks built in.
3
u/[deleted] Jul 07 '22
projectM might be relevant.
3
u/Gusfoo Jul 07 '22
Yes. Just search for Winamp visualisation plugins. For example https://github.com/visbot/awesome-avs
2
u/Soundless_Pr Jul 07 '22
Take a look at The Milkdrop Presets from the winamp Milkdrop visualizer.
They're basically just shaders with some inputs from audio processing provided by winamp or the milkdrop plugin.
1
u/No_Bar_419 Sep 25 '24
soundspectrum gforce
1
u/robholttracks Jan 30 '23
TouchDesigner is a node based programme already built for this. In addition to the nodes you can use own python scripts within it to some extent
1
u/TRCTheRaul Nov 19 '23
Registry editor, You can use Registry Editor to make your own Battery visualization presets!