3 ms·
I'm not sure why you think there's magic involved. Say you have songs with three sort of tags, album, genre and title. I.e.: song_1: genre_1, album_1, title_
by wander_homer 5y ago
I'm not sure why you think there's magic involved. Say you have songs with three sort of tags, album, genre and title. I.e.:
song_1: genre_1, album_1, title_1
song_2: genre_2, album_2, title_2
song_3: genre_1, album_3, title_3
Now when the user wants a tree with the first level being genre and the second being title, the player just goes through all the know genres to build the first level with two items (genre_1 and genre_2), then for the genre_1 sub-tree it generates a list of all songs with genre_1 and displays their title, ... So you end up with:
genre_1
|-> title_1
|-> title_3
genre_2
|-> title_2
Those are basically just normal database lookups.
Edit: In fact since the player allows for multi-value tags, items can even appear multiple times in the tree, e.g. when a song has multiple artists.
- dredmorbius 5y agoThe point to my question wasn't that there is magic involved, but to ask what the specific method was. Maybe I should have made that clearer, though I was hoping it would be obvious. In the artist -> album -> song case, to repeat myself, the recognised hierarchy reflects an actual one that's present in the original artefacts. (This needn't always be the case: multiple artists might play the same song, the same song might be on multiple albums, song title itself does not necessarily imply either artist or album. Though in the simple case it does.) In the genre/title example, how would it be clear that title is a subclass of genre rather than the other way 'round? And what of fusion or crossover works --- is DNA's remix of "Tom's Diner" folk-rock, a capella, or trip-hop?
- wander_homer 5y ago> In the genre/title example, how would it be clear that title is a subclass of genre rather than the other way 'round? It's not clear and it can be the other way around. You can also ask the player to list the genre as a subclass of titles. It'll be just a less useful representation, because the first level usually holds almost as much entries as there are songs, since titles are often unique. > And what of fusion or crossover works --- is DNA's remix of "Tom's Diner" folk-rock, a capella, or trip-hop? It can be all of those, like I said you can have multi-value tags. Then this song would show up three times in a tree with a genre level.
- dredmorbius 5y agoDigging into method, then: more-frequently-occurring tags are presumed to be more general than less-frequently-appearing tags? Or is there no presumption of specificity / generality at all, and just an association between tags. If the latter, it's not clear to me how the tags are directed, other than in the sense of an RDF triple's subject, predicate, and object. https://en.wikipedia.org/wiki/Semantic_triple https://en.wikipedia.org/wiki/Semantic_triple
- wander_homer 5y ago> Digging into method, then: more-frequently-occurring tags are presumed to be more general than less-frequently-appearing tags? No, all tags are handled in the same way by the player. It's completely up to the user to specify the hierarchy in which tags can be browsed. The player then builds the tree dynamically. > If the latter, it's not clear to me how the tags are directed, other than in the sense of an RDF triple's subject, predicate, and object. I'm kind of lost here, since I'm failing to see where the confusion comes from. Also, I'm not a native English speaker, so I might be missing something or my explanations just aren't well enough. So let's try this again with some simple pseudo code. Tags here are nothing but key:value pairs associated to audio files. So if the user asks for the tree structure like key_3/key_4/key_1 the player can simply do the following: keys = {key_3, key_4, key_1}; tree = new Tree; for song in songs { subtree = tree for key in keys { // key here might be something like "Artist" // value here might be something like "Iron Maiden" value = song.get_key_value(key) if !subtree.has_node(value) { // if the subtree doesn't already have the "Iron Maiden" node in the current level, add it subtree.insert_node_sorted(value) } // use the "Iron Maiden" node as the new subtree subtree = subtree.get_node(value) } subtree.insert_song_sorted(song) }