This is from a little while ago but it's always nice to make your code available. Here is a script for the Amarok music player, retrievable as the Moodbars-BL script from KDE-apps

Moodbars are ususally small graphics shown as a background to the elapsed time bar commonly used to show the progress of a track of music. The graphic is a representation of the track produced by some mathematical analysis. This analysis can be complex but in the case of the default in Amarok is more simple it seems. However you can tell the busy-ness and quiet spots of the track easily which is quite nice.

Anyway, the script automatically generates moodbar files for any local songs in the Amarok playlist. It is written in JS and is configurable in the "Scripts" section of the Amarok configuration. There is more information on the KDE-apps site, with instructions inside the download.