Song Choice [Script]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

BigMatty
Posts: 24
Joined: Tue May 30, 2006 8:14 am
Contact:

Song Choice [Script]

Post by BigMatty »

Song Choice

Script Installer
Just open the zip and double click on the file inside - it will install for you.

Changelog
v1.0 - 09/10/06
* Released!
v1.4 - 12/10/06
* Got rid of error affecting international versions of Windows XP (Thanks for your suggestions on this holterpolter)
* Added checks to all queries to exit quietly if no results are available, instead of showing a database error (Thanks for your suggestions on this DiddeLeeDoo)
* Improved 'NonStop Play' mode. As it struggles to find a suitable song inside the Song Choice the criteria is gradually weakened until it eventually picks anything.
* Uses 'star ratings' now, which makes more sense for users.
* Shows how many songs from each Song Choice goes into the main Song Choice playlist under the description nodes
* Remembers all your 'Filter By' settings, even after closing MediaMonkey

What it does

The main purpose of the script is to choose songs for you to listen to based on various criteria.

It creates a brand new node which looks a little something like this:
Image
As you can see there are a bunch of Song Choices.
Each Song Choice works differently. 'New Hits' gives you new songs that you like. 'Recommended Listening' gives you songs you haven't heard in a while. 'Classics' lists your favourite songs.
If I was to click on 'New Hits' then I'll get a bunch of 'new' songs... and the higher up the song is listed, the more of a 'hit' it is.

Let's explore inside the "Classics" node to see what's going on...
Image
This Song Choice is choosing songs which are rated 4 or more, at least 90 days old, and played at least once. Out of these songs, those which have a high rating are given a small boost of 1, and songs heard reguarly are given a large boost of 10. This means that songs you listen to lots are pushed to the top of the playlist by alot, and songs that are rated highly are pushed up by a small amount.

Each different Song Choice has different selection critiria and boosts songs by various different levels.

You can easily get a nice mixture of songs to listen to by clicking on the main node named 'Song Choice'. You can send directly to the 'Now Playing' list. The amount of songs it picks from your Song Choices can be changed from within the script itself (see the advanced section)

A really cool feature of this script is the 'NonStop Play' mode.
Image
When NonStop Play is enabled it will keep topping up the Now Playing list with songs from a selected Song Choice. In this instance I want to listen to 'Recommended Newbies'. Songs can be chosen from others just by selecting it inside the tree.
A cool feature is that once an artist is chosen it does not appear again until 5 other songs are played, and it doesn't ever choose the same song if it already appears in the 'Now Playing' list. This will give you a nice balance of music to hear!

Another feature is the 'Filter Results'...
Image
In this instance I was feeling like listening to Progressive Rock and Progressive Metal, so I enabled 'Filter by Genre' and clicked on those genres. Now whenever a Song Choice node is clicked on I will only get songs from those genres. Results can also be filtered by artists.

Advanced
So you want to customize the 'Song Choices' or make your own? Read on!
The script is easily customized, all you need is a little bit of scripting knowledge. The very first bit of code inside the script is a sub named 'UsersSongChoices'. Take a look at the code, it should be fairly obvious how new Song Choices are defined. Here's the 'Classic' Song Choice as an example...

Code: Select all

Set SongChoice = New SC
With SongChoice
        .Rating =                 3
        .Unrated =                False
        .DaysInDatabase =         90
        .NumberOfPlays =          1
        .RatingImportance =       1
        .PlayRateImportance =     -10
        .NeedsHearingImportance = 0
        .NewSongsImportance =     0
        .SelectFromMe =       3
End With
Storage.Add "Classics", SongChoice
General Guidelines
To ignore a setting set it to 0 (that's a zero!)
When boosting songs, the larger the number (when compared with others) the more boost is given to songs which fit that criteria. For example, giving 'RatingImportance' a high number like '20' will mean that highly rated songs appear at the top, as they are given a large boost. As the number gets lower and approaches 0, songs with a high rating are given less of a boost. When setting it to 0, it is ignored completely. Now for the real twist... setting it to a negative number has the opposite effect! For example, setting 'RatingImportance' to a low negative number like -2 will mean songs with a LOW rating are boosted a little bit. Setting it to a large negative number, like -20, will mean that low rated songs are given a big boost!

So in summary.. setting RatingImportance to;
- 20 = Low rated songs boosted lots
- 2 = Low rated songs boosted a little
0 = No boost given for song ratings
2 = High rated songs boosted a little
20 = High rated songs boosted lots

Hopefully that makes sense - just experiment with the values and see the outcome. Enjoy!

Selecting Songs
  • Rating
    Positive - Will choose songs that have a rating of at least _X_
    Negative - Will choose songs that have a rating less than _X_
  • Unrated
    True or False - Include songs which have not been rated?
  • DaysInDatabase
    Positive - Will choose songs that have been in the database for at least _X_ days
    Negative - Will choose songs that have been added within the last _X_ days
  • NumberOfPlays
    Positive - Will choose songs that have been played at least _X_ times
    Negative - Will choose songs that have been played less than _X_ times
Boosting Songs
  • RatingImportance
    > - High rated songs given a boost
    < - Low rated songs given a boost
  • PlayRateImportance
    > - Songs not played reguarly are chosen
    < - Songs played reguarly are chosen
  • NeedsHearingImportance - When you last heard the song based on playrate
    > - Songs that need hearing are chosen
    < - Songs that don't need hearing are chosen
  • NewSongsImportance
    > - New songs are chosen
    < - Older songs are chosen
Other Settings
  • The 'select from me' setting is how many songs from this particular Song Choice go into the main playlist when clicking on the main 'Song Choice' node.
  • If you enable the constant 'ShowSongDetails', when you click on a song in MediaMonkey it will popup information like the PlayRate, and NeedsHearing values. This is good for seeing why a song gets boosted and for fine-tuning your Song Choices.
To Do
  • Option sheets for managing Song Choices (instead of editing this code)
Last edited by BigMatty on Thu Oct 12, 2006 1:45 am, edited 10 times in total.
psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova »

Nice written.... Well done...
Nice results too.
Only con I can see for now it is the requirement to alter the script so that it can fit your prefernces. Creating an option sheet for that is a MUST and its quite easy since a lot of examples exist outhere.

Also, try adding more criteria and options since for now most of the things your scripts does, are also done by autoplaylists (but ofcourse not all of us have the gold version...)

Again, good job, keep up, welcome to MM scripting community...
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

Looks like a great piece of work, and a great base for some pretty advanced song selections. Installed here and hope to get some time to give it a study soonish.

Still running from deadline to deadline workwise so 'playtime' is very limited.
Image
BigMatty
Posts: 24
Joined: Tue May 30, 2006 8:14 am
Contact:

Post by BigMatty »

Hey guys,

Major revamp here. I basically scrapped the old script and have a brand new one with lots of cool features to try out :)

Just as a note there's an error which occurs when no results are given. For example if you filter by the artist 'Metallica' but the Song Choice contains no 'Metallica' then a database error pops up. Best just to click 'Ignore'.

Keep in mind this is my very first script so I may need a little advice from other keen scripters :)

Been working my ass off here so please let me know what you think!
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

It's interesting that you are using tree nodes to enable/disable options. Would these not be better moved to an option sheet?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
BigMatty
Posts: 24
Joined: Tue May 30, 2006 8:14 am
Contact:

Post by BigMatty »

Probably, once I investigate on how to do that :P

For now it works really well though. In fact it might be preferred, considering you can see if NonStop Play and Filtered Results is turned on just by glancing at the open node, instead of going into some options.
DiddeLeeDoo
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under
Contact:

Post by DiddeLeeDoo »

With all the choices here I guess it will take awhile before options even comes to mind. Amazing consept, look forward to see where this one is going. :) At this point I'm just 'looking', not quite understanding, but then again, I guess you've spend quite some time figuring this one out. Need 'catching-up' time...
Image
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

Looks cool will check this one out when i get home from work!

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

I'm not saying your system doesn't work well, it works great! I was just pointing out that an options sheet might be a bit more standard. The script is looking very interesting though! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Steegy
Posts: 3452
Joined: Sat Nov 05, 2005 7:17 pm
Contact:

Post by Steegy »

This script looks really superb, considering the very nice scripting, usefulness and speed of development.

I haven't tested it out yet, but I'll do it soon as this looks great!
Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
psyXonova
Posts: 785
Joined: Fri May 20, 2005 3:57 am
Location: Nicosia, Cyprus
Contact:

Post by psyXonova »

Nice to see that you rewrote your script almost from scratch. Works as it should. Nice job
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden
Contact:

Post by Bex »

I'm getting SQL error on every node :(

I suspect it has todo with "comma" vs. "dot" syntax error. (I have Swedish XP.)

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

Bex wrote:I'm getting SQL error on every node :(

I suspect it has todo with "comma" vs. "dot" syntax error. (I have Swedish XP.)

/Bex
I'm getting errors too.
BigMatty
Posts: 24
Joined: Tue May 30, 2006 8:14 am
Contact:

Post by BigMatty »

To those getting the errors could you please try out this script..

SongChoice Possible Fix

It's not a self install, just overwrite the old version with it.

If that doesn't work I have a suggestion by a member of the forum in my PM which should work :)

Thanks guys
kanski
Posts: 80
Joined: Fri Mar 10, 2006 11:18 am
Location: Russian Fed.
Contact:

Post by kanski »

BigMatty wrote:To those getting the errors could you please try out this script..

SongChoice Possible Fix

It's not a self install, just overwrite the old version with it.

If that doesn't work I have a suggestion by a member of the forum in my PM which should work :)

Thanks guys
GOOD! Thanks!
Post Reply