Script: Lyrics to Instrumental

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Script: Lyrics to Instrumental

by Seeker » Thu May 22, 2008 2:57 pm

cool - thanks!

by MM_Girl » Wed Apr 02, 2008 5:21 pm

Teknojnky, you ROCK. Thank you !!

Works like a charm.

by nynaevelan » Wed Apr 02, 2008 4:41 pm

I understand the explanation and if I had to choose I would rather use the method that doesn't freeze MM, but the biggest group I've used so far is 27 tracks and that takes a while. I think I will just have to adopt the method that I use for other time-intensive jobs, start it and go away for a few hours.

Thanks anyway for this script, it is a time-saver. :P

Nyn

by Teknojnky » Wed Apr 02, 2008 4:33 pm

I don't know.

There are 2 ways it could be done, the current way which updates each track as it goes, and the other way to add each file to a temp song list then update the songlist all at once.

There are pro's and con's to either method.

The current way can handle updating many files without freezing up MM, but it appears sluggish since it constantly updates the db and writes tags.

When using the songlist and UpdateAll method, it goes very fast during the processing, but then will freeze up a great deal while it processes the updateall.

You can see this in some scripts, which process very fast, then seem to get stuck during the update. Since the updateall method blocks the whole UI thread, it makes MM appear unresponsive.

Using smaller sets of files makes it less noticable tho.

by nynaevelan » Wed Apr 02, 2008 4:26 pm

This is nice, if you should want to work on it more, could you add some speed?

Nyn

by nynaevelan » Wed Apr 02, 2008 9:03 am

Teknojnky wrote:This script will take whatever you type in the input box, and set the lyrics tags of each of the selected files to whatever you input.

It will not clear the lyrics tag if you leave it blank (it just exits), if you want to clean the lyrics of particular files, use the 'clear fields' script (I don't have a link).

In other words, since you can't update the lyrics for multiple files via the MM properties dialog, with this script you can.

It is good, for example, to set a bunch of selected files lyrics to "[instrumental]" or whatever your preference is.
Thank you for the explanation, now I can go to work!!

Nyn

by spacefish » Wed Apr 02, 2008 8:56 am

Works great! :)

by Teknojnky » Wed Apr 02, 2008 8:45 am

This script will take whatever you type in the input box, and set the lyrics tags of each of the selected files to whatever you input.

It will not clear the lyrics tag if you leave it blank (it just exits), if you want to clean the lyrics of particular files, use the 'clear fields' script (I don't have a link).

In other words, since you can't update the lyrics for multiple files via the MM properties dialog, with this script you can.

It is good, for example, to set a bunch of selected files lyrics to "[instrumental]" or whatever your preference is.

by nynaevelan » Wed Apr 02, 2008 5:04 am

Since this is going in the auto folder can you give a little more insight in how it works? When I select a group of tracks will it automatically let me edit the lyrics of the tracks??

Nyn

by spacefish » Wed Apr 02, 2008 4:57 am

OMG, Thank you! :D

Code: Select all

LyricString = "[instrumental]" 'default lyric string'
And that's perfect! Mine are all already noted that way, MusicBrainz nut that I am. :lol:

Script: Lyrics to Instrumental

by Teknojnky » Tue Apr 01, 2008 10:46 pm

save to instrumentals.vbs in the mediamonkey\scripts\auto folder

Code: Select all

'
' MediaMonkey Script
'
' NAME: Lyrics to Instrumentals
'
' AUTHOR: TeknoJnky
' DATE : April 1 2008
'
' INSTALL: Copy Script to Instrumentals.vbs in the Mediamonkey\Scripts\Auto folder.
' This script takes the selected songs and sets the lyrics to the set string

Option Explicit

Dim LyricString
LyricString = "[instrumental]" 'default lyric string'


Sub OnStartup 
  
    Dim MenuItem
    Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Scripts, 0, -1) 
    
    MenuItem.Caption = "Lyrics to Instrumental"
    MenuItem.Hint = "Changes Lyrics field to " & LyricString
    MenuItem.UseScript = Script.ScriptPath 
    MenuItem.OnClickFunc = "FixLyrics"

End Sub 


Sub FixLyrics(MenuItem)

  Dim List,Song,Status,Counter
  Set List = SDB.CurrentSongList
  Dim Input
  Input = InputBox("Enter Lyric String: ","Lyrics to Instrumental",LyricString)

  If Input <> "" Then
    LyricString = Input
    Set Status = SDB.Progress
    Status.Text = "Initialising script..."
    Status.MaxValue = list.Count

    For Counter=0 To list.Count-1
      Status.Text = "Updating file "&(Counter+1)&" of "&list.Count&"..."
      Status.Value = Counter
      Set Song = List.Item(Counter)

        Song.Lyrics = LyricString

        Song.UpdateDB
        SDB.ProcessMessages
        Song.WriteTags
        SDB.ProcessMessages

      If Status.Terminate Then Exit For
    Next

    Status.Text = "Script Finished..."
    Status.Value = Status.MaxValue
    Set Status = Nothing
    
  End If

End Sub
this is just a quick mod of one of my other quick hacks (fix composer)

enjoy

Top