Skip to main content
Topic: HOW TO: Rating Songs In Foobar (Read 70963 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

HOW TO: Rating Songs In Foobar

I have been searching around for a good way to rate songs in foobar and ended up combining a lot of my research and making my own method, so thought I would share it if anybody else likes it.

Here is a pic showing how I have set my ratings to show in a playlist:

HOW TO: Rating Songs In Foobar

Reply #1
Applaud the work, but could you not use the official playlist statistics component. Right click>playlist statistics and rate or bind to shortcuts.

terry

HOW TO: Rating Songs In Foobar

Reply #2
Basically I wanted a way that kept the rating in the ID3 tag instead of a seperate database so that when I transferred music between my computers the ratings were maintained. Also, renaming an mp3 file and moving it to a different folder on my computer sometimes caused the foobar statistics rating to get reset because the database thought it was a new file.
I noticed that you could sync the statistics database with the tags, but I preferred my above method so that there is no extra database involved, its all in the id3 tags only (and I wanted to give myself a little challenge )

Also, thought some people would find useful the code I made for a graphical representation of the rating in the playlist view with the solid and empty dots

Here are some other patterns to show the rating in different ways:

Shows just solid dots for the rating (no empty dots), and a single empty dot for files with no rating:
Code: [Select]
$if(%rating%,$repeat(●,%rating%),o)


Same as above but with no dots at all when there is no rating set:
Code: [Select]
$repeat(●,%rating%)


The dots can also be replaced with stars (* or ★ ☆), squares (■ □) smaller dots (• °) than the larger ones (● o), whichever graphics representation you prefer (Jus google "Alt Codes" for a whole load of symbols)
Here's the code for using the star symbols and what it looks like:
Code: [Select]
$if(%rating%,$repeat(★,%rating%)$repeat(☆,$sub(5,%rating%)),☆☆☆☆☆)


HOW TO: Rating Songs In Foobar

Reply #3
Value of method is clear.
Was not a criticism.

terry

HOW TO: Rating Songs In Foobar

Reply #4
Worth also mentioning that the playback statistics plugin doesnt accomodate if 2 people using the same computer want their own seperate ratings and share the same music files, but with my method you could make 2 seperate ID3 tag fields ("PersonA Rating" + "PersonB Rating") and then you could show both of the seperate ratings in the playlist view in 2 seperate columns.


Also I would like to mention that instead of the foo_masstag component, the foo_quicktag component can also be used to set the "Rating" ID3 tag in a similar method but the difference is that you get a prompt to confirm you want to change the tag, which some people may prefer but I presonally found annoying:

HOW TO: Rating Songs In Foobar

Reply #5
You can set a value for the promt, that it does not pop up until you try to update (for example) 5 tracks at once... (in quicktagger prefs)
I use the quicktag way, but nice that someone made a howto to that id3-way of rating songs... since this is asked a lot.
fb2k on OSX: flac q8 > rockboxed Sansa e280v1: Vorbis q5.0

HOW TO: Rating Songs In Foobar

Reply #6
You can set a value for the promt, that it does not pop up until you try to update (for example) 5 tracks at once... (in quicktagger prefs)
I use the quicktag way, but nice that someone made a howto to that id3-way of rating songs... since this is asked a lot.


Very true, I only just noticed this was an option in the Quick Tagger prefs.
So I guess it doesnt matter if you use Mass Tagger or Quick Tagger, they both effectively work exactly the same, just use whichever you prefer. But if you want confirmation before chaging the rating incase of accidental keypresses when you have the hotkeys set up, use foo_quicktag. Here is a screenshot of how you would set foo_quicktag up, and of course you would then set the keyboard hotkeys for quicktag:

HOW TO: Rating Songs In Foobar

Reply #7
not to forget my personal favorite, and with unsurpassed settings





edit: false image

HOW TO: Rating Songs In Foobar

Reply #8
not to forget my personal favorite, and with unsurpassed settings
[PIC]


Sorry, I dont quite understand  That is a screenshot of foo_playback_custom showing settings to update the playback statistics in the tags, not anything to do with rating a track...
Unless I've missed something 

EDIT: Ahh hes edited the picture now to show the correct image. So foo_auto_rating uses the Playback Statistics to automatically create a rating for the file based on the number of times you have played it, very nice if you want ratings calculated automatically for you 


HOW TO: Rating Songs In Foobar

Reply #10
Hi Sital, just wanted to give my sincere thanks for these instructions.  I think it is an excellent system, I did get a little lost in the instructions about managing scripts. and also there is a slight error in the code for if you don't want any hollows circles in the ratings: but it's something that a quick experiment solved.

I have to say that as a relatively new user foobar 2000 is probably the greatest media player with the worst documentation and help files.  The on board rating system was greyed out, but I had all the plug-ins installed.  Could I find out why after a zillion Google searches, no I could not.  And it was only searching this forum and finding your method which allowed me to set up any rating system. 

I particularly like your system because I often browse my directories and import files or songs into the playlist, so having a playlist that writes to the file is really great.  Thanks again.

Moderation: Removed useless full quote.

HOW TO: Rating Songs In Foobar

Reply #11
Thank you very much for sharing this information 
I've made my own modifications to add the rating if anybody is interested...

I used foo_playback_custom.dll to get play count added to the mp3.

Regular Size

Code: [Select]
'('$num(%play_counter%,2) $if(%rating%,$ifequal(%rating%,0,▄▄ ▄ ▄ ▄ ,$ifequal(%rating%,6,▄ ▄ ▄ ██ ,$ifequal(%rating%,5,▄ ▄ ▄ ▄█ ,$repeat(▄ ,$sub(%rating%,1))█$repeat(▄ ,$sub(5,%rating%))))),▄ nostat)')'

Smaller Size

Code: [Select]
'('$num(%play_counter%,2) $if(%rating%,$ifequal(%rating%,0,▄▄▄▄,$ifequal(%rating%,1,█▄▄▄,$ifequal(%rating%,2,▄█▄▄,$ifequal(%rating%,3,▄▄█▄,$ifequal(%rating%,4,▄▄▄█,$ifequal(%rating%,5,▄██▄,$ifequal(%rating%,6,████,))))))),nostat)')'

Again thanks.
J

HOW TO: Rating Songs In Foobar

Reply #12
I wanted to add my thanks for this helpful information.  I love the idea of being able to define custom ratings, different for each user. 

And a quick question on the Global Hotkey keyboard shortcuts for each script.  It seems that when I create these shortcuts, it automatically restricts the context to "currently playing" (and your post also suggests this is the case).  Is it not possible to have the hotkey operate when the track is NOT playing?  There doesn't seem to be any good reason I can think of to restrict the context to tracks actually being played.  I'd like to be able to quickly rate a track without having to play it first.

Finally, I am mainly playing M4A files.  Presumably foobar2000 can write the custom rating information to such files, so that the rating travels with the file, rather than requiring a separate database?

Thanks!

Mike

HOW TO: Rating Songs In Foobar

Reply #13
I wanted to add my thanks for this helpful information.  I love the idea of being able to define custom ratings, different for each user. 

And a quick question on the Global Hotkey keyboard shortcuts for each script.  It seems that when I create these shortcuts, it automatically restricts the context to "currently playing" (and your post also suggests this is the case).  Is it not possible to have the hotkey operate when the track is NOT playing?  There doesn't seem to be any good reason I can think of to restrict the context to tracks actually being played.  I'd like to be able to quickly rate a track without having to play it first.

Finally, I am mainly playing M4A files.  Presumably foobar2000 can write the custom rating information to such files, so that the rating travels with the file, rather than requiring a separate database?

Thanks!

Mike


Nice to see people are finding my guide useful

Regarding the Global Hotkeys, when you are setting the hotkey in the Preferences, if you set the hotkey for the script under the '[context]' menu, then it will rate whichever song you have currently got highlighted even if it isnt playing. If you set the hotkey for the script under the '[context / now playing]' menu, then it will rate the song playing even if you have a different song highlighted.
Im not sure my explanation is fully clear so a picture should help:

HOW TO: Rating Songs In Foobar

Reply #14
Im not sure my explanation is fully clear so a picture should help


Ah!  I hadn't spotted those various contexts nest away there.  Very helpful.  Got it now.

And yes I just tested the rating system with an m4a file and it works perfectly saving the rating in the tags of each file, so that the rating always stays with the file whereever you take it


Excellent!  I've had foobar2000 installed on my system for many years, and used it on and off for particular reasons (e.g. to play some old mpc files I used to keep), but for some bizarre reason chose to spend some time doing all my ratings in WMP, and jumping through hoops to get m4a files even to play.  Now I got my fingers badly burned, I think, when I did something simple like move my Music folder to another drive, and I think I lost all my ratings as a result.  Why I didn't just stick with foobar2000 as my main music organiser/player I don't know.  Have learned my lesson.  I'm a paranoid geek at heart, and I like doing geeky stuff like writing custom rating tags direct to my music files so that I can port them wherever my music files go.

What I am curious to know, however, is what the "standard" tag is for rating a music file.  In other words, a tag that might even be recognised by an OS like Vista as a rating (e.g. in the Explorer window).  Any idea?

Thanks,

Mike

HOW TO: Rating Songs In Foobar

Reply #15
What I am curious to know, however, is what the "standard" tag is for rating a music file.  In other words, a tag that might even be recognised by an OS like Vista as a rating (e.g. in the Explorer window).  Any idea?


I dont think there is an 'official' id3 tag for rating, but pretty much everybody who stores it in id3 tags uses a system of a number 1-5 in the RATING id3 tag, and there are a couple of media players that recognise this tag and display the rating in the program, but most media players store any rating you set using the program in their own seperate database

HOW TO: Rating Songs In Foobar

Reply #16
I dont think there is an 'official' id3 tag for rating, but pretty much everybody who stores it in id3 tags uses a system of a number 1-5 in the RATING id3 tag


OK, thanks.  Since I like the idea of per-user ratings, I'll run with something like "mike rating" and "alice rating" (I don't like using apostrophes in field names).  I reckon that if, one day, I want to "standardise" the ratings -- i.e. to put them somewhere they can be seen by other apps -- there will be an easy way to do it.  Quite possibly foobar2000 (perhaps the masstagger component) already allows a mass update to change "mike rating" to "rating" (or whatever).

Thanks again for these tips for applying (and, importantly, viewing) ratings in foobar2000... truly very very helpful !

Mike

HOW TO: Rating Songs In Foobar

Reply #17
Well, I use foo_customdb to store all my subjective tags  I also made a post to help migrating to it

drmrbrewer: If you have some scripting abilities, the customdb uses a SQLite file-database, which is quite simple and could probably be uses to extract data for other applications. I haven't tried anything like that yet, but i've heard that it locks the db while foobar2000 is running, but not sure if it's still readable... Try it
Can't wait for a HD-AAC encoder :P

HOW TO: Rating Songs In Foobar

Reply #18
Thanks, Odyssey.  I had considered the option of a separate tag database, and indeed I'm used to this concept since I catalog / tag / rate my collection of photos with an application that uses a separate database (though you can write the metadata to the files if you choose, too, assuming the files support this).  I just need to trust the application will treat my database with respect, and that I can get the data out of it if required.  I can trust the photo cataloging application I use, but I know I now cannot trust WMP.  I'm sure foobar2000 / foo_customdb is trustworthy !

Writing custom ratings per-user to the files themselves, as suggested in the original post, has the advantage of simplicity I suppose.  What troubles me with this approach is this:  I generally try to protect my files from inadvertent damage / loss from other users (e.g. the wife, the children etc), so permissions are set either to give them no access at all, or only read access.  However, if they are to write custom ratings into the files then they must at least have write permissions.  Perhaps I can give write permissions but not delete permissions, though even with write permissions they could end up inadvertently overwriting all of my tags with rubbish.  That is the advantage of separate databases, I suppose.

Anyway, this strays a bit from the original topic, for which I apologise.  I still think the rating solution presented in the OP is very neat, and now have it implemented in my setup.  I managed to salvage a couple of WMP playlists I created to hold what I generally considered to be the "best" and "best + next-best" tracks in my collection, and this has at least enabled me to re-create the 5* and 4* track ratings in foobar2000 using the OP's scheme.  I feel a lot safer with my data in foobar2000 than in WMP !

Mike

HOW TO: Rating Songs In Foobar

Reply #19
This is a great thread ! I just like the concept of storing the rating in the id3tag itself. That way the your ratings will get stored permanently in the sound track itself !

All right ! Now, that we have managed to get the ratings embedded in the id3tags, the question would be - does foobar honours these ratings stored in id3tag ? I'm not quite sure how does foobar does things, I only started using it since the last week ! So, I'm guessing here, the ratings stored in the id3tag and displayed by foobar after following the tutorial in this thread, is a display only of the ratings (purely cosmetic) ! Right ?

Obviously, I would want to have the tracks that have been rated the highest played most frequently ! Is there a way to achieve this in foobar at all ? I read about the quicktag component, it wasn't very clear if the above would be possible by using quicktag ? If yes, how do I really do it, I mean have the ratings updated both in quicktag and id3tag in one go ? It won't be a good idea if you'd rate the tracks using the method outlined in sitalchauhan's tutorial and then repeat it using quicktag be it using script or manually, right ? The keyboard shortcut we set up should update the rating both ways. It should also be possible to import the tracks which have been rated by the method outlined in the tutorial, and simply run a script to import the ratings from the id3tag to the quicktag's database ?

Thanks for any replies.


HOW TO: Rating Songs In Foobar

Reply #20
maybe you could find useful this script to increase/decrease the rating one mark per time

Quote
$if(%rating%,$min(higher_value,$add(%rating%,1)),default_value)
$if(%rating%,$max(lower_value,$sub(%rating%,1)),default_value)




my settings, for rating from 0 to 6:
$if(%rating%,$min(6,$add(%rating%,1)),3)
$if(%rating%,$max(0,$sub(%rating%,1)),2)


HOW TO: Rating Songs In Foobar

Reply #21
what ist the font you are using in your playlist to display the stars? i do only get blank squares.
cheers

HOW TO: Rating Songs In Foobar

Reply #22
Are you on Windows XP? Try [a href='index.php?showtopic=66155']this[/a].
Full-quoting makes you scroll past the same junk over and over.

HOW TO: Rating Songs In Foobar

Reply #23
Great thread.  I had no idea it was so easy!

HOW TO: Rating Songs In Foobar

Reply #24
Have i understood correctly that this information is saved in the file itself so even if i move the file to another computer etc i can still se my rating (If i have the same script on that computer)

 
SimplePortal 1.0.0 RC1 © 2008-2018