Script: Radio-DJ [MM3]

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

Moderators: Peke, Gurus

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

Post by ollifant »

Hi Red,

the problem with using the "now playing" list is, that higher rated songs should repeat, but lower rated should not.

checking the last (let's say 100) Titles for already played songs, would destroy the weighting, if you have 5 Star songs that should repat more often (Hot Rotation).

On the other Hand, songs you don't like so much, shouldn't repeat even after 200 Songs for example.

Olli
locu
Posts: 20
Joined: Thu Nov 09, 2006 12:16 am
Location: Berlin, Germany

Post by locu »

As far as I remember RadioFreeMonkey used the last played and/or playcount properties of each track when generating the playlist to prevent certain tracks from being played again to quick.

I have no idea how exactly this was implemented, but for me it always seemed to work quite well. I don't know in how far you could integrate this behavior for the new Radio-DJ script.

Apart from this, nice work.

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

Post by uwuerfel »

Hi all,

does everybody prefer shuffle instead of true random or is there anybody who prefers true random instead of shuffle?

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

Post by uwuerfel »

I just uploaded V1.0.0.

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

Post by uwuerfel »

Just to keep you informed:

I started to implement a simple shuffle algorithm.
Looks like I have to change a considerable amount of code...

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

Post by ollifant »

Hi Uwe,

thanks for the update. Sounds, like you already have an idea about shuffling?

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

Post by uwuerfel »

Hi Olli,
ollifant wrote: Sounds, like you already have an idea about shuffling?
Yes.
In the first try it will be rather simple.
The function, which selected the next song of a given rating
will be switched to shuffle.
There will be nothing to remember played songs from one session
to another. Whenever the script is started, the algorithm starts again.
The script starts again, when
- you turn Auto-DJ on or off
- open the options dialog
- restart MM

The script doesn't restart when you just stop or restart playing
music (e.g. by "Play / Stop" or "Play / Play").
(at least that's what I found out)

For a first try this should be enough to see if it's the right way...


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

Post by uwuerfel »

Hi Olli,

here is the actual development snapshot.

[Link removed]

Remove RadioDJ.vbs from the "auto" folder and copy
this script to the auto folder.

The ini-file should look s.th. like this:

Code: Select all

[DevRadioDJ]
FileName=auto\RadioDJ_V1-1-dev.vbs
DisplayName=Dev_Radio-DJ
Language=VBScript
ScriptType=4
I tested the script yesterday and it worked for me.
Please give it a try and tell me what you think.

Please have in mind, that it is an enginering release,
this means that there can be bugs in it.

It still is an auto script, but tracing is enabled by default.
Maybe you should have a look in your temp-directory and
clean it up from time to time. The trace files are named
"radiodj_xxxxx.log", where xxxxx are some random characters.

Have fun :)


CIAo, uwe..
Last edited by uwuerfel on Tue Feb 05, 2008 5:30 am, edited 1 time in total.
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

thanks for sharing the newest version.

I've made a very quick test and everything seems to be ok.

I had one song twice (after 14 other Songs), but this must have been because of skipping. I skipped all the songs to make it faster selecting new songs. I think, if they haven't got a playcount, they will play again, even in shuffle-mode, right?

Olli

P.S.: From tomorrow afternoon on, I'm away for a few days. Don't wonder, if I don't answer.
uwuerfel
Posts: 76
Joined: Tue Jan 08, 2008 3:29 pm
Location: Germany

Post by uwuerfel »

Hi Olli,
ollifant wrote:I had one song twice (after 14 other Songs), but this must have been because of skipping. I skipped all the songs to make it faster selecting new songs. I think, if they haven't got a playcount, they will play again, even in shuffle-mode, right?
If a song repeats, that means that the songlist for the rating of that song got empty and was recreated. When it's recreated, every song from that rating is used. Since obviously all songs have been played, it wouldn't make much sense not to use all songs. Or maybe the script has been restarted and completely recreated all the internal songlists

I currently think about incorporating the use of the attribute "Last Played" when initializing the rated playlist for the first time. This can be used to have some sort of memory between one music session and the next.
MM updates the attribute "Last Played" only if the song has been played completely (or almost completely). So if you skip songs, for my script it's as if they were not played and it wouldn't behave any different...

I don't know how MM handles the attribute "Playcount", but I think it will probably be handled similar and only be updated after a song has been played completely. If i'm right, it would make no differerence what is used.


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

Post by ollifant »

If a song repeats, that means that the songlist for the rating of that song got empty and was recreated.
Not all 5-Star-rated songs were played, but the one song i had twice was skipped at the first play. Just like you wrote:
So if you skip songs, for my script it's as if they were not played and it wouldn't behave any different...
But for me this is absolutely no problem, because normally i don't skip that much :)

I'm testing your update now here at work since about 2 hours, still no problems 8)

Thx again,

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

Post by uwuerfel »

I just uploaded

V1.1.0
- using shuffle instead of true random
- added additional param to option dialog due to shuffle


I also added some description on the first posting, that explains a little bit
how shuffle works.


CIAo, uwe..
Autor of Radio-DJ
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

thanks for the new version. I've tested it a little bit this week and it was fine.

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

Post by uwuerfel »

Hi,

here is a new version of Radio-DJ.
It's still beta, so be carefull.
When it gets stable I will put it in the first article.

[Link removed]

The changes are:

- Switched to SQL-statements where possible.

- ini-file is now stored in the same folder as the scriptfile and also has the same name as the script file. You can not switch back from V1.2 an V1.1 since the old values from V1.1 are deleted after moving them to the new file. Therefore V1.1 won't find any values and will use the defaults.

- the old variable "timeframe" was replaced by "skipMostRecentPlayed". This means, that for each rating the internal playlist is sorted by "LastPlayedTime" and the most recently played x% are ignored. That way you should (almost) never hear the same song twice within a few minutes.

There is only one exception.
MM fills the now playing list with a short list of songs in advance (max 10 songs). Since "LastTimePlayed" is still somewhere in the past, when you restart the script, it can happen that one of these songs gets played twice. The only remedy against this, is to tell MM not to fill the list in advance.


[Edit]
I forgot one important detail:
If you are using autoplaylists as input for Radio-DJ, you must make sure that your autoplaylist ist sorted by "LastTimePlayed" in order "Z .. A".

If you are using static playlists as input, I can get the songs in the needed order from the db.
[/Edit]


CIAo, uwe..
Last edited by uwuerfel on Fri Apr 18, 2008 3:46 pm, edited 1 time in total.
Autor of Radio-DJ
ollifant
Posts: 27
Joined: Tue Jan 15, 2008 4:28 pm
Location: Germany

Post by ollifant »

Hi Uwe,

nice to hear from you with a new version.
the old variable "timeframe" was replaced by "skipMostRecentPlayed".
That's a great idea and i'm really looking forward to test it.

I'm still using your script everyday at work. It is still the best script for my purposes, so thank you for sharing.

Olli
Post Reply