Polochon-street / bliss

Bliss music library that can compute distance between songs
https://lelele.io/bliss_old.html
MIT License
79 stars 5 forks source link

Online database #20

Open Phyks opened 8 years ago

Phyks commented 8 years ago

Hi,

I am working on integrating Bliss in MPD, see https://github.com/Phyks/MPDBliss/.

I have something almost working, but running bliss on every song (almost 50k in my case) and storing distances across each songs in a db is really long.

I do not remember leleleplayer being that long to build its cache. Which approach are you using?

What about sharing the built infos in an open online database? Like associating computed values using bliss to musicbrainz ID or things like this?

Polochon-street commented 8 years ago

Hi!

First, thanks very much for bliss' integration in MPD, I use MPD too and will test it ASAP! For leleleplayer, I store every song's coordinates in an xml db, and then, when playing in lelelerandom mode, in order to choose a song to play after the previous, I do something like: do { song = get_random_song(); } while(bl_distance(song.force_vector, previous_force_vector) > treshold_distance || bl_cosine_similarity(song.force_vector, previous_force_vecotr) < treshold_similarity)

And then chose the remaining song. It sure doesn't find the best song, but that works. I usually use treshold_distance = 4.0 and treshold_similarity = 0.95, and increase them from 0.001 in the loop. That way, if your library is composed of like, two songs very different from each other, it will still continue to play.

This solution is indeed not optimal, so if you have any suggestion, don't hesitate :) (and if it's not clear, tell me!)

The musicbrainz ID thing is indeed a good idea, but I really don't know how does that work. I'll look into it!

Phyks commented 8 years ago

Ok, so I am basically doing the same for my integration with MPD (I am storing all the coordinates in a sqlite db, storing the pairwise distances in another table, and taking the song which is closest.

I will take a look at your approach, as computing all the distances between songs might be really long.

Concerning the idea of an online database, the idea is that if your songs are correctly tagged, we could match them against an online database and get the coordinates directly, rather than recomputing them everytime a user needs it. Musicbrainz provides such universal IDs for songs.

An idea to improve leleleplayer btw is to put the distances in cache as well. I will try to do something like this in my client and will let you know.

Polochon-street commented 8 years ago

The only problem I see in the online db idea is that the analysis process will probably change in some further update (regarding the tempo & attack analysis), meaning different values for same songs, making the distance computation irrelevant.

So, I'll wait until bliss is really stable before doing that. (and, well, thanks for the ideas!)

Phyks commented 8 years ago

Ok for this, better to wait for a stable API :)