Saturday, June 25th, 2005, 12:58 pm
Music Log Files
Ever wondered how much you listened to a particular song?
XMMS possesses a great extent of flexibility. It provides facilities which, when customised appropriately, can dump complete song descriptions. XMMS can then progressively, accumulatively add song data to log files. Timestamps imply the duration of listening, which lead to possible future extensions, e.g.:
- Automatically parse (scan, hash, then analyse) the log file/s
- Compute an average listening time — that is before skipping to another track — for each individual song
- Erase music that is frequently skipped or just output a ‘prospective deletion list’ to another file
Input/output operations are made quite simple. These can be invoked as command-line strings whenever a new track begins. It is a built-in XMMS plug-in, which can be found under Preferences » Song Change » Configure (see illustration below)
Add the following line to the “Song change” Command field:
(date; echo %s) >> ~/My_playlists/playlist.log
I am providing an example log file, assembled naturally (not artificially. Honest!) over 20 minutes or so. I still need to get rid of the doubly appearances, apparently caused by xmms-kde
in my dock (screenshot on the right). As well as giving a minimal user interface, xmms-kde
enables control of the player with CTRL+SHIFT+
keypad even if the player is neither visible nor in focus.
A music log file results in even more redundant data to store. According to a rough calculations, I will see it growing by 1 megabyte every month or so. Compression, however, should make it only 10-20% of its original size.
UPDATE 26/06/2005: The following command, which can be set to become a nightly cron job, will slice the large log file so that it is composed of daily ‘chunks’:
mv ~/[Path]/playlist.log ~/[Path]/playlist-`date +%Y-%m-%d`.log
This can be extended to form an annual and monthly hierarchy of directories.
See the later extension: producing history spreadsheets
June 25th, 2005 at 3:34 pm
My initial concept of this program is: Who needs it? It’s too much information. Just lighten up, sit back and enjoy the music!