Some of my scripts for daily use on a linux desktop

Showing posts with label equalizer. Show all posts
Showing posts with label equalizer. Show all posts

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 ;-)

Bargraph widget





The version 2.0 of the bargraph is located here : I add more effects and it is more easy to configure with a table of settings :-)


While looking at an old hifi system with green and red equalizer, I tried to do the same with cairo. But with the powerful of cairo, we can do more than simple bar graph. So I wrote this script, really simple to use even if there are 20 parameters to set. But as you can see on the picture, the effects are well rendering!

22. Feb 2020:
I just updated the widget so it can receives not only conky stats but also numeric values.
For use with conky stat :
equalizer('cpu', 'cpu0', ...
for use with numeric values:
equalizer('', my_value, ...

I'have done that because I wanted to retain previous values from conky stats in order to display a progressing graph like on this video :

It's absolutely useless, isn't it !

The code for the video is on the crunbang forum.

28 Feb. 2010:
I renamed the widget from 'equalizer' to 'bargraph'



Last version can be downloaded from ubuntu forums : here


Happy conkying!