Auto Rate by Playcount and Days in Library
Auto Rate by Playcount and Days in Library
I stumbled across iRate a while ago now and really liked the formula it uses to rate songs. Unfortunately not having a mac and not wanting to run iTunes means that using iRate is out of the question for me.
Does anyone feel inclined to port this to a MM script?
Does anyone feel inclined to port this to a MM script?
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
If this is the formula that iRate uses:
but what to do with unknown ratings? (use Rating = 50 ?)
Cheers
Steegy
EDITED: Removed unnecessary piece of code
This should be the MM implementation of the formula (with Song as SDBSongData object)Play Count
Days in Library = current date - date added
Multiplier = #of stars >>> 0 = 1
1 = 1.2
2 = 1.4
3 = 1.6
4 = 1.8
5 = 2.0
Formula:
(Play Count / Days in Library) * Multiplier * 1000 = Rating{integer}
Code: Select all
Song.Comment = [Song.PlayCounter / DateDiff("d", Song.DateAdded, Now)] * (1+Song.Rating/100) * 1000
Cheers
Steegy
EDITED: Removed unnecessary piece of code
Last edited by Steegy on Sun Apr 30, 2006 9:07 pm, edited 1 time in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
Yes, something like that and a script could look like this.
Quite a radical way to rate things though... especially with the DateAdded factor.
Quite a radical way to rate things though... especially with the DateAdded factor.
Code: Select all
Better stuff below
Last edited by DiddeLeeDoo on Sun Apr 30, 2006 9:28 pm, edited 5 times in total.
Notice that iRate only changes the tracks comment field (not the rating field).Quite a radical way to rate things though
So I suggest to stick with that. And it's nice for people that want to keep the normal rating field manual.
(
Changing the rating field, with calculations based on that same field, seems kind of awkward.
It would give wrong results if the script is run more than once, and there's no way to know if the script has already been run on a track or not.
)
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
Entry for the "Scripts.ini" file
CalculateRating.vbs (for the "Scripts" folder)
How to install (FAQ): http://faq.mediamonkey.com/index.php?ac ... artlang=en
Cheers
Steegy
Code: Select all
[CalculateRating]
FileName=CalculateRating.vbs
ProcName=CalculateRating
Order=14
DisplayName=Calculate Rating
Description=Calculate rating based on the relative playcount and the assigned rating
Language=VBScript
ScriptType=0
Code: Select all
Option Explicit
Sub CalculateRating
Dim i, Songs, Song
Set Songs = SDB.CurrentSongList
For i = 0 To Songs.Count - 1
Set Song = Songs.Item(i)
If Song.Rating = -1 Then
Song.Comment = (Song.PlayCounter / DateDiff("d", Song.DateAdded, Now)) * (1.5) * 1000
Else
Song.Comment = (Song.PlayCounter / DateDiff("d", Song.DateAdded, Now)) * (1 + (Song.Rating / 100)) * 1000
End If
Next
Songs.UpdateAll
End Sub
Cheers
Steegy
Last edited by Steegy on Sun Apr 30, 2006 9:37 pm, edited 3 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
I find the theory a bit strange, but like you say Steegy, if it is there just to add a Text Value to a song...
Guess it then would be better to add it to one of the CustomX fields instead of the comments field, but I do not have a portable device..
Guess it then would be better to add it to one of the CustomX fields instead of the comments field, but I do not have a portable device..
Last edited by DiddeLeeDoo on Sun Apr 30, 2006 9:21 pm, edited 1 time in total.
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
Well, it's actually very logical.
If you just bought a nice song last week and you like it, you might have played it 10 times.
If you had bought the same song a year ago, you would have played it much more already.
So the playcount is totally different, while you like the song in the same way.
To account for that, the "relative playcount" is calculated (the playcount per unit of time).
Cheers
Steegy
If you just bought a nice song last week and you like it, you might have played it 10 times.
If you had bought the same song a year ago, you would have played it much more already.
So the playcount is totally different, while you like the song in the same way.
To account for that, the "relative playcount" is calculated (the playcount per unit of time).
Cheers
Steegy
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
"complete" script (now with scripts.ini entry) has been posted above.
I changed the name to "CalculateRating", because the calculation is not exacly iRate's, and maybe the calculation will have to be changed in the future.
The script is only useful if you have a lot of files with PlayCount > 0.
For one or another reason, fost of my tracks PlayCount's are 0.
It writes to the "Comment" field (as the original iRate program), but that can easily be changed to "Custom1", "Custom2", "Custom3" or something else.
If the script is "approved", then maybe a "NeutralRating = 1.5" setting can be added, together with the field where to write the calculated rating to.
I changed the name to "CalculateRating", because the calculation is not exacly iRate's, and maybe the calculation will have to be changed in the future.
The script is only useful if you have a lot of files with PlayCount > 0.
For one or another reason, fost of my tracks PlayCount's are 0.
It writes to the "Comment" field (as the original iRate program), but that can easily be changed to "Custom1", "Custom2", "Custom3" or something else.
If the script is "approved", then maybe a "NeutralRating = 1.5" setting can be added, together with the field where to write the calculated rating to.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
-
- Posts: 1017
- Joined: Wed Mar 01, 2006 1:09 am
- Location: In a jungle down under
- Contact:
At least that version you did there do not change the ratings like the one I did..... I ended up with Bombs, since I have not any new music at the moment
Guess Amerie can comment on what he really wants, and take it from there. MM certainly seems to be able to do just about anything with a few scripting lines.
BTW: I just see that multiplier is not in there yet.
Worth checking the theory out I guess.
I just have a problem with DateAdded, as most of my songs do have the same DateAdded date.
Guess Amerie can comment on what he really wants, and take it from there. MM certainly seems to be able to do just about anything with a few scripting lines.
BTW: I just see that multiplier is not in there yet.
Worth checking the theory out I guess.
I just have a problem with DateAdded, as most of my songs do have the same DateAdded date.
Thanks, I really appreciate the help.
I thought it might help if I explained why this works for me. My music collection used to live on my laptop and I played everything through MM and that was great, but now I mostly only listen to music on my iPod mini.
One of my problems now is that my playcounts are very low and slow to increment as I only sync my iPod every 1 - 2 weeks and even though i will have listened to some songs far more than others during that time, they all get incremented by 1 only. So playcount alone means nothing in the short term, but over time it all sorts itself out.
Also, given the lack of ability to update anything about a song on the iPod apart from rating, I use this in an ultra simplified way:
- not rated
x hate it or filler track (e.g. album intros and interludes)
* needs attention
** don't overly like but it completes an album
*** like it
**** love it
***** all time favourite
This means I have very little definition in my ratings (most of my collection falls into the four star group), and its my ratings that influence what ends up on my iPod.
I plan to use this new rating in my autoplaylist conditions as I'm hoping it will let me circulate my music collection a little more but still within the context of my ratings, which I will continue to use as normal.
Does that make any sense? I don't know if it'll work but it's worth a try.
The script looks great and you completely beat me to it on a couple of things (field to write to, multiplier value for unknown rating). Thanks so much! Now I just need to wait a few more hours before I can go home an try it out.
The only other thing I'm stuck on is grouping the results in the context of a rating value. I had a look at what iRate does but I think I would have to try it to understand the logic:
> 750 = 100
> 401 = 80
> 201 = 60
> 101 = 40
> 41 = 20
0-41 = 0
I also think I'd want a few more groupings for real value add, but don't know what kind of thresholds to set. Any ideas?
(@DiddeLeeDoo: Amerie = she, not he)
I thought it might help if I explained why this works for me. My music collection used to live on my laptop and I played everything through MM and that was great, but now I mostly only listen to music on my iPod mini.
One of my problems now is that my playcounts are very low and slow to increment as I only sync my iPod every 1 - 2 weeks and even though i will have listened to some songs far more than others during that time, they all get incremented by 1 only. So playcount alone means nothing in the short term, but over time it all sorts itself out.
Also, given the lack of ability to update anything about a song on the iPod apart from rating, I use this in an ultra simplified way:
- not rated
x hate it or filler track (e.g. album intros and interludes)
* needs attention
** don't overly like but it completes an album
*** like it
**** love it
***** all time favourite
This means I have very little definition in my ratings (most of my collection falls into the four star group), and its my ratings that influence what ends up on my iPod.
I plan to use this new rating in my autoplaylist conditions as I'm hoping it will let me circulate my music collection a little more but still within the context of my ratings, which I will continue to use as normal.
Does that make any sense? I don't know if it'll work but it's worth a try.
The script looks great and you completely beat me to it on a couple of things (field to write to, multiplier value for unknown rating). Thanks so much! Now I just need to wait a few more hours before I can go home an try it out.
The only other thing I'm stuck on is grouping the results in the context of a rating value. I had a look at what iRate does but I think I would have to try it to understand the logic:
> 750 = 100
> 401 = 80
> 201 = 60
> 101 = 40
> 41 = 20
0-41 = 0
I also think I'd want a few more groupings for real value add, but don't know what kind of thresholds to set. Any ideas?
(@DiddeLeeDoo: Amerie = she, not he)
Yea, this would be a situation where your most/all of your library was pre-existing and haven't added much to it, where as folks who have start with a smaller library and/or are constantly adding to it might favor this type of system.DiddeLeeDoo wrote:most of my songs do have the same DateAdded date.
New script: Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page
That's no problem, is it.most of my songs do have the same DateAdded date.
In your case, almost all "relative playcounts" correspond with the real play counts, that's all.
The rating is still based on the playcount and the specified rating.
@ Amerie:
(similar to "Amelie", a French girls name, from the movie "Le Fabuleux destin d'Amelie Poulain")
Yes, the iRate calculation doesn't have a maximum value and can go to virtually infinite. These "thresholds" you mention here have to be chosen by yourself. It (too) much depends on your personal listening habits (e.g. currently, I have no songs above 101).The only other thing I'm stuck on is grouping the results in the context of a rating value. I had a look at what iRate does but I think I would have to try it to understand the logic:
> 750 = 100
> 401 = 80
> 201 = 60
> 101 = 40
> 41 = 20
0-41 = 0
Sorry, I don't understand what you mean. Do you want something changed in the script, or do you need this outside the script?I also think I'd want a few more groupings for real value add, but don't know what kind of thresholds to set. Any ideas?
Cheers
Steegy
Last edited by Steegy on Sun Apr 30, 2006 11:07 pm, edited 2 times in total.
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).