Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Auto Rating options in foobar 0.9.6.* (Read 11471 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Auto Rating options in foobar 0.9.6.*

I fount auto rating plugin (foo_auto_rating) that use playback statistics (foo_playcount) to determinate rating of tracks bat it is not working for foobar 0.9.6.8. Is there any other plugin for this usage or can someone help me to create some script for this purpose based on playback statistics plugin which will increment rating of track on every 50 or other numbers of playing and if track is not played for some time, example for 10 days, it will decrement rating? Something like this is done in DarkOne theme for foobar.

Auto Rating options in foobar 0.9.6.*

Reply #1
You can try with hotness algorithm:

- this script (if you are CUI user)
- this (if you are DUI user + you'll need additional component as mentioned in link)

Then add new playlist column for rating, and add this as code:

[font= "Lucida Console"]$rgb(0,0,0,0,0,0)
$if(%rating%,$repeat(★,%rating%)$rgb(224,224,224,255,255,255)$repeat(★,$sub(5,%rating%)),
$rgb(160,160,192)
$puts(autorating,$div($add($get_global(hotness),10),20))
$repeat(★,$get(autorating))$rgb(224,224,224,255,255,255)$repeat(★,$sub(5,$get(autorating)))
)
)[/font]
[/size]

If you are DUI user you'll need to put the linked script on top of above code, and if you are CUI user place the linked script in "Globals > Variables tab" and tick on "make date info available" in Globals

You can change the number 10 in red lined code to something that suites you more, or delete it (but then you'll never have 5 star match). You can also change the color: in above example it's black stars for offical playcount rating and some violet color for autorating

Auto Rating options in foobar 0.9.6.*

Reply #2
Does this work in ELPPlaylist too (like for Xchange, Curcao..)?

Auto Rating options in foobar 0.9.6.*

Reply #3
@2E7AH :I managed to get 'hotness' to work in DUI but this rating code is not working for me in DUI

Auto Rating options in foobar 0.9.6.*

Reply #4
After you've put linked code (from hotness thread), append the above code lines. Only change [font= "Courier New"]$get_global(hotness)[/font] to [font= "Courier New"]$get(hotness)[/font] (the red marked line)

You can make hotness globally available this way, so it will be easier to access and you can use it for autoplaylist or anywhere.

Auto Rating options in foobar 0.9.6.*

Reply #5
I am quite new to foobar.
DUI seems to accept only single line scripts, I tried to use your code but all I get is hotness value followed by lots of zeros & fffs.

How do I append this ?

Auto Rating options in foobar 0.9.6.*

Reply #6
Then make the code in one line and try again

Alternatively, use suggestion from previous post (there are screenshots, just follow them) and add column with this simple code:

Code: [Select]
$rgb(0,0,0,0,0,0)$if(%rating%,$repeat(★,%rating%)$rgb(224,224,224,255,255,255)$repeat(☆,$sub(5,%rating%)),$rgb(160,160,160,64,64,64)$puts(autorating,$div($add(%HOT%,4),20))$repeat(☆,%autorating%)$rgb(224,224,224,255,255,255)$repeat(☆,$sub(5,%autorating%)))

Auto Rating options in foobar 0.9.6.*

Reply #7
I forgot that DUI doesn't support colors in playlist view. You can use this instead:

Code: [Select]
$if(%rating%,$repeat(★,%rating%)$repeat(  ,$sub(5,%rating%)),$puts(autorating,$div($add(%HOT%,4),20))$repeat(☆,%autorating%)$repeat(  ,$sub(5,%autorating%)))

Empty stars are for autorating, and black stars are for rating:


[edit] Here is also screenshot for CUI:

Auto Rating options in foobar 0.9.6.*

Reply #8
Hi

would you mind sharing your whole config, I think you're using the hotness algorithm for the %title% colour too, am I right?
and the "small playcount numbers" are cool too

thanks
-Chris

Auto Rating options in foobar 0.9.6.*

Reply #9
Hi, chiwou 

This is from title column:
[font= "Courier New"]$get_global(info_text)
[%track artist% :: ]
$get_global(default_text)
$if2(%title%,%_filename_ext%)
$get_global(info_text)
$if(%play_count%,$replace(%play_count%,0,⁰,1,¹,2,²,3,³,4,⁴,5,⁵,6,⁶,7,⁷,8,⁸,9,⁹))
...[/font]


You were close about color, but it's based on %rating% (from Globals variables):
[font= "Courier New"]$set_global(default_text,
$if(%rating%,
$ifgreater(%rating%,3,
$blend($get(_default_text),$rgb(0,0,0),%rating%,10),
$blend($rgb(228,234,242),$get(_default_text),%rating%,3)),
$get(_default_text)))[/font]


[font= "Courier New"]$set_global(info_text,$blend($get(_default_text),$rgb(255,255,255),1,3))[/font]

where "_default_text" is based on %codec%  but you can set it to fixed color

[edit]
@gurubhai: use this shorter DUI code instead (I just now saw what I posted)

Code: [Select]
$if(%rating%,$repeat(★,%rating%),$repeat(☆,$div($add(%HOT%,4),20)))

Auto Rating options in foobar 0.9.6.*

Reply #10
thank you very much, works great

Auto Rating options in foobar 0.9.6.*

Reply #11
Unfortunately, I am using DUI which needs v0.8 of customdB  for hotness to work so no media library(modified) option.

Auto Rating options in foobar 0.9.6.*

Reply #12
It seems that this thread has turned to mess with all this different codes, so here is final post:

1. download latest custom_db from here: http://blog.99ravens.net/index.php?e=283
2. make Hotness field as described here: http://www.hydrogenaudio.org/forums/index....st&p=661680
3. use this for rating column:

for DUI:
Code: [Select]
$if(%rating%,$repeat(★,%rating%),$repeat(☆,$div($add(%HOT%,4),20)))

for CUI:
Code: [Select]
$rgb(0,0,0,0,0,0)
$if(%rating%,
$repeat(★,%rating%)$rgb(224,224,224,255,255,255)$repeat(☆,$sub(5,%rating%)),
$rgb(160,160,160,64,64,64)$repeat(☆,$div($add(%HOT%,4),20))$rgb(224,224,224,255,255,255)$repeat(☆,$sub(5,%autorating%)))


no need for any other scripts/codes

Auto Rating options in foobar 0.9.6.*

Reply #13
Hotness is not working with customdB 0.9a

Auto Rating options in foobar 0.9.6.*

Reply #14
worked it out. 

thanks for all the help.

Auto Rating options in foobar 0.9.6.*

Reply #15
Hi everyone.

I was able to get this code working and stars nicely displaying but still have one issue (implying obsolete value of Hotness while time pass.. I guess  ) and just wanted to check if this is only a problem on my system. I can not set Action's Update to Media Library (Modified) without freezing my Foobar to death...  or maybe it is actually doing something? like building a db? I let it run for some more time recently but it really went too long so I killed it anyway...

[custom_db 0.8 setup with DUI]

I'd appreciate a piece of advice here.

Cheers! 


Auto Rating options in foobar 0.9.6.*

Reply #16
you just need to restart when adding new fields, and then after the restart add new actions for those fields
and BTW the latest version of custom_db is 0.9a

Auto Rating options in foobar 0.9.6.*

Reply #17
2E7AH, thanks for quick response. Still, after I changed Update selector to 'Media Library (Modified)' and restarted Foobar it hanged again. Do you know how DB is being updated when Media Library (Modif) is selected? Is this option updating all files on Foo startup? I'm asking because if I have a long playlist and am thinking maybe plugin is really building a DB and is not hanged as I suspected, I can even see that HDD is working hard in this process...

BTW Do you recommend I use 0.9a instead of 0.8 (which was recommended before)?

Auto Rating options in foobar 0.9.6.*

Reply #18
I don't know if you done it right:
- delete all fields and actions and restart foobar
- add new fields and restart foobar
- add new actions to those fields and choose update
- restart again I guess

It should be updated now on startup pretty fast, although I don't know if your huge playlist will suffer

0.8 was suggested for some other reasons, latest version should be the best choice

Auto Rating options in foobar 0.9.6.*

Reply #19
Just wanted to chime in and thank 2E7AH for the excellent explanation and scripts, it all works perfectly on my end (except for a small mistake in the CUI script, "%autoratings%" at the end of the last line should be "$div($add(%HOT%,4),20)", IIRC). And of course to all the other people involved in making these scripts. No wonder foobar is the best with such a great community.

I played around and tweaked stuff for a bit and now (among other things), hot tracks show up in playlists as progressively more red the hotter they are. It's neat stuff!

Auto Rating options in foobar 0.9.6.*

Reply #20

Thanks for noticing, I noticed the mistake too, but I wasn't able to edit the post then and left it - I thought people are smart enough to assume that it's custom_db field + some kind of continuation of always letting something unfinished behind

Maybe you should share your tweaked code

Auto Rating options in foobar 0.9.6.*

Reply #21
2E7AH, thank you very much. I'm not sure what was wrong but I upgraded custom_db to 0.9a, removed my long playlist and started configuring db from scratch; after couple restarts I got it up and running, I even loaded my full playlist again and it is working just fine.

I agree with スラッシュ, Foobar community is really great, so once again thank you for patience and outstanding help you provide.

 

Auto Rating options in foobar 0.9.6.*

Reply #22
My code is a REAL mess but if you're interested, here it is. I tweaked it a bit more and it becomes orange-yellow when the song is REALLY hot now:

(just for the record, do this)
1. download latest custom_db from here: http://blog.99ravens.net/index.php?e=283
2. make Hotness field as described here: http://www.hydrogenaudio.org/forums/index....st&p=661680

note: this stuff is CUI only, since I don't know anything about DUI (and I think color isn't supported in the playlist?).

put this in the ratings column:
Code: [Select]
$rgb($mul(%HOT%,3),$sub($mul(%HOT%,25),2275),0)
$if(%rating%,
$repeat(★,%rating%)$rgb(0,244,244)$repeat(★,$sub(5,%rating%)),
$rgb($mul(%HOT%,2.5),160,160)$repeat(★,$div($add(%HOT%,4),20))$rgb(180,244,244)$repeat(★,$sub(5,$div($add(%HOT%,4),20))))


Put this at the top of all other columns where you want the color to change according to hotness (of course, you'll have to clear any subsequent color commands, or they'll override it). Of course, leave anything that's there (like %title% or whatever)
Code: [Select]
$rgb($mul(%HOT%,3),$sub($mul(%HOT%,25),2275),0)

$ifequal(%rating%,1,$rgb(180,180,180),)


So for example for title column:
Code: [Select]
$rgb($mul(%HOT%,3),$sub($mul(%HOT%,25),2275),0)

$ifequal(%rating%,1,$rgb(180,180,180),)

[%title%]

(The grey 1star is because I autoskip 1starred items)

If you do it right, it should look something like this!

The bright stars are custom ratings and the greyed out stars are "hotness-based" ratings. I guess I don't really need those now since I have the colors, but it's okay for me.