HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: carpman on 2010-09-29 17:44:31

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-29 17:44:31
DADA Auto-Rating (DAR) for foobar2000

Date and duration adjusted auto-rating algorithm

The DAR page: https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000 (https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000)

LATEST VERSION: 2.0.1 (released 5th April 2015)

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

CONTENTS:

1. Intro
2. Requirements
3. Setup instructions
4. The DAR Code
5. The DAR Indexed Rating (with Dots)
6. Making an Autoplaylist ranked by DAR
7. A note regarding issues raised on the old foo_DAR thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864)
8. Changelog

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

1. INTRO

A good auto-rating algorithm will simply tell you what your favourite (and conversely, least favourite) music is, and the rating will be derived from and reflect actual listening behaviour. This is quite different from manual ratings (e.g. 1 - 5 stars set by the user), since there's very often a disparity between what we'd like ourselves to like, and what we actually like. For those interested in uncovering their actual musical tastes, a good auto-rating formula can be quite illuminating.

(https://www.giantpygmy.net/studio/data/uploads/img/audio-posts/gpa-archive/DAR_v1.6.2_top10.png)
(obviously this data would normally accompany Track Title & Artist info  etc...)


The DADA Auto-Rating algorithm (DAR) addresses the following issues:

a) THE PLAY PER PERIOD PROBLEM
"Total Playcount" / "No. Days in Library" will give an unfair advantage to new tracks.

b) THE TOTAL PLAYCOUNT PROBLEM
Total playcount will give an unfair advantage to old tracks.

c) THE TRACK DURATION & PLAYCOUNT PROBLEM
Song A = 30 mins, Song B = 3 mins, the opportunity cost of listening to Song A is listening to Song B 10 times. If playcount is at the root of the rating (and it has to be), somehow duration has to be factored in, because we are physically limited by time (lifetime/listening time). No matter how much one likes Song A you simply cannot fit as many plays of that track into a lifetime as you can with Song B. So all other things being equal, Song B has an advantage (due to its duration) and this has to be adjusted for.

There are other factors, but they are the principle ones the DAR algorithm is interested in solving. DAR attempts to negate these issues so that regardless of the above, all tracks are rated on a level playing field.


2. REQUIREMENTS:

foobar2000 v.1+ (http://www.foobar2000.org/download)
foo_playcount.dll (the offical Playback Statistics plugin) (http://www.foobar2000.org/components/view/foo_playcount)
foo_dynfil.dll (the host for the DAR algorithm) (http://yirkha.fud.cz/progs/foobar2000/foo_dynfil-v1-beta-4.zip)  [Warning! Read this post (http://www.hydrogenaudio.org/forums/index.php?showtopic=86853&view=findpost&p=744320) before installing]


3. SETUP INSTRUCTIONS:

The latest code and setup instructions are here:
https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt (https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt)


4. DAR CODE:

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(pc1,$add($get(pc),2))
$puts(pc3,$mul($get(pc1),$get(pc1),$get(pc1)))
$puts(b1,$add($div($date_diff(2015),5),0))
$puts(b2,$add($div($get(b1),50),500))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),$get(lib1),100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($div($date_diff(%added%,%first_played%),5),5000),$get(b2),$add($div($get(l),20),140)),$add($div($get(pc3),58),3)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r2a,$ifgreater($get(r2),0,$get(r2),1))
$puts(r3,$sub($get(r2),$div($mul($get(r2a),$get(z),3),50000)))
$puts(r4,$add($get(r3),$get(b1)))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

5. DAR INDEXED RATING (WITH DOTS)

If you want a visual representation of the DAR results (i.e. dots) similar to the above screenshot:
Then create a custom column (CUI) in foobar2000 and enter this code:

Code: [Select]
$puts(maxdar,10000)
$puts(mindar,5000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(10,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$get(display),$get(notplayed))
For alternatives (i.e. for DUI or other CUI options) see the setup instructions file (https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt).


6. MAKING AN AUTOPLAYLIST RANKED BY DAR

To create an autoplaylist ranked according to the DAR algorithm see instructions (https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt):

Query pattern:
Code: [Select]
%_dynamic_rating% GREATER 0
Sort pattern:
Code: [Select]
$sub(99999,%_dynamic_rating%)

(https://www.giantpygmy.net/studio/data/uploads/img/audio-posts/gpa-archive/DAR_v1.6.2_autoplaylist_properties.png)


7. A NOTE REGARDING ISSUES RAISED ON THE OLD FOO_DAR THREAD

When the first DAR formula was released (then inappropriately named foo_DAR -- it's NOT a component!) a number of issues were raised, along with other substantial improvements, all of these have been remedied:


8. CHANGELOG (v.1.6.2 - onward)



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

That's it.
Enjoy!

Feedback and suggestions welcome.

C.

ps. Special thanks to Yirkha for making foo_dynfil and solving the %now% problem.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: q-stankovic on 2010-09-29 21:28:42
Thank you, carpman!

Can you describe in simple words how the formula works? How do added, first_played, last_played and playcount determine the dynamic rating?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-29 22:24:27
It's hard because the variables are used in a number of different ways to carry out different functions. These functions are then combined in a number of ways to achieve the final result.

I'll explain roughly how it goes.

On the DAR page linked to under the title (in the first post) you can see what it does, in how I've laid out the problem.

Firstly it addresses the duration issue:
See: http://www.giantpygmy.net/stuff/dar/DAR_v1...calibration.png (http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_duration_recalibration.png)
and: http://www.giantpygmy.net/stuff/dar/DAR_v1...s_playcount.png (http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_listeningtime_vs_playcount.png)

((%length_seconds% + 540) * 0.25)
Notice if you put 180 into that you get 180, if you put anything less it will gain and anything more will lose. So all track durations move to some degree toward 180 secs.

We add to that (%length_seconds%^2 ) / 9000

What this does is add a little duration back for extremely long tracks (+30 mins)

Then after "recalibrating" (perhaps, "weighting" the duration) it performs a simple calculation which creates the basis of the rating:

$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))

The adjusted duration (d3) as per above is multiplied by the %play_count%.
Then divided by 100.
This is then added to 1000 and multiplied by 10.

Why all the big numbers? It's kind of a floating point-ish issue since %titleformatting% rounds down, so that 1.9 gets rounded to 1.

I won't go further, except to say that after that, TIME (or rather age) is allowed to impact the rating. So a number of date based calculations (along with delayed playing, low-playcount penalties, and increased fall rates etc) are made and this erodes the earlier "duration-based" rating (r0).

See the graphs and explanations here for more:
https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000 (https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000)

Hope that helps,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-09-30 04:13:38
This is cool! How often does it get recalculated? Or do you have to press the button when you want it to recalculate?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-30 04:38:22
From here: http://www.hydrogenaudio.org/forums/index....st&p=724796 (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864&view=findpost&p=724796)

While experimenting with carpmans script i noticed that another type of automatic updating would be senseful. When a currently playing track increases its playcount and therefore changes its first played time then its and only its dynamic rating could be updated to reflect immediately the change of the value.
Indeed, seems reasonable. I'll add that to the component, so that when any metadata changes, the dynamic values of the relevant track(s) will be also recalculated.

And I'll make it do the same for any newly added tracks too. Currently the only action taken was to remove information for tracks removed from the Media Library.


This is up to Yirkha's component. But it sounds like it's in hand. At present it's like this:
Quote
Refreshes asynchronously at startup, when you press a button and using bindable main menu command Library > Recalculate dynamic rating.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: shakey_snake on 2010-09-30 04:41:55
Neato. Thank you.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: DustMagnet on 2010-09-30 06:16:43
Fascinating. The results I've looked at seem sane and realistic. Clearly you've put a lot of thought into this. Bravo.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: romor on 2010-09-30 08:38:19
Hi carpman,
great project and fabulous documentation which I did not absorb whole, but have question about max value of DAR Index: I'm getting very high value - 181 (it's one of my favourites tracks, but not as much  )

%play_count% = 44
%added% = 2010-05-22 03:04:55
%first_played% = 2010-05-22 03:17:52
%last_played% = 2010-09-12 00:03:30
%length% = 2:35:00.033 (it's that long, and it is one of 3 tracks released on this DVD: http://www.discogs.com/release/728911 (http://www.discogs.com/release/728911))

Issue is with length of course, and play_count considers played track after 1min of playback
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-30 11:35:47
Hi rumor,

Sounds like a classical example of this:
http://www.hydrogenaudio.org/forums/index....st&p=724804 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=62864&view=findpost&p=724804)

Simple answer is that you've already hit the nail on the head, it's a foo_playcount issue, and I've already made my point numerous times regarding how I feel about this. The insanity is that according to foo_playcount over a period of almost 5 months (assuming you sleep for 8 hours a day) you've spent 5.5% of you're waking life listening to one song. I'm sure that's not the case. 

The ideal situation is to have a playcount based on "total track listening time" / track length.

Have you done the following:

Quote
You may need to adjust the two variables.
The "maxdar" should be about 200 points greater than your current maximum rating.
The "mindar" is harder to approximate, if unsure leave it where it is, otherwise give it a value of 2000 to 3000 above the lowest rating, if that doesn't satify, just play around with it until you're happy.

$puts(maxdar,10800)
$puts(mindar,7800)


from: http://www.giantpygmy.net/gpa/data/uploads..._dar_v1.6.4.txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_v1.6.4.txt)

I'm guessing you're getting a DAR of something like 63000 !

1) Is this track a complete anomaly or are there a load of tracks like this in you collection?
2) How do you listen to music, mainly shuffle, or mainly album by album in default/ "linear" mode?

C.

EDIT: Basically I'd assumed that no individual track could be longer than a CD and I left plenty of headroom.
It's very possible to do a work around because my feeling is that even with foo_playcount's count if played > 1 min, that this is a very extreme case, so I'll look at building in some kind of track length cap.

In the meantime, let me know the answers to those 2 questions.

Thanks.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: romor on 2010-09-30 14:06:24
Hey, thanks for your reply, but I'm not rumor but romor: it's roughly translated as stream bubbling or sparkling

You ideal solution about play_count is perfect solution if someone asks me. I hope developer would consider this as at least making personal preference about play_count trigger is reasonable wish by many if I may say. I know there are components providing this feature, but I also want to take advantage of this fast binary solution over sqlite sloppiness. And again I would prefer your play_count formula as ideal.

I'll check with your quoted text later, in the meantime:

1. It seems like anomaly, here are my top 20:
Code: [Select]
Length     count    IDX    DAR
--------------------------------
2:35:00    46       181    62326
2:24:54    22       81     32272
1:59:57    22       63     26763
55:44      74       61     26307
29:51      85       33     17859
30:00      85       33     17917
30:56      76       33     17799
31:08      74       32     17636
52:24      33       29     16589
57:37      32       29     16775
45:00      43       27     15971
45:30      29       22     14449
55:31      17       19     13776
29:51      39       19     13694
24:45      39       17     13194
42:45      27       17     13155
35:36      28       17     13003
30:30      33       17     13171
32:12      34       17     13049
3:12       111      16     12851

notice the first three tracks which are from the same release

2. I would say mainly albums, and rarely shuffle mode


About edit: that discogs review (about this release) quoted another review where it is said that it's "possibly the longest continuous musical composition ever released on any format". There are limitation releasing your artwork in such format (and in this release even compression was unavoidable, so track 2 was compressed with AC-3), but yeah generally considering max length to CD length is reasonable thought.

Also I'll examine your project more later which would be easy with provided documentation

Cheers
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-09-30 16:13:13
There's the Playcount Statistics Custom, which has an option to tag a song when it's halfway through playing (or some other percentage). It uses tags, or foo_customdb (or both). I don't know if that's a viable alternative for you, but it's what I use anyway since I want playcount tags, and it works with DAR.

One of my songs has over 200 plays, so in order to get a decent rating out of the other tracks, I just let that one be too high... It's my own "fault" for playing that song as an alarm clock for a year.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-30 19:15:04
I'll try again ... hi romor, 

Quote
((%length_seconds% + 540) * 0.25)
Notice if you put 180 into that you get 180, if you put anything less it will gain and anything more will lose. So all track durations move to some degree toward 180 secs.

We add to that (%length_seconds%^2 ) / 9000

What this does is add a little duration back for extremely long tracks (+30 mins)

This was the problem, I had assumed "extremely long" must be < 80 mins.
So now if the track is > 45 mins the divisor is increased by %length_seconds%/2700 (i.e 45 mins).

Try these two versions and see which one works best for your library:

Default Duration Effect  (DAR 1.6.3 SLT beta)

In the default version you should see no difference for tracks < 45 mins.
So I'd like you to make a note of a 3, 5, 10 min track and check that the rating doesn't change.
You should notice a major change in very long tracks. If you feel it's still not enough I'd recommend the 2nd version below.

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),2699,$muldiv(9000,$get(l),2700),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

Weak Duration Effect  (DAR 1.6.3 SLT beta)

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),2699,$muldiv(10000,$get(l),2700),10000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),
$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

Let me know how it goes, and also which version suits you best.

Thanks for bringing this up.

C.

EDIT: Code pasting sloppiness.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: q-stankovic on 2010-09-30 19:56:57
Thank you for the detailed explanation, carpman!

I just expected some information about the relation of dynamic rating to the itemized playback statistics fields.
I assume it works like this:

The higher the playcount the higher the dynamic rating if all other playback statistics fields are the same.
The older the last played timestamp the lower the dynamic rating if all other ...

I have difficulties to see how first played and added timestamp are related.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-09-30 23:50:52
I assume it works like this:

The higher the playcount the higher the dynamic rating if all other playback statistics fields are the same.
The older the last played timestamp the lower the dynamic rating if all other ...

Correct.

I have difficulties to see how first played and added timestamp are related.

Quote
When tracks have a very low playcount (i.e. < 5) the effects of the low playcount penalty are a dominant factor in the DAR rating scheme. As the playcount increases this effect diminishes quickly (ultimately to zero).

Source: http://www.giantpygmy.net/gpa/index.php?id=dada-autorating (http://www.giantpygmy.net/gpa/index.php?id=dada-autorating)

Part of the low playcount penalty is the delay in first playing.
The greater the difference between first played and added the greater the penalty, the lower the rating.

However, this penalty is temporary since the gap between first played and added never changes yet playcount does (it's divided by playcount^2).

The green arrows below show the effect of delaying first playing the song by 40 weeks:
(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_lowplaycount_mechanism.png)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-01 01:45:00
@ romor

The 2 versions I've given you are marked below in red:

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_duration_recalibration_SLT_romor.png)

All these versions have the new Super Long Track suppression code (except the grey line which is the old default). As you can see it's identical up to 45 mins, then the new mechanism comes in.

I'm going to sit on it, but it's possible I'll put this in the next release (more likely at about 60 mins). Afterall, it will only effect a few extreme tracks.

Thanks for raising the issue, it's basically a combination of my assumption re. long tracks and the way foo_playcount counts them. As I said before, let me know what you think.

Cheers,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: romor on 2010-10-01 11:35:42
Thanks carpman for your replies and solutions
I wish play_count trigger issue to be solved (in our all interest)

I tried your new scripts and decided to go with DDE:

20 samples:
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-03 18:01:56
romor, you've probably already done this, but you'll need to change your maxdar, mindar settings in the DAR Index.
Quote
The "maxdar" should be about 200 points greater than your current maximum rating.
The "mindar" is harder to approximate, if unsure leave it where it is, otherwise give it a value of 2000 to 3000 above the lowest rating, if that doesn't satify, just play around with it until you're happy.

I'm guessing, but something like:
Code: [Select]
$puts(maxdar,20000)
$puts(mindar,7500)

The DAR Index is setup so that it should always be between 1 and 9 dots (with 10 dots suggesting your max needs to be adjusted).

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: sebassjee on 2010-10-03 22:21:13
Awesome component! Thank you..
There's only one thing i can't get working, How can I create a custom column for the dotted-rating?

seb

Edit: I allready managed it
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-03 23:53:27
Awesome component! Thank you..

Thank you. But you mustn't confuse people - it's not a component (I got into trouble with that a while back). 
Component credits go to Peter and Yirkha.

Hope you enjoy the results. 

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: romor on 2010-10-04 14:00:14
romor, you've probably already done this, but you'll need to change your maxdar, mindar settings in the DAR Index.

Thanks for interest carpman, I tried that, but got some flat values, like 99% of tracks with value 1 and rest some values till 9
BTW limit values were something like 36000/5000 (according suggestion)
I looked at DAR TF code and extracted formula:



Overall, at a first glance results from your idea are not very noticeable, (except my top 20 being my longest tracks on first try) but I expect to tweak it in future when I got more used to it.
Is this work based on your own suggestions/experience or you used some known algorithms?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-04 19:05:16
Result values are more/less same as DAR code, perhaps because of date difference calculation and foobar rounding maybe

Yes, my Excel DAR "modelling" sheet, always has slightly different values due to rounding.

Overall, at a first glance results from your idea are not very noticeable, (except my top 20 being my longest tracks on first try) but I expect to tweak it in future when I got more used to it.
Is this work based on your own suggestions/experience or you used some known algorithms?

The former. I just thought about what I wanted a ratings formula to do. A lot of the decisions are practical ones as I've said before, a) limited to pretty simple maths, b) rounding issues (as you've discovered).

I tempered quadratic part (red outlined) and made it linear: $puts(d2,$div($get(l),100)) slightly affecting the next part, but results are fine by me

The "d2" part is based on something I was finding regarding tracks whose duration was > 30 mins. I needed a way to benefit tracks 30 mins+ without giving that same benefit to songs <20 mins.

What's worth keeping in mind, is that my test data is based on a playcount that a) only counts after 67% played, and b) where, if I've fallen asleep for example,  the playcounts of those unlistened to tracks are subtracted by 1. So my test results are based on very accurate playcount data over a long period (as an example my ratings have never exceeded 10700 -- this is a reflection in part of my own listening behaviour, but has a lot to do with the nature of the playcount data).

I think your modifications are very suitable for your situation and the current limitations of foo_playcount.
Personally, I'd like to see an improved foo_playcount, but your modifications may well be useful for people who find themselves with similarly high DAR results as results of foo_playcount's limitations.

Please keep me informed of your modifications -- very interesting (and I like the formula!    ).

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: romor on 2010-10-04 19:55:32
I do intent to modify it based on my data and foo_playcount limitation on hard-coded 1min counting. Version 3 recently came out and there are no indication on preferred changes happening (or even replies in previous version thread IIRC) so that seems to be the way for users of foo_playcount
However I did not modify nothing special, I guess that removing quadratic part is the first idea that comes to mind when thinking about lowering influence of large tracks, as you've done in DDE and WDE
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-04 21:32:23
Absolutely, I understand what you're saying, and I'm all in favour of your modifying and improving DAR where possible. Personally, I have tremendous faith in Peter and the team in their rationality and ability to realise when something simply doesn't make sense. 

My view on what you've done is that you could almost get rid of d2 entirely. It's whole purpose is to increase the ratings of very long tracks, precisely because with a proper playcount listening to a song for an hour for example takes a substantial chunk out of your day, and deserves some ratings reward.

Here's what your modification does to duration as against removing d2 entirely (based on % of original track length):

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_duration_recalibration_romor_mod_d2.png)

ps. The formula you posted:
(http://i.imgur.com/CCcrD.png)

Which DAR version is this (I'm assuming it's the original one I posted - L^2 etc ...) but I was a little confused by this:
Quote
I looked at DAR TF code and extracted formula

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Yirkha on 2010-10-04 22:16:50
"TF code" = simply "title formatting code"?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Takaji on 2010-10-05 05:59:09
Very interesting algorithm! I'm having fun trying to calibrate it properly.
One thing I've noticed is that DAR seems to be more informative when looking at a playlist on the whole; if one uses the "dot" dating system to compare tracks in a single album, they all seem to come out the same, making it hard to tell which tracks on the album are the "best."

For example, I've got an album with playcounts like 24,7,7,9,11,3, etc... and ratings like 3/5,4/5,5/5...
Yet the DAR dot rating shows almost all the tracks as a 5 or 6.

One workaround that I think might satisfy some people (and me) is if instead of using dots, you could just output a more precise rating, like 7.8, 8.2, 3.4, etc... then I think the DAR dot rating may be more helpful when looking at a single album or group of tracks. I would do this myself, but I'm not that familiar with the code/math required.

Could someone provide a simple fix? Obviously the dots would no longer be needed.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 06:11:42
For example, I've got an album with playcounts like 24,7,7,9,11,3, etc... and ratings like 3/5,4/5,5/5...
Yet the DAR dot rating shows almost all the tracks as a 5 or 6.

One workaround that I think might satisfy some people (and me) is if instead of using dots, you could just output a more precise rating, like 7.8, 8.2, 3.4, etc... then I think the DAR dot rating may be more helpful when looking at a single album or group of tracks. I would do this myself, but I'm not that familiar with the code/math required.

Could someone provide a simple fix? Obviously the dots would no longer be needed.

Well before "fixing it" let's see if it's broken.
1. Can you give me the maximum and minimum DAR ratings (not DAR index) in your library?
2. Can you tell me the actual DAR ratings of the tracks from the album whose playcounts you quoted above?

Thanks,

C.

ps. You realise that DAR takes no notice of your "ratings like 3/5,4/5,5/5...".
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Takaji on 2010-10-05 06:23:33
Well before "fixing it" let's see if it's broken.
1. Can you give me the maximum and minimum DAR ratings (not DAR index) in your library?
2. Can you tell me the actual DAR ratings of the tracks from the album whose playcounts you quoted above?

Thanks,

C.

ps. You realise that DAR takes no notice of your "ratings like 3/5,4/5,5/5...".


1. Max: 11314, Min: 00055. I've calibrated the dot display script to have a maxdar=11514, and mindar=4255 (Got better results with that number for mindar IMO)
2. 08916, 08181, 08134, 08329, 08428, 07014, 08485, 08650, 08375, 08417

Yeap, I realize that, I would just expect that DAR would produce some results that at least help me determine which songs are my favourites. I realize too that those DAR values above are closely within each other, which is why I think a "n.n" alternate rating system would be helpful.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 06:27:00
1. Max: 11314, Min: 00055. I've calibrated the dot display script to have a maxdar=11514, and mindar=4255 (Got better results with that number for mindar IMO)
2. 08916, 08181, 08134, 08329, 08428, 07014, 08485, 08650, 08375, 08417
Unless your playback stats go back about 60 years I'm dubious about your min rating of: 00055 !!
Can you tell me the added, and playcount data for that track?

C.

EDIT: In the meantime, I'd set my maxdar to 11500 and mindar to 7000 8000. See how that goes.
EDIT2: By the way the default is:
$puts(maxdar,10800) -- [so you have to increase that and 11500 seems sensible]
$puts(mindar,7800) -- [you'll get better results with 8000, if you set it to 4000 then suddenly those ratings above are all relatively close together, i.e. By making the mindar lower you're exacerbating the problem].

Anyway, I'm intrigued by your track with the 00055 rating. 
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Takaji on 2010-10-05 06:47:47
Unless your playback stats go back about 60 years I'm dubious about your min rating of: 00055 !!
Can you tell me the added, and playcount data for that track?

EDIT: In the meantime, I'd set my maxdar to 11500 and mindar to 7000. See how that goes.


Track with 00055 DAR rating info: ADDED 2007-02-22 23:01:31, PLAY_COUNT 1

Using those values (11500, 7000) seems to give a more accurate rating (IMO) of the tracks in the album. However, it would still be great if you could show me how to display a "n.n"-style rating value.

Edit: Next-highest DAR rating is 00173, ADDED 2007-02-14 02:02:33, PLAY_COUNT 1
Edit 2: Actually, mindar=7000 is much better than 8000, or 7800. With 7000, tracks in the album are mostly either 2/3; with 8000, tracks are all mostly 1.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 06:57:15
Takaji, thanks for the info.
That's very peculiar indeed! Similar tracks in my library that are the same age and same playcount have a rating around 4500 [EDIT] My test isn't that old, but my calculations say a 1 min song that's 1329 days old should be around 3000.

I'm going to need more info, if you don't mind. So I can create the same file in my setup on fb2k 1.1.
I need to know the following:
I'm assuming you've not changed the actual DAR code from the 1st page?

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Takaji on 2010-10-05 07:05:37
I need to know the following:
  • Track length
  • Last Played
  • First Played
I'm assuming you've not changed the actual DAR code from the 1st page?


Length: 3:23.104 (9748978 samples)
Last played: 2010-09-20 00:29:42
First played: 2010-09-20 00:29:42
Play count: 1
Added: 2007-02-22 23:01:31

I have not changed the DAR code.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 07:19:42
Yeah, I just realised why that is before you posted. Your post confirms it.
Basically, there's a very large gap between when you added that song, and finally got around to listening to it (1314 days in fact). See the graph here for an explanation:
http://www.giantpygmy.net/stuff/dar/DAR_v1...t_mechanism.png (http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_lowplaycount_mechanism.png)

Okay, all is good.

See this post for more:
http://www.hydrogenaudio.org/forums/index....st&p=724934 (http://www.hydrogenaudio.org/forums/index.php?showtopic=83954&view=findpost&p=724934)

Quote
Part of the low playcount penalty is the delay in first playing.
The greater the difference between first played and added the greater the penalty, the lower the rating.

However, this penalty is temporary since the gap between first played and added never changes yet playcount does (it's divided by playcount^2).

The DAR Index (and DAR) will never go negative, so you can put in a much higher mindar than that of your lowest rating. Also, if you play that track again you'll notice a major leap in its rating.

Titleformatting can't do decimal places, but you can try this code if you don't want the dots:

This will give a 2 digit number between 1 and 100:

Code: [Select]
$puts(r3,%_dynamic_rating%)
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(maxdar,11500)
$puts(mindar,8000)
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),100),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(darind3),$get(notplayed))

Let me know if that's any good.

C.

EDIT: removed unnecessary $rgb(200,200,200) from code above.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Takaji on 2010-10-05 07:32:50
Yes, that's not bad, thank you for the code!

And thanks for all your patience. I'm looking forward to using DAR to create tailored playlists! Originally I wanted to make a playlist for my ipod containing songs higher than a certain rating, yet a lot of my tracks were not yet rated. I thought I would have to start manually rating every track in my library, but this is a good alternative!

Thank you for your hard work on this.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 07:39:10
No problem. It's really helpful to see the kinds of extremes that users throw up - it's a good test.
I'd tinker with those mindar maxdar settings until you're satified.
I'm looking forward to using DAR to create tailored playlists!

Yeah, I think foo_randompools and DAR were made for oneanother.

C.

EDIT: grammar
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Mr.Microwave on 2010-10-05 12:24:01
Awesome algorithm! Exactly the thing I have been looking for a long time!

Just one thing, is it possible to set it so that it recalculate dynamic rating on a regular interval (or even real time)? Since most of the time I leave my computer running and rarely I restart foobar.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-05 14:15:43
Glad you like it. This post hopefully answers your question:
foo_dynra is in beta, and it sounds like Yirkha may add a number of enhancements.
http://www.hydrogenaudio.org/forums/index....st&p=724796 (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864&view=findpost&p=724796)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Mr.Microwave on 2010-10-05 14:20:20
Cheers! I will keep an eye on that thread.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: -AdZero- on 2010-10-06 07:47:51
Hi.

Can anyone explain how to create the custom column with code for Dot DAR Index ?

I'm wondering if it's possible with the default UI or if another one is required. All I can do is creating a custom column with a single line pattern.

Thanks !

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Robertina on 2010-10-06 10:40:35
Can anyone explain how to create the custom column with code for Dot DAR Index ?

Is explained in chapter II here (http://www.giantpygmy.net/sections/pause/archive/dada_autorating_dar_latest_version.txt):
Quote
II. DAR INDEXED RATING (WITH DOTS) ... If you want a visual reprentation of the DAR results...
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: odyssey on 2010-10-06 11:59:16
Isn't another problem, duplicates?

I have many duplicates in my library and some can be grouped if the tags are consistent, but they aren't always. Besides this, what is a dupe? Generally I would say that if a song has largely the same contents, any edition of it should be considered a dupe (radio edit/album version/extended version etc).

Biggest problem is finding these dupes. fingerprinting solves part of the problem, but requires lot of user interaction and tagging and sometimes it cannot detect duplicate tracks with any useable match percentage.

Best solution I can think of to this problem is if someone could develop a fingerprinting engine that groups together dupes with a unique identifier.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: -AdZero- on 2010-10-06 12:27:38
Can anyone explain how to create the custom column with code for Dot DAR Index ?

Is explained in chapter II here (http://www.giantpygmy.net/sections/pause/archive/dada_autorating_dar_latest_version.txt):
Quote
II. DAR INDEXED RATING (WITH DOTS) ... If you want a visual reprentation of the DAR results...


Thanks for the reply, but I've read the documentation before asking...

The problem is that I don't know how to create the column with the lines of code that are given in the doc. I know how to create a custom column with a simple pattern on a single line, but not with several lines of script.

That is my real problem. So, I was wondering how to do that and if another UI is required.

Hope someone can bring a real explanation.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Robertina on 2010-10-06 13:06:16
That is my real problem. So, I was wondering how to do that and if another UI is required.
Another UI isn't mentioned as a requirement, so may I suggest to simply remove the word wraps and then copy that single line pattern?

Quote
Hope someone can bring a real explanation.
I hope this time my answer is more helpfully. I am using CUI which doesn't require to remove word wraps, so I didn't realize the DUI specific situation, please excuse. 
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: tpijag on 2010-10-06 14:10:14
A column accepts titleformating fields / formula - %_dynamic_rating%

Any simple to complex algorithm statements used to calculate the rating go into the large edit box included in the components preferences.
Remember to erase the single line time based sample .

terry
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: ScribeOfTheMist on 2010-10-06 14:51:35
I apologize if this is a dumb question, I have not used foobar to record play counts in several years, so I'm not at all up-to-date on the latest features in this area.

I am intrigued by the idea of this plugin, and would like to start using it, however my main concern is whether or not you can easily "fake" plays and still have the plugin work as intended. For example, if I copy some songs to an iPod and play them while jogging, can I easily tell my foobar library and this plugin that I played those songs, without having to actually play them from within foobar?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Robertina on 2010-10-06 15:11:18
A column accepts titleformating fields / formula - %_dynamic_rating% ...

If you are right, Terry (and I am an idiot), I would ask a moderator to move my nonsense posts into the recycle bin.

Sorry. 
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 16:10:23
For example, if I copy some songs to an iPod and play them while jogging, can I easily tell my foobar library and this plugin that I played those songs, without having to actually play them from within foobar?

It depends which playback statistics you use. The DAR rating will reflect whatever stats you have, so this is really a question for the foo_playcount thread. I've already made a suggestion there to be able to reduce playcount by one, perhaps you'd like to ask to be able to add playcount by one. Seems reasonable to me to be able to do both.

There are other playcount plugins that use SQL databases and allow the stats to be manipulated quite easily. I suggest you look into these.

At the moment I'm trying to stick to supporting foo_playcount only, as it's heading in the right direction, it's much faster than the SQL alternatives, it's import and export (XML) method is very good, and I know it will always be supported. That said, it has some glaring limitations (at present) that are quite unnecessary IMO, and you've pointed one of them out in your post.

Hope that helps.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 16:16:12
The problem is that I don't know how to create the column with the lines of code that are given in the doc. I know how to create a custom column with a simple pattern on a single line, but not with several lines of script.
What happens if you put the code on one line?
Code: [Select]
$puts(r3,%_dynamic_rating%)$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(maxdar,10800)$puts(mindar,7800)$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(display,$rgb(150,150,150)$repeat(?,$get(darind3)))$puts(notplayed,$rgb(200,200,200)- n/a -)$ifgreater(%play_count%,0,$get(display) $rgb(200,200,200)$get(darind3),$get(notplayed))
C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: -AdZero- on 2010-10-06 16:28:56
The problem is that I don't know how to create the column with the lines of code that are given in the doc. I know how to create a custom column with a simple pattern on a single line, but not with several lines of script.
What happens if you put the code on one line?
Code: [Select]
$puts(r3,%_dynamic_rating%)$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(maxdar,10800)$puts(mindar,7800)$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(display,$rgb(150,150,150)$repeat(?,$get(darind3)))$puts(notplayed,$rgb(200,200,200)- n/a -)$ifgreater(%play_count%,0,$get(display) $rgb(200,200,200)$get(darind3),$get(notplayed))
C.

I tried to put all script on a single line. The column content is strange...

(http://img831.imageshack.us/img831/9099/darox.png)

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Bollerkopp on 2010-10-06 16:55:07
Hi,

perhaps you might try my modified code with these dots "•". I had problems with the original-code on XP & DUI, too.

Code: [Select]
$puts(r3,%_dynamic_rating%)$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(maxdar,10800)$puts(mindar,7800)$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(display,$repeat(>>>•<<<,$get(darind3))$repeat(<<<•>>>,$sub(10,$get(darind3))))$puts(notplayed,- n/a -)$ifgreater(%play_count%,0,$get(display) $get(darind3),$get(notplayed))


@Carpman:

Thank you very much for the Auto-Rating.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 17:09:17
Thanks for that Bollerkopp.
So DUI has issues with that dot, as well as rgb(etc..) by the looks of it.

I'll make a note for the next release, especially for DUI users.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Robertina on 2010-10-06 17:19:00
The $rgb() syntax is no longer supported by the DUI since foobar2000 v1.0

And I am glad that my recommendations above (both the removal of the word wraps and the use of that pattern as the columns code) have not been wrong.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: -AdZero- on 2010-10-06 17:56:12
Hi,

perhaps you might try my modified code with these dots "•". I had problems with the original-code on XP & DUI, too.

Code: [Select]
$puts(r3,%_dynamic_rating%)$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(maxdar,10800)$puts(mindar,7800)$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(display,$repeat(>>>•<<<,$get(darind3))$repeat(<<<•>>>,$sub(10,$get(darind3))))$puts(notplayed,- n/a -)$ifgreater(%play_count%,0,$get(display) $get(darind3),$get(notplayed))


@Carpman:

Thank you very much for the Auto-Rating.

Thank you !!!

It works fine now.

It may be a good thing to update the documentation in order to avoid further questions about that tricky thing.

P.S. : Thank you to Carpman, Yirkha and of course Peter !
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 18:56:41
It may be a good thing to update the documentation in order to avoid further questions about that tricky thing.

Done: http://www.giantpygmy.net/gpa/data/uploads..._dar_v1.6.4.txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_v1.6.4.txt)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: ojdo on 2010-10-06 21:52:04
OMG. I just realized that the rating algorithm is not hard-coded into the component but can be tweaked myself.
This is the sexiest component in years! Thanks so much Yirkha for implementing it and to carpman for fiddling giving the DADA inspiration.

Now I'm modifying the algorithm for my use case, i.e. unofficial play count without %added% and many long tracks (DJ mixes with 1 to 2 hours length) which get too much attention with the L²/9000 part. Thanks again both! This is such a nice toy!

Yirkha: Do I assume correctly that a %_dynamic_rating% refresh of the currently played track is not possible due to the use of %now% and possible repaint glitches?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Yirkha on 2010-10-06 22:27:16
For example, if I copy some songs to an iPod and play them while jogging, can I easily tell my foobar library and this plugin that I played those songs, without having to actually play them from within foobar?
It depends which playback statistics you use. The DAR rating will reflect whatever stats you have, so this is really a question for the foo_playcount thread. I've already made a suggestion there to be able to reduce playcount by one, perhaps you'd like to ask to be able to add playcount by one.
Well I hear foo_playcount works with foo_dop fine, i.e. the play counts from the iPod are synced into the database when you plug the device in next time.

So DUI has issues with that dot, as well as rgb(etc..) by the looks of it.
I'll make a note for the next release, especially for DUI users.
Regarding the dot, I see it only as a a question mark in you initial and subsequent posts here, so I wonder how else should it look like? The "for DUI" line in the linked .txt has a proper bullet though.
To avoid this kind of issues, maybe it would be better to use [font= "Courier New"]$char(8226)[/font] or similar instead.

Do I assume correctly that a %_dynamic_rating% refresh of the currently played track is not possible due to the use of %now% and possible repaint glitches?
No, possible and coming - see [a href='index.php?act=findpost&pid=724796']my posts in the old DAR thread[/a].
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 23:10:44
Now I'm modifying the algorithm for my use case, i.e. unofficial play count without %added% and many long tracks (DJ mixes with 1 to 2 hours length) which get too much attention with the L²/9000 part. Thanks again both! This is such a nice toy!

Just to let you know that the next release will deal with the very long tracks issue, but sure without %added% I'm sure it'll require some interesting tweaks.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 23:18:19
Regarding the dot, I see it only as a a question mark in you initial and subsequent posts here, so I wonder how else should it look like? The "for DUI" line in the linked .txt has a proper bullet though.
To avoid this kind of issues, maybe it would be better to use $char(8226) or similar instead.

It should look like this:
http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_top10.png (http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_top10.png)

Yikha, how do I look up the appropriate $char number, is there a reference table somewhere?
I'll take your advice and replace the dot with appropriate code, once I've found what I'm after.

Cheers,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Yirkha on 2010-10-06 23:24:52
For example, find the character in Windows Character map, see the value in the bottom-right corner, e.g. U+2022, convert from hex to decimal using your favourite way (http://www.google.com/search?q=hex+to+dec).
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-06 23:59:35
Thanks Yirkha.

Also I found another way, simply paste the symbol direct into the HA forum post box and preview, returns:
&#9679 = $char(9679). Couldn't find it in the Windows Character map. I knew there was a reason I stayed away from such visuals.

Code updated in instructions: http://www.giantpygmy.net/gpa/data/uploads..._dar_v1.6.4.txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_v1.6.4.txt)

Cheers,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-11 17:35:29
Main page updated. Released 1.6.3. (SLT):  Only affects tracks > 60 mins
Quote
  • DAR 1.6.3 - Introduced Super Long Track duration suppression (this only affects songs > 60 mins). The original DAR didn't foresee tracks longer than the duration of a CD. Though rare, such tracks do exist. This update ensures their ratings are not artificially high.
The default code is on the front page (No.2 in the graph below). I've posted a number of alternatives which are explained in the graph below. No.1 is what would be the default if foo_playcount only counted at say 67% played.

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.3_duration_recalibration_SLT.png)

DAR 1.6.3. SLT @ 60 mins - Default (release version - No.2 in graph)

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

DAR 1.6.3. SLT @ 60 mins - Mild (mild duration effect - No.3 in graph)

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),3599,$muldiv(10000,$get(l),3600),10000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

DAR 1.6.3. SLT @ 60 mins - Weak (weak duration effect - No.4 in graph)

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

DAR 1.6.3. SLT @ 90 mins (No.1 in graph - recommended for those who use alternatives to foo_playcount, likely you'd need to change %play_count% to whatever. I'm not going to support this (help wise - i.e. questions about foo_custom_db), but while foo_playcount is like it is, I think users should have an alternative.)

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(d0,$ifgreater($get(l),5399,$muldiv(9000,$get(l),5400),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),135,100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),2000),500,$add($div($get(d3),6),70)),$add($mul($get(pc),$get(pc)),1)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

As always feedback and testing welcome.

C.

EDIT: Grammar/spelling.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-14 13:07:46
Would this work with ELPlaylist? What code would be necessary?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: ojdo on 2010-10-14 13:45:42
Would this work with ELPlaylist? What code would be necessary?

Yes. Code: %_dynamic_rating%. Installation instructions (http://www.giantpygmy.net/sections/pause/archive/dada_autorating_dar_latest_version.txt).
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-14 15:17:31
I think I should have been more specific: I'm trying to display the dynamic ratings in ELPlaylist in the "dots" form. I can't get it to work however. All I get is some random numbers.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-14 15:38:13
I don't know about ELPlaylist, but:
1) Can you post the code you're using, and
2) Does the normal DAR code give proper results? i.e. what range of values are you getting, and
3) When you say random numbers, can you give an example.

That might give me and those who use ELPlaylist more to go on.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-14 15:57:18
1. Code I'm using:

Code: [Select]
$puts(r3,%_dynamic_rating%)
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(maxdar,10800)
$puts(mindar,7800)
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$repeat(•,$get(darind3))$repeat(•,$sub(10,$get(darind3))))
$puts(notplayed,- n/a -)
$ifgreater(%play_counter%,0,$get(display) $get(darind3),$get(notplayed))

2. Yes, I tried using it in a "normal" columns ui playlist and it works, it shows the dots and everything.

3. In ELPlaylist the fields (like title, tracknumber, etc.) are shown using the $drawtext(variable) command. Trying to use the same $drawtext to show %_dynamic_rating% it shows random numbers like 06479, etc. (I guess it is the value returned by DR).

I don't know if it makes any sense, I am no expert on this matter at all. Thank you all for helping me!
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-14 16:08:18
What happens if you use this?:

Code: [Select]
$puts(r3,%_dynamic_rating%)
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(maxdar,10800)
$puts(mindar,7800)
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(150,150,150)$repeat($char(9679),$get(darind3)))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(display) $rgb(200,200,200)$get(darind3),$get(notplayed))
C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-14 16:24:28
It's the same. Actually, I think my problem is in showing the "dynamic rating" info in ELPlaylist. Neither $drawtext not $drawstring work.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-14 16:57:08
Yeah. I'm not familiar with ELPlaylist, but it suggests that it doesn't handle $puts and $gets?
What I can't figure is how when you enter that code it gives the actual numeric DAR rating, seemingly ignoring everything but the %_dynamic_rating% part. Which is odd.

Why not ask on the ELPlaylist thread. In the meantime perhaps a current DAR user may know the answer and post here.

If you do find out let me know and I'll add intructions for it.

Good luck,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-14 17:17:16
What about if you use this as the last line. I'm guessing, but I saw $char() used with $drawtextex.
However, searching for a decent manual for ELPlaylist isn't fun.
Code: [Select]
$ifgreater(%play_count%,0,$drawtextex($get(display) $rgb(200,200,200)$get(darind3)),$drawtextex($get(notplayed)))

If that's no good please go direct to ELPlaylist thread. 

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-15 08:58:48
Actually, I got it working. There was a conflict somewhere else in the code for ELPlaylist. The last line I used is:
Code: [Select]
$ifgreater(%play_counter%,0,$drawtext($get(display) $get(darind3),,,,,,vcenter),$drawtext($get(notplayed),,,,,,vcenter))

Thanks again for helping me and for the great algorithm.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-15 14:44:45
Actually, I got it working. There was a conflict somewhere else in the code for ELPlaylist. The last line I used is...

Static, would you mind pasting the whole DAR (dots) code that you used for ELPlaylist, to be on the safe side?

Glad you got it working. 

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-15 16:12:54
Here it is. It includes green colouring for the dots and also font and alignment options that fit my ELPlaylist setup.

Code: [Select]
///DYNAMIC RATING

$puts(r3,%_dynamic_rating%)
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(maxdar,10800)
$puts(mindar,7800)
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(164,191,71)$repeat(•,$get(darind3))$rgb(190,190,190)$repeat(•,$sub(10,$get(darind3))))
$puts(notplayed,$rgb(190,190,190)- n/a -)
$ifgreater(%play_counter%,0,$get(display) $get(darind3),$get(notplayed))
$ifgreater(%play_counter%,0,$drawtext($get(display)
$font(consolas,8,bold) $rgb(140,160,140)$get(darind3),584,,80,,,vcenter),$drawtext($get(notplayed),604,,80,,,vcenter))

(http://i55.tinypic.com/70gzfc.png)
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-15 16:47:58
Thanks Static.
So in theory, an ELPlaylist user, who was using foo_playcount, could use the following:

Code: [Select]
$puts(r3,%_dynamic_rating%)
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(maxdar,10800)
$puts(mindar,7800)
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,[color=#FF0000]$rgb(164,191,71)[/color]$repeat([color=#FF0000]$char(9679)[/color],$get(darind3))[color=#FF0000]$rgb(190,190,190)[/color]$repeat([color=#FF0000]$char(9679)[/color],$sub(10,$get(darind3))))
$puts(notplayed,[color=#FF0000]$rgb(190,190,190)[/color]- n/a -)
$ifgreater(%play_count%,0,$drawtext($get(display)
[color=#FF0000]$font(consolas,8,bold) $rgb(140,160,140)[/color]$get(darind3),[color=#FF0000]584[/color],,[color=#FF0000]80[/color],,,vcenter),$drawtext($get(notplayed),[color=#FF0000]604[/color],,[color=#FF0000]80[/color],,,vcenter))
... and adjust the "superficial" variables highlighted above to suit their aesthetic sensibilities.
Any ELPlaylist types, who use foo_playcount and want to test this code, I'd be grateful. If this works, I'll link to it from the help file. But due to the number of positioning and display variables I'm tempted to stay well clear.

Thanks again,

C.

EDIT: Used codebox
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Static on 2010-10-15 16:52:13
Yes, that's correct. The code also works with Playback Statistics Custom (foo_playback_custom), as long as %play_count% is replaced with %play_counter% in the original code of Dynamic rating, under the Media Library.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-15 16:58:03
Yep, I'm running a dual test between foo_playcount and foo_playback_custom (with custominfo_sqlite.db). The latter using 67% as played and with the ability to reduce and increase playcounts. So foo_playback_custom has what I would call the actual playcount data, and foo_playcount has a kind of "turbo charged" playcount data. It should give some indication of the distorting effect of foo_playcount.

Thanks again for providing the ELPlaylist solution.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: ScribeOfTheMist on 2010-10-29 13:33:37
Does the duration adjustment have more impact over a large amount of time and plays than it does over a few weeks with a handful of plays?

I've only been keeping play counts for the last few weeks since I got this plugin/script. I have a situation where I have:

(A) a 3-minute track that's been played 3 times has a higher DAR than
(B) a 22-minute track that's been played 2 times.

It seems to me that (B) should get the higher DAR since I've spent 42 minutes playing it as opposed to only 9 minutes with (A). Will the longer length of (B) give its DAR more "staying power" and cause it to eventually have a higher DAR than (A) if I don't touch either track for a few months? If not, what would be the best way to adjust the code so that duration has a greater impact?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-29 14:04:04
From: https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000 (https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000)

Quote
Low Playcounts & Predictability

When tracks have a very low playcount (i.e. < 5) the effects of the low playcount penalty are a dominant factor in the DAR rating scheme. As the playcount increases this effect diminishes quickly (ultimately to zero). It's primary purpose is to spread the rating over a wide range. Furthermore, a track played just once or twice, whether long or short, young or old cannot be said to be a favourite, and with so few plays predicting its popularity is problematic.

Also see: http://www.hydrogenaudio.org/forums/index....st&p=724934 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=83954&view=findpost&p=724934)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: ScribeOfTheMist on 2010-10-29 14:24:48
So in other words, the fact that I just started keeping play counts on a 5 year old library means I'm screwed
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-10-30 01:13:03
I don't get why the age of the library is relevant? I assume the age of the library, as far as the playback stats component is concerned, is from when it was installed.

In the scenario you gave, if you played both tracks once more, you would notice that the longer track has a higher rating. There's a good reason for partly subordinating the main DAR system to playcounts in the very early / initial stages.

If you have a 30 min track and you play it once, but you don't like it, so you never play it again (but it's part of an album you like and for the sake of cohesion, completeness and harmony you leave it in your library), why should that have a higher rating than a new 1 min song that you like and have already played twice? However, if you multiply it up and you've played the 30 min track 5 times but the 1 min track 10 times, that's clearly telling a different story.

Furthermore, if you think in terms of plotting a trend graph, it's very hard to see a trend from 1, 2 or 3 plots. The more playcounts you have the easier this becomes.

As far as you being screwed because you're starting from scratch ...
I started my test from scratch; you'll get meaningful results quicker than you expect. Unfortunately, the DAR does not know you and does not understand your preferences before they are manifest in action. One day this kind of thing might happen, but that will be a very scary day! Perhaps when Google merges with Last.fm. 

C.

EDIT: grammar
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-12 05:16:18
Released DAR version 1.6.4:

New code on first page: http://www.hydrogenaudio.org/forums/index....st&p=724734 (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=83954&view=findpost&p=724734)

Quote
DAR 1.6.4 (12/11/10) - Changed the old track suppression multiplier from a static to a dynamic variable. This reduces the "performance burden" of older tracks with each additional year in the collection. The lib0 variable can be altered for those with very large or small collections. For a library of less than 5000 tracks I'd recommend setting it to 1900 (which will be close to the DAR 1.6.3 default) or 1950. For most the default (2000) will work very well. If you have a large 30k+ library AND you are seeing newer tracks dominating the ratings, try increasing the lib0 to 2001, then 2002 etc... but do not go beyond the age of your oldest track. So, if your stats begin in 2007, the max for the lib0 variable will be 2007. I would suggest that to go to the maximum (i.e. in this example, 2007) would only be appropriate for users with a very large music collection (say, in the 50k+ region).

Relevant part of line to edit: $puts(lib0,$date_diff(2000-01-01 00:00:00)).

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.4_old_age_advantage_suppression_variable.png)

Updated:
Enjoy!
Feedback, questions etc .. most welcome.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-11-12 06:28:37
I don't know if I should bother you with this, but I have a couple songs that are exceptionally "hot" so to speak, and distort the ratings heavily. I'll show you what I mean with pictures since it's hard to explain:

Most of my "hottest" songs end up with ratings in the region of 12000 or so, which is fair, however there are 2 or 3 exceptions and they are songs that I had used as my wakeup ringtone for long periods, in addition to normal listening. This has caused them to get almost infeasibly high ratings. My top 3 is as follows:

(http://snobwall.com/upload/stored/clip_2010-11-12_072010.png)
(http://snobwall.com/upload/stored/clip_2010-11-12_072252.png)
(http://snobwall.com/upload/stored/clip_2010-11-12_072346.png)

I realize that those values are "correct", and that I have listened to those few songs an incredible amount within the period that I've had them. For practical reasons they're troublesome though, since I can't put a good "maxdar" value. Either my entire library (except for those 3 or 4 top songs) will have a rating of 5 or less (out of 10), or the top ratings will peak way above the 10. I picked the latter since it only affect those few songs, and I'd rather have more interesting info about the rest of my library, but I thought maybe you'd want to have a look at it.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-12 06:50:17
Try this:
EDIT: edited the code below. This will be the actual code when I have time to alter front page -- thanks スラッシュ.

Code: [Select]
$puts(maxdar,12700)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),200))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(150,150,150)$repeat($char(9679),$get(darind3)))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(display) $rgb(200,200,200)$get(darind3),$get(notplayed))


It puts a ceiling on the rating of maxdar minus 200 (so 12500). So set the maxdar 100 or so above the sensible "hot ratings" in your collection. Set the mindar to what you currently have.

Actually, I'm glad you posted because it would make sense to do it this way anyway. I'll release a new version, where the user sets the maxdar and this is used to cap the DAR value for the "dots display".  Something like a brickwall limiter for the DAR-dots.

C.

EDIT2: Various edits for clarity.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-11-12 07:08:39
Very cool, thanks for the super fast reply! but it only goes up to 9 now, is that intentional?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-12 07:12:04
Yes, that was how it was designed, but if you want it to go to 10 (I assume), change the first few lines to:

Code: [Select]
$puts(maxdar,12500)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))

That should do it.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-11-12 07:14:09
Actually 9 is perfectly fine too! I didn't consider that I had sort of chosen my own maximum as a result of those weird outliers...
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-13 03:02:16
Updated the instructions document to include a number of display alternatives for the DAR Index:
http://www.giantpygmy.net/gpa/data/uploads..._dar_v1.6.4.txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_v1.6.4.txt)

Includes 2 versions for CUI, 1 for DUI and a currently playing track indicator ...
The major functional improvement is that now you don't have to worry about those rogue, outlying, anomalies that got a rating of 50000 because you used them as an egg timer, a substitute looped backing to your Jane Fonda exercise DVD and whatever other weirdnesses you service with glorious music. i.e. I've put a ceiling on the dots, so anything above the max you set will get the max dots or stars or whatever characters you end up using.


II. DAR INDEXED RATING (WITH DOTS)

1. For Columns UI (CUI) users: max 10 dots

Settings: Set the maxdar to the minimum value that will achieve 10 dots, all ratings above that will get the maximum 10 dots. 8000 is likely appropriate for the mindar setting, but this is something that you may need to play around with.
Display: A rating of 6 will show 6 dark grey dots with 4 trailing light grey dots.

Code: [Select]
$puts(maxdar,11000)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(10,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(display),$get(notplayed))

2. Alternative for Columns UI (CUI) users: max 9 dots with number

Settings: Set the maxdar to 200 above the minimum value that will achieve the maximum 9 dots. 8000 is likely appropriate for the mindar setting, but this is something that you may need to play around with.
Display: A rating of 6 will show 6 dark grey dots (with no trailing light grey dots) followed by the number 6.

Code: [Select]
$puts(maxdar,11200)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),200))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(150,150,150)$repeat($char(9679),$get(darind3)))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%play_count%,0,$get(display) $rgb(200,200,200)$get(darind3),$get(notplayed))

3. For Default UI (DUI) users: max 10 dots with number

Settings: Set the maxdar to the minimum value that will achieve 10 dots, all ratings above that will get the maximum 10 dots. 8000 is likely appropriate for the mindar setting, but this is something that you may need to play around with.
Display: A rating of 6 will show 6 dark grey dots (with no trailing light grey dots) followed by the number 6.

Code: [Select]
$puts(maxdar,11000)$puts(mindar,8000)$puts(maxsub,$sub($get(maxdar),0))$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(display,$repeat($char(9679),$get(darind3)))$puts(notplayed,- n/a -)$ifgreater(%play_count%,0,$get(display) $get(darind3),$get(notplayed))

4. As a currently playing track indicator (CUI, possibly DUI):

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.4_dar_index_now_playing.png)

Non-playing tracks will show, for example, "Artist - Title" (or whatever titleformatting you set), however, the currently playing track will show the DAR indexed rating with a maximum of 10 dark grey dots followed by "Artist - Title". If you'd rather have this out of 5 dots, you can change the "$puts(darind2 ..." line from 10 to 5.

Set your titleformatting track display for your (probably left-most) column in the "trackinfo" line below (3rd line down).

Code: [Select]
$puts(maxdar,11000)
$puts(mindar,8000)
$puts(trackinfo,[color=#FF0000]%artist% - %title%[/color])
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$repeat($char(9679),$get(darind3)))
$puts(notplayed,$char(9679)  first play >)
$puts(rateplay,$ifgreater(%play_count%,0,$get(display),$get(notplayed)))
$puts(noplay,$get(trackinfo))
$puts(play,$get(rateplay) $get(trackinfo))
$ifgreater(%isplaying%,0,$get(play),$get(noplay)))

Thanks to スラッシュ and other posters in this thread who've got me thinking about this display issue.
Please let me know if there's anything that doesn't work properly.

Thanks,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-11-13 06:52:27
Ooh, you made one that's just like mine! Except your code is way neater, since I added lots of crap with colors and so on  On the plus side, I can now distinguish between a 10 and a 10++!

Also, I just realized why some of my songs have "- n/a -", but still have a ranking anyway: it's cause I use Playback Statistics Custom! So I should've replaced %play_count% with %play_counter% in the dot script.

Which leads me to a question: since I'm using Playback Statistics Custom with a "completion" rate of 75%, does that affect my scores in any significant way, or is the "default" script just fine? I've been reluctant to update the main script since you previously marked the old script as the best for people who use a system where it marks the playcount at 75%.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-13 07:12:28
Also, I just realized why some of my songs have "- n/a -", but still have a ranking anyway: it's cause I use Playback Statistics Custom! So I should've replaced %play_count% with %play_counter% in the dot script.

Yes, correct.

Which leads me to a question: since I'm using Playback Statistics Custom with a "completion" rate of 75%, does that affect my scores in any significant way, or is the "default" script just fine? I've been reluctant to update the main script since you previously marked the old script as the best for people who use a system where it marks the playcount at 75%.

The default script is absolutely fine, in fact the default settings are intentionally calibrated for a sane playcount system (i.e. one that counts played at 50%, 67%, or 75%). There are variables that can be tweaked to cater for the kind of distortions that the current official playcount stats method naturally introduces.

So yes, it's completely safe to go with the new version (and any subsequent ones I release).

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Skibbi on 2010-11-16 16:59:07
I'm thinking to setup this plugin on my foobar. But I'm wondering if it's possible to use this plugin in the following scenario. I like to listen at work ripped radioshows with *.cue files. So basically I listen the tracks only once per radioshow. But some tracks are common to multiple radioshows. In my understanding these common tracks should get more popular than the other. But playcount plugin counts by:
Quote
Playback statistics are now pinned to a combination of artist + album + disc number + track number + track title information

And radishows album is tagged usually as "name - episode" so each track will have always unique combination of tags. Is it possible to use DAR in the following scenario?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-11-16 17:57:08
Simple answer is if fb2k can read the cue and distinguish individual tracks and they are tagged in such a way that foo_playcount also sees them as unique, then so will DAR.

But unless I've misunderstood you, you've answered the question yourself:
And radishows album is tagged usually as "name - episode" so each track will have always unique combination of tags. Is it possible to use DAR in the following scenario?

Yes. I don't see why not.
Just check that foo_playcount gives different values to each of the tracks in the cue sheet, if it does, DAR will too.

C.

EDIT:
Quote
But some tracks are common to multiple radioshows

Oh I see, so you are saying that the same track could have the following names:
Radio Show X - Track X1
Radio Show Y - Track Y5

This is not a DAR issue, but more a UID / play stats issue. The only solution to something like this is what odyssey has suggested, a UID based on foo_biometrics / audio content signature (CRC) rather than tags / filename. At present, I don't see a way (outside of renaming) for these uniquely named tracks to be treated as one.

Hope that helps,

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Skibbi on 2010-11-16 19:13:36
That I was afraid of. It's too bad that playcount cannot be configured to count tracks by artist - trackname only. I was looking for something like offline last.fm stats. Anyway thanks for clearing this.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2010-11-16 22:23:16
If you can use last.fm, then you can actually make foobar get the stats from last.fm using marc2003's awesome script (http://www.hydrogenaudio.org/forums/index.php?showtopic=76772). You'll just have to adjust the DADA script to use the stats as downloaded from last fm, but it's straightforward.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Skibbi on 2010-11-16 22:57:07
Yes I saw that script, but I was looking for full offline solution.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Nixdagibts on 2010-12-05 09:47:55
I post my request here like cartman suggested.

I'm missing an option in foo_dynfil where I can put in a pattern like:
- %album% or %genre% or $directory_path(%path%)
Normally this should also be your grouping pattern in columnsUI

With this option set foo_dynfil should only calculate ratings within this pattern

Why: Lets presume I have a 10-dots rating column and two albums A and B each with 3 songs.
I played album A only on December 2009 with song1, song2 and song3. They get high ratings 4,5 and 9 dots.
In June 2010 i only played album B and all 3 respective songs get high ratings. In the same time all 3 songs of album A are getting lower ratings.
Over time they only have 1 dot. In December 2010 I like album A again and want to see 'hey, what was this great song here last year'
But thats now impossible. The good rating range of a 4,5 and 9 dots are gone.


You see what I mean? Maybe some users don't want this generel calculation and want to divide this into several sections
I know that most users want exactly this behavior where ratings are calculated over whole database.
With this in mind this option should be empty by default so nothing changes on upgrading for other users.

Maybe this is already possible: If so a little option field and a hint would be great.


Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-12-05 10:12:50
I post my request here like cartman suggested.
carpman.

Yes, I'm still puzzled.
a) I don't understand the bit about patterns and foo_dynfil. Calculating with this pattern:
Quote
%album% or %genre% or $directory_path(%path%)
Surely just means everything gets calculated? I'm confused.

b) You seem to want the rating to not change over time. Is that correct?

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Nixdagibts on 2010-12-05 10:43:26
Ah I missed a detail:
- lets say I choose as pattern %album%
- If only song1 from album A was recently played, then only album A should be recalculated.
Other albums should stay with their ratings. Seems not useful to you, right?


My main thought was to get a wide range of dots calculated per album.

PS: Aren't you developing foo_dynfil together with Yirkha?

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2010-12-05 11:04:19
PS: Aren't you developing foo_dynfil together with Yirkha?

No, Yirkha is entirely responsible for foo_dynfil. It's probably confusing because he's appended its development related posts to my old "foo_DAR" thread. I imagine pretty soon, he will give it its own thread.

You're better off posting foo_dynfil related queries here:
http://www.hydrogenaudio.org/forums/index....2864&st=200 (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864&st=200)

However, there may be a problem with what you're asking, in that most title formatting / calculations are track based, and not album based. i.e. AFAIK you can't have a %number_of_tracks_in_this_album% field. So I imagine you wouldn't be able to have a %latest_played_track_in_this_album% kind of question. I may be wrong though.

That said, isn't this what static manual ratings are made for?
You could use DAR to determine each month which tracks you give 5 stars etc ... then it's fixed while the DAR rating slowly declines.

Additionally you could, based on certain criteria:
Right click > Tagging > Manage Scripts > "format values from other fields"
Destination:  DARFIXED
Formatting pattern:  %_dynamic_rating%

Then [untested] have $if(%darfixed%,%_dynamic_rating%) in your DAR dots code.

Just some thoughts.

C.

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-01-26 19:07:47
@ Nixdagibts

re. your post (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864&view=findpost&p=741026)
Try this:

Code: [Select]
$puts(maxdar,11000)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(10,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$get(display),$get(notplayed))
This will give "- n/a -" for played tracks outside the library.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Nixdagibts on 2011-01-26 19:28:26
Simple and clean.  Thank you.
I would suggest to use this as default since it solves a little cosmetic problem?

PS: This is my customized column code.
It displays dots within the same column as title, shows dots on all non-playing files but hides them on a playing file for readability.
Longer titles are shown as marquee.

Code: [Select]
$puts(len,23)
$puts(title, [%title%])

$iflonger($get(title),$get(len)
,$puts(diff,$sub($len($get(title)),$get(len)))
$puts(start,$add(1,$mod(%_time_elapsed_seconds%,$get(diff))))
$puts(start2,$select($add($div($add(1,$mod( %_time_elapsed_seconds%,$mul($get(diff),2))),$add($get(diff),1)),1),$get(start),$sub($add($get(diff),1),$get(start))))

$substr($get(title),$get(start2),$add($get(start2),$get(len)))
,$get(title))

$puts(maxdar,11000)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$repeat($char(9679),$get(darind3)))
$puts(rateplay,$ifgreater(%_dynamic_rating%,0,$get(display),))

$if(%isplaying%,,$tab()$blend($rgb(200,200,200),$rgb(100,100,0),$get(darind3),5)$get(rateplay))
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-01-26 23:08:23
Simple and clean.  Thank you.
I would suggest to use this as default since it solves a little cosmetic problem?

Yes, I agree. When I wrote the code I actually thought foo_playcount was limited to library items and foo_dynfil was not. So I've learnt something new. I'll update when I have more time.

Many thanks.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Jack_x2yz on 2011-01-29 04:21:02
Hey man, I was wondering if you could tell me how you made the "last played" column in this picture.

, however if it's just a component and a bit of code, could you help me out please!
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-01-29 14:02:25
Jack_x2yz

EDIT: I assume you've already got playback stats (i.e. foo_playcount) installed, if so ...

Download this component:
http://yirkha.fud.cz/progs/foobar2000/foo_...l-v1-beta-3.zip (http://yirkha.fud.cz/progs/foobar2000/foo_dynfil-v1-beta-3.zip)

Once installed:

1) In foobar2000 go to: File > Preferences > Media Library > Dynamic Fields
2) Click on the + button, and type "last_played_display" [or what ever you want to call the field] (without the inverted commas)
3) Paste the code below (and only the code) into the blank "Title Formatting Expression" box.
4) Set the recalculation interval, then
5) Click "Okay" and "Okay" again and foobar2000 will restart.
6) Create a custom column and enter: %_last_played_display% (note the %_underscore at the beginning)

Code: [Select]
$if(%last_played%, $puts(diff,$date_diff(%last_played%)) $ifgreater(1,$get(diff),Today, $ifgreater(2,$get(diff),Yesterday, $get(diff) days ago)),-- no info --)


Alternatives:

Reflection's code:
Code: [Select]
$if(%last_played%,$puts(x,$date_diff(%last_played%)), Never Played)
$ifequal($get(x),0,$if(%last_played%,Today,),$get(x) day$ifgreater($get(x),1,s,) ago)

Yirhka's code:
Code: [Select]
$puts(x,$date_diff(%added%))$ifequal($get(x),0,today,$get(x) day$ifgreater($get(x),1,s,) ago)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Jack_x2yz on 2011-01-29 15:16:05
much thanks kind sir!
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: pIv on 2011-02-04 12:11:10
Jack_x2yz

EDIT: I assume you've already got playback stats (i.e. foo_playcount) installed, if so ...

Download this component:
http://yirkha.fud.cz/progs/foobar2000/foo_...l-v1-beta-3.zip (http://yirkha.fud.cz/progs/foobar2000/foo_dynfil-v1-beta-3.zip)

Once installed:

1) In foobar2000 go to: File > Preferences > Media Library > Dynamic Fields
2) Click on the + button, and type "last_played_display" [or what ever you want to call the field] (without the inverted commas)
3) Paste the code below (and only the code) into the blank "Title Formatting Expression" box.
4) Set the recalculation interval, then
5) Click "Okay" and "Okay" again and foobar2000 will restart.
6) Create a custom column and enter: %_last_played_display% (note the %_underscore at the beginning)

Code: [Select]
$if(%last_played%, $puts(diff,$date_diff(%last_played%)) $ifgreater(1,$get(diff),Today, $ifgreater(2,$get(diff),Yesterday, $get(diff) days ago)),-- no info --)


Alternatives:

Reflection's code:
Code: [Select]
$if(%last_played%,$puts(x,$date_diff(%last_played%)), Never Played)
$ifequal($get(x),0,$if(%last_played%,Today,),$get(x) day$ifgreater($get(x),1,s,) ago)

Yirhka's code:
Code: [Select]
$puts(x,$date_diff(%added%))$ifequal($get(x),0,today,$get(x) day$ifgreater($get(x),1,s,) ago)

C.


In this code "Today" is "Last 24 hours" and "Yesterday" is "24 hours after "Last 24 hours""
My answers:
1. It is possible print "Today" if  %last_played% = "current date" only, not yesterday date in "Last 24 hours" ?
2. It is function for current date and time?

If it is than write script with true "Today"  possible.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-02-04 18:43:23
@pIv

I'd like to keep this thread related to the DADA Auto-Rating formula. This is a general scripting + foo_dynfil question.
In short I don't know the answer to this. Having looked at the extended help in the foo_dynfil component, I don't see how it's possible. Perhaps others can figure a solution?


@Yirkha

There seems to a bit of "cross-thread confusion" between the foo_DAR thread (i.e. the foo_dynfil thread) and this one. IMO the sooner you create a foo_dynfil thread and the sooner we can shut down the foo_DAR thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=62864&view=findpost&p=561251) the better.

ps. Is there anything still to be done on foo_dynfil?

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2011-02-04 20:06:10
I came across that problem as well (I believe it's an inherent limitation of $date_diff, I wasn't sure if it was intentional or not so I didn't think it'd be right to complain), so I hacked into Reflection's code to show "Just now, 1-24 Hours, Yesterday, # Days, Never". I also made the output be just plain numbers so I could affect it with $rgb code in my column.

Should I post that here, or in foo_DAR, or wait for a new thread? I know it's off topic for DADA, but here's where people are discussing it... And foo_DAR is kinda dodgy too.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-02-04 21:31:14
Post it in the foo_DAR thread. Basically, this is related to Yirkha's component (and that foo_DAR thread is its de facto home right now), without which this stuff wouldn't be possible.

I'm sure Yirkha will create a new thread for all this stuff at some point, but until then, if it's not related to DAR ratings then that old foo_DAR thread is the one.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: スラッシュ on 2011-02-04 22:07:31
Quote from: re: last played column link=msg=0 date=


I also had this issue, and as far as I could tell there was no way around this (a limitation of $diff_date, I believe). So I hacked into Reflection's code for some adjustments. My version displays it as "Just now, 1-24 Hours, Yesterday, # Days, Not played". It also comes out as plain numbers so you can use it to do $rgb commands based on how high the value is.

My dynfil was called %_LastPlayed%, but you can use whatever.

The code is REALLY messy, and I barely have any idea how I put it together... Sorry. I have a bad coding style.

foo_dynfil code:
Code: [Select]
$if(%last_played%,$puts(x,$date_diff(%last_played%)),-1)
$ifequal($get(x),0,$if(%last_played%,

$ifequal($num($div($time_diff(%last_played%),3600),1),0,0,

$sub($mul($num($div($time_diff(%last_played%),3600),1),-1),50)

)

,),$get(x)$ifgreater($get(x),1,,))


Column code (didn't both with "ago". This way it's less wide... 35 width is enough now)
Code: [Select]
// Color commands

$rgb($ifgreater(200,$mul(3,%_LastPlayed%),$mul(3,%_LastPlayed%),200),$ifgreater(200,$mul(3,%_LastPlayed%),$mul(3,%_LastPlayed%),200),$ifgreater(200,$mul(3,%_LastPlayed%),$mul(3,%_LastPlayed%),200))

// Actual code


$ifgreater(%_LastPlayed%,-49,

$ifequal(%_LastPlayed%,-1,$rgb(223,234,244)Never,
$ifequal(%_LastPlayed%,0,Just now,$ifequal(%_LastPlayed%,1,Yesterday,%_LastPlayed% Days))),
$ifequal($mul(-1,$add(50,%_LastPlayed%)),1,1 Hour,


$mul(-1,$add(50,%_LastPlayed%)) Hours

)

)


The color commands will make the value more grey as it becomes older, and real light blue when it's never been played. But this is obviously related to my layout, so you may want to play around with the actual values (or remove it altogether).

It should look a bit like this:


(http://i.imgur.com/SDyVI.png)
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Durian on 2011-02-13 20:05:40
Hello there  , I'm wondering if there's a way to make the autoplaylist with the dar show only the first 10-20 tracks with the highest punctuation.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-02-14 01:19:45
Good question, and I don't know the answer (though I suspect it's no). However, you can for example, do:

Code: [Select]
%_dynamic_rating% GREATER 10000

with force sorted sort pattern:

Code: [Select]
$sub(99999,%_dynamic_rating%)

If anyone knows how to "limit no. of entries to no more than x" in an autoplaylist, I'd also like to know.
In the meantime, I hope that helps.

EDIT1: See this thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=74387&view=findpost&p=654093) for a similar request (looks like it's not possible).

EDIT2: Might be possible with this component (http://www.hydrogenaudio.org/forums/index.php?showtopic=64623), though haven't tried it myself.

Hopefully a foo_playlist_tree_mod user may chime in.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: sollniss on 2011-02-19 12:33:49
In reference to this: http://www.hydrogenaudio.org/forums/index....st&p=744335 (http://www.hydrogenaudio.org/forums/index.php?showtopic=86853&view=findpost&p=744335)

What I want:
(http://www.wuala.com/de/api/preview/sollniss/stuff/foo2.jpg)
What I get:
(http://www.wuala.com/de/api/preview/sollniss/stuff/foo1.jpg)
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-02-19 19:36:41
Well, I tested your slightly modified script and it works fine for me. When you mentioned the "tag %_dynamic_rating_10%" did you mean "field" or are these values actually written to tags?

If this is a field, is it generated by foo_dynfil? Because it works as standalone code, so it doesn't need foo_dynfil.

Try this code in Preferences > Media Library > Album List > Add new >
Code: [Select]
$puts(maxdar,10000)$puts(mindar,5000)$puts(maxsub,$sub($get(maxdar),0))$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(notplayed,n/a)$ifgreater(%play_count%,0,$get(darind3),$get(notplayed))

I imagine the problem comes from foo_dynfil referencing one of its own generated fields (maybe, maybe not - once this is resolved I'll put this to Yirkha).

EDIT: This might be more useful:
Code: [Select]
$puts(maxdar,10000)$puts(mindar,5000)$puts(maxsub,$sub($get(maxdar),0))$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(notplayed,n/a)$ifgreater(%play_count%,0,$get(darind3),$get(notplayed))|%title%
C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: sollniss on 2011-02-19 21:41:25
Yes, with tag I meant field, sorry.

Your second code works like a charm, thanks. I guess I made the mistake of putting the code into a field and using the field as album list view instead of the code itself.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2011-02-20 22:52:24
MINOR UPDATES:
C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Durian on 2012-09-07 02:00:37
How can I show the dar with decimals? I mean, 6.x instead of just 6 (with or without the dots)
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-08 04:35:24
The DAR rating is a 5 digit number from 00001 to 99999. No need for decimals.
However, it sounds like you're talking about the dots display code. If so, try the code below:

Settings:

Set the maxdar to the minimum value that will achieve 100 (i.e. 10 without the decimal point), all ratings above that will get the maximum 100.
8000 is likely appropriate for the mindar setting, but this is something that you may need to play around with.
Display:  A rating that would have achieved 6 dots will now get 060 to 069 (I think!)' less than 1 will come out as 001 to 009.
Hope that makes sense.

Code: [Select]
$puts(maxdar,10200)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),100),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$num($get(darind3),3),$get(notplayed))

If you want it to only go from 01 to 99 (i.e. 0.1 to 9.9) then use:
Code: [Select]
$puts(maxdar,10200)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),100),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$num($sub($get(darind3),1),2),$get(notplayed))
Try that. As far as decimal places go - not sure if it's possible.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Durian on 2012-09-12 00:44:13
Thanks, that worked almost as I wanted It... I was indeed hoping for [6.9, 10.0 etc..] instead of 069 or 100, but that's just perfect...

BTW, thanks for this component, It's more useful than manual rating ñ_ñ
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-12 01:10:19
Yes, %Title Formatting% code (as the name implies) was never designed to do maths, so my view is we're lucky that we can do as much as we can with it.
Thanks for the compliment. Yes, the problem I have with manual ratings is that tastes (and thus subjective rankings must) change over time.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: EpicForever on 2012-09-19 20:10:49
One sinmgle question - do I have to use and have installed "Media Library" component to make this work ? I don't use and I don't want to use any Media Library mechanism.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-22 02:57:48
From 1st Post in thread:

2. REQUIREMENTS:

foobar2000 v.1+ (http://www.foobar2000.org/download)
foo_playcount.dll (the offical Playback Statistics plugin) (http://www.foobar2000.org/components/view/foo_playcount)
foo_dynfil.dll (the host for the DAR algorithm) (http://yirkha.fud.cz/progs/foobar2000/foo_dynfil-v1-beta-4.zip)  [Warning! Read this post (http://www.hydrogenaudio.org/forums/index.php?showtopic=86853&view=findpost&p=744320) before installing]

These are the only components required.

C.

EDIT: Just read your auto rating thread (http://www.hydrogenaudio.org/forums/index.php?showtopic=97067&view=findpost&p=809106), and see you meant foobar2000's media library (part of foobar2000's core, no?). Looks like WilB and db1989 cleared everything up.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: EpicForever on 2012-09-22 09:35:12
My personal research gave me following results:

1. DAR doesn't work when Media Library component is not installed*
2. Auto rating formula given by WilB works without Media Library installed.

* I haven't read everything about DAR so I am not sure if my examination wasn't to short accordingly to algoritm that DAR utilizes. Additionally DAR code goes to sub-menu of Media Library options in menu, created by foo_dynfil component. I am not sure if I understood correctly, but it looks like foo_dynfil works only with files from Media Library? I think I've read somewhere that dynamic fields require Media Library... In this case ML would be also a requirement...
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: MyMaster on 2012-09-23 00:34:30
I'M USING DADA TO AUTO RATE MY MUSIC BUT I HAVE SOME QUESTIONS.

HOW CAN I REMOVE THE ADVANTAGE THAT IS GIVEN TO LONGER TRACKS?  I DON'T GET IT.  AREN'T ALL TRACKS CONSIDERED PLAYED AFTER 60 SECONDS?

EXAMPLE:
IF I SKIP A 3:40-TRACK AFTER 1:20 IT IS CONSIDERED PLAYED.  SAME THING WITH A 15:30-TRACK AFTER 1:20, STILL CONSIDERED PLAYED.  SO, WHY GIVE AN ADVANTAGE TO LONGER TRACKS?


ANOTHER THING:  IS IT POSSIBLE TO PENALIZE (EVEN MORE???) TRACKS THAT HAVEN'T BEEN PLAYED FOR A LONG TIME?



THANK U
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: tpijag on 2012-09-23 00:56:17
Please do not shout with all caps.

Developer spent quite a bit of effort in explaining his concepts behind DADA. You certainly can disagree, however may be advantageous to read it.The Why to your question (http://www.giantpygmy.net/sections/pause/archive/dada_autorating_dar_latest_version.html)
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: MyMaster on 2012-09-23 01:08:06
I READ IT BEFORE POSTING.  STILL DON'T GET IT.  IT WOULD MAKE PERFECT SENSE THE WAY IT IS NOW IF PLAYCOUNT WAS CALCULATED AFTER SONGS WERE PLAYED IN FULL, BUT IT ISN'T.  ALL IS REQUIRED TO INCREASE PLAYCOUNT IS 60SECS.  SHORT TRACKS AND LONGER TRACKS HAVE THE SAME PROBABILITY TO BE PLAYED OR SKIPPED IN SUCH A SHORT PERIOD.

IN MY OVER 30,000 TRACKS COLLECTION LONGER TRACKS SEEM FAVORED VS. SHORTER TRACKS EVEN WHEN THEY'RE NOT ACCORDING TO MY PLAYING HABITS.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: tpijag on 2012-09-23 01:20:07
Just a heads up, if you did not know it, the algorithm is not hard-coded and can be adjusted. Not be me, though you could have a look at the code. it is not very long.

Caps really are difficult to read and are perceived as yelling. Please consider standard case usage.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-23 05:23:51
@ MyMaster -- as per tpijag, no more CAPS!

I'm busy with work at present - so I can't go into this in depth. Everything I'm saying is actually covered in this thread (I'd read the whole thread to get a good idea of the code and its workings):

1) What you're talking about really is a limitation of foo_playcount and I've brought this up numerous times (i.e. considering a 45min track played after 1 min, is like leaving a film after 2 mins and saying you've seen it).

2) This is the essence of the duration calculation:

Quote
((%length_seconds% + 540) * 0.25)
Notice if you put 180 (i.e. 3 mins) into that you get 180, if you put anything less it will gain and anything more will lose. So all track durations move to some degree toward 180 secs.


Here's the bit of code we're talking about (I've bolded the variable you could play with):

Quote
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Have a look at this graph (notice top left is the part of the code you need to edit, and some alternative are even offered up -- see the key to the right) -- the graph shows their effect of ratings)

(http://www.giantpygmy.net/stuff/dar/DAR_v1.6.2_duration_recalibration.png)

If you want to completely cancel the effect of duration, which kind of defeats the point of DAR, then simply change this line of code:

From:
Code: [Select]
$puts(l,%length_seconds%)


To:
Code: [Select]
$puts(l,180)


If you want to weaken the effect of duration, try:
EDIT: This is the "Very Weak Duration Effect" (in the graph above):

Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))


Also read this:
http://www.giantpygmy.net/gpa/data/uploads..._dar_v1.6.4.txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_v1.6.4.txt)

ps. You were lucky -- this didn't take too long.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-23 05:41:58
Also MyMaster see this post:
http://www.hydrogenaudio.org/forums/index....st&p=731183 (http://www.hydrogenaudio.org/forums/index.php?showtopic=83954&view=findpost&p=731183)

This may also be of interest:

Quote
DAR 1.6.4:
Changed the old track suppression multiplier from a static to a dynamic variable.
This reduces the "performance burden" of older tracks with each additional year in the collection.
The lib0 variable can be altered for those with very large or small collections.

For a library of less than 5000 tracks I'd recommend 1900 (which will be close to the DAR 1.6.3 default) or 1950.
For most the default (2000) will work very well.

If you have a large 30k+ library AND you are seeing newer tracks dominating the ratings,
try increasing the lib0 to 2001, then 2002 etc... but do not go beyond the age of your oldest track.
So, if your stats begin in 2007, the max for the lib0 variable will be 2007.
I would suggest that to go to the maximum (i.e. in this example, 2007) would only be appropriate for users
with a very large music collection (say, in the 50k+ region).

Relevant line to edit: $puts(lib0,$date_diff(2000))


C.

Title: DADA Auto-Rating (DAR) for foobar2000
Post by: MyMaster on 2012-09-25 19:29:46
@ MyMaster -- as per tpijag, no more CAPS!

I'm busy with work at present - so I can't go into this in depth. Everything I'm saying is actually covered in this thread (I'd read the whole thread to get a good idea of the code and its workings):

1) What you're talking about really is a limitation of foo_playcount and I've brought this up numerous times (i.e. considering a 45min track played after 1 min, is like leaving a film after 2 mins and saying you've seen it).

2) This is the essence of the duration calculation:

Quote
((%length_seconds% + 540) * 0.25)
Notice if you put 180 (i.e. 3 mins) into that you get 180, if you put anything less it will gain and anything more will lose. So all track durations move to some degree toward 180 secs.


Here's the bit of code we're talking about (I've bolded the variable you could play with):

Quote
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Have a look at this graph (notice top left is the part of the code you need to edit, and some alternative are even offered up -- see the key to the right) -- the graph shows their effect of ratings)

(http://www.giantpygmy.net/sections/pause/archive/img/DAR_v1.6.2_duration_recalibration.png)

If you want to completely cancel the effect of duration, which kind of defeats the point of DAR, then simply change this line of code:

From:
Code: [Select]
$puts(l,%length_seconds%)


To:
Code: [Select]
$puts(l,180)


If you want to weaken the effect of duration, try:
EDIT: This is the "Very Weak Duration Effect" (in the graph above):

Code: [Select]
$puts(l,%length_seconds%)
   $puts(lib0,$date_diff(2000))
   $puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
   $puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
   $puts(d1,$muldiv($add($get(l),720),1,5))
   $puts(d2,$muldiv($get(l),$get(l),$get(d0)))
   $puts(d3,$add($get(d1),$get(d2)))


Also read this:
http://www.giantpygmy.net/sections/pause/a...est_version.txt (http://www.giantpygmy.net/sections/pause/archive/dada_autorating_dar_latest_version.txt)

ps. You were lucky -- this didn't take too long.

C.


thank you for the explanation on how to "fix" it.  much appreciated.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2012-09-27 09:09:07
For those having similar issues to MyMaster:

Here's some duration code replacements (just paste over relevant section of existing code):

Weak Duration Effect (see Graph Above)

Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(10000,$get(l),3600),10000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Very Weak Duration Effect (see Graph Above)

Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),720),1,5))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Extremely Weak Duration Effect

Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),900),1,6))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Super Weak Duration Effect

Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),1080),1,7))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))



Mega Weak Duration Effect


Code: [Select]
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(d0,$ifgreater($get(l),3599,$muldiv(20000,$get(l),3600),20000))
$puts(d1,$muldiv($add($get(l),1260),1,8))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))


C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2013-04-09 06:38:32
Since this kind of thing affects DAR ratings I've linked to a recent post to find "foo_playcount duplicates" (which may not be duplicates - for me I had 6 - and if you like Baroque composers it's pretty easy - unless you put the catalogue no., if there is one, in the title or stick with the CD track numbering --- neither of which I do, but that's me).

Finding foo_playcount tag (i.e. not path) duplicates, Excel sheet to save anyone else the bother
http://www.hydrogenaudio.org/forums/index....st&p=830592 (http://www.hydrogenaudio.org/forums/index.php?showtopic=100336&view=findpost&p=830592)

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2013-10-20 04:19:36
GPA site (and thus DAR info page) moved/updated and thus all the links changed (html to php).
http://www.giantpygmy.net/gpa/index.php?id=dada-autorating (http://www.giantpygmy.net/gpa/index.php?id=dada-autorating)

MODS: I'm taking the old site offline so I took the liberty of preemptively "repairing" (updating) the soon to be broken links in a few of the earlier posts in this thread - no other content was changed.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-01-27 10:07:22
CHANGES TO DAR CODE (prior to release as v.1.7.0)

LOW PLAYCOUNT PENALTY EQUATION ALTERATIONS

With over 6 years of playcount stats to play with, something had begun to bother me with the existing DAR formula:

So I've made, what I hope is a significant improvement to the "Low Playcount Penalty" part (http://www.giantpygmy.net/gpa/index.php?id=dada-autorating#penalty) of the DAR formula.


EFFECTS OF THE NEW LOW PLAYCOUNT EQUATION ON THE OVERALL DAR RATINGS


Here's the maths:

(http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v1.7.0_low_playcount_penalty_old_vs_new_equation.png)


Here's the difference between the new and old penalties in isolation:

(http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v1.7.0_low_playcount_penalty_old_vs_new_penalty_effect.png)


And here's the effect on the overall DAR rating:

(http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v1.7.0_low_playcount_penalty_old_vs_new_dar_effect.png)


Here's the new code to cut and paste:

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(lib2,135)
$puts(pc1,$add($get(pc),2))
$puts(pc3,$mul($get(pc1),$get(pc1),$get(pc1)))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),$get(lib1),100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),5000),500,$add($div($get(l),20),140)),$add($div($get(pc3),58),3)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)



Below I've highlighted the parts of the code that have been added (GREEN) and altered (RED).

Quote
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(lib2,135)
$puts(pc1,$add($get(pc),2))
$puts(pc3,$mul($get(pc1),$get(pc1),$get(pc1)))

$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),$get(lib1),100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),5000),500,$add($div($get(l),20),140)),$add($div($get(pc3),58),3)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$ifgreater($get(pc),0,$num($get(r4),5),-----)



So far I've not added this to the site (http://www.giantpygmy.net/gpa/index.php?id=dada-autorating) or the first post (http://www.hydrogenaud.io/forums/index.php?showtopic=83954) of this thread, so it's "unofficial". But I've been running this for a little while and IMO the ratings are better and the issues I outlined at the beginning have been resolved.

Finally, in my case I found I needed to drop the "mindar" part of the DAR Index code by about 1000.
Code: [Select]
$puts(mindar,5000)


As always, any and all feedback greatly appreciated.

C.

EDIT: !!! Important !!! made changes to code and graphs. If you've already started testing the code please use the updated code in this post. Explanation to follow.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-01-27 20:43:28
CODE & GRAPHS UPDATED ABOVE

I'm running a test parallel to my full library to simulate what happens for a new user of both foo_playcount and DAR Auto-Rating - i.e. how quickly do results start to make some kind of sense. This test highlighted a minor problem with the new version due to the way foobar2000 rounds numbers (always down). In short this meant the new penalty didn't decrease going from a playcount of 1 to 2 (after that it was fine). I always get caught out when going from Excel to foobar2000. Anyway it's now fixed.

I've modified the equation so the numbers come out pretty much the same, except now there's a more even distribution to the penalty reduction over playcounts 1 to 5.
And foobar2000 more closely mirrors Excel.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: mobyduck on 2015-02-01 18:04:27
Hi carpman and thank you for your work.

I tried your suggestion, but now all my songs have a single dot.

I think the problem is perhaps in my CUI column code. I haven't touched it for years and I'm not sure how should I modify it: could you have a look?
Code: [Select]
$puts(maxdar,11200)
$puts(mindar,8000)
$puts(maxsub,$sub($get(maxdar),200))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(0,128,128)$repeat($char(9679),$get(darind3)))
$puts(notplayed,$rgb(200,200,200) n/a)
$ifgreater(%_dynamic_rating%,0,$get(display),$get(notplayed))

Also I'd like to ask you if the 8th line of your new code ($puts(lib2,135)) is really needed, as I can't see lib2 used anywhere else and was not present in previous version.

Regards.

Alessandro
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-02-01 18:43:22
Funny that you posted this problem. I've just finished an updated release that will resolve such problems.

In terms of the  ($puts(lib2,135)). That was to do with making the old track suppression multiplier a dynamic variable (http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v1.6.4_old_age_advantage_suppression_variable.png).  I left the old code there to make it easy to switch back to the previous version should anyone wish to do so.
So, indeed you can delete that line of code. 

Alessandro can you do me a favour and use the following DAR code and then tell me what your min and max DAR values (not number of dots) are (your min value may be minus - I'll explain all this later):

Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(pc1,$add($get(pc),2))
$puts(pc3,$mul($get(pc1),$get(pc1),$get(pc1)))
$puts(b1,0)
$puts(b2,$add($div($get(b1),100),500))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),$get(lib1),100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),5000),$get(b2),$add($div($get(l),20),140)),$add($div($get(pc3),58),3)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$add($get(r3),$get(b1)))
$ifgreater($get(pc),0,$num($get(r4),5),-----)


To give you an example mine are:

MAX = 10550
MIN = 4692

Simply, the above code takes the floor out of the rating - so it can give you a minus figure.

Thanks,

C.

EDIT: minor edit for clarity
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: mobyduck on 2015-02-01 20:17:33
Alessandro can you do me a favour and use the following DAR code and then tell me what your min and max DAR values (not number of dots) are
I created a new CUI column displaying %_dynamic_rating%. If this is enough to get the values you requested, then the range on 4500 tracks is 01113 - 08395 (plus a couple of songs never played, hence without rating - there I see -----).

Cheers.

Alessandro
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-02-01 20:55:12
Alessandro

Thanks. You're a perfect test case for the new release.
Use the code below (DAR 1.7.0  -- to be released in the next few days) and then change the top 2 lines of your DAR Index values to:

$puts(maxdar,18000)
$puts(mindar,10000)

or

$puts(maxdar,17000)
$puts(mindar,9000)


Code: [Select]
$puts(pc,%play_count%)
$puts(x,$add($date_diff(%added%),2))
$puts(y,$date_diff(%added%,%last_played%))
$puts(z,$sub($get(x),$get(y),2))
$puts(l,%length_seconds%)
$puts(lib0,$date_diff(2000))
$puts(lib1,$div($add($mul($sub(100,$div($date_diff(%added%),$div($get(lib0),100))),15),2600),30))
$puts(pc1,$add($get(pc),2))
$puts(pc3,$mul($get(pc1),$get(pc1),$get(pc1)))
$puts(b1,10000)
$puts(b2,$add($div($get(b1),100),500))
$puts(d0,$ifgreater($get(l),3599,$muldiv(9000,$get(l),3600),9000))
$puts(d1,$muldiv($add($get(l),540),1,4))
$puts(d2,$muldiv($get(l),$get(l),$get(d0)))
$puts(d3,$add($get(d1),$get(d2)))
$puts(r0,$mul($add(1000,$muldiv($get(d3),$get(pc),100)),10))
$puts(dd,$div($add($get(y),50),10))
$puts(pp,$muldiv($get(pc),10000,$get(x)))
$puts(2,$muldiv($get(dd),$get(pp),100))
$puts(3,$muldiv($get(x),$get(lib1),100))
$puts(4,$div($get(pp),50))
$puts(5,$div($muldiv($add($date_diff(%added%,%first_played%),5000),$get(b2),$add($div($get(l),20),140)),$add($div($get(pc3),58),3)))
$puts(6,$muldiv($get(pc),625,$get(x)))
$puts(7,$add($get(3),$get(5),$get(6)))
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r3,$sub($get(r2),$div($mul($get(r2),$get(l),$get(z),$get(pc)),500000000)))
$puts(r4,$add($get(r3),$get(b1)))
$ifgreater($get(pc),0,$num($get(r4),5),-----)


Here's the DAR Index code I use in CUI with the suggested variables:

Code: [Select]
$puts(maxdar,18000)
$puts(mindar,10000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),10),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(10,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$get(display),$get(notplayed))


Then let me know how that works.
The new version will be explained in a future post, but simply it removes the floor on the rating and allows for an across the board boost to all ratings to keep them positive.

An analogy:

The per track DAR Ratings works like fish swimming up stream. Time is the stream's flow and each play is the energy the track (fish) requires to move against the flow. However, if one listens to some music only rarely and their library is old; that's the equivalent of the fish getting too tired. The floor on the ratings is like a dam. Over time all these old tired fish will get pushed up against the wall of the dam. The new DAR formula allows users to move the dam down stream. Thus all these old fish now have miles of river before they hit the (now imaginary) dam (since the floor has been removed - the dam is just where ratings go negative). The athletic fish (the tracks you play a lot) will now be even further from the dam (have a higher rating) than they already were. This can be done numerous times, effectively extending the ratings game decades into the future.

All this will be laid out in detail in a future post and will be the new code released as 1.7.0. For now you can be the guinea pig.

Let me know if you get sensible results.

ps. Nothing else about the ratings mechanics has changed. I've tested the code and it works well.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: mobyduck on 2015-02-01 21:18:17
Thanks. You're a perfect test case for the new release.
You're welcome: glad to help.
let me know how that works.
I copied your code and quickly glanced at my library: now I have my ratings (yay!) but I see only 18 tracks with 1 dot. I'm not saying it's wrong, but it strikes me as odd. If I set min/max at 9000/17000 it's even worse: only 4 tracks with 1 dot. Thoughts?

Also, I'd prefer the scale on 5 dots instead of 10 (simply for space reasons): do you think that would not be enough to accurately represent ratings? Or is it doable?

Thanks again.

Alessandro
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-02-01 21:54:18
Keep increasing the mindar value on the 2nd line of the DAR Index code by 1000 (or 500) until you get the number of 1 dots you want:

$puts(mindar,11000)

Try this code for 5 dots only:

Code: [Select]
$puts(maxdar,18000)
$puts(mindar,11000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),5),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(5,$get(darind3))))
$puts(notplayed,$rgb(200,200,200)- n/a -)
$ifgreater(%_dynamic_rating%,0,$get(display),$get(notplayed))


Here's the lines I've changed:

Quote
$puts(darind2,$div($mul($get(darind1),5),$get(minmax)))

Quote
$puts(display,$rgb(100,100,100)$repeat($char(9679),$get(darind3))$rgb(220,220,220)$repeat($char(9679),$sub(5,$get(darind3))))

C.

EDIT: Forgot to change both lines of code. This should work now.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-02-01 22:08:05
Alessandro

In regard to the DAR Index. There's no right or wrong and it will be different for everyone. It's merely done by indexing (to 10 or 5) the DAR Rating number having set an upper and lower bound. So the upper means anything equal to or higher will get 10 (or 5 depending on the index value). The DAR Index is just a way to express the ratings in a more general and user friendly (at a glance) way.

EDIT:
Also you may find in 3 years time it's necessary to change the mindar and maxdar values. They're a moveable feast and users should set them purely according to what makes sense to them.

EDIT2:

As a general rule for min and max DAR Index values:

You may want to do this every 2 or 3 years.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-02-05 12:24:57
NEW VERSION RELEASED

DAR 2.0.0:

- Major upgrade to the Low Playcount Penalty.
- Removed the floor from the ratings system and added a simple Auto-Boost mechanism (on by default).
- Simplified and improved the robustness of the Fall Rate Mechanism which defines how fast tracks fall when not played.


LINKS
Enjoy!

If you're in a hurry, probably the most important and interesting read is this:
https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000#-The-Floor,-the-Fish-&-the-Auto-Boost (https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000#-The-Floor,-the-Fish-&-the-Auto-Boost)

As always, any feedback, questions etc ... most welcome.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-04-06 21:21:07
UPDATE RELEASED

DAR 2.0.1:

- Fixed a minor error in the Fall Rate Mechanism (since 2.0.0) which defines how fast tracks fall when not played. Users should see an uptick in the ratings of low rated tracks that haven't been played for a while.

The Fall Rate is connected to "days since last played". Think of it like a weird gravity: The higher the rating the faster the track falls back down when not being played, this is a "weak force" (ho ho), but aids in the recycling of tracks at the top. i.e. to stay top of the pops you have to get played. As a track falls out of favour, its rating drops, and as its rating drops so does the rate at which it falls. That's the Fall Rate Mechanism. Which is now fixed. 

For those who have altered parts of their code, here's the section of the code you can cut and paste over the top (r1 to r4 + last line):

Code: [Select]
$puts(r1,$add($get(2),$get(r0)))
$puts(r2,$add($get(4),$sub($get(r1),$get(7))))
$puts(r2a,$ifgreater($get(r2),0,$get(r2),1))
$puts(r3,$sub($get(r2),$div($mul($get(r2a),$get(z),3),50000)))
$puts(r4,$add($get(r3),$get(b1)))
$ifgreater($get(pc),0,$num($get(r4),5),-----)

The full code is here:
https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt (https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt)

Or the first post of this thread:
http://www.hydrogenaud.io/forums/index.php...st&p=724734 (http://www.hydrogenaud.io/forums/index.php?s=&showtopic=83954&view=findpost&p=724734)

Sorry for any inconvenience.

C.

EDIT: Grammar
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: slcc2c on 2015-06-16 18:49:37
Has anyone played around with a way to make it so that if a song already has a rating that is displayed instead of the dynamic rating?
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-06-17 01:47:49
Hi slcc2c

The code below (assuming you already have DAR setup and can call %_dynamic_rating%) will give you a number between 1 and 5. How you choose to show that number (i.e. as stars etc..) is up to you and others here will have more expertise on that. But simply, if you have given your track a %rating% > 0 it will show that, if it is NOT > 0 it will show the  %_dynamic_rating% as an indexed number between 1 and 5.

As always with DAR Indexing the min and max values in lines 1 and 2 below, will determine the spread of values. For more info go here:
https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000 (https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000)

Code: [Select]
$puts(maxdar,10000)
$puts(mindar,5000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),5),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,- n/a -)
$puts(dardisplay,$ifgreater(%_dynamic_rating%,0,$get(darind3),$get(notplayed)))
$ifgreater(%rating%,0,%rating%,$get(dardisplay))

Hope that helps.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-06-19 01:30:13
These versions include the display code. As per pic below (but with 5 dots):

(http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v2.0.0_dar_index_dots.png)


Columns UI

Code: [Select]
$puts(maxdar,10000)
$puts(mindar,5000)
$puts(maxsub,$sub($get(maxdar),0))
$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))
$puts(r4,$ifgreater($get(r3),0,$get(r3),1))
$puts(minmax,$sub($get(maxdar),$get(mindar)))
$puts(darind1,$sub($get(r4),$get(mindar)))
$puts(darind2,$div($mul($get(darind1),5),$get(minmax)))
$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))
$puts(notplayed,- n/a -)
$puts(dardisplay,$ifgreater(%_dynamic_rating%,0,$get(darind3),$get(notplayed)))
$puts(value,$ifgreater(%rating%,0,%rating%,$get(dardisplay)))
$rgb(100,100,100)$repeat($char(9679),$get(value))$rgb(220,220,220)$repeat($char(9679),$sub(5,$get(value)))


Default UI


Code: [Select]
$puts(maxdar,10000)$puts(mindar,5000)$puts(maxsub,$sub($get(maxdar),0))$puts(r3,$ifgreater(%_dynamic_rating%,$get(maxsub),$get(maxsub),%_dynamic_rating%))$puts(r4,$ifgreater($get(r3),0,$get(r3),1))$puts(minmax,$sub($get(maxdar),$get(mindar)))$puts(darind1,$sub($get(r4),$get(mindar)))$puts(darind2,$div($mul($get(darind1),5),$get(minmax)))$puts(darind3,$ifgreater($get(darind2),1,$get(darind2),1))$puts(notplayed,- n/a-)$puts(dardisplay,$ifgreater(%_dynamic_rating%,0,$get(darind3),$get(notplayed)))$puts(value,$ifgreater(%rating%,0,%rating%,$get(dardisplay)))$repeat($char(9679),$get(value))$repeat(<<<$char(9679)>>>,$sub(5,$get(value)))

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: slcc2c on 2015-06-19 06:06:12
I cannot even express how much I appreciate the help. That is the exact functionality I want.
However, having your working code may have exposed what was broken about mine.
For some reason my %rating% tag is totally busted. (http://content.screencast.com/users/Spork76/folders/Jing/media/74fcc849-d21b-4264-abbb-3706f21b55db/2015-06-18_2356.png)
RATING however still works. (http://content.screencast.com/users/Spork76/folders/Jing/media/afff7100-28c0-4d00-b12c-b08ae7742e15/2015-06-19_0000.png)
Here are some screens displaying my issue.
Any thoughts at all? I posted this in the playback stats thread as well.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2015-06-19 06:26:54
I'm no expert on the %rating% tag stuff, but what I can say, is that when I right click on a file, select properties I don't have anything under Metadata. To see the %rating% info, I have to go to the Properties Tab. There, under Playback Statistics is where I see Rating.

So I imagine, this might be the issue. How did you tag %rating%? If you did it with Playback Statistics then I'd have thought all would be fine.

What I suggest is that you test this with one file. For example, take the track in the picture. It has a Rating tag = 4.
Right click on the file > Playback Statistics > Rating > Select 4

Then see what happens. If nothing then, Right Click > Properties > Metadata Tab > Highlight "Rating" and Delete. Then see if you get the correct display.

C.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2015-06-19 07:12:43
Chances are it's related to foo_playcount taking over rating (http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Components/Playback_Statistics_v3.x_(foo_playcount)#Common_sources_of_confusion). Solution is to use either %rating% or $meta(rating) depending on what you want to access.
Title: DADA Auto-Rating (DAR) for foobar2000
Post by: slcc2c on 2015-06-19 14:05:23
Thank you so much. $meta(rating) no longer works. I changed my keyboard shorcut to use playback statistics instead of quicktagger and now I am good to go.
It looks great and I have the exact functionality I have been looking for.

I set it up to where the 5 star summary is a column in facets and %_rating% is a new dynamic field using the 1-5 output algorithm you provided. Now I can find all tracks with a real or dynamic rating above a certain level!
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: zoumbro on 2017-02-10 11:33:10
Hello guys,

I need to do smg. I would like to have my folder Media library stucture sorted as followed:

folders sorted from most played to less played using the DAR filter.
Is it possible?
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-02-10 14:17:19
Two problems I can see with this idea:

1) DAR and Playcount both work on a per track basis and so are not suitable for aggregating a bunch of tracks
2) DAR is a method to nullify (to a certain extent) the degree to which playcount dominates the definition of "popular track". So for example a track that is 10 years old and has been played 50 times does not necessarily rank higher than a track played 20 times that you've had in your library for 1 year,

Sorry I can't be more helpful - but I don't see how this can be done. My only positive suggestion is that perhaps, something like this may be possible with foo_uie_sql_tree (https://hydrogenaud.io/index.php/topic,90978/topicseen.html). I'd ask on that thread.

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-04 18:50:40
Just a minor (admin) update

Had a big clean-up over at gp-net (http://www.giantpygmy.net/gp/) (home of the DADA Auto-Rating algo). GP Audio had loads of now out-dated (how-to / analysis type) stuff and so there was a vicious cull with only 2 survivors (http://www.giantpygmy.net/gpa/?id=blog&tag=gpa), one of which was of course DAR and the page dedicated to it has been updated and cleaned up and is now more user-friendly.

It's also moved, but the old links (http://www.giantpygmy.net/gpa/index.php?id=dada-autorating) still should work:
http://www.giantpygmy.net/gpa/index.php?id=blog&post=dada-music-auto-rating-algorithm-foobar2000

No updates required on the code - I've been running it with now close to 10 years of playcount stats and I'm getting sensible results and no anomalies have popped up to cause concern - so it appears all is well. Also, pleasing to see it's still being used (https://resir014.github.io/etc/fb2k/) by people - so that's good. 

Will likely provide some graphs to show the overall effect on a 10 year old library when the time comes.

If anyone spots mistakes, broken links or anything strange - please let me know - either here or via the contact page (http://www.giantpygmy.net/gp/?id=contacting-gp-net) on gp-net.

Thanks,

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: 2tec on 2017-10-04 22:19:07
First off, thanks, it looks great. I'd change "maths" to math, otherwise perfect. An awesome component and effort!
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-04 22:43:33
Thanks 2tec.  Maths - yeah, it's a UK thing (http://grammarist.com/spelling/math-maths/):

Quote
Math and maths are equally acceptable abbreviations of mathematics. The only difference is that math is preferred in the U.S. and Canada, and maths is preferred in the U.K., Australia, and most other English-speaking areas of the world.
Cheers (also a UK thing)

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2017-10-05 20:16:48
Thanks for the updates carpman.

I'd be curious to hear if you gathered any further thoughts on modifying $puts(lib0,$date_diff(2000)) over the years or your original suggestions (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_latest_version.txt) still hold true today.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-05 22:29:46
Excellent question! Short answer: Everything still holds for today.

Long answer: The reason is that it's designed to work on a very large range and so although we're now in 2017 the question remains, how big is your library and when did you begin gathering playcount stats. The 2000 baseline number (which was chosen because stats cannot predate foobar2000) will work for the majority of people and won't need to be changed - even if one starts collecting stats in 2017. All it does is allow some fine tweaking to those users who have very small or very large collections. As you know, it's about the recycling speed of tracks - so small libraries will recycle tracks much quicker than large ones. As time passes it just allows the tweaking slider to slightly grow in length. It's really there for users who are noticing a dominance of either new or old tracks - and especially for those who have vast libraries - old tracks, rarely recycled through the playback cycle, might need a boost and they can incrementally raise the 2000 value toward the year (but not beyond) that when they began collecting stats. So no, nothing has really change, since for example, the date one starts collecting stats remains static.

Good question.

C.

EDIT: What does change over time, is that it allows new users with new libraries and a recent stat collecting starting point a little more leeway (a slightly longer slider) than those of us oldies who have stats that date back to the 2000's.  So you could imagine a volume slider that every year grows by 0.01. So after 10 years a new user can turn his music up to 10.1 - that doesn't mean they should. In this case they probably shouldn't. These were all things anticipated and tested for in the very long excel modelling phase.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2017-10-05 23:07:42
I understood how it works, I was mostly just curious if the actual values were possibly slightly off or which values would be considered extreme (naturally it's kind of a subjective topic).  Guess the more straightforward question would be is what value did you personally settle on (considering whatever sized library you have), with the disclaimer that naturally everyone should pick it for themselves. Thanks for the explanation though.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-05 23:53:53
I've settled on the default = $puts(lib0,$date_diff(2000)).
For context my music library is approx 10,000 tracks (small?) and playcount stats started August 2008.

I think the advice in the txt (http://www.giantpygmy.net/gpa/data/uploads/files/dada_autorating_dar_latest_version.txt) file you linked to is pretty relevant still.

What would be really interesting is to see a poll done with foobar2000 users library sizes (I know I've seen some people with more tracks than is possible to listen to in a human lifetime - not sure what that's about - dopamine?)

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-06 00:22:06
Just in case people don't know what Daeron's talking about, it may be helpful to explain:

One of the time-based calculations in the DAR formula deals with old tracks (e.g. tracks that have been in your library since you started collecting stats). There is a downward force on the rating caused by the passing of time (playcount / time passed). However over time this downward force can be made to diminish giving some relief to the old track's age burden - and that is what this variable does.

The reason it can be tweaked is that some people recycle tracks quicker than others (if you have a massive library the time it takes to play each track once is much greater - and thus the age burden of older tracks needs to be lifted - and vice versa for very small music collections).

What is important of course is that in alleviating this downward force you don't create an upward force, since that would mean tracks benefit simply by virtue of the fact they're getting older (no one likes a song more by not playing it).  And that is why the variable needs to be capped at the age of the library. So if your oldest track added date is 2015, then $puts(lib0,$date_diff(2016)) would create anomalies.

Hope that helps those less familiar with DAR's inner workings than Daeron.  ;)

C.

(http://www.giantpygmy.net/gpa/data/uploads/images/pause/DAR_v1.6.4_old_age_advantage_suppression_variable.png)
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2017-10-06 08:04:07
@ Daeron

Just to give you a little better idea of the outcome of the lib0 variable which is an input to the lib1 calculation which provides a dynamic variable that affects the date based side of the DAR calculations.

As you can see below we have 2 tracks (one 3000 days old in red, and the other 245 days old in green). You'll notice that a lib0 of 1900 (which is the lowest acceptable value) is not so different from 1950. As we approach the year the library stats began (in my case 2008) the curve begins to steepen for the old track, whereas the new track is barely affected. 

(http://www.giantpygmy.net/stuff/foo_DAR/foo-DAR-lib0-to-lib1-variable-outputs1.png)

So if you look at the default lib0 of 2000 there's a 22 point difference between the old and new tracks, if we bump that up to 2008 (max) that difference is 39. 

The bar chart (2nd y axis) shows the (adjusted) age relation of these two tracks. So, with a lib0 of 1900 the old track is 12 times as old (which is close to reality = 12.2), but when we switch the lib0 to 2000 (default) the track is treated as 10.2 times as old, at lib0 2008 the track is treated as just 8.7 times as old. So clearly the "playcount / time period" burden is going to be reduced and the older track's rating will rise as you bump up the lib0 variable. 

Hope that helps flesh out the lib0 and gives you a better feeling for how to adjust it for your library.

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2017-10-07 03:31:20
Thanks for the further explanation, it was helpful. And indeed a poll of library sizes would be interesting. A statistical analysis of how the dynamic ratings are distributed for each individual person perhaps even more so. Would be nice to see some people religiously listening to a small subset of tracks while others barely chewing through new tracks every day and so on.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Der Internet on 2020-04-09 14:58:39
what can i try if foobar freezes on startup with foo_dynfill?

seems to be relatated to my media library..without it its starts fine
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2020-04-09 23:19:38
In my experience the calculations take time and foobar freezes for the duration of it if you have a large enough library. The problem is worsened by each new dynamic variable you add.

This isn't really related to DADA/DAR also, just the foo_dynfil component, so this is a bit off-topic.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Der Internet on 2020-04-10 13:44:39
sorry you're absolutely right - i wasn't patient enough ( it just takes forever) + it's the wrong topic
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2020-04-10 20:34:26
@ Der Internet

Just out of interest, how many tracks in your library?  Approx.

Also @ Daeron

I haven't been keeping up to date with foobar2000 changes recently. Are you aware of any issues running Yirkha's foo_dynfill component on the latest releases?  Slower or faster (any issues?).

Thanks,
C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2020-04-11 02:54:50
~150k tracks. Still on v1.4.3 since 1.5 has its own issues regarding the reworked Properties window.

I'm not aware of anything that specifically made foo_dynfil slower, I suspect its just the amount of tracks it has to cope with now. But this is all anecdotal.

Would be nice if there was a way to cache the calculations. For all I care it could even write to actual tags.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Der Internet on 2020-04-12 13:26:59
i have ~25k tracks. but it seems that only the initial scan takes so long, after that it's better. i don't see any changes with newer foobar versions :)
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2020-04-12 16:54:29
Interesting - thanks for the info.

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2020-08-05 01:26:31
Just a minor (admin) update

Been doing some house-keeping and in the process of streamlining things moved the DADA Auto-Rating info page.

It's new home is here:
https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000

I've updated the OP on this thread, so all the links, as well as some important links in intermediary posts have been updated.
Don't know if people still use this, but I do, so ....

The instructions / code file is now here:
https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt

No updates required on the code - I've been running it with over 10 years of playcount stats and I'm still getting very sensible results.
Any important broken links or annoyances, let me know.

Cheers, 

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: gryph0n on 2022-02-04 14:15:51
Like EpicForever had noted much earlier, the default workflow for this excellent script works only if you are using the Media Library.
Like him, my music is already organized by folders, and I do not have any utility for the Media Library.

It is possible to make the DADA scripts work without the Media Library, with 'dirty hack', using 'foo_playcount' & Custom columns.
I believe one disadvantage of this hack/mod is that the Custom column is probably only evaluated at Foobar2000 start-up. So if you play a track a few times, after starting foobar2k, it's rating/dots will not change until foobar2k is restarted. For me, this is an acceptable limitation.

Steps to install:

Explanation of the 'mod'
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2022-03-17 05:51:46
Just a minor (admin) update

The home of the DADA Auto-Rating info page (Studio) has been / is being updated, and so I've updated the key links in this thread  to keep the majority of content alive.  All that's changed are the URLs from xxxxx/gptxt/xxxxxx to xxxxx/studio/xxxxxx.

It's new home is here:
https://www.giantpygmy.net/studio/?post=dada-music-auto-rating-algorithm-foobar2000

The instructions / code file is now here:
https://www.giantpygmy.net/studio/data/uploads/files/dada_autorating_dar_latest_version.txt

No updates required on the code - I've been running it for way too many years now and I'm still getting very sensible results, so I must have done some good guessing along the way.
 
Any important broken links or annoyances, please let me know.

Cheers, 

C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2023-09-23 01:13:20
Now that we have foo_skipcount, perhaps this could be integrated into DADA to tank the score of tracks as their %skip_count% increases?
https://hydrogenaud.io/index.php/topic,124741.0.html

Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: carpman on 2023-09-23 02:39:25
A long, long time ago (2008) the SKIP function was initially integrated in DAR (as the skip component worked with an unofficial playback-statistics component (CUI only?).  However, it was dropped and the reasoning, IIRC was reasonably sound:
See:  https://hydrogenaud.io/index.php/topic,62864.msg566241.html#msg566241
and :  https://hydrogenaud.io/index.php/topic,63287.0.html

A philosophical discussion on the meaning of hitting next.

Ultimately, all this would be moot, if a component recorded total listening time on a per track basis instead of playcount.  But that never happened.  DAR was really created in the hope that some day a component would record that, because then you get a good notional playcount by dividing total listening time by track length.  This then sorts out the penalty requirement for a skip (if there should be one at all).

This is all a long time ago.  I still use foobar2000 and DAR, but I'm so busy on other stuff - I'd only even think about going back to adapt the code, if we had a component that dealt with total track listening time.

Hope that helps,
C.
Title: Re: DADA Auto-Rating (DAR) for foobar2000
Post by: Daeron on 2023-09-23 03:01:38
Makes sense. DADA still works pretty well (has been using it a long time) and I doubt the addition of skips would significantly change the behavior so I didn't find it worthwhile to try to rework it myself, but asked just in case someone has more interest/time for it. I agree that tracking total time spent listening on a per track basis would be the way to go if we ever got that functionality.