Skip to main content

Topic: foo_bestversion (Read 8274 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • hymerman
  • [*][*]
foo_bestversion
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


  • EpicForever
  • [*][*][*][*][*]
foo_bestversion
Reply #1
Nice thing  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"?
  • Last Edit: 23 March, 2013, 01:30:22 PM by EpicForever

  • hymerman
  • [*][*]
foo_bestversion
Reply #2
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.
  • Last Edit: 23 March, 2013, 03:54:13 PM by hymerman

  • EpicForever
  • [*][*][*][*][*]
foo_bestversion
Reply #3
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

EDIT:
So, I see that you use tag similarities, bitrates and playcounts.  OK  . But I can't figure out weighting between them  I am not a C++ programmer  .
  • Last Edit: 24 March, 2013, 04:33:09 AM by EpicForever

  • foosion
  • [*][*][*][*][*]
  • Moderator
foo_bestversion
Reply #4
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

  • hymerman
  • [*][*]
foo_bestversion
Reply #5
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  . But I can't figure out weighting between them  I am not a C++ programmer  .


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.

You need to call playlist_manager::playlist_undo_backup before you modify the playlist.


Oh, well that's nice and easy  Thanks!

  • EpicForever
  • [*][*][*][*][*]
foo_bestversion
Reply #6
Any updates available?

  • mire777
  • [*][*][*][*][*]
foo_bestversion
Reply #7
How to install this?

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
foo_bestversion
Reply #8
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.

  • mire777
  • [*][*][*][*][*]
foo_bestversion
Reply #9
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..
  • Last Edit: 03 August, 2013, 10:12:07 AM by mire777

  • marc2003
  • [*][*][*][*][*]
foo_bestversion
Reply #10
i assume you read the first post and have this installed?

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




  • mire777
  • [*][*][*][*][*]
foo_bestversion
Reply #11
i assume you read the first post and have this installed?

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.

foo_bestversion
Reply #12
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...

  • mire777
  • [*][*][*][*][*]
foo_bestversion
Reply #13
Ok, now work's.
My mistake, foobar don't recognize file if you change extension in dll..

  • fuffi
  • [*][*][*][*]
foo_bestversion
Reply #14
Thank you, for this Component! I was curious, if I had some "better" Versions and  fortunately, I have

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?

  • marc2003
  • [*][*][*][*][*]
foo_bestversion
Reply #15
here's a patched version of foo_softplaylists which doesn't crash...

http://www.hydrogenaudio.org/forums/index....st&p=811096

  • hymerman
  • [*][*]
foo_bestversion
Reply #16
Oh wow, apologies for not replying to anyone - turns out I forgot to enable email notification! I just thought nobody was using the component

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  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.

  • marc2003
  • [*][*][*][*][*]
foo_bestversion
Reply #17
And I made it open source so the same thing doesn't happen to this component if I lose interest


um...

Have fun with it  :
https://www.dropbox.com/s/cf0p2mdpzpwfhco/f...lists-source.7z


  • fuffi
  • [*][*][*][*]
foo_bestversion
Reply #18
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".

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.


Have fun with it :) :
https://www.dropbox.com/s/cf0p2mdpzpwfhco/f...lists-source.7z

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...



foo_bestversion
Reply #19
I kind of missed your reply...
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.
  • Last Edit: 06 February, 2014, 04:26:39 PM by ChronoSphere

  • hymerman
  • [*][*]
foo_bestversion
Reply #20
No problem, I've been missing replies too!

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

foo_bestversion
Reply #21
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
  • Last Edit: 06 February, 2014, 06:54:45 PM by ChronoSphere

  • hymerman
  • [*][*]
foo_bestversion
Reply #22
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

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.

  • mudlord
  • [*][*][*][*][*]
  • Developer (Donating)
foo_bestversion
Reply #23
Why is there no static linking of MSVC runtimes. In this day and age it should be mandatory.

  • foosion
  • [*][*][*][*][*]
  • Moderator
foo_bestversion
Reply #24
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