Music Visualizer?

Does anyone have any ideas on how I can make some function react to music, like an audio visualizer (ex: there is a sudden jump in the music, so I use a particle animator color script to change the color to red or something like that)? I have looked into this

But there is not much info on it.

You don't need to do any heavy calculations to get spectrum data in Unity - at least not yourself. Just use AudioSource.GetSpectrumData. That gives you all the values, you just need to render it somehow.

I guess you want to build some kinda spectrum analyzer like Winamp visualizations or MediaPlayer screens?

What I've learned from examining this kinda task, is that you have certain heavy calculations to perform each frame if you want a realistic reaction on the sound.

The reason is that music comes with "beats" so there would be some "pikes" in the volume where the drums etc. hits. But there is also a frequence of the waveform you need to put into the equation to get these data out.

My answer would be, go look for a c# example on how to detect BPM on an MP3/OGG and then grab the parts from those.

Its pretty hardcore math to build yourself, I've heard. Sorry that I cant provide you with the actual codesolution, but I havent found it myself. So if you do, please post it to the community as many people might find this very interesting too. Including me. :-)

I wrote a fairly long tutorial on how to do music visualization in Unity: http://www.creativeapplications.net/mac/visuals-for-sonar-festival-vdmx-to-unity3d-tutorials/

if your interested in beat-detection you can download the source for the processing library, minim (http://code.compartmental.net/minim/distro/minim-2.0.2-full.zip) and look at BeatDetect.java ; perhaps you could port the code to work with Unity3d. hope this helps, -rook

I recently released a Unity Scripting Package for music visualization, called Visualizer Studio. It should help you out quite a bit! :slight_smile:

[Link removed by mod]

i m really glad to find the link about the vdmx/unity3D interaction…I had the chance to use vdmx long years ago…it was not even officially published…my vision on vjing has naturally evolved toward 3D from few years now, and i m looking for interesting ways to connect Unity with external tools, it seems i can’t sadly get the project to work, maybe a question of unity version…wonder if you could republish a more "recent " version of the project (for unity 4+vdmx B8)…i hope the problem doesn’t come from my 10.6 machine installation…please , let me know…
tks by advance

I know this is really old but I just want to share this. This is a very simple music visualizer and maybe it could help you start. http://karllim.weebly.com/unity3d-simple-visualizer.html