1 May 2009 connolly   » (Master)

more on music collection and office organization

I'm still not sure how to manage my music files. Now that I have most of it on one big disk on a linux always-on machine (I hesitate to say server as I don't have a clear back-up strategy), I put our mac mini under the TV in the hearth, replacing the XO-1 laptop, in order to do video as well as just sound.

It doesn't make much sense, after all, to try to stay open-source-pure when it comes to listening to RIAA music and watching hollywood movies; I might as well have Steve Jobs negotiating my sharecropping deal.

mpd uses .m3u files. They're pretty simple, but for archival purposes, I try to stick to XHTML. I wrote another little python ditty to do the conversion: see m3uin.py in r423:4a5a8b2d237c of palmagent hg repo.

I run it like this:

$ python ~/projects/palmagent/m3uin.py
/var/lib/mpd/playlists/Three\ Chords\ and\ the\ Truth.m3u

and out comes:

  1. from A Song's Best Friend_ The Very Best Of John Denver [Disc 1]
    by John Denver
    Poems, Prayers And Promises

  2. from WOW Worship (orange)
    by Compilations
    Did you Feel the Mountains Tremble

  3. from Family Music Party
    by Trout Fishing In America
    Back When I Could Fly

Not only can us humans make sense of that, but it's got RDFa attributes sprinkled here and there that make it yummy Semantic Web Data so that we can delegate processing to machines:

Jukebox$ xsltproc --novalid
http://www.w3.org/2008/07/rdfa-xslt three_chords.html 
Jukebox$ rapper three_chords.rdf -o turtle | less
rapper: Parsing file three_chords.rdf with parser rdfxml
rapper: Serializing with serializer turtle
rapper: Parsing returned 77 triples

and out comes:

@prefix h: <http://www.w3.org/1999/xhtml> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix mo: <http://purl.org/ontology/mo/> .

<three_chords.rdf#album1> dc:title "A Song's Best Friend_ The Very Best Of John Denver [Disc 1]" ; mo:track <artists-popular/John%20Denver/A%20Song%27s%20Best%20Friend_%20The%20Very%20Best%20Of%20John%20Denver%20%5BDisc%201%5D/1-04%20Poems%2C%20Prayers%20And%20Promises.mp3> ; a mo:Record ; foaf:maker <three_chords.rdf#agent1> .

<three_chords.rdf#agent1> a foaf:Agent ; foaf:name "John Denver" .

In my March 2008 item, hAudio for microformats mixtapes, in progress, I tried using microformats but struggled since hAudio was still sparsely documented and changing. In contrast, RDFa and the music ontology were pretty easy to work with.

As I said in my Aug 2008 item, The details of data in documents; GRDDL, profiles, and HTML5, one of the options is that "People who want to put data in their HTML documents use RDFa".

I'm looking into getting metadata from the audio file, not just the path name. In particular, using the mutagen library I can see that iTunes stores CDDB IDs when it rips music and I'd like to use those to ground my data globally:

MPEG 1 layer 3, 160000 bps, 44100 Hz, 246.81 seconds (audio/mp3)
COMM=iTunNORM='eng'= 00000550 000001F3 00002A22 00002F25
00021A29 000219F5 0000707F 00006A4C 0003536D 0002B40A
TPE1=John Denver
TIT2=Poems, Prayers And Promises
TENC=iTunes v4.7
TALB=A Song's Best Friend: The Very Best Of John Denver [Disc 1]
TCOM=John Denver

Yet ToDo: connect this with ImmPort/PDB in neurocommons/science commons/creative commons work (pdb-immport code in SVN), Linked Open Data for the U.S.A. recovery IT infrastructure, and maybe XBRL stuff.

See Also:

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!