Script: Radio-DJ [MM3]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

Hi m_bojangles,

I can reproduce the first part of your problems until you say you restarted MM for the first time. After restarting MM, my installation behaves different.

But anyway, I trying to explain why this happens.
(At least as far as I understand it...)

I write logging information to a trace file.
The error occurs during opening the trace file and it seems to me, that the file is already open. Thats why it says "permission denied".

I have no idea, why the trace file gets opened more than once.
Maybe this has to do with the way how MM handles scripts.
I have to ask the MM developers.

I also saw the pop-up box with the song name in the title and "unknown name". I have no idea where this comes from. This is probably a pop-up box from MM.


For the moment as a workaround:
Please open the script RadioDJ.vbs
Goto line 1492
set the line to

Code: Select all

        m_sIntTraceLevel = NOMSG
thus disabling the logging mechanism.

When I retry the procedure you descibed
I was able to look at the options panel. When I went into the options for AutoDJ, I set the playlist to RadioDJ plug-in for AutoDJ.
[...]
Then I turned on AutoDJ via the Play menu.
Then I played the third to last song in my Now Playing list.
Now I still get the pop-up box with "unknown name", when setting the playlist in AutoDJ-Option to RadioDJ -- but the RadioDJ scripts seems to work.


This should give you the possibility to hear music while I try to solve this puzzle...


CIAo, uwe..
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

I could reproduce it: It happens, when i open the Radio-DJ Node and while the plugin is listening my collection there.

I found a trace.log but don't have your E-Mail-Adress. So i will post the end of the log here.

Thanks for your work.

I will also try your workaround. Perhaps it works for me too.

Olli

_______________________________________________________________
trace.log (only the last messages)
_______________________________________________________________

15.01.2008 22:32:26 OCCURRED IN: fillRadioDJ SEVERITY: 5 MESSAGE: nextRating = 9
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 10 MESSAGE: entereded
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating = 9
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating is Integer
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: ratedSongLists is Variant()
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: ratedSongLists(0) is SDBSongList
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating = 9
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: maxRnd = 23
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: r1 = 9,32310104370117
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: r2 = 9
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: song = Grace Kelly; (80)
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 10 MESSAGE: finished
15.01.2008 22:32:26 OCCURRED IN: fillRadioDJ SEVERITY: 5 MESSAGE: Song = Grace Kelly(80)
15.01.2008 22:32:26 OCCURRED IN: fillRadioDJ SEVERITY: 5 MESSAGE: Song 67 added Grace Kelly 80
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 10 MESSAGE: entereded
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: maxRnd = 78
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: random = 4,47261965274811
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: i = 0
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: lower = 0
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: upper = 4
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: i = 1
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: lower = 4
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: upper = 4
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: i = 2
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: lower = 4
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: upper = 5
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Entered
15.01.2008 22:32:26 OCCURRED IN: ConfigData::Property Get Weighting SEVERITY: 10 MESSAGE: Finished
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: weighting = 1
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 5 MESSAGE: rating = 2
15.01.2008 22:32:26 OCCURRED IN: chooseWeightedRating SEVERITY: 10 MESSAGE: finished
15.01.2008 22:32:26 OCCURRED IN: fillRadioDJ SEVERITY: 5 MESSAGE: nextRating = 2
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 10 MESSAGE: entereded
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating = 2
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating is Integer
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: ratedSongLists is Variant()
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: ratedSongLists(0) is SDBSongList
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 5 MESSAGE: rating = 2
15.01.2008 22:32:26 OCCURRED IN: chooseRandomSong SEVERITY: 20 MESSAGE: No song in rating 2 found.
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

Hi Olli,

it seems that at least for one rating (one star) you have no song.
Obviously in the options you have enabled songs with one star.

The error happens, because the algorithm tries to select a song with
one star but can't find any song.

This should give you enough information for a workaround.
(Either disable one star or give at least one song that rating)

I try to solve this situation for the next bugfix somewhat smarter...


CIAo, uwe..

PS: you can use www.mediafire.com to upload files. It works even without registration.
m_bojangles
Posts: 105
Joined: Fri Jun 11, 2004 8:22 pm

Post by m_bojangles »

uwuerfel wrote: For the moment as a workaround:
Please open the script RadioDJ.vbs
Goto line 1492
set the line to

Code: Select all

        m_sIntTraceLevel = NOMSG
thus disabling the logging mechanism.
I'll try this uwe, but I don't have an editor with line numbers. Is this the line you want me to modify?

Code: Select all

m_sIntTraceLevel = VERBOSEMSG
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

m_bojangles wrote:
I'll try this uwe, but I don't have an editor with line numbers. Is this the line you want me to modify?

Code: Select all

m_sIntTraceLevel = VERBOSEMSG

Yes it is.
Good luck.


CIAo, uwe..
Big_Berny
Posts: 1784
Joined: Mon Nov 28, 2005 11:55 am
Location: Switzerland
Contact:

Post by Big_Berny »

Thanks for the update! I'll try it out when I have time! :)
Image
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP
AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Maybe if you pack it an a mmip i might be interested in testing it ;-)
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

today i tested the script at work the whole day by listening to random music from my collection.

And it was really not bad. Some higher rated songs were played a bit too often, but i guess, "15" for 5 Star rated songs is a bit too much, when you only have 3 or 4 songs with this rating :D

So i think with a little bit of playing around with the settings this script really rocks! 8)

But there's the problem at the moment: At the moment, the Auto-DJ Playlist is set and i leave the options dialogue with "ok", i can't get back to it anymore.

When i click at "options" i only get the already well known "unknown name"-error and the options-window won't open.

That's the only serious bug i discovered, this silly little window :x

Question: would it be difficult to set a minimum amount of songs, before the same song plays again? Because i often had a song played twice with only about 8 songs in between.

Olli
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

Hi Olli,
ollifant wrote: Some higher rated songs were played a bit too often, but i guess, "15" for 5 Star rated songs is a bit too much, when you only have 3 or 4 songs with this rating :D
This is far too high.
I will show you an example below.

ollifant wrote: But there's the problem at the moment: At the moment, the Auto-DJ Playlist is set and i leave the options dialogue with "ok", i can't get back to it anymore.
Hm, this is strange.
I never had the effect, that I couldn't open the options page any more.
Are you sure, that you initialized the GUI by clicking on "Tools / Scripts / RadioDJ"?
This creates the option page and the node for RadioDJ in the MM tree. If you forget to initalize it, both won't be shown.

Nevertheless, the auto-DJ functionality will work even without that initialize, since the initialize is only necessary for GUI elements.
ollifant wrote: Question: would it be difficult to set a minimum amount of songs, before the same song plays again? Because i often had a song played twice with only about 8 songs in between.
I fear it could lead to dead locks.
And I also think there is no need for it.

Reagarding the repetition of a single song, there is not only the weighting important, but also the amount of songs per rating.

Lets have a look at this example:

Code: Select all

Let's say we have the following amount of songs in MM

            Amount of
Rating      songs         
--------    --------
5   Stars   20           
4,5 Stars   250          
4   Stars   450          
3,5 Stars   500          
3   Stars   500          
2,5 Stars   200          

To make things easier for this example, let's say, that we only have 3 ratings and
we put 4 and 4,5 in one rating and 3 and 3.5 in another rating.
This brings us to the following list where I have assumed a rating that you maybe have used.
I also computed the resulting probability for each rating and what this means in term of
"How often is a song from this rating in my playlist?". Finaly you can see after how many
songs a song from in a rating gets repeated. 

                                            Probability         Every x-th           
                Amount of                   for this            song comes          repetition
Rating          songs        Weighting      rating              from this rating    after x songs
--------        --------     ---------      ------              ----------------    -------------
5 Stars         20           20             57,14%              1,75                35
4 + 4,5 Stars   700          10             28,57%              3,5                 2450
3 + 3,5 Stars   1000         5              14,29%              7                   7000


Now I have set all the weightings to the same number.
Surprisingly this doesn't mean, that every song is played as often as each other song.
It only means, that the probability for each rating is the same. But since we have only
very few songs in the 5 star rating, a song from the 5 star rating gets repeated much
more often than every other song.

                                            Probability         Every x-th           
                Amount of                   for this            song comes          repetition
Rating          songs        Weighting      rating              from this rating    after x songs
--------        --------     ---------      ------              ----------------    -------------
5 Stars         20           10             33,33%              3                   60
4 + 4,5 Stars   700          10             33,33%              3                   2100
3 + 3,5 Stars   1000         10             33,33%              3                   3000


This is just to show you, that even with a weighting in 5 stars, that is less than the weighting
of 4 stars, songs from 5 stars still get repeated more often than other songs.

                                            Probability         Every x-th           
                Amount of                   for this            song comes          repetition
Rating          songs        Weighting      rating              from this rating    after x songs
--------        --------     ---------      ------              ----------------    -------------
5 Stars         20           5              16,67%              6                   120
4 + 4,5 Stars   700          20             66,67%              1,5                 1050
3 + 3,5 Stars   1000         5              16,67%              6                   6000


In this example you can see which weightings you would need so that every song gets repeated
more or less the same. (just in this very special example)

                                            Probability         Every x-th           
                Amount of                   for this            song comes          repetition
Rating          songs        Weighting      rating              from this rating    after x songs
--------        --------     ---------      ------              ----------------    -------------
5 Stars         20           0,35           1,2%                85,7                1714,3
4 + 4,5 Stars   700          12             40,0%               2,5                 1750,0
3 + 3,5 Stars   1000         17             56,7%               1,8                 1764,7

So my advice is just play with the weightings until you have your prefered settings.
There should be nothing else needed.

Hope that helps.

CIAo, uwe..
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

I have Uploaded

V0.4.2
The strange messagebox saying "Unknown name" doesn't appear anymore.
It turned out, that the subs "InitOptionSheet" and "SaveOptionSheet"
must exist, even if they are not used.

chooseWheigtedRating checks if songlists for a randomly chosen rating
are empty. If they are, another rating is generated.

Logging is disabled by default.


CIAo, uwe..
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

thanks for this great explanation and the examples. Yesterday and today i already thought about this and finally found out, that the number of songs does matter for sure, because of the different playlists that your script generates.

I have now lowered the amount for the higher rated songs and it's getting better.

about the "repeat after x songs" thing: are the songs from one rating picked by true random (means, one song could be played more often than another), or by shuffle (every song is played, just the order changes)?

I really like your script! Working is now much more fun with my favourite music!

And now I'm going to test your new version, cause playing around will be much easier without loading and unloading the script everytime, you want to get to the options and change a setting :wink:

Olli
Last edited by ollifant on Fri Jan 18, 2008 10:36 am, edited 1 time in total.
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Yeah, it works!!! 8)

Thank You!
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

sorry, but there's a new problem: changes in the settings won't be saved :(

When i open the options windows again, the old settings are back...

Olli
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

Hi Olli,
ollifant wrote: about the "repeat after x songs" thing: are the songs from one rating picked by true random (means, one song could be played more often than another), or by shuffle (every song is played, just the order changes)?
Yes it's true random.
ollifant wrote: I really like your script!
Thanks
:D


CIAo, uwe..
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

ollifant wrote:sorry, but there's a new problem: changes in the settings won't be saved :(

When i open the options windows again, the old settings are back...
Hm, that's strange. I have no idea why this could hapen.
And I can't reproduce it here.

Can you please describe detailed what you are doing.
Hopefully I can reproduce it then.

The other possibility is, that you turn on tracing (go to line 1524 and set m_sIntTraceLevel to VERBOSEMSG) and leave me the trace.


CIAo, uwe..
Post Reply