IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
foo_bestversion, Picks the best versions of tracks from library (+last.fm top tracks)
hymerman
post Mar 20 2013, 18:04
Post #1





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



foo_bestversion
This component can pick the best version of a track (using my own fuzzy rating scheme) from other tracks in your library.

Also included is a command to get the top tracks of an artist from last.fm and generate a playlist from that. I'm also planning to support XSPF playlists, and dead playlist item revival (like foo_playlist_revive).

It's all open source - do with it what you want! And if you make improvements, I'll be happy to accept pull requests on github.

Any problems, use the github issue tracker. Any comments, add them in this forum thread.

If you don't have it already, you'll need the x86 Visual C++ 2012 redistributable.

Download
http://files.benhymers.com/foo_bestversion....fb2k-component

Homepage, git repository and issue tracker
https://github.com/hymerman/foo_bestversion

Go to the top of the page
+Quote Post
EpicForever
post Mar 23 2013, 17:44
Post #2





Group: Members
Posts: 651
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



Nice thing smile.gif But I got one question - why I can't undo replacement operation?

EDIT:
Other thing - I think that longer version should be treated as better one if both have the same encoding quality.

What are the criteria used to calculate "rating"?

This post has been edited by EpicForever: Mar 23 2013, 18:30
Go to the top of the page
+Quote Post
hymerman
post Mar 23 2013, 20:52
Post #3





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



Good question! I don't know how undo works in foobar. I'll add it to my list of things to do (I created an issue on github here: https://github.com/hymerman/foo_bestversion/issues/11)

The rating thing is a bit subjective - I basically had a bunch of sets of tracks of which I knew which one I'd want to be picked, and I added criteria and tweaked weights until it worked for all of them. Here's the bit of code that does it. Scroll down to "calculateTrackRating" - that's the code that calculates it, it's fairly simple but only if you understand C++! I'm going to expose those values in a preferences page at some point too.

Edit: oh yes, I meant to ask - why would a longer track be preferable to a shorter track, all other things being equal? I could add that as a low-value tie-breaker if it's genuinely a good criteria.

This post has been edited by hymerman: Mar 23 2013, 20:54
Go to the top of the page
+Quote Post
EpicForever
post Mar 24 2013, 09:25
Post #4





Group: Members
Posts: 651
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



On "Trancemaster" compilation series you can sometimes find files marked as "Original Mix" but they are slightly edited and shorter than "real" Original Mix (8:42 on TM vs. 9:16 on single for example). Sometimes I got both files - shorter ripped from my own Trancemaster CD and longer, downloaded from somewhere. The best version is just the original, unedited version, thus the longer one. Of course as long as it has very similar or just identical encoding parameters smile.gif

EDIT:
So, I see that you use tag similarities, bitrates and playcounts. OK smile.gif . But I can't figure out weighting between them biggrin.gif I am not a C++ programmer smile.gif .

This post has been edited by EpicForever: Mar 24 2013, 09:33
Go to the top of the page
+Quote Post
foosion
post Mar 25 2013, 07:37
Post #5





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



QUOTE (hymerman @ Mar 23 2013, 20:52) *
Good question! I don't know how undo works in foobar.
You need to call playlist_manager::playlist_undo_backup before you modify the playlist.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
hymerman
post Mar 25 2013, 09:52
Post #6





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



QUOTE (EpicForever @ Mar 24 2013, 09:25) *
On "Trancemaster" compilation series you can sometimes find files marked as "Original Mix" but they are slightly edited and shorter than "real" Original Mix (8:42 on TM vs. 9:16 on single for example). ... So, I see that you use tag similarities, bitrates and playcounts. OK smile.gif . But I can't figure out weighting between them biggrin.gif I am not a C++ programmer smile.gif .


Aha, well for cases like that I also take into account the musicbrainz release type - original albums > singles > compilations > VA compilations. I should add that to the readme - it works better when your library has been tagged with Musicbrainz Picard or foo_musicbrainz. I can add an option to use track lengths in the calculation, but set to a weighting of 0 by default, so it's there for you to use if you want it.

QUOTE (foosion @ Mar 25 2013, 07:37) *
You need to call playlist_manager::playlist_undo_backup before you modify the playlist.


Oh, well that's nice and easy smile.gif Thanks!
Go to the top of the page
+Quote Post
EpicForever
post Aug 3 2013, 08:45
Post #7





Group: Members
Posts: 651
Joined: 14-September 11
From: Szczecin, PL
Member No.: 93712



Any updates available?
Go to the top of the page
+Quote Post
mire777
post Aug 3 2013, 11:43
Post #8





Group: Members
Posts: 245
Joined: 9-June 12
Member No.: 100550



How to install this?
Go to the top of the page
+Quote Post
db1989
post Aug 3 2013, 14:21
Post #9





Group: Super Moderator
Posts: 5141
Joined: 23-June 06
Member No.: 32180



As you would any other component? http://www.foobar2000.org/FAQ If you are having some problem not covered in that FAQ, you should specify it.
Go to the top of the page
+Quote Post
mire777
post Aug 3 2013, 15:10
Post #10





Group: Members
Posts: 245
Joined: 9-June 12
Member No.: 100550



QUOTE (db1989 @ Aug 3 2013, 15:21) *
As you would any other component? http://www.foobar2000.org/FAQ If you are having some problem not covered in that FAQ, you should specify it.


I go to preferences>components>install
Restart foobar..
But then i have this: ''Failed to load DLL: foo_bestversion.dll
Reason: This component is missing a required dependency, or was made for different version of foobar2000.''

I running 1.2.2 version..

This post has been edited by mire777: Aug 3 2013, 15:12
Go to the top of the page
+Quote Post
marc2003
post Aug 3 2013, 15:13
Post #11





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



i assume you read the first post and have this installed?

QUOTE (hymerman @ Mar 20 2013, 18:04) *
If you don't have it already, you'll need the x86 Visual C++ 2012 redistributable.



Go to the top of the page
+Quote Post
mire777
post Aug 3 2013, 15:28
Post #12





Group: Members
Posts: 245
Joined: 9-June 12
Member No.: 100550



QUOTE (marc2003 @ Aug 3 2013, 16:13) *
i assume you read the first post and have this installed?

QUOTE (hymerman @ Mar 20 2013, 18:04) *
If you don't have it already, you'll need the x86 Visual C++ 2012 redistributable.


Yes i have, I'll try to install it again.
Go to the top of the page
+Quote Post
ChronoSphere
post Aug 3 2013, 15:34
Post #13





Group: Members
Posts: 399
Joined: 11-March 07
Member No.: 41384



Hmm, this one doesn't work as I expected it to tbh. I have some game soundtracks (mixed mp3/flac) with some songs being present in multiple soundtracks. What I did was load all of them, select all -> replace with best track -> remove duplicates. There were still duplicate tracks present...
Go to the top of the page
+Quote Post
mire777
post Aug 3 2013, 15:42
Post #14





Group: Members
Posts: 245
Joined: 9-June 12
Member No.: 100550



Ok, now work's.
My mistake, foobar don't recognize file if you change extension in dll..
Go to the top of the page
+Quote Post
fuffi
post Oct 13 2013, 17:51
Post #15





Group: Members
Posts: 189
Joined: 10-February 07
From: kölle an rhein
Member No.: 40490



Thank you, for this Component! I was curious, if I had some "better" Versions and fortunately, I have smile.gif

But I mostly use your Tool as a replacement for foo_scrobblecharts.dll or foo_softplaylists.dll because those old components crash quite often, and yours not ;-D

Just needed so have a autoplaylist generated by some Last.FM tags/infos.

Do you plan to include some more options like "Similar Artists Top Tracks Playlist" or is this out of question?
Go to the top of the page
+Quote Post
marc2003
post Oct 13 2013, 18:08
Post #16





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



here's a patched version of foo_softplaylists which doesn't crash...

http://www.hydrogenaudio.org/forums/index....st&p=811096
Go to the top of the page
+Quote Post
hymerman
post Oct 21 2013, 13:06
Post #17





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



Oh wow, apologies for not replying to anyone - turns out I forgot to enable email notification! I just thought nobody was using the component smile.gif

I've done some work towards a general "turn this block of text into a playlist" dialogue, which I've been using for e.g. matching track lists copied from Spotify to tracks in my foobar library. It allows you to paste in some text, specify a regex to extract artist and title names from each line, and matches those up to tracks. I need to tidy it up somewhat since it's very clunky, then I'll build a new release. If anyone wants to try it out, the source is available in the 'arbitrary-text-matching' branch in the github repo.

ChronoSphere: What would you expect to happen in that case? It works per-track, so if you have two different files representing the same song, and you do 'replace with best track' on both of them, you'll end up with two of the same file.

fuffi: You're very welcome! That's the reason I created the component really - foo_softplaylists is broken and un-maintained, and I'd been requesting some features for a while, so I just went and re-wrote the parts I wanted. And I made it open source so the same thing doesn't happen to this component if I lose interest wink.gif I can definitely look into adding a similar artists grabber, since that's something I found useful in foo_softplaylists. I've created an issue for it on github: Add grabbing of similar artists top tracks from last.fm.
Go to the top of the page
+Quote Post
marc2003
post Oct 21 2013, 13:11
Post #18





Group: Members
Posts: 4326
Joined: 27-January 05
From: England
Member No.: 19379



QUOTE (hymerman @ Oct 21 2013, 13:06) *
And I made it open source so the same thing doesn't happen to this component if I lose interest wink.gif


um...

QUOTE (JohanDeBock @ Nov 27 2012, 20:52) *

Go to the top of the page
+Quote Post
fuffi
post Oct 21 2013, 13:30
Post #19





Group: Members
Posts: 189
Joined: 10-February 07
From: kölle an rhein
Member No.: 40490



QUOTE (hymerman @ Oct 21 2013, 14:06) *
I've done some work towards a general "turn this block of text into a playlist" dialogue, which I've been using for e.g. matching track lists copied from Spotify to tracks in my foobar library. It allows you to paste in some text, specify a regex to extract artist and title names from each line, and matches those up to tracks. I need to tidy it up somewhat since it's very clunky, then I'll build a new release.

wow! that sounds very useful+++
I always wondered, how it could be possible to replicate all those cool playlists found on the internet (which unfortunately, i never get to work in foobar2000 easily, if they had more than 10 entries...) for my own use. or just get a cool playlist from spotify and play the songs i already own from my own NAS. spotify is a great addition to last.fm imho, especially for the playlists they "offer".

QUOTE (hymerman @ Oct 21 2013, 14:06) *
I can definitely look into adding a similar artists grabber, since that's something I found useful in foo_softplaylists. I've created an issue for it on github

I would be very pleased to see that and also test, but unfortunately I'm a dump user which only can add a DLL-plugin to foobar2000. So if there is a DLL to download, I'll be able to use/test it.


QUOTE (JohanDeBock @ Nov 27 2012, 20:52) *

I guess, it took me more than 2 years to find this original posting! thanks to you, -who posted a working version link to me too- I also can enjoy now two plugins, while couldnt enjoy any last.fm plugin the last years...


Go to the top of the page
+Quote Post
ChronoSphere
post Feb 6 2014, 22:23
Post #20





Group: Members
Posts: 399
Joined: 11-March 07
Member No.: 41384



I kind of missed your reply...
QUOTE (hymerman @ Oct 21 2013, 13:06) *
ChronoSphere: What would you expect to happen in that case? It works per-track, so if you have two different files representing the same song, and you do 'replace with best track' on both of them, you'll end up with two of the same file.
Exactly, that's why I used "remove duplicates" at the end, to only have one version of the track. The thing is, though, that there are multiple songs with the same duration/name in different albums, so what I expected it to do was to replace the 3 versions with the best of the 3, leaving me with 3 tracks, two of which would be get rid off with "remove duplicates", but maybe there is something wrong with my logic.

I'm getting crashes when executing best_version on one album, how can I provide debug info if you're still working on that plugin? I'm currently abusing it as a playlist reviver after converting my library to another lossless format and it's been working great so far.

edit: looks like the % character in a tag crashes it.

This post has been edited by ChronoSphere: Feb 6 2014, 22:26
Go to the top of the page
+Quote Post
hymerman
post Feb 6 2014, 23:07
Post #21





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



No problem, I've been missing replies too!

QUOTE (ChronoSphere @ Feb 6 2014, 22:23) *
Exactly, that's why I used "remove duplicates" at the end, to only have one version of the track. The thing is, though, that there are multiple songs with the same duration/name in different albums, so what I expected it to do was to replace the 3 versions with the best of the 3, leaving me with 3 tracks, two of which would be get rid off with "remove duplicates", but maybe there is something wrong with my logic.

Ok, I misunderstood. That sounds exactly right. It's a fairly simple algorithm so it'll consider anything with a matching title and artist as equal, where both comparisons are case insensitive, and the title comparison ignores anything in parentheses at the end of the title. The album is ignored (since that's kind of the point). So if the artists have some slightly different characters or punctuation, or one has 'the' and the other doesn't, they'll be considered different. That's one of the things I'd like to improve, though it's quite difficult to get right!

QUOTE
I'm getting crashes when executing best_version on one album, how can I provide debug info if you're still working on that plugin? I'm currently abusing it as a playlist reviver after converting my library to another lossless format and it's been working great so far.

edit: looks like the % character in a tag crashes it.


Good find; I've not tried to repro it here (I'm very short on time at the moment) but I've entered a bug so I'll get round to it later:

https://github.com/hymerman/foo_bestversion/issues/14
Go to the top of the page
+Quote Post
ChronoSphere
post Feb 7 2014, 00:47
Post #22





Group: Members
Posts: 399
Joined: 11-March 07
Member No.: 41384



Hmm I see. How well does it work with non-latin characters though? I have a couple of Japanese albums where it fails to find anything, while it is able to find the other. Since I only changed the format (and in some cases the filename), but not tags, I expected it to have an exact match. Both albums are in the media library, the one that it can find is "狼と香辛料 OST I - 狼と旅の音楽", the one it can't is "狼と香辛料 OST II - 狼と「幸せであり続ける物語」の音楽" (basically, the second disc)

edit: just realized you said it ignores album. It's quite confusing to be honest, I can't pin it down but sometimes it fails to find a match even on latin-tagged songs. Then it manages to find some tracks of the album, but fails finding others in the same album (with same artist).

edit2: are you taking only track artist, or also album artist into account? It should do something like if(!album_artist) match(track_artist);
So far it seems the tracks not having a track artist are the ones that fail

This post has been edited by ChronoSphere: Feb 7 2014, 00:54
Go to the top of the page
+Quote Post
hymerman
post Feb 7 2014, 01:00
Post #23





Group: Members
Posts: 78
Joined: 1-June 05
Member No.: 22429



Looks like I had a similar problem to you a while ago:

https://github.com/hymerman/foo_bestversion/issues/1

I forgot all about that to be honest! Again, I'll get round to it one of these days, when I get the time smile.gif

That said, if I remember rightly the problem was in sending non-unicode text to the last.fm web service. Locally it just does a string compare so I don't see why non-ASCII characters would make it fail. The % thing is probably to do with titleformatting. If you can find a pair of tracks (just title and artist should do) that reliably don't get substituted for each other, either let me know here or add it to the bug on github, that way I'll have a test case which will make fixing it easier.
Go to the top of the page
+Quote Post
mudlord
post Feb 7 2014, 02:21
Post #24





Group: Developer (Donating)
Posts: 797
Joined: 1-December 07
Member No.: 49165



Why is there no static linking of MSVC runtimes. In this day and age it should be mandatory.
Go to the top of the page
+Quote Post
foosion
post Feb 7 2014, 10:39
Post #25





Group: FB2K Moderator (Donating)
Posts: 4336
Joined: 24-February 03
Member No.: 5153



QUOTE (hymerman @ Feb 7 2014, 01:00) *
Locally it just does a string compare so I don't see why non-ASCII characters would make it fail.
It depends on how the components implements this comparison. A lexicographic comparison (using strcmp) might fail due to inconsistent encoding of characters outside the Basic Multilingual Plane. See UTF-8 (section CESU-8) about the encoding of UTF-16 surrogate pairs in UTF-8.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th April 2014 - 23:34