Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create a live music visualizer desktop System
I've always wanted to have a desktop image that was a live music visualizer. This is how I did it. As far as I can tell (by Googling the techniques that have been detailed elsewhere), this is the only start-to-finish instruction to accomplish responsive music visualization on the desktop.

Before you begin, note that the major issue with this hint is that it requires you have the visualizer running in iTunes in order for the desktop visualizer to work. I have a Quad dual-core, so I don't notice a hit in performance, but I'd prefer this to work cleaner. Read on for the how-to if you'd like to see how I did it...

First, I copied a visualizer (for example, Lathe.qtz) from the Compositions folder in the /System » Library » Compositions folder, and modified it heavily in Quartz Composer (part of XCode) to make it unique.

Still in Quartz Composer, go to Editor » Edit Protocol Conformance, and click both Screen Saver and Music Visualizer. Then save the edited composition into the Screen Savers folder in your user's Library folder.

Then open the Desktop & Screen Saver System Preferences pane, and set your newly-created screen saver as your screen saver. After doing that, in Terminal, issue this command.
/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background
This sets your selected screen saver as your desktop background. Press Control-C to quit the overlay, or simply close the Terminal window the command is running in, to exit the background screensaver. (I made a new entry into my bash profile to simplify the long command into a more memorable and simpler command, Visualize.)

Nothing will happen until you turn on the visualizer in iTunes. You can use any one the visualizers, except for iTunes Visualizer or iTunes Classic Visualizer. All the rest use the Quartz engine, and will send the audio output to the correct listener (for lack of a better word.)

Two improvements that could be made to this technique. First, as noted earlier, is the need to have to run the iTunes visualizer alongside the desktop visualizer.

The other improvement that could be made is that this solution paints the compostion directly between your desktop icons and your current desktop pattern. I set my desktop so a simple color from the Desktop tab of the Desktop & Screen Saver System Preferences panel, in order to save some processor cycles by not painting two large JPGs accross my two displays.

When/if I figure out improvements, I'll post them.

[robg adds: I tested this, and while it works, the frame rate on my 2.66 Quad core Mac Pro, driving three displays, isn't all that good, and the CPU hit is very noticeable. If you just want to run a screensaver as a background, you can use the above command to do so -- no need to make it an iTunes visualizer as well. We ran the "screen saver in the background" hint many years back, and it's still one of my favorite OS X demonstrations.

Interesting to see that, back in 2002, it took 50% of the CPU power of a 733MHz G4 to do this on a single 1600x1200 screen. (Note that was total CPU utilization for everything I was doing at the time, including using iTunes, etc.) Today, on my three-year-old Mac Pro pushing three relatively large displays (1920x1200, 2048x1152, 1680x1050), it takes less than 5% of the CPU power just to run the visualizer, and total CPU load with a similar set of apps running never went over 9% during my testing. Wow.]
    •    
  • Currently 2.08 / 5
  You rated: 3 / 5 (13 votes cast)
 
[20,216 views]  

Create a live music visualizer desktop | 4 comments | Create New Account
Click here to return to the 'Create a live music visualizer desktop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a live music visualizer desktop
Authored by: yostinso on Jan 25, '10 10:30:46AM

There's an app called "QCDesktop" that will take a Quartz composition and layer either over or beneath icons (or in front of everything). I use a Quartz composition with the "Audio Input" input pointed at Soundflower's output. You can then either set your system audio to output through Soundflower, or use Audio Hijack to grab a specific application's output.



[ Reply to This | # ]
Create a live music visualizer desktop
Authored by: TigerKR on Jan 25, '10 07:38:14PM

Any idea where the default visualization is stored?



[ Reply to This | # ]
Create a live music visualizer desktop
Authored by: siliconjones on Jan 26, '10 12:41:06PM

If your meaning "iTunes Visualizer" I'm not sure exactly where it lives. I've looked for it. It is not a Quartz Composition. Although, it was made by Robert Hodgin under the project name "Magentosphere" it has been tweaked by Apple. It was made in Processing. The Magnetosphere visualizer bundle can be found by googling. Although it is compiled software and therefor not editable like the quartz compositions.



[ Reply to This | # ]
Create a live music visualizer desktop
Authored by: prescor on Jan 27, '10 06:02:08PM

How do you get it to keep running after you close the terminal window or quit your terminal app of choice? I tried appending it with a '&' but it still dies.



[ Reply to This | # ]