Live data from Hacker News

The music classifying nightmare

blog.pkh.me

21–30 of 77 posts

Re: The music classifying nightmare

#21
Somewhat related but as I've been building a rails project I've been meaning to open source the song parser I've been building alongside it. It scans an mp3 and pulls out the artists along with the type of role they played on the song. Here's a quick gist I pulled from my model:

https://gist.github.com/3680949

Some examples:

Drake - The Motto (Jon Bellion Cover)

=> [["Jon Bellion", :cover], ["Drake", :original]]

David Byrne and Brian Eno - Strange Overtones

=> [["David Byrne", :original], ["Brian Eno", :original]]

Cheri Coke, MELO-X - Free

=> [["Cheri Coke", :original], ["MELO-X", :original]]

Avicii - Street Dancer (Whelan & Discala Remix)

=> [["Whelan", :remixer], ["Discala", :remixer], ["Avicii", :original]]

RAC - Hollywood featuring Penguin Prison (The Magician Remix)

=> [["Penguin Prison", :featured], ["The Magician", :remixer], ["RAC", :original]]

And a ridiculous example:

Eight, Nine & Ten (Eleven cover - Song name feat. One, Two & Three (Prod. by Four) (Five & Six remix) (Seven cover)

=> [["One", :featured], ["Three", :featured], ["Two", :featured], ["Four", :producer], ["Five", :remixer], ["Six", :remixer], ["Seven", :cover], ["Eight", :original], ["Nine", :original], ["Ten", :original], ["Eleven", :cover]]

If there's any interest, I'd love to turn it into a proper github repo and accept some pull requests.. it's far from perfect (both code-wise and generally) but works well for most cases.

Re: The music classifying nightmare

#22
post #15

You're making the problem a lot harder than it needs, or ought, to be. The most telling example, IMO, is the Aphex Twin one... > Oh, and his real name is Richard David James. What are you > supposed to use for the file system directories and files > name? His name? The most common nickname? Both? One file > system solution is to have symbolic links (do you link > Richard David James to Aphex Twin, or vice versa?). Fo…

Well, it's the same person behind. Even if the artist tried to give a different "personality" to his music over the time, following all his creations is actually a good listening experience. The "hey I just want to listen to the musical evolution of this guy" isn't a rare feeling IMO. Grabbing all his nicknames is kind of a problem.

Of course, you have a point, I'm making the problem harder than it needs, and you can just don't care about most of these issues. Hey, that's actually to the conclusion I reached. But still, I believe the current solutions are not optimal if you want to match N songs, store all the related "context" information, or just keep a consistent way of storing them.

Re: The music classifying nightmare

#23
I don't think there is a perfect way to organize a music collection in a hierarchical manner, so I don't even bother. Good tag metadata and foobar's search does all the work for me.

To me, the purpose of a filesystem is not to implement fine-grained categorization, but to provide basic grouping of related files so that I can easily operate on them all at once. To this end, my music collection mostly consists of one folder per album in a root music directory. Folders are usually named "Artist/Group Name - Album Title". That naming scheme doesn't always fit (albums featuring various artists, soundtracks in which I'm more likely to care about the title of the work rather than the artist that composed it, etc), but I don't try to separate soundtracks from regular albums or anything like that, I just throw them in the same root directory. With this scheme, it's easy to delete/share/transcode an album when it's contained within a single directory, convenient for people I share with, and I don't waste any time obsessing over something that I rarely need to see.

Some people have advocated a more database or metadata-oriented approach where you strip all metadata from the filename and folder hierarchy and stuff all your files in one directory. It's an interesting idea, for sure, more closely resembling the way web services like Youtube store their content. It makes one begin to imagine a desktop operating system that featured a metadata database as the primary filesystem organization scheme in place of the traditional hierarchical filesystem.

With our currently available tools, however, having some kind of useful metadata in the filename and/or filesystem hierarchy, even if it is redundant, is incredibly useful when performing manual file manipulation, especially the aforementioned sharing of files. You'd need ubiquitous categorization metadata in files (that is, not just ID3 and company for music files) and ubiquitous support for parsing this metadata in everyday applications (that is to say, when beginning a download of a song or a document, your web browser would show you the relevant metadata and hide the filename, if it exists. when opening a file, one would have to be greeted with a search box instead of a traditional hierarchy dialog) before we could ever entirely transition from having meaningful filenames to having meaningless hashes, timestamps, or garbage as the primary identifiers of files.

Re: The music classifying nightmare

#24
post #18

Earlier quoted context omitted.

Nice, I'm sure a lot of people would be interested in trying this. But talking to myself, I'm disgusted with all of this, so I'm just maintaining my mess in its current state for now. Still, I like to see such solution, and I'd be really interested in a counter article to what I wrote dealing with each issue. Even if at the end, I will likely not use the given solution. About the regex search, I'm not sure that's rea…

Sorry-- I was unclear. The regex is not for organization. It's just an easy and flexible way to browse subsets of your library, like smart playlists in iTunes, but more powerful.

I was actually talking about browsing. The musical content analysis has the goal to provide new ways of representing your music, and browse it.

Re: The music classifying nightmare

#26
post #4

Earlier quoted context omitted.

That's irrelevant, it's either ripped from one or the other, and that's the information that should be there. Lookinng up on which albums a song has appeared should be a database / wikipedia lookup. Think about it, is it relevant on which christmas compilations "so this is christmas" has appeared?

It's not irrelevant. If the exact same recording of a song appears on two albums, an ideal categorization system would allow it to appear as such without storing multiple (redundant) copies of the song. An easy way to think of it is a normalized relational database. If the song has an id of 5 and is on two albums with id 2 and 3, then there would be an AlbumSong join table with schema (album_id, song_id) and two rows…

Why do you care about this? When you listen to the album, you obviously want to hear every song on the album, and hard drives now are so big (and this occurence rare enough) that the extra space can hardly matter. So why do you care?

Re: The music classifying nightmare

#27
This sounds like exactly the kind of problem that relational databases were designed to solve. You can organize it with an entity-relationship model fairly easily. Once you have stored your information in a database, the filename doesn't really matter as long as each mp3, ogg, etc. gets a unique name; you can look up the file by querying the database for files that have the properties you care about.

Re: The music classifying nightmare

#28
post #25

Some of these problems (like creators with the same name) have been solved by librarians years ago.

You mean by having a guy to ask where to find something because you're lost in the store and can't find shit?

No, there is a whole field that deals with issues like this. It's called library science. Specifically, dealing with this problem is called [authority control](http://en.wikipedia.org/wiki/Authority_control).

Some of the other problems are also solved by cataloging experts.

Re: The music classifying nightmare

#29
post #19

Oh god, I tried renaming files on my own (and I'm kind of a beginner programmer). Then I found out about unicode problems and then came 2 problems. problem #1 was apparently I set the encoding wrong while renaming the ID3 for the music files so the foreign languages turned into question marks. I thought scratch that, time to use someone else's tool. foobar2000 solved everything I had a problem with except problem #2.…

This is the shitty python script I use to organize music, which seems to work pretty well except in one case[1]: https://gist.github.com/3681165.

For the love of god, try it on a small sample of your music or it will wreak all kinds of havoc and you will yell and curse my name.

What it does: takes a directory of folders with MP3s, and makes them into the a directory of folders like yourdir/[ARTIST]/[ALBUM]/[TRACK No.] - [Track name].mp3. More importantly though, I believe it handles unicode correctly, and it's just over 100 lines of code, so you could adapt it to whatever system you prefer.

Find the python library called Mutagen that deals with parsing ID3 tags and put it in the same directory as this horrible script.

[1]: The one case it handles spectacularly poorly is when you have an album with multiple artists. This could be a soundtrack, a compilation, or even that thing that happens especially often in rap where the artist is like "[Some dude] ft. [Some other dude]". Honestly, I just handle those cases manually, but it might not be that hard to make the script do it right.

By the way, I've really only run this script on Windows. There are undoubtedly some tweaks that should be made to make it work correctly on Unix-y systems.

Re: The music classifying nightmare

#30
I only go so far as sanitizing and standardizing my music collection through Tag&Rename (and I haven't found a good OSX equivalent to this yet sadly). It gets the data from Amazon in 98% of cases, adds the album art (which I like having on my player), etc. Then I store the files in:

Artist/Album/Track# - Song name [- Artist name]

The last is only there for soundtracks and other "Various Artists" type collections.

This is Good Enough [tm] for me. I can sync this across hard drives (backup), minimize duplicates (although I end up with these through compilations of various sorts), etc.

Unfortunately the ID3 tag system is All Wrong [tm] for this in many ways stated (in this post and elsewhere). For example:

- Albums don't really have an artist; songs do;

- Programs for automating this that get info from Amazon and elsewhere tend to use what year the particular CD was released rather than when it was originally released, which is far more useful and relevant (eg if you want the Beatles White album you don't care the CD was released in 1998, it should come up under 1968;

- Albums don't really have years either. Or at least they have publication years. The songs have years. Normal studio albums have a common year. Compilations and soundtracks do not;

- Genres are coarse-grained, arbitrary and (IMHO) mostly useless;

- What I like is greatly influenced by the circumstances around the song, sometimes more than the song itself. I might like a song because it reminds me of a particular person, place or event. Or even mood. Sometimes its the lyrics. Sometimes its the sound. No recommendation engine is going to capture this sort of angle.

This goes beyond music: people just aren't interested in classifying, well, pretty much anything. Playlists seem to be about as far as most people are willing to go. Playlists are a fairly convenient way of coming up with s event-specific music eg for working out, for relaxing, for dancing, for a party, etc.

Efforts at far strong and more accurate metadata, classification and organization speak more about one's festidious--even anal-retentiveness--more than any real need or better outcome (IMHO). It's just rabbit-holing really.

Post reply on HN