Auto Rating of Songs & Radio Announcer v5.02 [Script]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 01, 2006 3:56 pm

well somebody likes the stars i did thanks. 8)

so diddeleedoo

your almost done with the catch up ratings script.?

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon May 01, 2006 4:00 pm

confused wrote:did you see the stars rovingcowboy made to work on the dark skins?
he made the bomb on them a grave stone being hit by a lighitinning bolt.
thats a negative star? :)
Yeah thats cool, but still there is unfortunately no negative ratings defined in the id3 tag standards.
4.17. Popularimeter

The purpose of this frame is to specify how good an audio file is.
Many interesting applications could be found to this frame such as a
playlist that features better audio files more often than others or
it could be used to profile a person's taste and find other 'good'
files by comparing people's profiles. The frame contains the email
address to the user, one rating byte and a four byte play counter,
intended to be increased with one for every time the file is played.
The email is a terminated string. The rating is 1-255 where 1 is
worst and 255 is best. 0 is unknown. If no personal counter is wanted
it may be omitted. When the counter reaches all one's, one byte is
inserted in front of the counter thus making the counter eight bits
bigger in the same away as the play counter ("PCNT"). There may be
more than one "POPM" frame in each tag, but only one with the same
email address.

<Header for 'Popularimeter', ID: "POPM">
Email to user <text string> $00
Rating $xx
Counter $xx xx xx xx (xx ...)
http://www.id3.org/id3v2.4.0-frames.txt

So while it might not be everyone's prefence the same, we all have to define a 'baseline' rating.. ie neutral, don't like, don't hate, etc. and then rate everything else in relation.

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 01, 2006 4:28 pm

so teknojnky

what your saying is that there is the options to use 10 ratings 5 for postive stars and 5 for negative stars?

so you can make the neg... ones show when the song rating declines?

how would one enable the neg... options then?

this would be very useful then as diddeleedoo could make his catch up script use a reverse rating for the whole ratings and we could use 10 stars 5 + and 5 - that would be far more correct of a rating.

but rusty and jiri would have to figure out how to show the extra set of neg.. stars in the menu.

so do you know how to do that to tell them also? this is a good idea you brought up.

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon May 01, 2006 5:04 pm

rovingcowboy wrote:so teknojnky

what your saying is that there is the options to use 10 ratings 5 for postive stars and 5 for negative stars?
No, what I am saying is there no negative stars, so I use bomb thru 2 as negative, 2.5 as zero/neutral, 3+ as positive.

Otherwise, there is no 'negative' except for maybe 'bomb' but even that is not a true negative, its "one" according to the id3 spec.

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 01, 2006 9:35 pm

oh

okay i see i misunderstood what you said, i was getting ready to make another set of neg.. stars. ?

idea?

i will make a set of stars that has negative stars for the first couple ratings

so those that want them as negative can use them.

i think that will that work?

am starting on it now.

8)
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Mon May 01, 2006 11:32 pm

I'm just trying to get the base in order... is this something that maybe a fairly 'right' model ?

Image

Based on the above, I currently try out the following changes..

DRAFT

Code: Select all

' EXPLAINING THE SYSTEM
'"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
' This system is based on how many times you tolerate
' to listen to the same song in a set amount of time.
'   
'   1 play  = 2.5 stars (Accepted)
'   2 plays = 3.0 stars (Like)
'   3 plays = 3.5 stars (Nice)
'   4 plays = 4.0 stars (Any time)
'   5 plays = 4.5 stars (Love It)
'   6 plays or more = 5 stars (In Love!).. Lucky you!!
'
'   2.0 Stars = New Album, Unratet and Unplayed
'
'   Skip degrading steps for 2.0 Star songs
'   1st skip = 1.5 Stars = Not now, maybe another day
'   2nd skip = 1.0 Stars = Not now either
'   3rd skip = 0.5 Stars = Not now either!!! Annoying
'   4th skip = 0.0 Stars = Bad Album Filler, Rating "Recycle Bin" (bomb)
'  
'  1.5 and 1.0 Star songs get 2.5 Star (accepted) if played fully once.
'  0.0 and 0.5 Star songs needs to be played twise to get 2.5 Star
'
'  Songs already rated high, only loose half a star if they are skipped.
'
'  A 2.5 Star song jump down to 1.5 Star (maybe another day) if
'  skipped, to keep 2.0 Star songs for new albums, unplayed, unrated
 
' A 2.0 Stars song go down to 1.5 on first skip
' (Not sure if it would need two skips to go down to 1.5 Star???)
Rating is a personal thing, and should not really be a Genre or anything like that.

Just added this function, and it's working well. (development version only)

Code: Select all

ProtectSpecialSongs = True
' Songs with values in either the Mood or
' the Occasion field will not be rated at all.
' This song is probably well classified already.
This can be used for those special songs. Kids songs, Christmas songs, Party songs, songs for when Aunty Nelly comes over.. things like that... Fill Occasion fields with something, or Mood, and they are protected. You can for example select all songs with Genre XMas, and add Occasion: Christmas to those.

In fact, now when I've learned Option Sheet, the registry and things like that, I'll add a few options, like setting moods, setting occasion, rate if current occastion is the same as the song got, time-out periods... just have to put it all together to a working model, and post here.

That 'Auto-Rate Whole Collection' script works, but I'll finish this one first, and then finish off that 'catch-up' script.. with Time-Limit in the 'check back time' 6 months, 3 years, or no Time-Limit.... with 'Trial Runs' shown on screen, before doing it for 'real'
Image

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Tue May 02, 2006 9:28 am

with the stars i made you could make the code go all the way back to 0.0 stars and use all the sets of stars for your ratings.

i am setting this star images collection up to use the 3 stars as your lowest good rating the lower stars are made to be different color so you can use them for your bad rating.

i posted them on my skins page with the other stars. in the area for background images for monkey.
:D
Last edited by rovingcowboy on Tue May 02, 2006 12:39 pm, edited 1 time in total.
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Tue May 02, 2006 9:37 am

News about the 'keep-updated' script
A totally rebuild script have been made and is currently being tested!!!!
Improvements in upcoming script
1. No more parameters in the script. It's all available in an Option Sheet
2. Data File is no longer needed.
3. A system for dealing with Moods and Occasions is currently being testet
4. Protection of Special Songs an option.
5. Announcer do not repeat artist name if same as last song.
6. Allow for protected rating level for Unplayed/New albums/Unrated songs
7. A larger range of rating levels
8. Enable/Disable
9. Ehhhmm, I think that's it.

Maybe posted tomorrow if passing a bit of testing!! (midnight here and I just finished! Too late to verify everything)

Grab this old one if you wish, it has limited life-time here now when a new and better one is just around the corner!

AND THANK YOU FOR THE INPUTS!!

@Roving Cowboy.... The Catch-Up one is next, and you may want to use that as a speciality script. Not sure... the new script is quite different.. unlike any other script I've seen so far here. It's not like I have read every post here, but when searching for programming codes in this script they do not come up.. maybe because the new version of MM allow for better scripting... not sure.... you'll see when I get to test it a bit... doing those Moods and Occasions now, but it's a bit late, so I'll not be finished tonight..
Image

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Tue May 02, 2006 12:50 pm

This is the one I need to sleep on....... the rest is finished....

Any ideas would be helpful tomorrow... not quite sure if this would work well in real life....

Code: Select all

[x] Protect Songs with values in Occasion or Mood
      (General Use Songs do not have values there)
----------------------------------------------------------------------------
Tag upgraded songs with 
    Occasion: Christmas
    The next [6] Hours
Only songs with the same Occasion value will degrade if skipped
----------------------------------------------------------------------------
Tag upgraded songs with 
    Mood: Party
    the next [8] Hour(s)
Only songs with the same Mood value will degrade if skipped
Suggestions, Ideas ???????/
Image

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Tue May 02, 2006 1:11 pm

too many options just make it rate songs as normal there is no need to pick the certian styles with an option box. they will get rated when they are played. as long as they are rated by the history count then there should be no degrading of them.

how ever if there is then just protecte it from degrading.

over here we have a saying. " kiss = keep it simple stupid " not that your stupid but that your making it too complex for what it needs to do.

simple is always better. example

two auto buff's race each other up a moutian to see what is better the one old car or the one new car.

they get going the new car is out front but 3/4's the way up has to pull over cause his fancy electronic carborator adjustment was defected from the manufacture and now his carb can't adjust for the thinner air he has to do it manualy which means taking off all the covers on the engine to get to it.

while he is doing that the old car driver pulls up to the side gets out with a flash light and screw driver pops his hood, turns the screws to what he knows is needed at that atmasphere, drops the hood jumps back in the car and drives off to the finish line.

while the other guy is just putting the hood back down on his car. then he gets in only to find the battery is too dead to start the car after he had the light cord pluged in to it to see what he was doing in the dark corners of the engine compartment..

so newer more complicated was not the best after all? the old fast simple way got the job done quicker.

:lol:
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Tue May 02, 2006 9:09 pm

Latest version of AutoRateSongs as of 4 May 2006

NEWS
16 May 2006
Part: AutoRateSongs.vbs Changes: Pause while speaking were added to the Radio Announcer part.
19 May 2006
Auto Rating Catch-Up is finished: [Link to script]
3 June 2006
An important note to other scripters has been added to the the very end of this post.
11 June 2006
Various ways of improving the system are currently being tested. Will not be released before some good ol' testing and reports have been done.

-----
Based on valuable input here, and analyzing a 3 year old MM database, with about 25,000 plays it seems to be best to do 2.0 Stars for 'New Album', unplayed and unrated songs.
Here's the current rating layout
Image

System explained
The system use 2.0 Star as a starting point for a new album or any unrated/unplayed songs.

An unrated song will get 2.5 Star if you play it once. However will get 1.5 Star for 'Maybe another day' if you skip it the first time you hear it. Even if you skip it twise, it will still get up to the accepted level of 2.5 Stars if you play it fully one day. 0.0 & 0.5 Star songs needs to be played fully twise to get up to the 'accepted' level. Please note 2.0 Stars is reserved for new/unrated songs, so the rating system jump over this level if needed

The system ensures that the rating are updated. If you manually have rated a song 5.0 Stars, but start to get sick of it, it will be reduced to 4.5 Star if you skip it once.

On the other hand, if you play some new music more than usual, the system ensures that the song get rated as it deserves, even if you forget.

Here's a screen shot of this 'keep-updated' script's Option Sheet.
Image

Understanding play counts.
Say if you set it to 0 - 1 - 3 for the first 3 ones, it means
When a song is played between 0 and 0 then set it to 2.5 Star (zero cancel this level)
When a song is played between 1 and 1 then set it to 3.0 Star
When a song is played between 2 and 3 then set it to 3.5 Star
A song played 2 times will then get 3.5 Star
I'll try to ease this part of it, by making it more 'human logic friendly'

Upgrade only happen if the song currently have less rating.

Installation
Exit MediaMonkey first
Then there are 3 code sections below.
1. MediaMonkey\Scripts\Scripts.ini Section
2. MediaMonkey\Scripts\Auto\AutoRateOptionSheet.vbs
3. MediaMonkey\Scripts\AutoRateSongs.vbs

With a freshly restarted MediaMonkey, go to
Tools - Options - Library - Auto Rating, and hit the Enable CheckBox in the top left corner, then hit OK, and after the second song you should see the ratings start.

Possible trap during installation: AutoRateSongs.vbs needs to have correct filename, and be aware that notepad tend to add .txt at the end of files. To avoid this use double quotes when saving, ie "AutoRateSongs.vbs"

1. The Scripts.ini Section (Same as before)
Open and add this section to \MediaMonkey\Scripts\Scripts.ini

Code: Select all

[AutoRateSongs]
FileName=AutoRateSongs.vbs
ProcName=AutoRateLastSongPlayed
Language=VBScript
ScriptType=2
2. The Option Sheet
Save this one to \MediaMonkey\Scripts\Auto\AutoRateOptionSheet.vbs

Code: Select all

' Save this script to \MediaMonkey\Scripts\Auto\AutoRateOptionSheet.vbs
' Companion script to \MediaMonkey\Scripts\AutoRateSongs.vbs
' Author: DiddeLeeDoo
' Thank you fellow monkeys for great ideas and help
' Date: 3 May 2006

Sub OnStartup
  ind = SDB.UI.AddOptionSheet("Auto Rating", Script.ScriptPath, "InitSheet", "SaveSheet", -3)
End Sub

Dim oT(13,3)

    oT(0,0) = "os00"
    oT(0,1) = False
    oT(0,2) = "Ctr00"
    oT(0,3) = "Enable"
    
    oT(1,0) = "osTimeStamp"
    oT(1,1) = False
    oT(1,2) = "Ctr01"
    oT(1,3) = "Time Stamp to Custom2"
    
    oT(2,0) = "osNH"
    oT(2,1) = True
    oT(2,2) = "Ctr02"
    oT(2,3) = "Northern Hemisphere"

    oT(3,0) = "osRadio"
    oT(3,1) = False
    oT(3,2) = "Ctr03"
    oT(3,3) = "Radio Announcer"
'-
    oT(4,0) = "osSMStart"
    oT(4,1) = 10
    oT(4,2) = "Ctr04"
    oT(4,3) = "Start Skip-Monitor after XX seconds play. Allow you to sample songs."

    oT(5,0) = "osInterlude"
    oT(5,1) = 20
    oT(5,2) = "Ctr05"
    oT(5,3) = "Do nothing with sound clips shorter than XX Seconds"

    oT(6,0) = "osSMStop"
    oT(6,1) = 85
    oT(6,2) = "Ctr06"
    oT(6,3) = "Stop Skip-Monitor at XX % of song."

    oT(7,0) = "osPeriod"
    oT(7,1) = 1
    oT(7,2) = "Ctr07"
    oT(7,3) = "Number of days to check for multi-plays. (Default=1)"
    
    oT(8,0) = "osPR050"
    oT(8,1) = 1
    oT(8,2) = "Ctr08"
    oT(8,3) = "Minimum 2.5 Stars when played up to or equal to # (Default=1)"

    oT(9,0) = "osPR060"
    oT(9,1) = 2
    oT(9,2) = "Ctr09"
    oT(9,3) = "Minimum 3.0 Stars when played up to or equal to # (Default=2)"

    oT(10,0) = "osPR070"
    oT(10,1) = 3
    oT(10,2) = "Ctr10"
    oT(10,3) = "Minimum 3.5 Stars when played up to or equal to # (Default=3)"
    
    oT(11,0) = "osPR080"
    oT(11,1) = 4
    oT(11,2) = "Ctr11"
    oT(11,3) = "Minimum 4.0 Stars when played up to or equal to # (Default=4)"
    
    oT(12,0) = "osPR090"
    oT(12,1) = 5
    oT(12,2) = "Ctr12"
    oT(12,3) = "Minimum 4.5 Stars when played up to or equal to # (Default=5)"

    oT(13,0) = "osProtect"
    oT(13,1) = False
    oT(13,2) = "Ctr13"
    oT(13,3) = "Ignore songs having"
'--

Sub InitSheet(Sheet)

  Set UI=SDB.UI

  Set Edt = UI.NewCheckBox(Sheet)
  Edt.Common.SetRect 20, 20, 120, 20
  Edt.Checked  = oT(0,1)
  Edt.Common.ControlName = oT(0,2)
  Edt.Caption = oT(0,3)
  
  Set Edt = UI.NewCheckBox(Sheet)
  Edt.Common.SetRect 280, 20, 150, 20
  Edt.Checked  = oT(1,1)
  Edt.Common.ControlName = oT(1,2)
  Edt.Caption = oT(1,3)

  Set Edt = UI.NewCheckBox(Sheet)
  Edt.Common.SetRect 280, 40, 150, 20
  Edt.Checked  = oT(2,1)
  Edt.Common.ControlName = oT(2,2)
  Edt.Caption = oT(2,3)

  Set Edt = UI.NewCheckBox(Sheet)
  Edt.Common.SetRect 150, 20, 120, 20
  Edt.Checked  = oT(3,1)
  Edt.Common.ControlName = oT(3,2)
  Edt.Caption = oT(3,3)

  Set Edt = UI.NewCheckBox(Sheet)
  Edt.Common.SetRect 150, 40, 118, 20
  Edt.Checked  = oT(13,1)
  Edt.Common.ControlName = oT(13,2)
  Edt.Caption = oT(13,3)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 169, 60, 150, 20
     Edt.Caption = "Mood and/or Occasion values"
     Edt.Autosize = True
     Edt.Alignment = 0
  
'-
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 90, 50, 20
  Edt.Value = oT(4,1)
  Edt.MinValue = 5
  Edt.MaxValue = 50
  Edt.Common.ControlName = oT(4,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 93, 300, 20
     Edt.Caption = oT(4,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 110, 50, 20
  Edt.Value = oT(6,1)
  Edt.MinValue = 35
  Edt.MaxValue = 95
  Edt.Common.ControlName = oT(6,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 113, 300, 20
     Edt.Caption = oT(6,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 130, 50, 20
  Edt.Value = oT(5,1)
  Edt.MinValue = 5
  Edt.MaxValue = 90
  Edt.Common.ControlName = oT(5,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 133, 300, 20
     Edt.Caption = oT(5,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 155, 50, 20
  Edt.Value = oT(7,1)
  Edt.MinValue = 1
  Edt.MaxValue = 5000
  Edt.Common.ControlName = oT(7,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 158, 300, 20
     Edt.Caption = oT(7,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 180, 50, 20
  Edt.Value = oT(8,1)
  Edt.MinValue = 0
  Edt.MaxValue = 500
  Edt.Common.ControlName = oT(8,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 183, 300, 20
     Edt.Caption = oT(8,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 200, 50, 20
  Edt.Value = oT(9,1)
  Edt.MinValue = 0
  Edt.MaxValue = 500
  Edt.Common.ControlName = oT(9,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 203, 300, 20
     Edt.Caption = oT(9,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 220, 50, 20
  Edt.Value = oT(10,1)
  Edt.MinValue = 0
  Edt.MaxValue = 500
  Edt.Common.ControlName = oT(10,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 223, 300, 20
     Edt.Caption = oT(10,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 240, 50, 20
  Edt.Value = oT(11,1)
  Edt.MinValue = 0
  Edt.MaxValue = 500
  Edt.Common.ControlName = oT(11,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 243, 300, 20
     Edt.Caption = oT(11,3)
     Edt.Autosize = True
     Edt.Alignment = 0
  
  Set Edt = UI.NewSpinEdit(Sheet)
  Edt.Common.SetRect 20, 260, 50, 20
  Edt.Value = oT(12,1)
  Edt.MinValue = 0
  Edt.MaxValue = 500
  Edt.Common.ControlName = oT(12,2)
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 263, 300, 20
     Edt.Caption = oT(12,3)
     Edt.Autosize = True
     Edt.Alignment = 0
     Set Edt = UI.NewLabel(Sheet)
     Edt.Common.SetRect 77, 283, 300, 20
     Edt.Caption = "Anything over the 4.5 Star level receive 5.0 Stars"
     Edt.Autosize = True
     Edt.Alignment = 0
  
'--
  Set Regs = SDB.Registry

  If Regs.OpenKey("Auto Rating", True) Then

     If Regs.ValueExists(oT(0,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(0,2))
       Edt.Checked = Regs.BoolValue(oT(0,0))
     End If
     
     If Regs.ValueExists(oT(1,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(1,2))
       Edt.Checked = Regs.BoolValue(oT(1,0))
     End If
     
     If Regs.ValueExists(oT(2,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(2,2))
       Edt.Checked = Regs.BoolValue(oT(2,0))
     End If
     
     If Regs.ValueExists(oT(3,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(3,2))
       Edt.Checked = Regs.BoolValue(oT(3,0))
     End If

     If Regs.ValueExists(oT(13,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(13,2))
       Edt.Checked = Regs.BoolValue(oT(13,0))
     End If
'-     
     If Regs.ValueExists(oT(4,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(4,2))
       Edt.Value = Regs.IntValue(oT(4,0))
     End If
    
     If Regs.ValueExists(oT(5,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(5,2))
       Edt.Value = Regs.IntValue(oT(5,0))
     End If
    
     If Regs.ValueExists(oT(6,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(6,2))
       Edt.Value = Regs.IntValue(oT(6,0))
     End If
    
     If Regs.ValueExists(oT(7,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(7,2))
       Edt.Value = Regs.IntValue(oT(7,0))
     End If
    
     If Regs.ValueExists(oT(8,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(8,2))
       Edt.Value = Regs.IntValue(oT(8,0))
     End If
    
     If Regs.ValueExists(oT(9,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(9,2))
       Edt.Value = Regs.IntValue(oT(9,0))
     End If
    
     If Regs.ValueExists(oT(10,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(10,2))
       Edt.Value = Regs.IntValue(oT(10,0))
     End If
    
     If Regs.ValueExists(oT(11,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(11,2))
       Edt.Value = Regs.IntValue(oT(11,0))
     End If
    
     If Regs.ValueExists(oT(12,0)) Then
       Set Edt = Sheet.Common.ChildControl(oT(12,2))
       Edt.Value = Regs.IntValue(oT(12,0))
     End If
    
    Regs.CloseKey
  End If
End Sub

'--

Sub SaveSheet(Sheet)
  Set Regs = SDB.Registry

  If Regs.OpenKey("Auto Rating", True) Then

     Set Edt = Sheet.Common.ChildControl(oT(0,2))
     Regs.BoolValue(oT(0,0)) = Edt.Checked
     
     Set Edt = Sheet.Common.ChildControl(oT(1,2))
     Regs.BoolValue(oT(1,0)) = Edt.Checked
     
     Set Edt = Sheet.Common.ChildControl(oT(2,2))
     Regs.BoolValue(oT(2,0)) = Edt.Checked
     
     Set Edt = Sheet.Common.ChildControl(oT(3,2))
     Regs.BoolValue(oT(3,0)) = Edt.Checked

     Set Edt = Sheet.Common.ChildControl(oT(13,2))
     Regs.BoolValue(oT(13,0)) = Edt.Checked
'-
     Set Edt = Sheet.Common.ChildControl(oT(4,2))
     Regs.IntValue(oT(4,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(5,2))
     Regs.IntValue(oT(5,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(6,2))
     Regs.IntValue(oT(6,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(7,2))
     Regs.IntValue(oT(7,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(8,2))
     Regs.IntValue(oT(8,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(9,2))
     Regs.IntValue(oT(9,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(10,2))
     Regs.IntValue(oT(10,0)) = Edt.Value
    
     Set Edt = Sheet.Common.ChildControl(oT(11,2))
     Regs.IntValue(oT(11,0)) = Edt.Value

     Set Edt = Sheet.Common.ChildControl(oT(12,2))
     Regs.IntValue(oT(12,0)) = Edt.Value

     Regs.CloseKey 
  End If

End Sub
Good to know: If you're happy with your calibration, and want no one else (even yourself) to stuff around with your setting, you can take the AutoRateOpitionSheet.vbs out of the \Auto folder and it will be gone after a restart of MM. If you ever want to make adjustments, you can move it back to the \Auto folder. Because of this option with the current one, I took away the old 'Set & Forget' script.


3. The Auto Rating Script (Same filename as before)
Save this one to \MediaMonkey\Scripts\AutoRateSongs.vbs
Start MM and go to Tools - Options - Library - Auto Rating and tick Enable,
do your options and hit OK. Will work after seconds song.

Code: Select all

' Save this script to
' \MediaMonkey\Scripts\AutoRateSongs.vbs
' Author: DiddeLeeDoo
' Thank you fellow monkeys for great ideas and help
' Date: 16 May 2006
'############################################################
Dim Itm
Set Regs = SDB.Registry
Sub AutoRateLastSongPlayed

If Regs.OpenKey("Auto Rating", True) Then
   If Not Regs.BoolValue("os00") Then
      Regs.CloseKey
      Exit Sub
   End If
End If

If Regs.IntValue("arSongID") = 0 Then
   Regs.StringValue("arSongPlayStart")= Now
   WriteCurrentSongData
   Exit Sub
End If   

Set Itm = SDB.Player.CurrentSong
If Itm.ID = Regs.IntValue("arSongID") and Regs.IntValue("arSongSeconds") > DateDiff("s",Regs.StringValue("arSongPlayStart"),Now) Then
   Regs.IntValue("arSongSeconds") = Regs.IntValue("arSongSeconds") + 2
   Regs.IntValue("arSongRating")=Itm.Rating
   Regs.CloseKey
   Exit Sub
End If

arRT = DateDiff("s",Regs.StringValue("arSongPlayStart"),Now)
Regs.StringValue("arSongPlayStart")= Now

If Regs.IntValue("arSongSeconds") <= Regs.IntValue("osInterlude") Then
   WriteCurrentSongData
   Exit Sub
End If

If Regs.IntValue("osProtect") and Trim(Regs.StringValue("arSongMood")) & Trim(Regs.StringValue("arSongOccasion")) <> "" Then
   WriteCurrentSongData
   Exit Sub
End If

If arRT <= Regs.IntValue("osSMStart")+1 Then
   WriteCurrentSongData
   Exit Sub
End If

D_H = "'d'"

Dim dbTable, dbSong
Set dbTable = SDB.Database.QuerySongs("AND Songs.ID=" & Regs.IntValue("arSongID"))
Set dbSong = dbTable.Item

If arRT <= Regs.IntValue("arSongSeconds")*(Regs.IntValue("osSMStop")/100) Then
   If Regs.IntValue("arSongRating") < 0 Then
     If Not dbTable.EOF Then
        dbSong.Rating = 30
        dbSong.UpdateDB
     End If
   ElseIf Regs.IntValue("arSongRating") >= 10 Then
    SkipVal = 10
    If Regs.IntValue("arSongRating") = 50 Then SkipVal = 20
    SkipStep = Regs.IntValue("arSongRating") - SkipVal
     If Not dbTable.EOF Then
        dbSong.Rating = SkipStep
        dbSong.UpdateDB
     End If
End If

Else
 StrQuery = "SELECT Count(Played.IdSong) AS arNoP "_
 + "FROM Played "_
 + "WHERE (((DateDiff(" & D_H & ",Now(),[Played].[Playdate])" & _
 + ">=-" & Regs.IntValue("osPeriod") & ")=True)) GROUP BY Played.IdSong "_
 + "HAVING Count(Played.IdSong) >0 AND Played.IdSong=" & _
 + Regs.IntValue("arSongID")

 Dim dbT
 Set dbT = SDB.Database.OpenSQL(StrQuery)

 If Not dbT.EOF Then
    dbD=Int(dbT.StringByIndex(0))
 End If
     If dbD<=Regs.IntValue("osPR050") Then
        cRate = 50
 ElseIf dbD<=Regs.IntValue("osPR060") Then
    cRate = 60
 ElseIf dbD<=Regs.IntValue("osPR070") Then
    cRate = 70
 ElseIf dbD<=Regs.IntValue("osPR080") Then
    cRate = 80
 ElseIf dbD<=Regs.IntValue("osPR090") Then
    cRate = 90
     Else
        cRate = 100
     End If
 If Regs.IntValue("arSongRating")>=0 and Regs.IntValue("arSongRating")<20 Then
    RateUp = Regs.IntValue("arSongRating") + 10
  Else   
    RateUp = cRate
 End If
 
 If RateUp > Regs.IntValue("arSongRating") Then
    If Not dbTable.EOF Then
       dbSong.Rating = RateUp
    If Regs.BoolValue("osTimeStamp") Then dbSong.Custom2=wDay&" "&TimeOfDay&" "&Season
       dbSong.UpdateDB
    End If
 End If 
End If


If Itm.ArtistName = Regs.StringValue("arSongArtist") Then
     SayThis = Itm.Title & "."
   Else
     SayThis = Itm.ArtistName & ", " & Itm.Title & "."
End If

If Regs.BoolValue("osRadio") Then 
   Dim tts
   Set tts = CreateObject("SAPI.SpVoice")
   SDB.Player.Pause
   tts.Speak SayThis
   tts.WaitUntilDone(-1)
   SDB.Player.Pause
   Regs.StringValue("arSongPlayStart")= Now
End If

WriteCurrentSongData
End Sub

Sub WriteCurrentSongData
    Set Itm = SDB.Player.CurrentSong
    Regs.IntValue("arSongID")=Itm.ID
    Regs.IntValue("arSongSeconds")=Int(Itm.SongLength/1000)
    Regs.IntValue("arSongRating")=Itm.Rating
    Regs.IntValue("arSongPlayed")=Itm.PlayCounter
    Regs.StringValue("arSongMood")=Itm.Mood
    Regs.StringValue("arSongOccasion")=Itm.Occasion
    Regs.StringValue("arSongArtist")=Itm.ArtistName
    Regs.CloseKey
End Sub

Function Season()
osNH = Regs.IntValue("osNH")
 wwNow = Int(DatePart("ww",Now))
  If wwNow < 12 Then
   If osNH Then Season = "Winter" else Season = "Summer"
  ElseIf wwNow < 25 Then
   If osNH then Season = "Spring" else Season = "Autumn"
  ElseIf wwNow < 38 Then
   If osNH then Season = "Summer" else Season = "Winter"
  ElseIf wwNow < 51 Then
   If osNH then Season = "Autumn" else Season = "Spring"
  Else 'for those two weeks at the end of the year
   If osNH then Season = "Winter" else Season = "Summer"
  End If
End Function

Function TimeOfDay()
 tNow = DatePart("h",Now)
 If tNow < 6 Then
   TimeOfDay = "night"
  ElseIf tNow < 9 Then
   TimeOfDay = "morning"
  ElseIf tNow < 17 Then
   TimeOfDay = "daytime"
  ElseIf tNow < 19 Then
   TimeOfDay = "dinner"
  ElseIf tNow < 24 Then
   TimeOfDay = "evening"
 End If
End Function

Function wDay()
 wDay = WeekdayName(Weekday(Now))
End Function 
IMPORTANT NOTE TO OTHER SCRIPTERS HERE
This system is tuned and ready. If you plan to or do any sort of modifications, PLEASE DO NOT POST A COMPLETE VERSION OF THIS SCRIPT ANYWHERE!!!!!!!

If you have modifications to contribute with, post them in this THREAD ONLY, with the modification you've done ONLY.
NOT THE WHOLE SCRIPT!!!!!

I do not take lightly on people doing that here, as it already have happened more than once.
Last edited by DiddeLeeDoo on Sun Jun 11, 2006 8:17 am, edited 47 times in total.
Image

rovingcowboy
Posts: 14162
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Tue May 02, 2006 9:30 pm

:o :( :o :-? :P :( :cry: :roll: :o :x :lol: :o 8) :-? :cry: :roll: :P :lol: 8) :D ooh.???

new codes to mess with :lol:


okay okay now where's that metal ruler? i got to slap my fingers. :wink:
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy 5 Android 5) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Tue May 02, 2006 9:47 pm

You know, you could combine this to one script, just change the script.ini entry to point to the auto\autoratesongs.vbs file.

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Tue May 02, 2006 9:48 pm

I can make you a custom one if you like Roving Cowboy, but as you'll find out when you get to play with the AutoRateSongs Catch-Up script, the above makes sence.

However, it's a living process, and I think when results come in from the AutoRate Catch-up script, we'll be able to finalize it all!

By the way, I'm adding things as I go in the post above, and just put in results, and the layout of ratings.

When finished writing above, I'll get to that Catch-Up script, and we can 'shoot blanks' to see how the calibration issue works out!!

:D
Image

DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo » Tue May 02, 2006 10:09 pm

Teknojnky wrote:You know, you could combine this to one script, just change the script.ini entry to point to the auto\autoratesongs.vbs file.
So there'll be no performance issues with that do you think?

Just though this Option Sheet is quite huge, and will lay dead at all times. It will only be called upon when changing options.

I thought it would be best to keep the 'Rate the Last song played' as small as possible, to ensure it works ok on a 486 machine too :wink:
Image

Post Reply