Some of my scripts for daily use on a linux desktop

Sunday, February 28, 2010

Audio Spectrum Analyser / Equalizer



As you can see on this video, we can make some funny things with conky. (With recordmydesktop, I don't have a nice sound, and sound is not synchro to the video, sorry for that).
After drawing some bargraphs with Lua, I tried to draw an audio spectrum. This has nothing to do with Conky or Lua but all the work was already done for a screenlet named Impulse for gnome ().

This screenlet use a C library and some python bindings for drawing the spectrum. The main work to port this to conky was to translate drawing from python to lua and it was quiet easy.
I tried to make lua bindings for the C library but I didn't managed because I don't know C ! Even after reading this HowTo.

How the conky works ?
conkyrc load the Lua script and run the main function in Lua. This function create a pipe to the python binding linked to the C library at first run of the conky. After that, the Lua script read the values returned by python and draw the equalizer.
Also, I included the bargraph widget in the lua script so the spectrum can be more colorized ;-)

No comments:

Post a Comment