Skip to main content
Topic: DADA Auto-Rating (DAR) for foobar2000 (Read 55568 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

DADA Auto-Rating (DAR) for foobar2000

Reply #100
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!

DADA Auto-Rating (DAR) for foobar2000

Reply #101
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

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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #102
much thanks kind sir!

DADA Auto-Rating (DAR) for foobar2000

Reply #103
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

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.

DADA Auto-Rating (DAR) for foobar2000

Reply #104
@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 the better.

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

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #105
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.

DADA Auto-Rating (DAR) for foobar2000

Reply #106
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #107
[quote author=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:



DADA Auto-Rating (DAR) for foobar2000

Reply #108
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.

DADA Auto-Rating (DAR) for foobar2000

Reply #109
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 for a similar request (looks like it's not possible).

EDIT2: Might be possible with this component, though haven't tried it myself.

Hopefully a foo_playlist_tree_mod user may chime in.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)


DADA Auto-Rating (DAR) for foobar2000

Reply #111
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #112
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.
The very act of observing, influences what happens.

DADA Auto-Rating (DAR) for foobar2000

Reply #113
MINOR UPDATES:
  • Updated first post of this thread due to latest foo_dynfil release, see "2. Requirements", and
  • Also amended all versions of the DAR Index (Dots) code as per this post, see setup instructions txt file (this also includes additional instructions due to changes in foo_dynfil).
  • Minor updates to the DAR page (getting DAR working in foobar2000).
C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #114
How can I show the dar with decimals? I mean, 6.x instead of just 6 (with or without the dots)

DADA Auto-Rating (DAR) for foobar2000

Reply #115
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #116
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 ñ_ñ

DADA Auto-Rating (DAR) for foobar2000

Reply #117
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #118
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.

DADA Auto-Rating (DAR) for foobar2000

Reply #119
From 1st Post in thread:

2. REQUIREMENTS:

foobar2000 v.1+
foo_playcount.dll (the offical Playback Statistics plugin)
foo_dynfil.dll (the host for the DAR algorithm)  [Warning! Read this post before installing]

These are the only components required.

C.

EDIT: Just read your auto rating thread, and see you meant foobar2000's media library (part of foobar2000's core, no?). Looks like WilB and db1989 cleared everything up.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

DADA Auto-Rating (DAR) for foobar2000

Reply #120
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...

DADA Auto-Rating (DAR) for foobar2000

Reply #121
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

DADA Auto-Rating (DAR) for foobar2000

Reply #122
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

DADA Auto-Rating (DAR) for foobar2000

Reply #123
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.

DADA Auto-Rating (DAR) for foobar2000

Reply #124
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.

 
SimplePortal 1.0.0 RC1 © 2008-2019