For a while now, I've been getting requests for official data feeds describing the music at Magnatune. I've now added an "API" section to the "Info" section at Magnatune, with XML and CSV data feeds:
What I'm hoping to do with all this is to encourage 3rd parties to write interesting applications which know about Magnatune's music. These feeds could be used by stores such as netmusic, collaborative sites such such as webjay or iRate, or implemented as music-collection players in xmms, winamp, or other players.
I made two different XML versions of the song-by-song feed, as traditional XML is not much fun to parse, if you have to write a parser from scratch
<Track>
<artist>Arthur Yoria</artist>
<albumname>I'll Be Here Awake</albumname>
<tracknum>1</tracknum>
<year>2004</year>
<mp3genre>Rock</mp3genre>
etc...
vs:
<Track artist="Arthur Yoria" album="I'll Be Here Awake" title="I'll Be Here Awake" tracknum="1" year="2004" etc..
this 2nd version is easier to write a quick-and-dirty parser for, but isn't what XML parser usually like, which is why I also made the 1st format.
I also made a more hierarchical XML format, which adds the concept of an album, and tracks inside an album, like so:
<Album>
<artist>Arthur Yoria</artist>
<albumname>I'll Be Here Awake</albumname>
<year>2004</year>
<mp3genre>Rock</mp3genre>
<home>http://magnatune.com/artists/yoria</home>
<buy>https://magnatune.com/artists/buy_album?artist=Arthur+Yoria&album=Ill+Be+Here+Awake&magnatunegenres=Rock</buy>
<magnatunegenres>Rock Wakeup Singing</magnatunegenres>
<Track>
<artist>Arthur Yoria</artist>
<albumname>I'll Be Here Awake</albumname>
<tracknum>1</tracknum>
etc...
and finally, to make it REALLY easy to work with Magnatune's music, I made a CSV format, which can be dropped into any relational/sql db, or Microsoft Excel.
Of course, in making such a feed, I found a number of problems with my meta-data. A lot of albums didn't have "track length" id3 tags, so I used mp3info to calculate this, and id3v2 to put the data into id3v2 tags inside the mp3 file. A small number of albums were/are missing year or genre id3 data, so I need to go back and re-rip them so that the data is really clean. So part of this process of telling people what's at Magnatune is writing a meta-data "lint" program (which I've done now) and then <sigh> fixing all data that cause metadata-lint warnings.
I've been meeting more people trying wacky redo-the-music-business ideas on the web, such as http://www.mediagora.com/ and http://www.opsound.com/ -- the easier I can make it for these other people to use Magnatune in their business plans, the more visibility Magnatune's music will get!
John, aren't you missing a field in your XML? I looked through and I don't see something that identifies the track title for a given song. You have a tracknum and an albumname but not tracktitle or trackname or anything like that.
This is a cool idea and I'm excited to see what creative things people do with it.
Posted by: Dave | April 18, 2004 at 08:27 PM
You wrote:
"John, aren't you missing a field in your XML? I looked through and I don't see something that identifies the track title for a given song."
Whoops, you're absolutely right, I forgot to include the obvious piece of info, namely the title (name) of each song. Thanks for catching that -- I've fixed it now.
-john
Posted by: John Buckman | April 18, 2004 at 09:00 PM
This is only a suggestion, but could ultimately make things easier in the long run:
Instead of XML, how about RDF?
http://www.w3.org/RDF/
The main benefit of RDF is that you can re-use a lot of existing structures. That would then allow existing tools to be able to understand your data, without knowing everything about it.
The learning curve on generating RDF is a bit more than XML, but well-worth it IMO. The output is about the same complexity, just more formally-structured.
Posted by: Steve Pomeroy | April 20, 2004 at 09:07 AM
"Instead of XML, how about RDF?"
I'm certainly open to it, though it wouldn't be "instead of" for me, but "in addition to" -- I'd rather have multiple different formatted data feeds and people can choose what they want.
My resident XML wiz, Chris Allen http://www.lifewithalacrity.com is down on RDF due to the complexity (it's also not easy to parse) so RDF wasn't my choice for a first pass implementation.
But, if I get lots of requests for it, I'll do it.
Posted by: John Buckman | April 20, 2004 at 09:17 AM
I'm not exactly "down on RDF", instead just that as John said, it adds an element of complexity. There is some real value to the approach of the "semantic" style of XML, especially early on before standards are complete.
I am working on an RDF approach to the same info, that will conform with ideas from both FOAF and MusicBrainz RDF. Progress at www.socialtext.net/musicmetadata
Posted by: Christopher Allen | April 20, 2004 at 11:21 AM
John,
while you have the XML religion, how about exposing an RSS feed of new albums? That way folks can subscribe with their aggregators and get notified when new albums are added to the catalog. For examples of folks using this in their business, see http://www.fictionwise.com, where they do just this with the new books each week. I set up a similar thing for WREK in Atlanta (http://www.wrek.org) where I expose the newly programmed material as an RSS feed - http://www.wrek.org/addlist.xml . It's not widely publicized, but I use it to follow what has been added to the station's rotation. Just a suggestion.
Posted by: Dave | April 20, 2004 at 08:42 PM
" how about exposing an RSS feed of new albums? That way folks can subscribe with their aggregators and get notified when new albums are added to the catalog."
That's absolutely something I want to do, and in the works.
-john
Posted by: John Buckman | April 21, 2004 at 09:52 AM
Ah, very cool. I should have known you'd be on it already...
Posted by: Dave | April 21, 2004 at 07:17 PM
With Magnatune outputting RSS feeds, other media places, and of course archive.org, I believe we have one of the most powerful sources of new fresh, music in the works. Clear channel? Who cares when you have bandwidth and smart technology?
Posted by: Steve Pomeroy | April 21, 2004 at 09:06 PM