Genre Shortcut Keys

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus


Post by musiclistener »

Great moded script.

Thank you !
Posts: 263
Joined: Fri Dec 23, 2005 11:42 am
Location: In front of my computer

Post by MeMeMe »

I'd like to modify the script on the first page to allow for 20 genres,.
I can see that I could basically create two versions of the script:
once for genre's 1-10, using CTRL+ALT+ number keys 0-9,
and again for CTRL+SHIFT+ number keys 0-9

But what @d really like is a script that did the following:
Each of the key combos was assigned to a word like:
Death, Doom, Metal, Power, Symphonic, and so on.

Then when I hit a key combo, the script does one of two things:
1) If the word is part of the genre, it removes it.
2) If the word is not part of the genre, it includes it at the start.

combo1 = "Death"
combo2 = "Industrial"
combo3 = "Gothic"
combo4 = "Metal"
combo5 = "Rock"

Then when rating a song, I click
and the song genre becomes "Metal"
I then click CTRL+ALT + 4
and the song genre becomes "Death Metal"
I then click CTRL + ALT +3
it then becomes "Gothic Death Metal"
And if I then realise I made a mistake and click CTRL+ALT+1
it then becomes "Death Metal"

At the moment, when creating genre-based autoplaylists, I use the "contains" option rather than the "equals" option - this allows me to treat the genre tag as a collection of tags. But to get the most out of it I need o be able to use complex tags like those above.
Posts: 1
Joined: Fri Dec 22, 2006 4:43 pm

Post by maddevil11 »

does anyone have a installer or some kinda or program that will make that script execute itself and add itself to my MM...i tried to learn how to do it but am helpless. PLEASE HELP!!

(the script i am talking about is the shortcut rating system (and maybe that master shortcut on/off switch too) )

Posts: 14278
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Post by Peke »

This is old script structure and I'm glad that it is still in use.

I'll see what can be done to make some Changes and use new MM goodies (read features) like Setup menu, implementing installer and few other things.
Best regards,
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to add SCREENSHOTS to forum

Post by baker »

Hey Peke, thanks for a great script. If you want to add features, maybe you'd like to add a 'sub-genre' function? So that depending on the track's genre it would add the appropriate sub-genre to a custom field. For example, while hitting 'S' would simply update the Genre field , hitting 'Shift-S' would add either 'Ska' to Custom1 of a Reggae track or 'Soul' to an R&B track.

Just a thought..

Post by Guest »

baker wrote:This is a great script. I've been using it to update not only genres but year and custom fields and. There's only one problem though.. Is there anyway to tell MM not to use these hotkeys when modifying a filename? For example, if I want to change a filename to "Beatles - Sgt Pepper", I can't do it unless I go into Properties because I have the 'B' key assigned to 'Blues'. Mucho gracias.
Posts: 14278
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Post by Peke »

Things will be much simplified in MM 3.0.
Best regards,
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to add SCREENSHOTS to forum
Negative Zero
Posts: 2
Joined: Wed Feb 28, 2007 12:49 am
Location: United States


Post by Negative Zero »

i've spent the last few hours tinkering around the innards of this script, mainly because i really wanted the ability to completely remove the rating from a song.

while i was at it, i also added the ability to assign a 0 (bomb) rating and (i think) made it a little more efficient by creating the menus inside a loop. i'm fairly new to scripting (and this is only my 1st post (2nd attempt) at writing for MM), so if that's a bad idea, please let me know.

any other comments would be welcome :)

Code: Select all

' MediaMonkey Script
' NAME: Predefined RATING Script v1.4
' DATE: 14.07.2007
' DATE: 22.01.2006
' DATE: 22.01.2006
'DATE:   26.08.2005
' NOTE:   Idea taken from Pekes "Predefined Genre Script v1.0".
'               LIMEX: I changed to use buttons 1-0 instead of 1-5 in order to assign also 1/2 stars.
' - Feel free to change the constants at the beginning of this file
' - Copy script to MM directory scripts\auto
' USE:
' - Press key "`",1-0,"-" to rate the currently selected song(s)
' - If no song is selected then currently playing song is rated
' REMARK: Rating process now can be done very fast without additional mouse clicks:
'   1) Start playing a list
'   2) Make sure no tracks are selected (otherwise they catch the rating)
'   3) Listen to track; wind forward if needed with '3' on numeric pad
'   4) Press "`",1-0,"-" on normal keyboard for rating
'   5) Jump to next song with '9' an numeric pad
'   6) Continue with step 3)

' Define some constants
'Set Value to TRUE/FALSE if you want to use HotKey modifiers
const Use_Shift = FALSE  'TRUE
const Use_Ctrl  = FALSE  'TRUE
const Use_Alt   = FALSE  'TRUE

'Icon to be used in the menu
const MenuIcon  = 64     '=yellow star

' MediaMonkey on-start Procedure
Sub OnStartup
' --------------
' Build the hotkey modifier
' --------------
  Dim HotKeyRing
  HotKeyRing = ""

  If Use_Shift Then HotKeyRing = HotKeyRing&"Shift+"
  If Use_Ctrl Then HotKeyRing = HotKeyRing&"Ctrl+"
  If Use_Alt Then HotKeyRing = HotKeyRing&"Alt+"

' ----------------
' Create a new edit menu entry
' ----------------
' first we make a separator
  SDB.UI.AddMenuItemSep SDB.UI.Menu_Edit, 0, 0

' then we add the new menu
  Dim RatingMenu
  Set RatingMenu       = SDB.UI.addMenuItemSub(SDB.UI.Menu_Edit,0,0)
  With RatingMenu
      .caption   = "Change Rating"
      .IconIndex = MenuIcon
      .useScript = Script.ScriptPath
  End With

' ----------------
' Create the sub menus
' ----------------
  Dim RatingSubmenu(12), i, count, caption, key, icon

  count = -1
  For i = 0 To 11
    key = i
    caption = count&".5"    ' will be overwritten on first pass by second if statement below

    If i Mod 2 = 0 Then     ' satisfied only on even numbered loop iterations
      count = count+1
      caption = count&".0"
    End If

    caption = caption&" Stars"

    If i = 0 Then
      key = "`"
      caption = "0 Stars"
    ElseIf i = 10 Then
      key = 0
    ElseIf i = 11 Then
      key = "-"
      caption = "Unknown Rating"
    End If

    If i = 2 Then caption = Left(caption,Len(caption)-1)
    icon = "Y"
    If i = 0 Then icon = "N"
    If i = 11 Then icon = "N"

    Set RatingSubmenu(i) = SDB.UI.AddMenuItem(RatingMenu,0,0)
    With RatingSubmenu(i)
        .Caption     = caption
        .OnClickFunc = "PredefinedRating"
        .UseScript   = Script.ScriptPath
        .ShortCut    = HotKeyRing&key
        If icon = "Y" Then .IconIndex = MenuIcon
    End With

End Sub

' Helper and callback procedure
Sub EditRating(i_rating)
  Dim songlist, song, i

' ---------------
' First check which songs to alter
' ---------------
  If SDB.SelectedSongList.count > 0 Then
    Set songlist = SDB.SelectedSongList
  ElseIf SDB.Player.CurrentSongIndex >= 0 then
    Set songlist = SDB.NewSongList
    Result = SDB.MessageBox("No tracks selected!", mtError, Array(mbOk))
    Exit Sub
  End If

' ---------------
' Change the songs rating
' ---------------
  For i = 0 To songlist.count-1
    Set song = songlist.Item(i)
    With song
        .Rating = i_rating
        .UpdateDB           'update MM database
        .WriteTags          'write data to file tag
    End With

' free memory again??
' songlist = nothing

End Sub

Sub PredefinedRating(i_menuItem)
'  Rating varies from 0 (= 0 stars) to 100 (= 5 stars)
'  So we multiply caption (= 1...0) with 10
   Dim i_rating
   i_rating = Right(i_menuItem.ShortCut,1)

   If i_rating = "`" Then
      i_rating = 0
   ElseIf i_rating = "-" Then
      i_rating = -1
   ElseIf i_rating = 0 Then
      i_rating = 100
      i_rating = i_rating*10
   End If

End Sub

Defy convention. Defy rules. Defy math... Negative Zero.
Posts: 157
Joined: Sun Dec 09, 2007 4:52 pm

Post by bob61 »

Just curious - is this script OK for use with MM3?
Posts: 14278
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia

Post by Peke »

It should Be OK No SQL Calls there.
Best regards,
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
How to add SCREENSHOTS to forum
Posts: 30
Joined: Thu Dec 20, 2007 1:20 pm

Post by baker »

I use this script all the time or a modified version. Any progress on the update mentioned earlier?
Posts: 105
Joined: Tue Jan 01, 2008 8:08 am
Location: Australia

Post by jonp »

Is there a simply way to modify this script so the short cut keys add a selected song to a specific playlist rather than assign a genre?
Posts: 21
Joined: Wed Nov 19, 2008 11:54 am

Re: Genre Shortcut Keys

Post by shemait »

It would be great if I could assign Moods and/or Categories to hotkeys, as well. Maybe something like ALT+1 = my first Mood (Upbeat), and CTRL+! = my first Category (Background), and so on. I am currently working on trying to make sense of the genre script, and seeing if I think I can figure the changes out for myself, but haven't gotten too far (yet). Any help would be appreciated!
Posts: 21
Joined: Wed Nov 19, 2008 11:54 am

Re: Genre Shortcut Keys

Post by shemait »

I actually figured this out on my own, so I will post it here, although it may not be very useful to many people, since it is based on setting the Tempo with ONLY letters. Example: I select a song that I think is "Upbeat" and click the letter "u." This changes that songs Tempo to "Upbeat." Of course, this is modifiable. For example, I made one that changes the Mood based on keyboard letters, as well.
Hope it helps someone!

Code: Select all

' MediaMonkey Script
' NAME: Predefined Tempo Script v1.0
' AUTHOR: Peke
' DATE  : 18.05.2005
' INSTALL: Change Defaults in "Variable Configuration" Section of this file
' Variable Definition (Do Not Change)

' Tempo Variables
Dim Str_Tempo1, Str_Tempo2, Str_Tempo3, Str_Tempo4, Str_Tempo5, Str_Tempo6, Str_Tempo7, 

Str_Tempo8, Str_Tempo9, Str_Tempo10 

' Hotkey Variables
Dim Use_Shift, Use_Ctrl, Use_Alt

' Variable Configuration
'Set Value to TRUE/FALSE if you want to it use in HotKey
Use_Shift = FALSE
Use_Ctrl  = FALSE
Use_Alt   = FALSE

'Change Tempos According to your needs
Str_Tempo1  = "Upbeat"
Str_Tempo2  = "Medium"
Str_Tempo3  = "Mellow"
Str_Tempo4  = "Country"
Str_Tempo5  = "Reggae"
Str_Tempo6  = "Hip-Hop"
Str_Tempo7  = "Alternative"
Str_Tempo8  = "Comedy"
Str_Tempo9  = "Sountrack"
Str_Tempo10 = "Pop"
'===< CONFIGUTARTION ENDED >===============================================

' MediaMonkey On Start Procedure
Sub OnStartup

  Dim HotKeyRing
  HotKeyRing = ""
  If Use_Shift Then
     HotKeyRing = HotKeyRing&"Shift+"
  End if
  If Use_Ctrl Then
     HotKeyRing = HotKeyRing&"Ctrl+"
  End if
  If Use_Alt Then
     HotKeyRing = HotKeyRing&"Alt+"
  End if

  Dim ETempo
  Set ETempo = SDB.UI.addMenuItemSub(SDB.UI.Menu_Edit,0,0)
  ETempo.caption = "Change Tempo"
  ETempo.IconIndex = 58
  ETempo.useScript = Script.ScriptPath
  Dim Tempo1
  Set Tempo1 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo1.Caption = "#1 "&Str_Tempo1
  Tempo1.OnClickFunc = "PredefinedTempo"
  Tempo1.UseScript = Script.ScriptPath
  Tempo1.IconIndex = 18
  Tempo1.ShortCut = HotKeyRing&"u"
  Dim Tempo2
  Set Tempo2 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo2.Caption = "#2 "&Str_Tempo2
  Tempo2.OnClickFunc = "PredefinedTempo"
  Tempo2.UseScript = Script.ScriptPath
  Tempo2.IconIndex = 18
  Tempo2.ShortCut = HotKeyRing&"e"
  Dim Tempo3
  Set Tempo3 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo3.Caption = "#3 "&Str_Tempo3
  Tempo3.OnClickFunc = "PredefinedTempo"
  Tempo3.UseScript = Script.ScriptPath
  Tempo3.IconIndex = 18
  Tempo3.ShortCut = HotKeyRing&"m"

  Dim Tempo4
  Set Tempo4 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo4.Caption = "#4 "&Str_Tempo4
  Tempo4.OnClickFunc = "PredefinedTempo"
  Tempo4.UseScript = Script.ScriptPath
  Tempo4.IconIndex = 18
  Tempo4.ShortCut = HotKeyRing&"4"

  Dim Tempo5
  Set Tempo5 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo5.Caption = "#5 "&Str_Tempo5
  Tempo5.OnClickFunc = "PredefinedTempo"
  Tempo5.UseScript = Script.ScriptPath
  Tempo5.IconIndex = 18
  Tempo5.ShortCut = HotKeyRing&"5"

  Dim Tempo6
  Set Tempo6 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo6.Caption = "#6 "&Str_Tempo6
  Tempo6.OnClickFunc = "PredefinedTempo"
  Tempo6.UseScript = Script.ScriptPath
  Tempo6.IconIndex = 18
  Tempo6.ShortCut = HotKeyRing&"6"

  Dim Tempo7
  Set Tempo7 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo7.Caption = "#7 "&Str_Tempo7
  Tempo7.OnClickFunc = "PredefinedTempo"
  Tempo7.UseScript = Script.ScriptPath
  Tempo7.IconIndex = 18
  Tempo7.ShortCut = HotKeyRing&"7"

  Dim Tempo8
  Set Tempo8 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo8.Caption = "#8 "&Str_Tempo8
  Tempo8.OnClickFunc = "PredefinedTempo"
  Tempo8.UseScript = Script.ScriptPath
  Tempo8.IconIndex = 18
  Tempo8.ShortCut = HotKeyRing&"8"

  Dim Tempo9
  Set Tempo9 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo9.Caption = "#9 "&Str_Tempo9
  Tempo9.OnClickFunc = "PredefinedTempo(9)"
  Tempo9.UseScript = Script.ScriptPath
  Tempo9.IconIndex = 18
  Tempo9.ShortCut = HotKeyRing&"9"

  Dim Tempo0
  Set Tempo0 = SDB.UI.AddMenuItem(ETempo,0,0)
  Tempo0.Caption = "#10 "&Str_Tempo10
  Tempo0.OnClickFunc = "PredefinedTempo"
  Tempo0.UseScript = Script.ScriptPath
  Tempo0.IconIndex = 18
  Tempo0.ShortCut = HotKeyRing&"0"
End Sub

Sub EditTempo(Str_Tempo)
  Dim list, itm, i
  If SDB.SelectedSongList.count = 0 Then
    Result = SDB.MessageBox( "No tracks Selected!", mtError, Array(mbOk))
    Exit Sub
  End If
  Set list = SDB.SelectedSongList
  For i=0 To list.count-1
    Set itm = list.Item(i)
    itm.Tempo = Str_Tempo

End Sub

Sub PredefinedTempo(Item)
   If Left(Item.Caption,3) = "#10" Then
   End If
End Sub
Posts: 77
Joined: Sat Oct 31, 2009 10:04 am
Location: Russia

Re: Genre Shortcut Keys

Post by UksusoFF »

Hello! How can make global hotkeys from this script?
Post Reply