views:

152

answers:

3

Being a web developer, I know how event driven user interfaces are written, but do not have insight into other families of code (embedded software like automotive software, automation software on assembly lines, drivers, or the crawling lower-thirds on CNN, etc.)

I was looking at the iTunes visualizer (example) and am curious:

  1. What code is used to write the visualizer? Objective C?

  2. Does it use Core Animation? What type of abstraction does that library offer?

  3. What does the code look like? Is it a list of mathematical equations for producing the crazy graphics? Is it a list of key frames with tweening? Is there an array of images, fractals, worm holes, flowers, sparkles, and some magic mixing them together. Or something totally different?

I am not looking for a tutorial, just an understanding of how something very different than web development works.

Oh yah, I know iTunes is closed source, so all of this is conjecture.

A: 

In my opinion:

  1. Probably C and/or Objective-C with OpenGL.

  2. Possibly. Core Animation provides layers (images) that can be animated very easily and efficiently (fade-in, fade-out, translation, rotations, etc.). It probably uses the same hardware acceleration as OpenGL does. These layers may be used for transitions in the visualizer.

  3. Your bet is as good as mine, but you're probably right. They may use some set of mathematical equations that takes as input a number of variables (such as the amplitude of the sound) and produce an image.

Martin Cote
A: 

iTunes appears to use the G-Force visualizer (or at least, G-Force was licensed for use in iTunes 8.x):

http://en.wikipedia.org/wiki/Music_visualization

http://en.wikipedia.org/wiki/SoundSpectrum

In a more general sense, visualizations are typically combinations of various geometric elements whose parameters are linked to certain sound measurements (volumne, pitch, et cetera), waveforms, and spectrum graphs, with various visual transformations/filters layered on top of those source elements. That's why you tend to see a lot of squiggly lines in visualizations - they're a common form of representing waveforms and spectrums.

Amber
A: 

Although the default iTunes visualizer is written in Objective-C/C++, you can also write iTunes visualizers using Quartz Composer, which is included with XCode on the Mac. It is a node-based compositing environment for visual effects. It has a template for creating Music Visualizers.

Frederik