Introduction About Site Map

RSS 2 Feed RSS 2 Feed

Main Page | Blog Index

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)

XMMS menu

Add the following line to the “Song change” Command field:

(date; echo %s) >> ~/My_playlists/playlist.log

XMMS KDEI 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

One Response to “Music Log Files”

  1. Harvey Tobkes Says:

    My initial concept of this program is: Who needs it? It’s too much information. Just lighten up, sit back and enjoy the music!

Back to top

Retrieval statistics: 21 queries taking a total of 0.154 seconds • Please report low bandwidth using the feedback form
Original styles created by Ian Main (all acknowledgements) • PHP scripts and styles later modified by Roy Schestowitz • Help yourself to a GPL'd copy
|— Proudly powered by W o r d P r e s s — based on a heavily-hacked version 1.2.1 (Mingus) installation —|