Help - Search - Members - Calendar
Full Version: foo_DAR: auto rating
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3
carpman
foo_DAR: Date Adjusted Ratings (or Digital Audio Ratings) Formula for foobar2000

UPDATED: 30.04.08

[for Setup instructions, latest versions, code etc. see Post#2]

Introduction

I came up with this is because I never really liked fixed ratings that were based on how I felt about a song (as that would change from day to day), plus I couldn't be bothered to rate every song in my collection. Instead, I found it more interesting to find out how I "felt" about a song (over time) by automatically rating it according to my actual listening behaviour.

Consequently this rating scheme ignores subjective criteria and doesn't utilise pre-existing user defined ratings, instead it's based entirely on data collected by foobar2k (+ components).

The formula may make an interesting companion to users' existing ratings schemes as well as to topdownjimmy's hotness algorithm.

The formula attempts to cancel out various disparities caused by, for example:
- play counts (old tracks having a great advantage over new ones)
- plays per time period (new tracks having an advantage over old ones)
- track duration, where short tracks are likely to be played more (and skipped less) than very long ones.

It should work regardless of play habits and should not require tweeking, however if people want to alter and improve it - please go ahead. At present I'm more than happy with the results and I'm likely to leave it as it is, barring a major flaw (which is possible - but so far not encountered).

---------------------------------

So, what does it do?

The rating is based on a number of factors:
- How often a track is played and how often it is skipped.
- The duration of the track (obviously a 2 minute piece is likely to be played more often and skipped less often than a 30 minute track).
- How long the track has been in the library.
- When it was last played.
- When it was first played.
- Files that are less than a week old get a temporary "pseudo rating" until the "probabationary period" is over.

Once a track has been played it will gain a rating.
The rating will continue to fall until it is played again.
Skipping a file will increase this decline.

A new track can compete with an old one:
Two 3 minute songs, both played today. Track A is 2 weeks old and Track B is 1 year old. If Track A has been played 5 times, to have the same rating Track B will have to have been played 28 times (28.25 times to be precise). Assuming Track B is skipped 1 time in every 5 plays (as it's an "old" song), then (let's now call it) Track B(2) will have to have been played 30 times (30.08 times to be precise) to equal Track A's rating.

Long tracks can compete with shorter ones:
A long track is likely to get skipped more often than a short one. Let's say Track C is 5 times as long as Tracks A and B. Like B it's 1 year old and like A and B it's been played today. So Track C is 15 minutes long. Let's say, for every time it's been played it's been skipped. To achieve the same rating as A and B, Track C will have to be played 15 times (14.9 time to be exact). Now let's say Track C hasn't been played today, instead the last time it was played was 6 months ago. Then Track C(2) would need to have been played 16.33 times to achieve parity with Tracks A and B.

If a song has a negative value, you may want to consider deleting it:
The foo_DAR rating has been designed to avoid negative values. For example. a 3 minute song (Track D), which was added to the library 10 years ago, and was played once 5 years ago, and has since been skipped 605 times will still not have a negative rating; however, if it's skipped once more it will. Since v.3 a floor has been added so now a song's rating can only go as low as 1.

How often can you listen to the same song?
A 3 minute song (Track E) added 2 weeks ago has been played 5 times a day since being added. 70 plays in two weeks and not once skipped yields a rating of: 15743.

A rating of 10000 and above is good (though that depends on how much you listen to your music and the size of your collection).

A 3 minute song (Track F), never skipped, would have to be played 15.18 times in its first year to remain on 10000 (this is the same as the "pseudo rating" value given to tracks less than a week old).

NEW: Tracks that are not played for a long time after they have been added are penalised:
Let's say track F wasn't played immediately after it was added to the library a year ago; instead, all of its plays occurred in the last week. Track F(2) would have to be played 18.42 times (rather than 15.18 times) to achieve its rating of 10000.

---------------------------------

Test it first: You can test the ratings formula before implimenting it with this Excel sheet (which includes the examples above). Please note, there are minor discrepencies in the output due to differences in the way foobar2k and MS Excel handle dates and rounding.

My guess is that for most people, ratings across their entire collections will range between 8000 and 12000, with anything over 10000 being regarded as a good to very good track.

Note: This rating formula has been tested with an individual track based library. I'm not sure it will work too well on images and cue sheets etc... That depends on how foobar2k and the relevant components treat these files. It may work fine.
Works fine with cue sheets.

---------------------------------

Please read the setup instructions and "how to" info in Post#2 before asking any questions, thanks.

Oh, and a quick thanks to all on this forum who have helped with all and any foobar related questions I've had.

Cheers
Carpman.

***********************


Change log: foo_DAR v.3 -- 30/04/08
updated foo_DAR_noskip so the effect of duration is slightly reduced (this mirrors the negative effect of the %skip% function in foo_DAR_full). Also included a penalty weighting (for both versions) for tracks that are not played for a long time after they've been added. The penalty is reduced the more the track is played, ultimately becoming inconsequential.

Change log: foo_DAR v.2 -- 25/04/08
fixed 1.25 multiplier error (was defaulting to 1, rather than 1.25)

----
carpman
foo_DAR Setup & Other Useful Info

UPDATED: 04.05.08

There are 2 versions of foo_DAR:

1) foo_DAR_full: for foo_playback_custom (this is the official release and has full functionality)
2) foo_DAR_noskip: for foo_playcount (thanks to Bollerkopp for raising this issue - this has been modified for users of the official playback stats plugin and lacks the %skip% function)

foo_DAR_noadded is no longer supported. If you don't have an %added% field, find and replace %added% with %first_played%. However, although you will still get sensible results, this is not an ideal replacement for either foo_DAR_full or foo_DAR_noskip.


Required components and fields for each version:

1) foo_DAR_full for foo_playback_custom

Components required:
foo_custominfo.dll (tested with foo_custominfo 0.1.2)
foo_cwb_hooks.dll (tested with cwbowron's title format hooks 1.2.6 [Jan 2 2008 - 15:50:05])
foo_playback_custom.dll (tested with Playback Statistics Custom 1.4.3)
foo_autoplaylist.dll (optional - to rank according to foo_DAR rating)
foo_ui_columns.dll (optional - but recommended -- has also been tested with 9.5.2 default ui)

Fields used in the ratings formula:
%length_seconds%
%play_counter%
%skip% (skip count)
%added% (this is the date the file was added to the library)
%last_played% (date last played)
%first_played% (date first played)
%cwb_systemdatetime% (time now)

Download the LATEST SETUP INSTRUCTIONS for foo_DAR_full

----------------------------------

2) foo_DAR_noskip for foo_playcount

Components required:
foo_playcount.dll (tested with Playback Statistics v.2)
foo_cwb_hooks.dll (tested with cwbowron's title format hooks 1.2.6 [Jan 2 2008 - 15:50:05])
foo_autoplaylist.dll (optional - to rank according to foo_DAR rating)
foo_ui_columns.dll (optional - but recommended -- has also been tested with 9.5.2 default ui)

Fields used in the ratings formula:
%length_seconds%
%play_count%
%skip%
%added%
%last_played% (date last played)
%first_played% (date first played)
%cwb_systemdatetime% (time now)

(see setup section below for code and info)

----------------------------------

If you enter any of the above fields (or their alternatives i.e. instead of using %play_counter% you use %play_count%) into a column and you get a sensible result then the formula will work, if you do not, then you are missing a required component. A quick search will tell you which one you require.

If you do use an alternative field to those listed above just do a find and replace on the formula and it will work.

************

SETUP

FORMULA: (1) foo_DAR_full for foo_playback_custom

CODE

$puts(ra,$mul($add(1000,$div($mul(%length_seconds%,$sub(%play_counter%,$div(%skip%,2))),100)),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_counter%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(pd5,$div($mul($cwb_datediff(%added%,%first_played%),5),%play_counter%))$puts(pd6,$add($get(pd3),$get(pd5)))$puts(r1,$add($get(pd2),$get(ra)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd6))))$puts(r3,$ifgreater($get(r2),0,$get(r2),1))$puts(r4,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r3),10000))$ifgreater(%play_counter%,0,$num($get(r4),5),-----)

Paste as below (or default ui alternative):

IPB Image

FORMULA: (1) foo_DAR_full for Autoplaylist

Query field:
CODE
%play_counter% GREATER 0

Sort field:
CODE

$sub($puts(ra,$mul($add(1000,$div($mul(%length_seconds%,$sub(%play_counter%,$div(%skip%,2))),100)),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_counter%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(pd5,$div($mul($cwb_datediff(%added%,%first_played%),5),%play_counter%))$puts(pd6,$add($get(pd3),$get(pd5)))$puts(r1,$add($get(pd2),$get(ra)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd6))))$puts(r3,$ifgreater($get(r2),0,$get(r2),1))$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$num($get(r3),5),10000),100000000)

Paste as below:
IPB Image

----------------------------------

FORMULA: (2) foo_DAR_noskip for foo_playcount

CODE

$puts(dur,$div($add(%length_seconds%,180),2))$puts(ra,$mul($add(1000,$div($mul($get(dur),$sub(%play_count%,$div(%skip%,2))),100)),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra)))$puts(pd5,$div($mul($cwb_datediff(%added%,%first_played%),5),%play_count%))$puts(pd6,$add($get(pd3),$get(pd5)))$puts(r1,$add($get(pd2),$get(ra)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd6))))$puts(r3,$ifgreater($get(r2),0,$get(r2),1))$puts(r4,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r3),10000))$ifgreater(%play_count%,0,$num($get(r4),5),-----)


FORMULA: (2) foo_DAR_noskip for Autoplaylist

Query field:
CODE
%play_count% GREATER 0

Sort field:
CODE

$sub($puts(dur,$div($add(%length_seconds%,180),2))$puts(ra,$mul($add(1000,$div($mul($get(dur),$sub(%play_count%,$div(%skip%,2))),100)),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra)))$puts(pd5,$div($mul($cwb_datediff(%added%,%first_played%),5),%play_count%))$puts(pd6,$add($get(pd3),$get(pd5)))$puts(r1,$add($get(pd2),$get(ra)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd6))))$puts(r3,$ifgreater($get(r2),0,$get(r2),1))$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$num($get(r3),5),10000),100000000)

----------------------------------


Docs:

Setup Instruction for foo_DAR_full
Step by step formula description
foo_DAR ratings formula test sheet
HOW TO get sensible %added% data when playback stats pre-date the existence of an %added% field
foo_custominfo.dll (as wiki link is down)

C.
Bollerkopp
hi,

wow... this is just amazing! i don't like to rate every song in my collection, too. so i loved the "hotness"-algorithm very much. but i use the autoplaylist, where hotness isn't working. your algorithm do it - so it's perfect for me. biggrin.gif i want to thank you - i love it! smile.gif

one question: i don't use the foo_custominfo-component and the foo_playback_custom-component. instead i have the foo_playcount-component. so i edited the algorithm in %play_count%. in the autoplaylist-string i edited it, too. it is normal that in the query is a song with the rating of 10025 on rank first and an song with the rating 10112 on rank second?

greets smile.gif
carpman
QUOTE(Bollerkopp @ Apr 26 2008, 01:28) *

one question: i don't use the foo_custominfo-component and the foo_playback_custom-component. instead i have the foo_playcount-component. so i edited the algorithm in %play_count%. in the autoplaylist-string i edited it, too. it is normal that in the query is a song with the rating of 10025 on rank first and an song with the rating 10112 on rank second?

Hi Bollerkopp

Thanks for your kind words.

If I understand you correctly, the answer is no. The autoplaylist should rank the songs according to rating.
If you are getting sensible results in your column output (and values of 10025 and 10112 sound okay) then that should show up in the autoplaylists ordering.

I suggest the following.

1) I had problems with the autoplaylist string because it needs to be a pure single line (i.e. with no additional spaces. When you edited the formula (I'd recommend editing in notepad) you may have (as I did a number of times) introduced breaks/spaces. Copy and paste the formula into a non-formatted text editor (like notepad and remove any breaks/spaces. Or copy the formula from the code-box above and carefully replace the fields you initially edited.

2) As a check, you can always enter these fields one by one (or your new replacement fields) into a new column and see if you get an expected outcome. If you do it means all is working well.

%length_seconds%
%play_counter%
%skip% (skip count)
%added% (this is the date the file was added to the library)
%last_played% (date last played)
%cwb_systemdatetime% (time now)

However, my feeling is that (1) is the problem. As clearly you are getting decent results, yet the ordering is problematic.

By the way do you have the %skip% field?
Are there any other fields above you are missing?

C.


Bollerkopp
QUOTE(carpman @ Apr 26 2008, 02:49) *

If I understand you correctly, the answer is no. The autoplaylist should rank the songs according to rating.
If you are getting sensible results in your column output (and values of 10025 and 10112 sound okay) then that should show up in the autoplaylists ordering.


here you can see my autoplaylist of the rating:

IPB Image

there you see, that a lower rating is before a higher rating. blink.gif

QUOTE(carpman @ Apr 26 2008, 02:49) *
1) I had problems with the autoplaylist string because it needs to be a pure single line (i.e. with no additional spaces. When you edited the formula (I'd recommend editing in notepad) you may have (as I did a number of times) introduced breaks/spaces. Copy and paste the formula into a non-formatted text editor (like notepad and remove any breaks/spaces. Or copy the formula from the code-box above and carefully replace the fields you initially edited.


yes, i edited the algorithm in notepad - no breaks or spaces.

QUOTE(carpman @ Apr 26 2008, 02:49) *
%length_seconds%
%play_counter%
%skip% (skip count)
%added% (this is the date the file was added to the library)
%last_played% (date last played)
%cwb_systemdatetime% (time now)

However, my feeling is that (1) is the problem. As clearly you are getting decent results, yet the ordering is problematic.

By the way do you have the %skip% field?
Are there any other fields above you are missing?


no, i don't have the %skip%-field. sad.gif so i have to use the other components? the %skip%-field is important?
the other fields i have - %play_counter% = play_count. smile.gif

carpman
Right. Well the good news is that the formula works. Your results look good.
So the problem is with the autoplaylist.

Is the %skip% field important?
Not essential. It's nice, as skipping a song is quite telling - "I'd rather listen to something else" deserves to negatively affect a rating. As I say, nice, but not essential.

1) Can you paste in a codebox (codebox, not /code) the formula directly from the autoplaylist box. Also can you do me a screen shot of the autoplaylist screen? (not essential - but would be helpful)
2) What version of foobar2k are you using?
3) What relevant components are you using and what versions?

I'll have a look at it.

I might do a version for people who use foo_playcount. Would be nice if there was some way to carry stats over from one to the other (i.e. %play_count% to %play_counter%. Perhaps there is.

I'll look into this. I'd rather not do 2 versions. But I guess if I had years of play stats I wouldn't switch to a rating algorithm that forced me to start afresh.

Where is the %play_count% data stored?

C.
carpman
I'll test this at some point - but I think it's possible to switch your play count data and probably the other stuff too using foo_custom_info. I'm NOT suggesting you do this, but in custom info you can do this kind of thing (haven't tested yet by the way):

$add(%PLAY_COUNTER%,%PLAY_COUNT%)

That would, in theory, do a one off transfer of all your play_count data to the custom_info database (also may be a good way of backing up your play stats) which would store as %PLAY_COUNTER%.

Just a thought. Like I say I'll test such things when I have the time.

C.

Bollerkopp
QUOTE(carpman @ Apr 26 2008, 03:33) *

Is the %skip% field important?
Not essential. It's nice, as skipping a song is quite telling - "I'd rather listen to something else" deserves to negatively affect a rating. As I say, nice, but not essential.


yes, you're right... i think it's a very nice thing in use with this rating, too. smile.gif

QUOTE(carpman @ Apr 26 2008, 03:33) *
1) Can you paste in a codebox (codebox, not /code) the formula directly from the autoplaylist box. Also can you do me a screen shot of the autoplaylist screen? (not essential - but would be helpful)


sure:

CODE
$sub($puts(ra,$add(1000,$div($mul(%length_seconds%,$sub(%play_count%,$div(%skip%,2))),100)))$puts(ra2,$mul($get(ra),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra2)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$num($get(r2),5),10000),100000000)



QUOTE(carpman @ Apr 26 2008, 03:33) *
2) What version of foobar2k are you using?


i use version 0.9.5.0.

QUOTE(carpman @ Apr 26 2008, 03:33) *
3) What relevant components are you using and what versions?


- Core
foobar2000 core 0.9.5

- foo_autoplaylist.dll
Autoplaylist Manager 1.0

- foo_cwb_hooks.dll
cwbowron's title format hooks 1.2.5

- foo_playcount.dll
Playback Statistics 2.0

- foo_ui_columns.dll
Columns UI 0.3 beta 2 preview 1

QUOTE(carpman @ Apr 26 2008, 03:33) *
Where is the %play_count% data stored?


it's stored in the "PlaybackStatistics.DAT" in the foobar-folder.

QUOTE(carpman @ Apr 26 2008, 03:45) *

I'll test this at some point - but I think it's possible to switch your play count data and probably the other stuff too using foo_custom_info. I'm NOT suggesting you do this, but in custom info you can do this kind of thing (haven't tested yet by the way):

$add(%PLAY_COUNTER%,%PLAY_COUNT%)

That would, in theory, do a one off transfer of all your play_count data to the custom_info database (also may be a good way of backing up your play stats) which would store as %PLAY_COUNTER%.

Just a thought. Like I say I'll test such things when I have the time.


ah, ok... sounds cool. biggrin.gif
carpman
Thanks Bollerkopp.

Give me a little time.

I'll check your autoplaylist formula first. If I can't figure what's wrong I'll setup a new foobar install, probably with latest foobar and all your component versions. I've tested already on 9.4.3 and 9.5.2 beta - so foobar version is unlikely to be the issue.

I'll get back to you when I've worked it out.

Cheers

C.


Bollerkopp
oki, thank you very much. there's noch rush... take your time. smile.gif

greets
carpman
Bollerkopp

I just inverted what you did:

I copied your autoplaylist formula from your codebox into notepad. I did a find and replace on %play_count% and replaced it with %play_counter%. I pasted that back into autoplaylist and it worked fine.

Which means everything you did works fine.
The only difference is that you don't have a %skip% field. My guess is that this confuses the hell out of autoplaylist, whereas foobar2k's core deals with it differently and just ignores missing fields or treats them as zeros in calculations. So 0 / 2 = 0, thus %play_count% - 0 = %play_count%. This would mean that the formula works fine in foobar2k but perhaps not fine in autoplaylist.

To test this can you do me a favour and try this:

In notepad:
Do a find and replace on "%skip%" (in the autoplaylist formula) and replace it with 1. From what I gather foobar2k rounds down. So it will treat 1/2 as 0.

Let me know if that works.

C.
Bollerkopp
ok, i tried it, but i think that there is no difference. unsure.gif

IPB Image

the edited autoplaylist-string:

CODE
$sub($puts(ra,$add(1000,$div($mul(%length_seconds%,$sub(%play_count%,$div(1,2))),100)))$puts(ra2,$mul($get(ra),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra2)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$num($get(r2),5),10000),100000000)
carpman
The only other thing I can think of right now is:
a) what's in your autoplaylist query box?
b) when you created your autoplaylist did you create a "new one", i.e. each time I update the formula I have to enter the new formula in the sort box, (then i press preview to check), then I "remove" existing playlist (in this case RATE) as in the picture in post 2, then reselect RATE as the "playlist to take over", then I hit "add to autoplaylist".

I assume you follow these steps too. Is that correct?

C.


Bollerkopp
QUOTE(carpman @ Apr 26 2008, 06:19) *

The only other thing I can think of right now is:
a) what's in your autoplaylist query box?


"%play_count% GREATER 0 OR %skip% GREATER 1" smile.gif

QUOTE(carpman @ Apr 26 2008, 06:19) *
b) when you created your autoplaylist did you create a "new one", i.e. each time I update the formula I have to enter the new formula in the sort box, (then i press preview to check), then I "remove" existing playlist (in this case RATE) as in the picture in post 2, then reselect RATE as the "playlist to take over", then I hit "add to autoplaylist".

I assume you follow these steps too. Is that correct?


yes, i do exactly the same procedure.
carpman
Try:
QUOTE(Bollerkopp @ Apr 26 2008, 05:38) *

"%play_count% GREATER 0 OR %skip% GREATER 1"


See if that works.

[EDIT: also: I'm just doing a foobar version to mirror yours using all your components that you mentioned with the latest foobar (9.5.2) - I have a question: what code do you use in the "process files added to the library" (is it a tagging script? and also, where do you store the date stamp info (i.e. %added%), in the tags?]

C.
Bollerkopp
QUOTE(carpman @ Apr 26 2008, 12:52) *

See if that works.


it's the same thing. sad.gif

QUOTE(carpman @ Apr 26 2008, 12:52) *
what code do you use in the "process files added to the library" (is it a tagging script? and also, where do you store the date stamp info (i.e. %added%), in the tags?]


yes, it's a tagging script (new file tagger) and it's stored as %ADDED% in the tags.

this is the code:

QUOTE
Time Stamp NOW
Format "ADDED" using $if($greater($len(%ADDED%),5),%ADDED%,%NOW%)
Remove NOW


greets
carpman
Just testing now.
So far on 9.5.2 all components except columns ui are the same as yours.

- Core
foobar2000 core 0.9.5.2 beta

- foo_autoplaylist.dll
Autoplaylist Manager 1.0

- foo_cwb_hooks.dll
cwbowron's title format hooks 1.2.5

- foo_playcount.dll
Playback Statistics 2.0

Files are tagged as per your script and I copied your Autoplaylist formula directly from your codebox into autoplaylist.

OUTCOME:
All properly sorted in formula order (high to low).

So I need to test with columns ui:

- foo_ui_columns.dll
Columns UI 0.3 beta 2 preview 1

I've been using:
Version 0.1.3 beta 1v7

Maybe that's it. If not then I think we need to ask the real foobar2k experts.
I'll post a pic of my results tonight.

Very strange.

C.

By the way which UI are you using (default or cols)?


carpman
Here's a pic of what I'm getting using %play_count% and components as stated above:
Screenshot of test results

C.
Bollerkopp
first: thank you so much for your effort. smile.gif

QUOTE(carpman @ Apr 26 2008, 15:40) *

I've been using:
Version 0.1.3 beta 1v7

i will test your version, too.

QUOTE(carpman @ Apr 26 2008, 15:40) *
I'll post a pic of my results tonight.

cool, thx. smile.gif

QUOTE(carpman @ Apr 26 2008, 15:40) *
By the way which UI are you using (default or cols)?

i use columns UI.
Bollerkopp
hey,

sooo sorry, it was my fault! damn, i forget to edit the first %PLAY_COUNTER% in the display-script of my rating-colum. omg... not my day. sad.gif

now it's working perfectly! smile.gif thank you so much and sorry, that i wasted your time with this simply mistake.

here is the result:

IPB Image

i love your work! biggrin.gif

greets
carpman
hi Bollerkopp

biggrin.gif - You haven't wasted my time. I'm glad you solved the problem.
It's been interesting for me, as you've helped me find out that it works very easily with the official play stats plugin. Also I've found a way, I think, to port stats from the official foo_playcount to foo_playback_custom via the custom info plugin. I'll do a trial with this and, if it works well, I'll post a How To - should anyone decide they can't do without the %skip% routine [unless one already exists?].

I'd be very interested to know how many people use the official plugin versus the custom one and whether, if there was an easy way to move from one to the other, would people consider switching?

Really glad you liked the ratings.
Enjoy the results.

C.
Bollerkopp
hi carpman,

that sounds very cool - i am very interested in a "how to", if it works. biggrin.gif
i think the %skip%-routine is a cool thing for the rating smile.gif

thx & greets
Purple Monkey
Just though I'd comment, as I don't use %added% I made a work around by approximating to ether the first play or last modified date (which ever is earlier:)
CODE
$puts(sd,$if($greater($cwb_datediff(%first_played%,%cwb_systemdatetime%),$cwb_datediff(%last_modified%,%cwb_systemdatetime%)),%first_played%,%last_modified%))
$puts(pc,%play_count%)
$puts(ra,$add(1000,$div($mul(%length_seconds%,$sub($get(pc),$div(%skip%,2))),100)))
$puts(ra2,$mul($get(ra),10))
$puts(dd,$div($add($cwb_datediff($get(sd),%last_played%),50),10))
$puts(pp,$div($mul($get(pc),10000),$cwb_datediff($get(sd),%cwb_systemdatetime%)))
$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))
$puts(pd3,$div($mul($cwb_datediff($get(sd),%cwb_systemdatetime%),125),100))
$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra2)))
$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))
$puts(r3,$ifgreater($cwb_datediff($get(sd),%cwb_systemdatetime%),7,$get(r2),10000))


%play_count% -> %play_counter% if you don't use official.
carpman
That's a nice idea!
Sounds like it works too. biggrin.gif

Though, aren't you missing the final get statement from the bottom?:
$ifgreater(%play_counter%,0,$num($get(r3),5),-----)

I guess this is your actual code?

CODE

$puts(sd,$if($greater($cwb_datediff(%first_played%,%cwb_systemdatetime%),$cwb_datediff(%last_modified%,%cwb_systemdatetime%)),%first_played%,%last_modified%))
$puts(pc,%play_count%)
$puts(ra,$add(1000,$div($mul(%length_seconds%,$sub($get(pc),$div(%skip%,2))),100)))
$puts(ra2,$mul($get(ra),10))
$puts(dd,$div($add($cwb_datediff($get(sd),%last_played%),50),10))
$puts(pp,$div($mul($get(pc),10000),$cwb_datediff($get(sd),%cwb_systemdatetime%)))
$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))
$puts(pd3,$div($mul($cwb_datediff($get(sd),%cwb_systemdatetime%),125),100))
$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra2)))
$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))
$puts(r3,$ifgreater($cwb_datediff($get(sd),%cwb_systemdatetime%),7,$get(r2),10000))
$ifgreater(%play_count%,0,$num($get(r3),5),-----)


Good solution, just ran it -- works well.

By the way, does anyone know the relative popularity of foo_playcount versus foo_playback_custom?
I'd be interested to know.

C.
Purple Monkey
Ah yea, I have that in another part of my code so it missed the c&p. Just trying gauge the dynamic range so I can convert a number into something more "glanceable".
carpman
QUOTE(Purple Monkey @ Apr 27 2008, 13:15) *

Just trying gauge the dynamic range so I can convert a number into something more "glanceable".


In the download linked to in the first post is a spreadsheet which is pretty much for this kind of testing. Put in your highest and lowest variables and see what comes out. That should give you your gauge.

C.
cmdrpaddy
I've followed your instructions and I was wondering if you have found any problems when the added date is later than the last played date?

I have only just added an %added% tag to my music (using custominfo) and obviously since my playback stats existed before I added this tag my Days Since Added is negative. Every rating for every song that I've played in my library is 10000, no matter how many times I've played the song.

The excel spreadsheet returns what seem like realistic values for various songs. Could excels behaviour with negative numbers be different to foobars?

This is the modified rating formula I'm using (%play_counter% ---> %play_count% should be the only change)
CODE

$puts(ra,$add(1000,$div($mul(%length_seconds%,$sub(%play_count%,$div(%skip%,2))),100)))$puts(ra2,$mul($get(ra),10))$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra2)))$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))$puts(r3,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r2),10000))$ifgreater(%play_count%,0,$num($get(r3),5),-----)
carpman
hi cmdrpaddy

Thanks for the feedback.
Firstly, the reason you are getting a rating of 10000 for every track is because of this line:

$puts(r3,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r2),10000))

This is the "pseudo rating" applied to new tracks less than 7 days old. The reason for this is that in the first few days the rating is "vulnerable" to skewing caused by the "plays per time period" problem. Obviously if you add a new track and play it twice and then extropolate that behaviour you'd listen to it 730 times a year. The formula's pretty good at smoothing this out after 4 or 5 days. Thus the pseudo rating is there to prevent brand new tracks from jumping straight to the top of the ratings (it's a fudge - but a necessary one).

What I would do and have done is this:

There are two methods for dealing with this, the first is the best and relies on the %first_played% field. If you don't have that info then use the second method:

1) Setup a custom info Context Menu Command:
Got to: Preferences > Tools > Custom Info
Select the Context Menu Commands tab

Click "New"
Enter the following:

Display name: Custom Info/Date/Added (first played)
Field name: ADDED
Value: %first_played%

Save all

Highlight a few tracks first to test this:
Right click > Custom Info > Date > [left click on] Added (first played)

That should resolve the date problem.
If you don't have first played data then:

2) As above but add the following instead:

Display name: Custom Info/Date/Added (date modified)
Field name: ADDED
Value: %lastmodified%

Save all

Highlight a few tracks first to test this:
Right click > Custom Info > Date > [left click on] Added (date modified)

That should give you reasonable date %added% info.

Let me know if that works.

Cheers,
C.
cmdrpaddy
The first option worked perfectly thanks!
carpman
Updated the 1st and 2nd posts to account for recent changes and new versions for foo_playcount users.

There are now 3 versions of foo_DAR:

1) foo_DAR_full: for foo_playback_custom (this is the official release and has full functionality)
2) foo_DAR_noskip: for foo_playcount (thanks to Bollerkopp for raising this issue - this has been modified for users of the official playback stats plugin and lacks the %skip% function)
3) foo_DAR_noadded: for foo_playcount (thanks to Purple Monkey for raising this issue - this has been modified for users who don't have either a %skip% or an %added% field)

C.
carpman
Tested all versions of the formula with cue sheet + wavpack file and worked fine; more due to foobar than anything I've done. I preferred the results from foo_DAR_full (but this is more to do with foo_playback_custom).

Both foo_playcount and foo_playback_custom treated the cue sheet "tracks" as real tracks and thus assigned ratings correctly.

C.
metal_termite
Would you consider making a version that incorporates the %RATING% tag? I rate my songs between 0 and 5, the higher the value the better.

metal_termite
Regarding foo_DAR_noskip:

How much emphasis is given to %length_seconds% and %last_played%?

My top two rated tracks are as follows

CODE

Track     Time     %play_count%     %added%        %last_played%    Rating
--------------------------------------------------------------------------
a         5:28        40            2006-12-31      2008-04-30       11159
b         3:01        47            2007-05-15      2008-04-24       10969
carpman
Hi metal_termite
QUOTE(metal_termite @ Apr 30 2008, 14:38) *

Would you consider making a version that incorporates the %RATING% tag? I rate my songs between 0 and 5, the higher the value the better.

I thought about that and chose not to. However, I will consider it.

The reason I didn't like the idea was because it defeats the purpose of foo_DAR which is to allow your actual behaviour to inform you about how much you really like a song; i.e. it attempts to by-pass unconscious judgements about a song. For example I was unpleasantly (in relation to how cool I might think I am) shocked about how much I liked Ready For The Times To Get Better by Crystal Gayle. Silly judgement, sure .. but that's why I wrote foo_DAR. I believe it's a better judge than "I" am.

QUOTE(metal_termite @ Apr 30 2008, 15:16) *

How much emphasis is given to %length_seconds% and %last_played%?

That's a good question - and has made me think.
Download this and you can see for yourself.

The answer is that in this case the %length_seconds% is the predominant factor.
In the spreadsheet linked to above, you can see that if both tracks were 5:28 and both tracks were played 40 times:

Track a) 11159 (foobar) --- (excel gives 11167)
Track b) 11352 (excel)

(the disparity is due to Excel's treatment of dates and rounding versus foobar's -- but close enough to get the idea)

That should show you that the date elements have an effect but not as much as the duration.
The reason for the duration is that foo_DAR_full has %skip% and the longer the track the more likely it is to be skipped, but I'm now thinking at present this may be a little clumsy and I might need to smooth this somewhat.

So thanks for this example as it's a good one since the duration difference (although almost double) is still marginal in relation to normal track lengths.

I'll see if I can find a way to normalise this and yet still provide advantage for long tracks like Free Jazz by Ornette Coleman (37 mins). Sitting through that might make me cool but it's quicker to listen to Ready For The Times To Get Better by Crystal Gayle 10 times. biggrin.gif

Hope that answers your question.
C.

carpman
Okay - I've got a nice and simple solution which so far seems to work really well. Looking at it I had something similar but not as good or simple which I abandoned - I think this will make a decent improvement.

I'll do some testing this evening, and will hopefully have this done by tonight.

C.



metal_termite
Thanks, and I see your point regarding the %RATING% tag.
carpman
Okay. foo_DAR v.3's are out, for download see Post 2.

@metal termite: v.3 smooths out the duration part of foo_DAR_noskip, so now it looks like this:

IPB Image

That should solve the problem.

I've updated foo_DAR_noskip so the effect of duration is slightly reduced (this mirrors the negative effect of the %skip% function in foo_DAR_full). Also included in both versions is a penalty weighting for tracks that are not played for a long time after they've been added. The penalty is reduced the more the track is played, ultimately becoming inconsequential.

I've updated the excel sheet which now has the two versions (side by side) and some extra examples, as well as the new penalty weighting calculation.

metal termite, if you want to compare your old results (don't use the latest formula just yet - as it's got the new penalty calc, instead) paste this over your old code:
CODE

$puts(dur,$div($add(%length_seconds%,180),2))
$puts(ra,$mul($add(1000,$div($mul($get(dur),$sub(%play_count%,$div(%skip%,2))),100)),10))
$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))
$puts(pp,$div($mul(%play_count%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))
$puts(pd,$mul($get(dd),$get(pp)))$puts(pd2,$div($get(pd),100))
$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))
$puts(pd4,$div($get(pp),40))$puts(r1,$add($get(pd2),$get(ra)))
$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd3))))
$puts(r3,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r2),10000))
$ifgreater(%play_count%,0,$num($get(r3),5),-----)


Let me know how that goes.

With regard to the %rating% tag - I considered it and decided no (you know why smile.gif ).

<edit>Oh yeah, in v.3 I've added a floor (00001) to the rating to stop it going negative due to the penalty calc - if you added a track 6 years ago and only just got round to playing it today the penalty (quite rightly is pretty severe and) would push it into the negative. </edit>

C.
metal_termite
Thanks Carpman, the updated algorithm produces better results. smile.gif

CODE

Track     Time     %play_count%     %added%        %last_played%    Rating
--------------------------------------------------------------------------
b         3:01        47            2007-05-15      2008-04-24       10957
c         3:04        27            2008-03-03      2008-04-11       10906
a         5:28        40            2006-12-31      2008-04-30       10857


carpman
metal termite

Just out of interest, are these results from the formula pasted above or from the new v.3 formula from post no. 2?
Results look good, thanks for bringing this up, it's definitely improved foo_DAR_noskip.

C.
metal_termite
Those are the results from the formula of the above code in post number 37.
carpman
Okay. Thanks.

C.
metal_termite
EDIT: Nevermind. You're already aware that the new playback statistics component messes up foo_dar.
carpman
QUOTE(metal_termite @ May 2 2008, 21:35) *

The most recent Playback Statistics (2.1.1) component causes havoc with foo_dar. All my tracks have a score of 10000. I suppose it has something to do with the added tag.

Yes, I'm afraid it does. As far as foo_DAR is concerned (or anything else for that matter) all your tracks are now < 1 day old.

I posted about this.

I'm staying well away from Playback Statistics until it measures up to foo_playback_custom. I ran it on my test install and it did the same thing.

The new Playback Statistics made the %added% work from the time now!

I think something has been implimented which may now copy %first_played% as %added% instead - but %first_played% and %added% are not the same thing and this obviously negates some of the foo_DAR stuff. Why some kind of transfer of existing data to PlaybackStatistics.dat can't be sorted out I don't know, perhaps it can be, or even will be, I don't know.

Why foo_playcount can't have a % played before being counted as played I don't know either.
And why foo_playcount can't have a %skip% count I don't know either.
These are question for foobar2k devs, not me.

Hope you have your data backed up.

Sorry I can't be any more helpful.

C.

<edit>What's nice about foo_playback_custom and the cutom info db it uses is that this kind of thing can't happen - it's so easy to manipulate the data in the database. So for example I can easily add the date I installed foobar2k (or foo_playback_custom) as an %added% date to a large proportion of my tracks.</edit>
metal_termite
QUOTE(carpman @ May 2 2008, 16:55) *

Hope you have your data backed up.


Yeah, Windows Shadow Copy just saved my butt because I hadn't backed up foo_playcount.dll and PlaybackStatistics.dat

Hopefully future versions of the Playback Statistics components will incorporate already existing %added% tag values into the database as you said.
carpman
Glad you were saved.

It's a funny situation at present, with cwb_hooks soon to be deprecated.
I normally run 2 copies of foobar (with foo_DAR going on I've got 3 on the go for testing). I can easily see a situation in 5 years from now where for playing my music I'm still using 9.4.3 and my other version (which is very lightweight for work, processing, ABX etc ..) is the very latest version 11.5.6 or something. I wonder if they will even be on speaking terms by then?

C.
carpman
QUOTE(metal_termite @ May 2 2008, 21:35) *

EDIT: Nevermind. You're already aware that the new playback statistics component messes up foo_dar.

Just for the sake of clarification and accuracy:
The new playback statistics component appears to substantially alter the user's existing %added% data, which in turn "messes up foo_dar".

C.
northwall
Hello,

i try to use foo_DAR in foobar 0.9.5.2 with DUI
I have all the components installed without "columns UI"
I have done all as described in your "foo_DAR_fullsetupinfo.rtf"
In my Playlist i can show the column "DAR" and "DARSET".
The column "DAR" is always empty.
The column "DARSET" i can fill by the context menu: "Custom Info - Rating - Set DAR"
Why is the column "DARSET" not filled automatically while playing (or after playing) the title ?

Paul
northwall
Hello,

i made some experiments: I choosed the Systemdate of my PC to see what happens.
I have played a song a second time and the Rating was still 10000 (as before)

Is it possible to make it work with 0.9.5.2 DUI ?

Paul

Hello,

i made some experiments: I choosed the Systemdate of my PC to see what happens.
I have played a song a second time and the Rating was still 10000 (as before)

Is it possible to make it work with 0.9.5.2 DUI ?

Paul
Purple Monkey
QUOTE(carpman @ May 3 2008, 03:32) *


Just for the sake of clarification and accuracy:
The new playback statistics component appears to substantially alter the user's existing %added% data, which in turn "messes up foo_dar".

C.


Does using $meta(added) work? I would assume that this would only use tag info. (or $cinfo(added) if you only store it in foo_custominfo.)
carpman
QUOTE(northwall @ May 4 2008, 13:48) *

Hello,
i try to use foo_DAR in foobar 0.9.5.2 with DUI
I have all the components installed without "columns UI"
I have done all as described in your "foo_DAR_fullsetupinfo.rtf"
In my Playlist i can show the column "DAR" and "DARSET".

Hi northwall

foo_DAR has been tested with foobar 0.9.5.2 DUI and works fine.

I need to know which version of foo_DAR you are using.
I assume it's foo_DAR_full?

As far as DARSET (as per foo_DAR_fullsetupinfo.rtf) this is purely to take a "snapshot" of your ratings.
So for example, if at the start of the year you want to make a benchmark rating - you'd use the DARSET instructions. At the end of the year you'd be able to see who's going up and who's going down.

Are you getting 10000 ratings for all your tracks? If so this will be related to your %added% data. If this is less than 8 days ago you will get a 10000 rating. So for a brand new setup you WILL get 10000 for the first week (that means it's working).

Also you can change the 7 in the code below to 0 to test this:

$puts(ra,$mul($add(1000,$div($mul(%length_seconds%,$sub(%play_counter%,$div(%skip%,2))),100)),10))
$puts(dd,$div($add($cwb_datediff(%added%,%last_played%),50),10))
$puts(pp,$div($mul(%play_counter%,10000),$cwb_datediff(%added%,%cwb_systemdatetime%)))
$puts(pd,$mul($get(dd),$get(pp)))
$puts(pd2,$div($get(pd),100))
$puts(pd3,$div($mul($cwb_datediff(%added%,%cwb_systemdatetime%),125),100))
$puts(pd4,$div($get(pp),40))
$puts(pd5,$div($mul($cwb_datediff(%added%,%first_played%),5),%play_counter%))
$puts(pd6,$add($get(pd3),$get(pd5)))
$puts(r1,$add($get(pd2),$get(ra)))
$puts(r2,$add($get(pd4),$sub($get(r1),$get(pd6))))
$puts(r3,$ifgreater($get(r2),0,$get(r2),1))
$puts(r4,$ifgreater($cwb_datediff(%added%,%cwb_systemdatetime%),7,$get(r3),10000))
$ifgreater(%play_counter%,0,$num($get(r4),5),-----)

If that "solves" the issue, then remember to change this back to 7 later. See this post for why.

If it's something else then what I suggest is setting up a test column enter the following fields one by one and post the outcome for an example track:

1) %play_counter% or %play_count%
2) $cwb_datediff(%added%,%cwb_systemdatetime%)
3) $cwb_datediff(%added%,%first_played%)
4) $cwb_datediff(%added%,%last_played%)

Also, let me know which version you are using (i.e. foo_DAR_full v.3) and we'll take it from there.

QUOTE(Purple Monkey @ May 4 2008, 16:31) *

QUOTE(carpman @ May 3 2008, 03:32) *


Just for the sake of clarification and accuracy:
The new playback statistics component appears to substantially alter the user's existing %added% data, which in turn "messes up foo_dar".

C.


Does using $meta(added) work? I would assume that this would only use tag info. (or $cinfo(added) if you only store it in foo_custominfo.)

@ purple monkey: I'm going to wait and see what happens with foo_playcount. Rather than try and second guess ways to get round its various peculiarities. Do you think users will always date stamp their tags with %added%? I'm not sure. At the moment it's a mess, we'd be better off with one stats component, that successfully manages all the relevant fields (skip, last and first played, added, played etc.) But hey, in the old days web devs had to make 2 different websites one for IE users and one for Netscape users.

C.

<edit>whoops -- HA posting went funny. That should be better </edit>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.