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 (http://www.microsoft.com/en-us/download/details.aspx?id=30679).
Download
http://files.benhymers.com/foo_bestversion....fb2k-component (http://files.benhymers.com/foo_bestversion/foo_bestversion.fb2k-component)
Homepage, git repository and issue tracker
https://github.com/hymerman/foo_bestversion (https://github.com/hymerman/foo_bestversion)
(http://files.benhymers.com/foo_bestversion/foo_bestversion_illustration.png)
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"?
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) (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 (https://github.com/hymerman/foo_bestversion/blob/master/foo_bestversion/BestVersion.cpp). 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.
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 .
Good question! I don't know how undo works in foobar.
You need to call playlist_manager::playlist_undo_backup (http://foosion.foobar2000.org/doxygen/latest/classplaylist__manager.html#a2aa0e8dd90b1678a10ecbf0d85cf912a) before you modify the playlist.
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 (http://foosion.foobar2000.org/doxygen/latest/classplaylist__manager.html#a2aa0e8dd90b1678a10ecbf0d85cf912a) before you modify the playlist.
Oh, well that's nice and easy Thanks!
Any updates available?
How to install this?
As you would any other component? http://www.foobar2000.org/FAQ (http://www.foobar2000.org/FAQ) If you are having some problem not covered in that FAQ, you should specify it.
As you would any other component? http://www.foobar2000.org/FAQ (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..
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 (http://www.microsoft.com/en-us/download/details.aspx?id=30679).
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 (http://www.microsoft.com/en-us/download/details.aspx?id=30679).
Yes i have, I'll try to install it again.
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...
Ok, now work's.
My mistake, foobar don't recognize file if you change extension in dll..
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?
here's a patched version of foo_softplaylists which doesn't crash...
http://www.hydrogenaudio.org/forums/index....st&p=811096 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=76133&view=findpost&p=811096)
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 (https://github.com/hymerman/foo_bestversion).
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 (https://github.com/hymerman/foo_bestversion/issues/13).
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 (https://www.dropbox.com/s/cf0p2mdpzpwfhco/foo_softplaylists-source.7z)
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 (https://www.dropbox.com/s/cf0p2mdpzpwfhco/foo_softplaylists-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...
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.
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!
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 (https://github.com/hymerman/foo_bestversion/issues/14)
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
Looks like I had a similar problem to you a while ago:
https://github.com/hymerman/foo_bestversion/issues/1 (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.
Why is there no static linking of MSVC runtimes. In this day and age it should be mandatory.
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) (http://en.wikipedia.org/wiki/UTF-8#CESU-8) about the encoding of UTF-16 surrogate pairs in UTF-8.
Why is there no static linking of MSVC runtimes. In this day and age it should be mandatory.
That was a conscious choice - I assumed people wouldn't want their components bloated by all linking to the same runtime statically. If that's not what the consensus is amongst component developers, I'd be happy to change it. What do other components tend to do? Are there any guidelines for this?
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) (http://en.wikipedia.org/wiki/UTF-8#CESU-8) about the encoding of UTF-16 surrogate pairs in UTF-8.
I'm doing stricmp_utf8 on strings returned from the foobar metadb, which I thought were all UTF-8, which if I'm right would all work fine (I know a bit about character encodings, the bugs are just because it's all been a rush job!). Does foobar not convert tags on adding them to its database?
The foobar2000 core - and therefore the metadb - expect all string to be UTF-8 encoded. The issue could therefore be caused by input plugins or by tagging plugins. However, we shouldn't discuss this further until we have confirmed whether this is the cause of the problems. ChronoSphere, could you verify this yourself or upload two files which should be matched but aren't?
I have uploaded two sets of files here (http://www.hydrogenaudio.org/forums/index.php?showtopic=104542).
Added a separate bug about this here:
https://github.com/hymerman/foo_bestversion/issues/15 (https://github.com/hymerman/foo_bestversion/issues/15)
for set2:
- all tracks are in the media library
- tags contain a % in the middle of the tag -> results in foobar crash when executing foo_bestversion
- tags contain a % at the end of the tag -> no crash
I immediately thought about printf() when I read that. I went to GitHub and found multiple uses of console::printf in the first file I looked at, e.g.
/* line 285 */ console::printf(("Only one version of " + title + " exists in library").c_str());
There are several options for fixing this bug:
// Option 1
console::printf("Only one version of %s exists in library", title.c_str());
// Option 2
console::info(("Only one version of " + title + " exists in library").c_str());
// Option 3
console::formatter() << "Only one version of " << title.c_str() << " exists in library"; // Not sure whether the call to c_str is required.
I haven't checked the other files.
Of course; good call foosion. I didn't know about console::info.
I've fixed all the bugs and issues that have been mentioned so far and have put up a new release, on github since it now allows you to attach files to releases (which themselves are generated from tags - nice!).
You can grab it here:
foo_bestversion.fb2k-component, version 1.0.1 (https://github.com/hymerman/foo_bestversion/releases/download/1.0.1/foo_bestversion.fb2k-component)
ChronoSphere, those files you sent me now work fine! Thanks for helping out.
I can't edit my original post; do I need some special forum privilege for that? Also how do I get this added to the components page on foobar2000.org?
I can confirm it was able to restore all my broken playlists now, great job!
You can't edit posts after a few hours from what I know, it's an intended change implemented some months ago. Don't know about the foobar component page.
edit: a minor thing: it looks like the sorting of the playlist is not kept when replacing. I just noticed it threw tracks all over the place on two playlists.
Also how do I get this added to the components page on foobar2000.org?
http://www.hydrogenaudio.org/forums/index....showtopic=82691 (http://www.hydrogenaudio.org/forums/index.php?showtopic=82691)
Hi all,
I've fixed the Unicode bugs and fixed the breakages that appear to have happened alongside the latest last.fm update. New version is uploaded here:
https://github.com/hymerman/foo_bestversion/releases (https://github.com/hymerman/foo_bestversion/releases)
... incidentally, that's the best place to download new releases from now on. Also the VS redistributable is no longer required. I still can't edit my original post to change this information though
When this component is installed (1.0.2), opening the preferences dialogue of SACD (foo_input_sacd 0.9.6) crashes foobar to desktop on my computer.
Seems fixed in 1.0.3. Now I just have to figure out what the component can do for me in my playlists
When this component is installed (1.0.2), opening the preferences dialogue of SACD (foo_input_sacd 0.9.6) crashes foobar to desktop on my computer.
The settings dialog of foo_input_sacd 0.9.6 is sensitive to other plugins as well. I'd forgotten that I had installed another hacked DSD ASIO output plugin. After I removed that plugin and uninstalled all of my DSD related ASIO drivers then foo_input_sacd 0.9.6 worked fine.
Reviving an old topic - sorry in advance... there hasn't been any development / interest? in this component for quite a while which I think is a shame as this plugin has great potential. There really is no better method to trim a large playlist based on titles and technical info.
I have some ideas that I would like to present and have written them down at foo_bestversion Github proposal (https://github.com/hymerman/foo_bestversion/issues/33). Hopefully someone finds this interesting enough to have a go at the code.