Page 1 of 2

MusicMatch Ratings 1.1 [MM2+3]

Posted: Tue Jan 17, 2006 5:56 am
by trixmoto
As requested, this script copies ratings from MusicMatch (which apparently appear as values 1-5 in the Quality field) to MediaMonkey ratings (in the ratings field), of all the selected tracks. It does not remove the information from the Quality field (so the ratings should still appear fine in MusicMatch).

Code: Select all

'
' MediaMonkey Script
'
' NAME: MusicMatchRatings 1.1
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 04/12/2007
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini 
'          Don't forget to remove comments (') and set the order appropriately
'
' [MusicMatchRatings]
' FileName=MusicMatchRatings.vbs
' ProcName=MusicMatchRatings
' Order=19
' DisplayName=MusicMatch Ratings
' Description=Convert MusicMatch Ratings
' Language=VBScript
' ScriptType=0 
'
' FIXES: Added text values are now also converted
'

Option Explicit 
Dim Debug : Debug = False

Sub MusicMatchRatings
  Dim list : Set list = SDB.CurrentSongList  
  If list.Count = 0 Then
    Call SDB.MessageBox("MusicMatchRatings: There are no selected tracks to process.",mtError,Array(mbOk))
    Exit Sub
  End If    
  
  Dim prog : Set prog = SDB.Progress
  prog.Text = "Initialising script..."
  prog.MaxValue = list.Count
  
  Dim log : Set log = Nothing
  If Debug Then
    Set log = SDB.Tools.FileSystem.CreateTextFile(Script.ScriptPath&".log",True)
    If log Is Nothing Then
      Debug = False
    Else
      Call log.WriteLine("*Processing "&list.Count&" tracks")
    End If
  End If
    
  Dim c : c = 0
  Dim i : i = 0
  For i = 0 To list.Count-1
    Dim itm : Set itm = list.Item(i)
    prog.Text = "Checking track '"&itm.Title&"' ("&(i+1)&"/"&list.Count&")..."
    prog.Value = i
    SDB.ProcessMessages
    
    Dim r : r = -1
    If isNumeric(itm.Quality) Then
      Dim q : q = Int(itm.Quality)
      If q > -1 Then
        If q < 6 Then
          r = q * 20
          c = c + 1
        End If
      End If
    Else
      Select Case itm.Quality
        Case "Bad Taste"
          r = 0
          c = c + 1
        Case "Poor"
          r = 20
          c = c + 1
        Case "Fair"
          r = 40
          c = c + 1
        Case "Good"
          r = 60
          c = c + 1
        Case "Very Good"
          r = 80
          c = c + 1
        Case "Excellent"
          r = 100
          c = c + 1
      End Select
    End If
    itm.Rating = r
    
    If Debug Then
      Call log.WriteLine(itm.ID&":"&itm.Quality&"="&q&"="&r&"~"&itm.Title)
    End If
    
    If prog.Terminate Then 
      If Debug Then
        Call log.WriteLine("*Cancelled by user")
      End If
      Exit For
    End If
  Next
  
  prog.Text = "Finalising script..."
  prog.Value = prog.MaxValue
  If Not (prog.Terminate) Then
    Call list.UpdateAll
    If Debug Then
      Call log.WriteLine("*Processed all")
    End If    
  End If
  If Debug Then
    Call log.WriteLine("*Tracks updated: "&c&"/"&list.Count)
    log.Close
  End if  
  Call SDB.MessageBox("Tracks updated: "&c&" out of "&list.Count,mtInformation,Array(mbOk))
End Sub

Sub Install()
  Dim inip : inip = SDB.ApplicationPath&"Scripts\Scripts.ini"
  Dim inif : Set inif = SDB.Tools.IniFileByPath(inip)
  If Not (inif Is Nothing) Then
    inif.StringValue("MusicMatchRatings","Filename") = "MusicMatchRatings.vbs"
    inif.StringValue("MusicMatchRatings","Procname") = "MusicMatchRatings"
    inif.StringValue("MusicMatchRatings","Order") = "19"
    inif.StringValue("MusicMatchRatings","DisplayName") = "MusicMatch Ratings"
    inif.StringValue("MusicMatchRatings","Description") = "Convert MusicMatch Ratings"
    inif.StringValue("MusicMatchRatings","Language") = "VBScript"
    inif.StringValue("MusicMatchRatings","ScriptType") = "0"
    SDB.RefreshScriptItems
  End If
End Sub

Posted: Tue Jan 17, 2006 5:59 am
by Bex
I think this one is going to be most appreciated by many!

Good one trix! (As always :D )

/Bex

Posted: Tue Jan 17, 2006 6:04 am
by trixmoto
Appreciated if it works! As I've never used MusicMatch I have no real data to test it with. Although I tested it with the data the way I was told it was, and that worked! :)

Posted: Wed Jan 18, 2006 3:55 am
by trixmoto
Rik,

You are awesome!!
The script you wrote works perfectly.
I certainly didn't expect such a fast answer, I love you man!

...

Thanks a million again. I think now I'm finally cured of a long-lasting MMJB addiction! ;-)

- Martin

Posted: Wed Jan 18, 2006 9:02 am
by judas
Nice one again trix,,..i dont use MMJB and have never, but as bex said many are going to appreciate this (unless thay have manually re-rated they're library...in this case they wouldn't like you so much!!!)

keep it up...

judas

... Can you help me with itunes?

Posted: Mon Aug 28, 2006 5:58 pm
by pkdrojo
That's nice ... But ... you can do the same with itunes?

Posted: Tue Aug 29, 2006 4:16 am
by trixmoto
Erm.... No idea! :)

I don't use iTunes but hopefully somone else will be able to help you!

Posted: Tue Aug 29, 2006 4:19 am
by jiri
MM can import ratings from iTunes - the dialog shows after you scan some tracks.

Jiri

YMJ

Posted: Sat Dec 09, 2006 2:31 pm
by felixxx999
Do you have a script for Yahoo Music Jukebox?

Posted: Mon Dec 11, 2006 5:50 am
by trixmoto
Currently, no. But if you can give me some information on how the ratings are stored, I might be able to write one. Do they appear in any of the other MM fields?

Posted: Sat Dec 16, 2006 2:19 pm
by felixxx999
trixmoto wrote:Currently, no. But if you can give me some information on how the ratings are stored, I might be able to write one. Do they appear in any of the other MM fields?
I did some research and I guess Yahoo stores the data on-line. Shame, because I've rated so many on YMJ....

Thanks anyway.

Posted: Sat Dec 16, 2006 3:12 pm
by Bex
If you can export playlists in M3U format from Yahoo then you can create one playlist per rating and import them into MM. Then just select all tracks per playlists in MM and set the rating.

Not quite understanding.

Posted: Tue May 29, 2007 10:43 pm
by TexFlood
Hi there, I'm a long time user of MusicMatch and have compiled/rated/sorted a large library using MusicMatch tagging.
:oops:

Well, it has come time for me to move on to greener pastures, I've done my due diligence with all the big music players and found MM to be *way* more flexible than the rest. So here I am all ready to get set up. I've downloaded all kinds of scripts, but I first want to get my ratings moved over from MusicMatch to MM.

When I run this MusicMatch script on a few of my MP3's that were all tagged in MusicMatch everything works perfectly, the star ratings appear in MM. What I don't understand is where this new rating is being saved. If I pull up the mp3 in mp3Tag, I don't see these ratings getting saved. Are they being saved externally in a central file instead?

If I remove the mp3s from MM and re-add them the ratings are gone... (The Quality value is still there so I can rerun the script, but I would like to permanently save the rating to a tag such as in the POPM tag. What am I not understanding?

Edit:
Looking through the script and trying to understand, at the end it runs the Update DB command and the HTML Help says the UpdateDB command:
"Writes changes that were made to track's properties back to the Library."
Does that mean within the mp3 file or elsewhere?

Edit Again:
lol Ok I've figured it out, I've added the following line under the itm.UpdateDB:
itm.WriteTags
I'm going to assume that its ok to run both those commands, not sure where in the heck the UpdateDB is saving...

As my final note for the evening, the scripting capabilities in MM are awesome! I'm hoping that saving these POPM values in MM's star numerologically (made up word) settings will not affect my ability to sync my brand new 8G Ipod Nano and use ratings! Or am I in for the battle of evermore (ie only change these ratings from MM and deal with the inaccuracies)? I'll keep searching these boards as this post is turning into a blog.

Posted: Wed May 30, 2007 6:23 am
by trixmoto
The script only saves the values into the database. You can then synchronise the track to save the ratings to the tags, or have your settings setup to do this automatically (like mine) or indeed add this line to the script. I'm glad you found the script useful. :)

Re: MusicMatch Ratings 1.0 [MM2+3]

Posted: Wed Jul 04, 2007 2:10 pm
by Mitch470
trixmoto wrote:As requested, this script copies ratings from MusicMatch (which apparently appear as values 1-5 in the Quality field) to MediaMonkey ratings (in the ratings field), of all the selected tracks. It does not remove the information from the Quality field (so the ratings should still appear fine in MusicMatch).
Trix,

I installed the above code into my scripts.ini file and then started MediaMonkey Gold 2.5.5. I clicked that Script

I finally figured out that I needed to create a VBS file separately. Then I loaded all unrated songs into the main pane and selected all of them. It worked like a charm.

Thanks for a great script.