DADA Auto-Rating (DAR v.1.6.4) for foobar2000 v.1.1+ Changelog 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)) 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. I. SETUP INSTRUCTIONS If you've previously installed (foo_dynra), firstly uninstall it (remove it from foobar2000's component directory). [For new users] After you've installed foobar2000, foo_playcount.dll, foo_dynfil 1) In foobar2000 go to: File > Preferences > Media Library > Dynamic Fields 2) Click on the + button, and type " dynamic_rating " (without the inverted commas) 3) Paste the code below (and only the code) into the blank "Title Formatting Expression" box. 4) Set the "Aggregation Type" (this isn't very important and can be left on the default setting, basically it effects how the field is reported when multiple tracks are selected in viewers such as the selection info viewer (DUI) and the properties dialog (context menu > properties > properties tab in CUI). 5) Set the recalculation interval, then 6) Click "Okay" and "Okay" again and foobar2000 will restart. 7) Create a custom column and enter: %_dynamic_rating% (note the %_underscore at the beginning) 8) If you haven't already played some tracks (i.e. you haven't got any playback stats) do so, then: 9) Incase the library hasn't done its initial calculation, go to: Library > "recalculate dynamic fields", foo_dynfil will do this according to the recalculation interval set earlier. $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(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%),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),-----) ************************************************************************ II. DAR INDEXED RATING (WITH DOTS) If you want a visual reprentation of the DAR results (i.e. dots) as per this screenshot: http://www.giantpygmy.net/sections/pause/archive/img/DAR_v1.6.2_top10.png Then create a custom column in foobar2000 and enter the following code: 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. $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)) 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. $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(%_dynamic_rating%,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. $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(%_dynamic_rating%,0,$get(display) $get(darind3),$get(notplayed)) 4. As a currently playing track indicator: Non-playing tracks will show, for example, "Artist - Title", 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). $puts(maxdar,11000) $puts(mindar,8000) $puts(trackinfo,%artist% - %title%) $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(%_dynamic_rating%,0,$get(display),$get(notplayed))) $puts(noplay,$get(trackinfo)) $puts(play,$get(rateplay) $get(trackinfo)) $ifgreater(%isplaying%,0,$get(play),$get(noplay))) ************************************************************************ III. MAKING AN AUTOPLAYLIST RANKED BY DAR To create an autoplaylist ranked according to the DAR algorithm: 1) Go to: Library > Search > and paste: " %_dynamic_rating% GREATER 0 " (without the inverted commas) into the search box. 2) Click on the [...] button and select: "Create Autoplaylist" 3) Right click on the New Playlist and select "Autoplaylist properties" 4) Enter " $sub(99999,%_dynamic_rating%) " in the box as per this screenshot: http://www.giantpygmy.net/sections/pause/archive/img/DAR_v1.6.2_autoplaylist_properties.png ************************************************************************ That's it. Hope you enjoy the results! Any feedback, questions etc., please go to the DAR thread at Hydrogen Audio: http://www.hydrogenaudio.org/forums/index.php?showtopic=83954 [END]