Audio Visualizer

Using FFT transforms and shaders

Audio Processing

Using SFML's audio library and a boiler plate FFT sampling repo, this project experiments with different methods of changing meshes in response to incoming frequency amplitudes. Namely, two modules that can be adjusted to create different types of visualizers.


WAV files are collections of samples that make up the sounds you hear in music. Fast Fourier Transforms allow one to take a group of those samples at an interval and output the different frequencies' amplitudes over time. This creates an effect of objects moving with the music.




The above scene has 3 components. The outside ring is the amplitudes of about 1000 samples taken from the FFT function. They show a more detailed spectrum of detail. The inner rings represent the average of frequency ranges, with very low on the outside to about 10000 Hz on the inside. They represent what is called a bucket (a number of samples in the same range of frequency added). The inner simon says sphere also represents bands, but utilizes vertex and fragment shaders to change the spheres radius in an octant with respect to amplitude.

What I Learned

Initially I had a lot of issues with the FFT functions and the repo I chose. I spent a long time trying to make the sound have a lot more quality visually. As you can see in the video, the amplitudes don't really seem different (especially on the outside ring), and just slightly moves in the same direction at once. I was quite dissapointed I couldn't figure that out, but oh well. There were also some smoothing functions for the movement I tried to implement. I wanted the different elements to move when a certain threshold was reached. Threading would have been a way to accomplish that, but it was too late. All in all, if I did the project again, I would have prerendered files from audio that could be used as data like an obj does, since the whole project was supposed to be about what I could do with sound, and not the actual sound processing itself.


Overall, it was fun, albeit a little more of a headache than I imagined initially. I hope you enjoyed, thank you for reading.


References

SFML Audio Libraries

jiwoojang's Audio Processor