Request: Enhanced random

Any ideas about how to improve MediaMonkey for Windows 4? Let us know!

Moderator: Gurus

antigoon
Posts: 12
Joined: Tue Jun 13, 2006 12:21 pm

Request: Enhanced random

Post by antigoon »

How about another couple of options that would influence the behavior of random track selection.
  • 1. The option to prefer higher rated songs. I think the purpose of this is obvious.
    2. The option to prefer more recently played / less recently played songs. Some people want to make sure they get a good rotation of their music and therefore prefer less recently heard songs. Other people want to hear more recently heard songs; I'm not sure why, but it seems to be something some people want.
I see these options being available via some sort of slider. Here's my attempt at an ASCII picture.

Code: Select all

Pure Random                                                  Prefer higher rated
                               v
o------------------------------+--------------------------------------------o


Prefer less recently                 Pure                  Prefer more recently
heard songs                         Random                      heard songs
         v
o--------+-----------------------------o------------------------------------o
    Teknojnky
    Posts: 5537
    Joined: Tue Sep 06, 2005 11:01 pm
    Contact:

    Post by Teknojnky »

    Nod, better random/shuffle has been requested by many.
    Steegy
    Posts: 3450
    Joined: Sat Nov 05, 2005 7:17 pm

    Post by Steegy »

    I try to solve this problem with more music. :) Chance of 2 songs after each other decreases quadraticly with the increase of songs.
    Extensions: ExternalTools, ExtractFields, SongPreviewer, LinkedTracks, CleanImport, and some other scripts (Need Help with Addons > List of All Scripts).
    Lowlander
    Posts: 59949
    Joined: Sat Sep 06, 2003 5:53 pm

    Post by Lowlander »

    Wouldn't the scrobblerDJ be a good guide to create a script that can do this?
    rovingcowboy
    Posts: 14163
    Joined: Sat Oct 25, 2003 7:57 am
    Location: (Texas)
    Contact:

    Post by rovingcowboy »

    no that is still not true random.

    true random would be the program picking all the equazions and not picking a repeat song until all are played in the playlist atleast once.

    it needs to be done with out any percentage thing because the suffle now seems to be running on a perctage and making both on a percentage will compound the error in the shuffle feature now. :-?

    and we don't want it compounded its already screwed up enough. :lol:
    roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
    antigoon
    Posts: 12
    Joined: Tue Jun 13, 2006 12:21 pm

    Post by antigoon »

    Teknojnky wrote:Nod, better random/shuffle has been requested by many.
    Yup, I'm just trying to flush out in a bit more detail exactly what should be in a "better random/shuffle".
    antigoon
    Posts: 12
    Joined: Tue Jun 13, 2006 12:21 pm

    Post by antigoon »

    rovingcowboy wrote:no that is still not true random.

    true random would be the program picking all the equazions and not picking a repeat song until all are played in the playlist atleast once.

    it needs to be done with out any percentage thing because the suffle now seems to be running on a perctage and making both on a percentage will compound the error in the shuffle feature now. :-?

    and we don't want it compounded its already screwed up enough. :lol:

    Two points

    1. "True random"?

    True random is pretty much whatever you want to make it. But mathematically speaking, a random process is not affected by previous outcomes. That is to say, it does allow repeats.
    We don't really care about the strict mathematical definition though: we just want what sounds good to us. But when you start throwing around terms like "true random", it sounds like you do care about the math.

    2. It's not so simple

    It sounds so easy doesn't it?

    So let's go with a randomizing algorithm that we'll call A1. We play all the songs in the playlist in some random order and we don't repeat until they're all played, then do the whole thing again, re-shuffling in a new random order. Let's say the last three songs played in the playlist are songs S1, S2, S3. Now we re-shuffle for the next time around. It's entirely possible that S1, S2, and S3 will all be played within the first ten songs of the next go through the playlist. And one day you'll hear this and scream "that's not true random".

    So, we have to change the algorithm. It's like A1 but if there are N songs in the playlist then no song can be played again before all (N-1) other songs are played in between. We'll call this algorithm A2. If you think about it (try an example of 4 songs), once you randomize the first time, every time you go through the playlist again, it will be in the same order as the first time.

    So, we have to change the algorithm. Maybe we allow (N/2) other songs to be played in between. Or maybe a certain number of hours of playtime. This seems to work, but of course it's not a simple randomizing algorithm anymore because we've got to keep a list of the last N/2 songs played and as new random songs are chosen, they can be rejected if they're not in the last N/2.

    So... By the time you get something like you want, it's going to be something more complicated than you'd imagined. Which is fine, because it's probably what we all want. But if we're going to make it complicated, why not add the weighted random feature as well.
    rovingcowboy
    Posts: 14163
    Joined: Sat Oct 25, 2003 7:57 am
    Location: (Texas)
    Contact:

    Post by rovingcowboy »

    yep i do care about the math.

    it should be controld by the script. what one needs is to do a script that will counter the shuffle button, with the picking of the songs by the math.

    if one was to redo the button code in the player then you can get in to the more heavy codes. but for the way of the script it needs to be simple and go on a few columes to get its choice for the next song.

    so the song would be picked by the script within 4 or 5 seconds after the shuffle button picks it's next song.

    and the best way to make that as fast as possible is by letting the numbers pick it. none of the i liked this so i'd might like that one.

    or the i want this much of this artist and that much of the other artists?
    how is that random you just told the player what you wanted?
    random in order to be true has to be free of any control from the user of the program that is other then the on off of the random feature.

    and if you make it a script then it should be an auto run script and work on all playlists like the shuffle button.


    the whole thing with the shuffle button is that it is not good so it needs either redone completely in the monkeys code. or it needs a good script to use as a patch.

    kind of like what was needed to fix the space scope hubble it needed fixed to be in focus so they added a eye glass style of patch. it was cheap and fast and it works.

    but since they are redoing monkey for the next version there is the chance to redo the code for the players shuffle button.

    so i am for doing either of them as long as we get true random by the math. and not by the wishy washy style of i liked this or that...

    8)
    roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
    Lowlander
    Posts: 59949
    Joined: Sat Sep 06, 2003 5:53 pm

    Post by Lowlander »

    RovingCowboy what you are asking is what MM already does. The shuffle is already mathematical random (that's why people complain about too many repeats). And you can also use it on your whole library with the autoDJ feature.
    The only thing that can be debated is if there is a flaw in the random function (some programing languages have had this problem in the past), but despite that it doesn't always feel pure mathematical random it most likely is.

    The script idea has it's own value, many don't want a mathematical random, but a more controlled random that doesn't allow certain repetitions, like not the same track in so many songs and not a track from the same artist in so many. That would be an enhanced random, not a pure.

    It all depends on yourself which one you would like to use. Some want the pure, some want a enhanced random.
    psyXonova
    Posts: 785
    Joined: Fri May 20, 2005 3:57 am
    Location: Nicosia, Cyprus
    Contact:

    Post by psyXonova »

    I think that something like that can be done with scripting but it will be difficult...
    Perhaps if no one else is willing to i can take that as my next project...
    But dont expect it sooner than a month
    rovingcowboy
    Posts: 14163
    Joined: Sat Oct 25, 2003 7:57 am
    Location: (Texas)
    Contact:

    Post by rovingcowboy »

    oh i see!!

    i thought monkey was using the what i like is what i want to hear controled random.

    i guess it is so messed up it looks and seems that way?

    but since monkey resembles winamp? did the dev's copy winamps shuffle button codes?
    since it also seems to do the same as monkey.

    since monkey is not now using a percentage style then it wont be compounded by adding that on top of it in a script.

    but i still think the math way is best it just needs some more lines of code in it to work properly.
    it seems like they cut the code short to save size of the over all exe.
    and just put the bare min.. code in to make it work.

    see i don 't care if the same artist is repeated i just want to hear all the songs in any one playlist before the songs are repeated.

    the differnent fields i am thinking that should be used to fix it are already being used so it apears. as they are the ones that make the most sense for doing random song choices.

    so it seems what is really needed to fix the shuffle button choices is in fact more lines of code in the program exe and not a script.
    that will make the math way work more correctly.

    and the script could be used for the wishy washy percentage way of doing random.
    roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
    Lowlander
    Posts: 59949
    Joined: Sat Sep 06, 2003 5:53 pm

    Post by Lowlander »

    rovingcowboy wrote:see i don 't care if the same artist is repeated i just want to hear all the songs in any one playlist before the songs are repeated.
    Which means that you want a modified random as a mathematical random would repeat songs before playing all songs on the list. The current implementation is probably correct as it's a mathematical random. This means that one song can be played twice in a row.

    The best solution would be that the developers included options for the shuffle/autoDJ so users can define how they want shuffle/autoDJ applied.
    rovingcowboy
    Posts: 14163
    Joined: Sat Oct 25, 2003 7:57 am
    Location: (Texas)
    Contact:

    Post by rovingcowboy »

    there is another problem too.

    i have playlists that are over 20 hours long. each one of my playlists
    only play for a time limit each day of any where from 30 minutes to 4 hours.

    so any random in my case would also have to work over time limits of days. meaning it would have to include a history list of what it played on what playlist each day.

    but there is a simple way around that.

    just make set limits on the playcounts allowed to be played before any other playcount is allowed. use a random number generator script and pick the ten numbers to hard code for the playcounts to be played first.

    and if none of the playcounts are in the list then any other playcount can be played. have the code check for the number each time a song is started. and run the script. when the songs are played in the hard coded count put them in a temp list of not playable songs until all have been played from the playlist. so the code would not restart them.
    but that is getting more and more code in doing all that.

    so

    1. a beter code using both math and percetage randomizing ways for the shuffle button.
    2. a way to make it play only certian songs with certian playcounts first.
    the playcounts should be the ones in the history playcounts. because the field playcounts can be changed and that would screwup the randomizing.
    and not keep playing them over, by giving them some kind of id of already played this session. this can be done with the last date played field, and make it play only songs that have not been played in the last 4 days.
    3. making the script work on auto.

    thats what i see needs so far. small ideas but huge coding pain in the butt.
    roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
    Nova5
    Posts: 193
    Joined: Fri Mar 10, 2006 11:33 pm

    Post by Nova5 »

    rovingcowboy wrote:no that is still not true random.

    true random would be the program picking all the equazions and not picking a repeat song until all are played in the playlist atleast once.

    it needs to be done with out any percentage thing because the suffle now seems to be running on a perctage and making both on a percentage will compound the error in the shuffle feature now. :-?

    and we don't want it compounded its already screwed up enough. :lol:
    Except that isn't true random. a true random system cannot exist on a computer, mathmatically its not legal. Computers run on math (binary logic really but in the end its math.. Hell they can't even do any other form of math except addition. The rest is trickery!)

    They can only simulate randomness, the best random that can be acheived on a computer is to use a random number generator function limited to the number of tracks in the library or playlist its working with at that moment. say.. 1-673. then play the track that has that number assigned to its postion in the list.

    True Random allows for the same track to play time after time.. even infinte plays one after the other. Although it would seem to be impossible for that to happen since its supposed to be random... it does because it is possible. random obeys no laws.
    rovingcowboy
    Posts: 14163
    Joined: Sat Oct 25, 2003 7:57 am
    Location: (Texas)
    Contact:

    Post by rovingcowboy »

    when a rule of operation is broken then the operation stops being the same operation as it was before the rule was broken.

    therefore if the operation is called random, and the rule of picking things at random is broken by the operation picking the same item over in a consecitive order it stops being a random operation and becomes a repeat operation.

    if there was one item to pick then it has no choice. but it also is not called random becaue the rule of having a choice was not given to the operation, so it never started out to be random.

    random means it picks the items in a list of multiple items one at a time until all have been picked if the rule of repeat is givin to the operation, then it is allowed to pick them over again in the same way one at a time until all are picked, with out it being calld a repeat operation.

    8)
    roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
    Post Reply