Prev/Next in Shuffle mode

To get bugs in the current release fixed, please report them here.

Moderator: Gurus

Posts: 7
Joined: Thu Jan 08, 2004 9:47 pm

Prev/Next in Shuffle mode

Post by Ekted » Fri Jan 23, 2004 2:03 pm

The player should really keep the idea of a sequence of tracks in shuffle mode. You should be able to go backwards/forwards through the random playlist. ometimes I click quickly on NEXT to skip a few tracks, and I want to go back one, but PREV is just as random as NEXT. This is a very do-able thing. Does it not make sense?

Posts: 46619
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

memory use?

Post by Lowlander » Fri Jan 23, 2004 4:11 pm

Well actually it isn't that easy as MM would need to start keeping track of which songs have been played and in what order. The question then will be if it's enough for the last song, last 5, last 10 last 1000.

As you see with shuffle play, MM doesn't plan that ahead, everytime a next song is requested (end of song, user action) it will use an algorithm to play the next song (Correct me if I'm wrong).

The question is what this remembering will do to the performance of MM and more importantly the system. I'm afraid that this might not me too good.

That said I understand the problem, and I often have wished I could move back while in shuffle play.
Lowlander (MediaMonkey user since 2003)


Post by Guest » Fri Jan 23, 2004 4:33 pm

It is VERY easy to do. You decide how big your shuffle "loop" is going to be. Say it's 1,000,000 songs. Obviously there would be repeats, but who cares. At any given point in the loop, you know which index you are on out of 1,000,000. The song to play at index 'n' is a hash of some seed (maybe MM start time) plus the song index. This is essentially a random number. So do NEXT you simply hash n+1, and to go PREV you hash n-1 (wrapping when you over/under-flow). This would be about 1 page of code and cost zero memory or CPU overhead.

Posts: 7
Joined: Thu Jan 08, 2004 9:47 pm

Post by Ekted » Fri Jan 23, 2004 5:03 pm

Previous post was mine. This site has cookie problems.

Posts: 46619
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Post by Lowlander » Fri Jan 23, 2004 7:21 pm


we'll see what programmers think.
Lowlander (MediaMonkey user since 2003)

Posts: 5395
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic

Post by jiri » Sat Jan 24, 2004 3:25 am

Some comments:

- Those who have need to use Prev button in Shuffle mode I'd recommend to use 'Randomize list' instead of 'Shuffle' as Prev/Next work normally then.

- Other possible solution that was proposed was to put all played tracks to the top of Now Playing and choose the next track from all the tracks that are 'below' the currently playing one. Then after all tracks were played they would be ordered in Now Playing in the order they were played. User could switch between this and the 'old' Shuffle logic.


Posts: 46619
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Played status

Post by Lowlander » Sat Jan 24, 2004 12:49 pm

That seems like an awkward systems. I wouldn't mind if the Now Playing window would be able to show which songs had been played (and a reset for this).
Lowlander (MediaMonkey user since 2003)

Posts: 7263
Joined: Tue Apr 29, 2003 3:39 am
Location: Montreal, Canada

Thoughts on Shuffle/randomize

Post by rusty » Tue Jan 27, 2004 9:51 am

I think that the second option that Jiri briefly described is actually a pretty good one: it eliminates the need for dual/overlapping shuffle/randomize functionalities, and meets the need to show previous/upcoming tracks even when 'shuffle' mode is enabled. Here's the full spec in case you want to comment:

Current issues:
1) There are multiple means of randomizing the 'Now Playing' list of tracks: shuffle (via player) / randomize (via playlist editor). This is confusing
2) When 'shuffled' or 'randomized', the user should still be able to see what song is about to be played
3) When 'shuffled' or 'randomized', the user should be able to see what songs have been played prior to the current one

Alternate solution:
-When the user clicks 'randomize' in the Now Playing list, it simply randomizes all the songs in the playlist (but keeps the currently playing track as 1)
-When the user clicks 'shuffle' in the player, it causes:
-Songs subsequent to the currently playing song to be randomized
-All songs added subsequently to the Now Playing queue to be randomized within a position subsequent to the currently playing track
-Use the terminology 'Shuffle' in both cases to avoid terminological confusion.
-Upon completion of playing the list of tracks in the Now Playing list, if continuous playback is enabled, the list should continue playing from the beginning _without_ reshuffling the tracks so as to prevent recently heard tracks from being played again.

Note: based on, it would also be important to persist the Now Playing list, along with the last-played position in the list so that if the user clicks 'Play' after re-opening MM, it simply continues where it left off.


Posts: 46619
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

My 2 cents

Post by Lowlander » Tue Jan 27, 2004 11:27 am

The way I use it:

I add a bunch of songs which are often sorten an a certain field.

I randomize this list

I manually add 1 song or move 1 song on now playing

I might add another bulk that requires the now playing list to be randomized again.

What would be helpful:

That when randomizing the playing track becomes number 1 in list

An option that songs that played are auto-deleted from now playing list

A way to identify which songs on the now playing list have been played (either in one MM session or over several MM sessions as long as the song has been on the now playing list).

Duplicate warning when adding song that already is on playlist

The option to select a group of songs in the now playing and have only those randomized and/or have the option to randomized the songs from the current playing song on (once normally not played yet) or only songs that haven't played yet.

The shuffle I don't use as I normally want to see what the next song will be. So if shuffle would do the same as randomize I would be satisfied. If it's left like it is that works for me too.[/b]
Lowlander (MediaMonkey user since 2003)

Posts: 54
Joined: Sat Jan 17, 2004 11:37 am

Post by malibu » Tue Jan 27, 2004 5:54 pm

The array/hash solution is not trivial, because there are logistics to maintaining a dynamic structure so that it has N number of locations. Whether it be a linked list that needs memory allocations and relinking when 10 items are added to the start, or a dynamically sized array that will need all items after the inserted shuffled down... Either way there are complexities and CPU cycles involved.

The way it works now with the 'randomize list' option has the same effect with the added bonus of being able to know what the next and last songs were, and to be able to further insert songs in a specific order.. Why not just use that?

Post Reply