Old 4th September 2003, 01:41   #1
cdbsi
Junior Member
 
Join Date: Nov 2002
Posts: 8
How does the Winamp shuffle algorithm work?

Any ideas?
cdbsi is offline   Reply With Quote
Old 4th September 2003, 02:21   #2
ShyShy
Amazon Bush Woman
Forum Queen
 
ShyShy's Avatar
 
Join Date: May 2003
Location: The Sticks, Queensland
Posts: 8,066
Uh, I'm thinking that you're in the wronga area with this question. You may want to try the appropriate tech area.
ShyShy is offline   Reply With Quote
Old 4th September 2003, 02:52   #3
godoncrack
Forum King
 
godoncrack's Avatar
 
Join Date: Aug 2003
Location: http://www.mossad.gov.il
Posts: 2,135
i think.....
numbers you list
takes numbers 1-x
scrambles them
then plays list in that order
i think
godoncrack is offline   Reply With Quote
Old 4th September 2003, 03:50   #4
DragonSon
Fears the boots
Forum King
 
DragonSon's Avatar
 
Join Date: May 2003
Posts: 3,445
Quote:
Originally posted by ShyShy
Uh, I'm thinking that you're in the wronga area with this question. You may want to try the appropriate tech area.

And try the search feature before you post a tech question, as well.
DragonSon is offline   Reply With Quote
Old 4th September 2003, 04:21   #5
corkhead0
Major Dude
 
Join Date: Oct 2002
Posts: 548
Quote:
Originally posted by godoncrack
i think.....
numbers you list
takes numbers 1-x
scrambles them
then plays list in that order
i think
I doubt it, if it did that then people wouldn't be complaining that the shuffle isn't very random.

I think it's something more like:

int song = floor(rnd * songsInPL) + 1;
play (song);

I can't remember the proper C++ name for the floor function, and can't be arsed to look it up right now.
corkhead0 is offline   Reply With Quote
Old 4th September 2003, 04:46   #6
cdbsi
Junior Member
 
Join Date: Nov 2002
Posts: 8
Quote:
Originally posted by ShyShy
Uh, I'm thinking that you're in the wronga area with this question. You may want to try the appropriate tech area.
I think not. On the bottom of the following news article it states "Spread the word of shuffle in Nullsoft Propaganda Forums" and "Talk about 'On to a Better Shuffle' in the Forums" as links to this very forum:

http://www.winamp.com/news.jhtml?articleid=9049

Unless Nullsoft themselves don't know what they're talking about.

Again, I think not.
cdbsi is offline   Reply With Quote
Old 4th September 2003, 04:53   #7
zootm
Forum King
 
zootm's Avatar
 
Join Date: Jan 2002
Location: the nether reaches of bonnie scotland
Posts: 13,377
there's a billion and one algorithms to make pseudorandom numbers, it'll just be one of them, coupled with the restriction that is mentioned in the news source you provide:
Quote:
you'll never hear the same song again until at least half of the rest of the songs in the playlist play through
out of interest, why are you asking?

zootm is offline   Reply With Quote
Old 4th September 2003, 05:03   #8
cdbsi
Junior Member
 
Join Date: Nov 2002
Posts: 8
Quote:
Originally posted by zootm
out of interest, why are you asking?
*** BEGIN SARCASM ***

Nullsoft told me to... hence the following link => http://www.winamp.com/news.jhtml?articleid=9049

Since I am inspired by Nullsoft, I want to support them by creating inquiries in their forum.

I also have a huge crush on Justin Frankel. The ideal geek that I just love to loathe.

*** END SARCASM ***
cdbsi is offline   Reply With Quote
Old 4th September 2003, 08:08   #9
whiteflip
Post Master General
(Forum King)
 
whiteflip's Avatar
 
Join Date: Jun 2000
Location: Seattle, Now Las Vegas
Posts: 6,032
There is no such thing as random. Everything is predetermined. I proved that one while high and drunk and camping. We decided to write down all of our thoughts and thats what came out. It was trippy. There were equations and stuff but you have to be high to understand them.

Winamp is written in C++ i think So it prolly uses a function of random seeded by the time or the winamp guys wrote their own random cuz the one in the included C++ library sucks.

How random works in most programing language is this. There is a gigantic list of numbers and a seed value. if the seed (starting point in list) value is constant you will get the same random numbers in order every time. If the seed value is set to the computers clock, every time you run the random function you get a number from a different position in the list.

This is probably applied to a peice of code that takes your play list and fines a random song and stores the order of the songs it picks as well as the song picked so as not to pick the same song again going through the list. Cuz you can click the <| button and get a song you were just listening to while in random. It does this pick random song from list everytime you advance a song.

My friend made a random that had a seed value based on the starting and ending locations in memory where the program resided.

Correct me if I am wrong.

[edit]yeah ugh if you read all that, sorry. just read the article above, it answers all.[/edit]

I'm Back?
whiteflip is offline   Reply With Quote
Old 4th September 2003, 11:10   #10
Mr Jones
Nothing to say...
 
Mr Jones's Avatar
 
Join Date: Sep 2000
Location: UK
Posts: 23,048
Moved to WA2 discussion
Mr Jones is offline   Reply With Quote
Old 12th February 2017, 04:51   #11
blksith0
Junior Member
 
Join Date: Mar 2012
Posts: 10
This is still the first google result.

Does it build a predetermined list of numbers corresponding to that position in the playlist?
Does it allow duplicates to be played, or does the "pool" of numbers shrink by 1 after every choice?
Does it just choose a random number from 1 to <playlist size> at the end of each song?
blksith0 is offline   Reply With Quote
Old 12th February 2017, 16:24   #12
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,535
Quote:
Originally Posted by blksith0 View Post
This is still the first google result.

Does it build a predetermined list of numbers corresponding to that position in the playlist?
Does it allow duplicates to be played, or does the "pool" of numbers shrink by 1 after every choice?
Does it just choose a random number from 1 to <playlist size> at the end of each song?
Winamp has both a randomize function and a shuffle function. Your questions seem to imply that you are asking about the randomize function.

The randomize function does not change the visible playback order of the items in a playlist. There is either no provision to prevent playback of the same item before all the items in the playlist are played, or it doesn't work correctly. During playback an item is selected at random and the same item is often selected more than once before all the items in the listing are played. The exact algorithm that is used to control this has never been published, afaik.

The shuffle function rearranges the items in a playlist. You can see the 'new' playback ordering and there is no guarantee that every item in the playlist is rearranged during a single shuffle. It usually takes activating the function several times in a row to thoroughly mix up the original playback order. In other words, it's like shuffling a deck of cards.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 12th February 2017, 19:46   #13
ryerman
Major Dude
 
ryerman's Avatar
 
Join Date: Mar 2010
Location: Canada
Posts: 572
Hi Aminifu

I'm pretty sure you've got randomize and shuffle mixed up.
When I click on "Randomize list" (Cntrl+Shift+R) I can watch the playlist change.

Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin
ryerman is offline   Reply With Quote
Old 12th February 2017, 21:18   #14
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,535
Hi ryerman,

You are correct. It has been awhile since I've used either function. This will teach me not to rely solely on memory. I should have tested before making the earlier post.

Thank you for posting the correction.

Winamp Pro 5.666.3516 fully-patched - Komodo X Touchscreen by Victhor skin
Windows 10 Home 64-bit desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump