Rating



Rating the tracks (from * to ***** for example) is cool, and you can do that in two clicks in Winamp. One method to do that in foobar2000 is the use of the component called foo_playcount (also used for playback statistics).


1. Install foo_playcount.

2. Hotkeys
If you want to be able to rate a track with a hotkey instead of using the context menu (that's recommended), go to the General/Keyboard shortcuts section, and Add New. Find the actions by filtering with "stat rating". Attribute a key for each rating value (like Ctrl-1, Ctrl-2, etc.)


4. Rate tracks
Select the track, then use your hotkey or go in the context-menu (right-click on the track), then Playback Statistics>Rating> and chose your value.

It's a bit complicated to find the option in the context menu. You can make this a bit handier (and more Winamp-like) by configuring the context menu (did I say say that? everything is customizable in foobar2000...)
Go to Menu>File>Preferences, Display / Context.
There you will find the element "rating" in the "Playback Statistic group". Move it in the root folder as on the picture below.


No it just appears in the context menu of any song/artist/album:

5. Use filters and autoplaylists
You create for example a playlist of best rated tracks. Open a search box (Menu>Library>Search) and use the following syntax:
rating PRESENT SORT DESCENDING BY rating (list of rated tracks ordered by decreasing rating.)
Other possibilities include:
rating IS 3 (explicit)
rating GREATER 3 (tracks rated 4 or 5)
rating LESS 3 (tracks rated 1 or 2)
rating HAS **** (tracks rated **** or *****)
rating HAS * AND NOT rating HAS *** (tracks rated * or **)
etc.

From any of these searches, you can create an automatic playlist by clicking the [...] button on the right of the search field. A list will be created in your playlists, which you can rename. It will update in real-time.

6. Make a nice display

The ratings have numeric values, but it would be good to display them in playlists with stars or whatever. For example like this:


This is easy and a good opportunity to introduce titleformatting. To add such a column, right-click on the headers (at the top of the picture above) and chose Columns>More.
(or in the facets, right click on any facet header and Preferences)

You will get a window similar to that:

Put any name in the left column. In the right column, the content of the column is described by:
$if(%rating%,$repeat(●,%rating%),o)

Which means: if %rating% is present, repeat "●" as many times as the rating is; else, display "o"
Once you got the thing, you can change it, and customize without limits. That's foobar2000!

A complete reference for titleformatting can be found here.

7. Write tag in the file
By default, the tag (as playcount statistics) are stored in a separate file, and not in the tags of the files. If you want, you can write these data to the files (for example, if you are about to reinstall foobar, and want to keep these data. Well, you could also find the data file. Or if you want to send the file. Or make a "backup" of your stats. Whatever)
In the context menu of any track selection, just select Playback Statistics>Write Statistics to File Tags.
I let you guess what "Import statistics from file tags" does.

Conclusion:
It works. The limitations of this method are:
-I don't think these ratings will be transferred in an iPod or in another media player. However, what it does is put a field in the track tag called "rating" with a value between 1 and 5. The rating wil be kept, for example, if you transfer the file to any other system using foobar with the same config. Compatilibity should be that easy...

5 comments:

Anonymous said...

Thank you for your tutorial! It really helped me out! :)

Solitair said...

THANK YOU VERY MUCH for your wellwritten tutorial!!!
It makes it possible to sort by rating for a "foobar-dummy" like me.

By the way: correct searchstring for "explicit" is f.e. %rating% IS 3

Anonymous said...

Sice version 1.0 it's not possible anymore to rearrange items in the context menu.

See:

http://www.hydrogenaudio.org/forums/index.php?showtopic=76330&st=0

Anonymous said...

$pad($repeat(★,%rating%),5,☆)

g rad said...

This small tweak adds stars as the rating symbol.>
$if(%rating%,$repeat(★,%rating%),☆)
<