6

I'm interested in making an OpenGL visualizer for MP3's as a pet project.

I stumbled upon this youtube video which demonstrates someone showing off a visualizer being used in conjunction with Augmented Reality.

http://www.youtube.com/watch?v=SnshyLJSpnc#t=1m15s

Please watch that video, but ignore the augmented reality aspect of that video. I'm only interested in making a Visualizer, not augmented reality.

What kinds of algorithms were used to generate those patterns in relation to the music? If you watch, you can see what looks like several different methods of visualization. The first one has a distinct look:

The first one looked like waves moving over the rendering area: alt text

Another "mode" seemed to have the visualization move around the center in concentrict circles: alt text

Anyone who is well versed in Audio Programming, what kinds of algorithms could be used to generate similar looking visualizations? What kind of algorithm did the first one use? Or the one with the concentric circles?

Any help in pointing me to what algorithms were used to generate these visualizations based on the music would help me greatly!

4

1 回答 1

8

首先,这些似乎都是基于 FFT 算法(快速傅立叶变换),该算法可以将声波用于特定时间片并将其分离成 XY 频谱线图,其中 X 表示频谱(通常基于对数从 20hz 到 20,000hz),Y 表示每个不同频率的声音的幅度或音量。

如果您查看最初的可视化(视频前面的扁平、无色的可视化),您将看到它的朴素形式。您会注意到,较低的音符在左侧显示为峰值和尖峰,而较高的音符出现在中间和右侧,这是经典的傅立叶变换映射。(其实这个视频最大的毛病就是后半段,介绍完之后,从左到右的FFT映射有缺陷,以至于大部分最高和最低的音符都被截断了左右边缘可视化)。

从这里开始,他只是在这一基本技巧中添加不同且逐渐复杂的装饰。首先,他添加了一个非常基本的颜色映射:波形的高度直接映射到它的颜色:从红色(最低)到深蓝色/靛蓝(最高),遵循经典的 ROYGBIV 模式(红色、橙色、黄色、绿色、蓝色、靛蓝、紫罗兰色)。请记住,高度也对应于该频率下的体积。据我所知,他始终使用相同的颜色映射,没有任何变化。

所有后续的装饰和变化似乎只是使用渐进式时间映射的不同方式。最初,他只是将波形映射在可视区域的前面,然后逐渐将它们流走,这样他就可以有效地制作一个连续运行的 3d 曲面图,频率从左到右,音量(和颜色)从下到上和时间从前到后运行。这就是你在第一张照片中所拥有的。

其他一切都只是这个越来越复杂的版本,以更复杂的方式映射时间(和仅时间)。例如,在你展示的第二个圆形中,我相信他在中间明显的极点周围以非常快的径向扫描模式映射时间。

于 2010-02-05T21:12:56.280 回答