
Ask HN: Why are modern music players so bad at playing music in random order? - winternett
On my phone I have a micro SD card with thousands of Mp3s on it yet I catch both Google Play Music and VLC player playing the same progression of music over and over when I have the random button set to on... I thought this was because it was a tactic to get me to upgrade the music players I was using, but it also happens lately on all kinds of devices I use.<p>YouTube, Spotify, and SoundCloud provide revolutionary services yet it seems like a lot of the time I am listening to pre-arranged and designated music playlists rather than a truly honest music stream.<p>In the days of the 5 disk CD changer, people truly knew what random meant. no tune was played twice until all of the tunes were played...
======
patmcc
Here's the problem: go ahead and ask a bunch of different people what they
want/expect their shuffle/random button to do and you'll get a bunch of
different answers.

1\. I want it to play in a truly random fashion, with replacement (same song
twice in a row is possible).

2\. I want it to play in a truly random fashion, without replacement (each
song is removed from the list once played).

3\. I want it to "seem" random (don't play too many songs by the same artist
in a row).

4\. I want it to be random, but predictable (same "random" ordering if I start
the playlist again).

5\. I want it to play my favourite songs more often than my lower-rated songs.

6\. I want it to play my less-commonly played songs more often than the stuff
I listen to all the time.

So: what exactly do you want when you say random?

~~~
kstenerud
80% of people mean this: I don't want to hear the same song too soon after
hearing it before. How soon is "too soon"? Probably anywhere from 50 to 200
songs.

Easiest solution that gets you 99% there would be to make a shuffled list, run
through the whole thing, then shuffle again. The only reason why this wasn't
done in the past was lack of RAM, which isn't an issue anymore.

Or if RAM really actually is an issue on your embedded device, use a Debruijn
sequence.

~~~
ilikehurdles
Do you have a source for that claim?

For me, random means: "I want to hear every song in this selection exactly
once, chosen randomly". Random should mean uniformly distributed and I don't
care whether the same artist or album is played back-to-back. I feel like this
is exactly what "shuffle" has meant for decades before some UX quack at
Spotify headquarters decided they knew better.

~~~
kstenerud
So... what you're saying is that you don't want to hear the same song too soon
after hearing it before?

~~~
ilikehurdles
No, I’m saying I want to hear every song in the list exactly once before any
is repeated. Your summary is more generous than my definition.

~~~
iforgotpassword
That's shuffle, not random. Maybe randomized. With random, every song should
have the same chance of being picked, which would technically allow the same
song to play twice. If you'd let the player run for a decade, every song
should have played about the same number of times.

But this usually leads to people perceiving the feature as not being random
enough.

See Spotify for example: [https://www.quora.com/Is-Spotifys-shuffle-feature-
truly-rand...](https://www.quora.com/Is-Spotifys-shuffle-feature-truly-random-
I-keep-hearing-the-same-songs-in-my-library-too-often-for-it-to-be-a-mere-
coincidence-Does-Spotify-use-some-kind-of-special-algorithm-to-determine-what-
song-plays-If-so-why/answer/Mattias-Petter-Johansson)

~~~
IanCal
Random has a lot of meanings, and you are picking a very specific one. It
doesn't have to be uniformly distributed, for example, but relevant here is I
don't think there's a problem describing a random shuffle as "random". It is
playing a _list_ in a random order.

------
crb
Steve Jobs in 2005: "You know we've gotten a lot of people that say our
shuffle's not random. Well it really is random but sometimes random means
you've got two songs from the same artist next to each other. Just happens
randomly sometimes.

And so what we've added is smart shuffle to actually make it less random - if
you want.

Even though people will think it's more random it's actually less random and
what it is, in preferences, there it is right there, it says smart shuffle
allows you to control how likely you are to hear multiple songs by the same
artist or from the same album in a row."

[https://youtu.be/lg188Ebas9E?t=719](https://youtu.be/lg188Ebas9E?t=719)

~~~
mrweasel
I always got the feeling that the original iPod Shuffle would randomize your
songs ONCE, and that's why people where complaining. So when you loaded up
your Shuffle, the software would order the songs randomly, on a playlist, for
that set of songs. The Shuffle would then reshuffle the songs, when new one
where added or removed, but only then.

That theory also explained the disconnect between the complaints and Apples
response. Apple would indeed be right that the music was randomized, but not
continuously, as consumers expected.

It was never clear to me what the issue actually was, perhaps we really don't
understand randomness.

~~~
eridius
Apple's response above was talking about iTunes, not about iPods.

------
fevangelou
Spotify (and I assume others) doesn't exactly serve a random playlist, but one
that favours/returns more revenue back to them. So older releases, "burned
out" songs and so on. Create a playlist with 10 songs, add 8 before the 90s
(e.g. Cure, U2 etc.) and add some newer ones (after 2000 - e.g. Radiohead).
You'll be living in the 80s for most of the time...

If you search the Spotify forums, there are a few posts on the issue with no
official answer from Spotify whatsoever.

~~~
hadrien01
One way to mitigate that is to play music in alphabetical order, it's more
random than "random" and you can listen to artists you wouldn't ear with the
"random" order

~~~
ngomez
This doesn't work too well if someone adds Nine Inch Nails' Ghosts I-IV or
Kendrick Lamar's untitled unmastered to their playlist.

------
asdfman123
If it literally plays the same progression of music over and over, it's
because the randomization is poorly designed. I had an early MP3 player that
literally had the same "random" order, to the point where I always knew what
song would come next.

In that case, it's because random numbers generated by a computer are
_pseudorandom,_ or just generated by the exact same arithmetic sequence. For
instance, here's a really bad pseudo-random number generator: Start with 4.
Take the last number, divide it by 2, and if it's even add 5. If it goes over
100, subtract 100. (I didn't claim it was good.)

These pseudo-random number generators can be improved by providing a seed
number, which means if you give it the same starting point it will generate
the exact same sequence, but the key is giving it a random seed. Often
programs provide the current time as the seed. My last MP3 player would have
been much better if they did that.

Spotify does a much better job with actually randomly shuffling playlists. But
the problem with Spotify is if you listen to, say, Wilco radio, it's not
adventurous enough and keeps playing the same few songs over and over in
random order until you get sick of all of them.

Spotify upped its game with the "daily mix" feature, but yeah, radio stations
are kind of crappy right now.

------
saghm
A bit tangential, but for a while I've wanted the ability to "pin" certain
songs together for the purpose of random shuffles so that they always get
played back to back. One good example of this is the second half Abbey Road;
if I'm shuffling some Beatles songs, I really want "Carry That Weight" to come
immediately after "Golden Slumbers" (and if I'm being honest, I want "The End"
coming right after both of those). I know that I could just manually
concatenate the songs together with some sort of music editor and then put
that as a single song in my library, but I've always wondered if there were
any music players that supported this sort of thing built-in when shuffling
music. Has anyone ever used a player that lets you do this, or am I just the
only one who wants this?

~~~
Timpy
Dark Side of the Moon, Abbey Road, and We Will Rock You / We Are the Champions
are my go to examples for this. I hate going for a run and getting the
penultimate track from Dark Side of the Moon on shuffle. It cuts out right at
the climax, I always stop my run and manually tell Google to play Eclipse
next.

While I'm on my soapbox, another tremendous annoyance I want to get rid of:
"Deluxe" tracks. I'm so tired of scrolling through re-released/deluxe versions
of albums to find the album with the original track listing. I don't want
remixes or rough cuts in my random playlist. With all of the shallow marketing
attempts at selling the same classic albums to the general public over and
over again, the alternate tracks outnumber the original.

~~~
saghm
That's a great example! I also can't listen to Brain Damage without want to
hear Eclipse after.

------
magduf
This has little to do with music, but as an example of how a program has a
"random" setting that doesn't make much sense, my KDE rotating background I've
found has a really annoying implementation: Suppose I give it 2 directories
full of photos, one of those containing 1000 photos, and the other containing
only 1. It'll show that 1 photo half the time, because it's randomly selecting
between the directories first, and _then_ selecting among the photos in that
directory. It should be selecting randomly between all 1001 photos, but that's
not how it works.

~~~
jraph
This should get fixed. Have you reported this on bugs.kde.org? People are very
friendly there.

------
qpiox
Every single person can have multiple definitions on what random means in
different situations (use-cases).

My hypothesis is that people use the random or shuffle options when they don't
know exactly what do they want to listen to, they have a nice collection (or
have access to a huge database), and want to be surprised on what follows.

So, a truly random progression is never what you truly want! Instead you want
a good DJ, that will suprise you and keep the mood going.

Imaging the opposite. A truly randomized playlist out of a list of 100000
songs. Who would want a truly randomized progression? Imagine listening to
Beethovens 6th part II, then Sepultura, then Dua Lipa, then Juzni Vetar, and
then only after 20000 other songs forced upon you with no context, you will
get to the 6th part III.

So, don't ask for true random. Ask for an option that will give you a nice
progression, keep the tempo, keep the mood, ask you if it is good (or measure
it somehow). Yes, you want to hear the oldies/goldies, but not only those,
otherwise it will get boring, yes you also want to be educated, to hear some
good songs that you have not heard about in the past, ... just some of the
possibilities.

Playlists are a hot topic in the field of recommender systems these days, and
personalized playlists, playlists adapted to your mood and liking and your
swings in mood from time to time, are the real future in modern players.

Last years ACM Recommenders systems conference had an competition in exactly
that - the challenge of automatic playlist continuation. See this link for
more details including the publications that presented some of the results of
the challenge.
[http://www.recsyschallenge.com/2018](http://www.recsyschallenge.com/2018)

------
manofkent
[https://labs.spotify.com/2014/02/28/how-to-shuffle-
songs/](https://labs.spotify.com/2014/02/28/how-to-shuffle-songs/)

~~~
tobr
They must have changed it since, as they frequently put songs by the same
artist right next to each other nowadays.

------
jey
VLC 4 has an interesting new randomizer that works as you describe:
[https://blog.rom1v.com/2019/05/a-new-core-playlist-for-
vlc-4...](https://blog.rom1v.com/2019/05/a-new-core-playlist-for-
vlc-4/#random-playback)

Discussion:
[https://news.ycombinator.com/item?id=19978295](https://news.ycombinator.com/item?id=19978295)

------
theandrewbailey
It sounds like you want a shuffle function that obeys the gambler's fallacy.

[https://en.wikipedia.org/wiki/Gambler%27s_fallacy](https://en.wikipedia.org/wiki/Gambler%27s_fallacy)

------
christiansakai
Funny, when I was looking for my first part time dev job in college, a company
interviewed me on “how to create a random playlist”. Didn’t get the job.

To this day I still wasn’t sure what was the purpose of that question? Was it
to see how I think or did they really wanted me to come up with a way to
create random playlist that satisfies their arbitrary definition of random

------
s_y_n_t_a_x
My side project is a media player (music, images, videos). I'm not happy with
any music player, so when I get frustrated with them, I work on mine, trying
to solve the issues. Being able to choose a shuffle mode is one big difference
in my player. You can choose from lru, random, similar, least skipped.

I like least skipped mode because I usually skip past the same songs. The more
I skip them, the less they are played.

Similar mode is nice because I notice I skip music depending on what mood I'm
in, and I have a tendency to just put all my music in one giant playlist. If
I'm in a picky mood I put it on similar shuffle and if I listen to a song all
the way through it'll play a similar song it hasn't played yet. If I skip a
song, it'll use the last one I completed.

Another big thing is being able to see the next song coming up, and being able
to dismiss it. So you can refine the next in the queue while you listen
through the current song.

------
scohesc
Because random is actually "random based on what you've listened to most in
your playlist, because we believe that we know the definition of random more
than you do"

------
h2odragon
Hopefully someone will pop up with a logic listing of the way WinAmp did
"shuffle". Surprisingly complicated. "Random" isn't enough, even with a good
PRNG. Believe it or not radio DJ's had more job than just talking over your
favorite bits of the song.

------
jrockway
> no tune was played twice until all of the tunes were played...

That doesn't sound random.

I use Google Play Music and it "randomizes" things in the way you desire. It
takes your playlist and shuffles the entries; you can even press a button to
see how it's sorted it. That ordering sticks around forever if you take no
further action, though, so it will repeat that random ordering indefinitely
unless you press the shuffle button to disable that, then start playing
something, then press the shuffle button again.

~~~
GrumpyNl
If its programmed like youtube, it only shuffles the last 100 you have visited
in your list, not the whole list.

~~~
saghm
Not sure exactly what you're referring to here, but on Google Play Music,
there's a concept of a "queue" of music that's currently playing/has been
played. Generally it's just the songs in order of the album/playlist/etc.
where you selected the song to play, but you can also manually
add/delete/reorder the songs on the list. Since it keeps track of the songs
that were played previously in the queue (to enable the "previous track"
button, among other things), enabling shuffle just reorders the queue in a
random way (with the currently playing song first). From the few times when
I've used it with extremely large lists of songs (e.g. my entire music
library), it doesn't just shuffle a subset of the queue that you have
currently active, but the entire thing. You can also choose to start playing
an album/playlist/etc. shuffled, which just puts the entire thing in the queue
in a random order and starts playing through it.

------
mindcrime
I don't have a problem playing my local ogg/mp3 collection in shuffle mode
with XMMS; but using Youtube for listening to music sucks in a related regard.

It seems like pretty much no matter what song I start listening to on YT, it
eventually falls into a rut where I start hearing the same handful of songs
that I've heard a million times. It's like it's _too_ good at figuring out
"what I like" and tries to only play songs it "knows" I like. Or more likely,
since plenty of what I like are "deep cuts", it's just playing the most
popular few songs by the given artist(s).

The _order_ within a given session is probably shuffled up OK, but it still
sucks from a variety standpoint because I don't want to hear "Eighteen and
Life", "Round and Round", "Kickstart My Heart", "Livin' On A Prayer", "Rock
You Like A Hurricane", "Fallen Angel", "Shot In The Dark", etc., day after day
after day after day after day... as much as I like all of those songs.

It does seem to be at least somewhat genre aware though. If I start out
listening to classical music, it doesn't jump to metal/rock, or if I start out
listening to synthwave, it doesn't bridge to classical. But the problem I just
described seems to exist within each genre. :-(

------
pwinnski
This is why Apple calls it "shuffle" rather than "random."

------
zamalek
Because random doesn't look/seem random to humans. The problem is that these
players aren't randomizing the order of the songs, they are randomizing the
_next chosen_ song.

You'll want to shuffle the entire playlist at once; or use a player that
attempts to avoid this issue (Winamp would let you bias the RNG to choose
songs further away from the current one, for example). If you decide on the
latter, there is always the chance that you'll hear repetition, because
repetition is valid in random sequences.

~~~
gothroach
I believe the issue he's describing is not how random the playlists seem, but
rather that it randomizes a list once and uses that as the order instead of
each time the list is played. I've definitely seen that behavior in some music
players.

------
wonderhamster
what kind of animal listens to music in a random order?!? I have trouble
finding a player that organizes by album. I just want to play to a sorted list
of albums in order. No player does this.

~~~
WorldMaker
You can set that up with Foobar 2000 if your albums are correctly tagged. It's
also one of the few players I've met that gives you a "middle choice" of
randomly picking albums, but playing the albums themselves start to finish.

(That said, I'm one of the animals that shuffles everything in my library
regardless of genre or album order anything else.)

------
luminati
Here is a nice post about this problem: [https://keyj.emphy.de/balanced-
shuffle/](https://keyj.emphy.de/balanced-shuffle/)

------
fmajid
Not related to the OP’s complaint, but a shocking few can shuffle by random
album. Apple regressed: the iPod could but the iPhone can’t.

~~~
eterm
This is something my main music player had circa 2003 when I used a linux
desktop player.

Since then I've not had it any service or software I use, it's the missing
killer feature for me. I want "random"/recommended albums not
recommended/random songs.

~~~
alanbernstein
You can hack the functionality into desktop spotify, if you care enough (on
linux and mac at least).

------
chkaloon
Pandora (even though I gave it up for Spotify years ago) seemed to be the best
at keeping variety. Spotify is very bad at it.

~~~
rasjani
Never used pandora but MixRadio was the best for my taste. Spotify is nice but
it’s really fucking hard to find new stuff that within Spotify itself.

------
dilutedh2o
Am just here to nitpick, but the 5 disk CD changer behavior that you just
described is not true randomness (by definition).

~~~
gvb
Nitpicking your nitpick, the difference is whether the random sampling is with
replacement or without replacement. Wikipedia's definition of "simple random
sample" defines it to include both ways:

 _[S]ampling is typically done "without replacement", i.e., one deliberately
avoids choosing any member of the population more than once. Although simple
random sampling can be conducted with replacement instead, this is less common
and would normally be described more fully as simple random sampling with
replacement._

Ref:
[https://en.wikipedia.org/wiki/Simple_random_sample](https://en.wikipedia.org/wiki/Simple_random_sample)

~~~
alanbernstein
nitnitnitpick: GP is likely (and overly pedantically) referring to the use of
a PRNG to implement the shuffle, rather than using a true random source.

------
imdhmd
I got so tired with YouTube's recommendation for playing Hindi songs, because
it got so repetitive, that I opted to delete my entire viewing history. This
did not help and with-in a few weeks, the 'random' playlist became predictably
repetitive again. I'm having similar experience with YouTube Music as well.

------
ryanmercer
I like how I have it on random, then it'll play 3-4 titles from one artist in
a row, even though that artist is roughly equal in number as any other artist
in my library. This will happen at least once a week driving home. It will
also barely ever play probably 30% of my titles but it will play 5-10% of them
a LOT.

------
WorldMaker
There's definitely a feeling that track orders feel quite similar between play
attempts because there isn't a large enough "shuffle memory" between sessions,
or in many of these services any "shuffle memory" at all (some really are just
random and hoping the distribution of the random function enough to
compensate).

5 Disk Changers had a finite need for memory for recalling what had been
played, which was easy enough. Some people's libraries are so large it's an
interesting question of how much is it worth storing the played state of a
song, and for how long (can you clear that to start a fresh shuffle? can you
add individual songs back without just clearing the memory state?).

Some players let you manually manage this: shuffle songs into a shuffle
playlist and then play that list in track order, remembering your last heard
state.

(For the purposes of dealing with the bad PRNG in my car I wrote a Python
script a few years ago to do a version of that shuffle playlist management in
how it fills thumb drives intended for my car. It keeps a shuffled track list
in YAML and then uses that copy files to the drive by track number for the
simple lexicographic default play order of the car.)

------
Zarath
Spotify is the worst offender for me. Random won't play any song outside of
the top 100-200 in my song library, but depending on how it is sorted. So if
it is sorted from A-Z, I will hear only songs that start with A or B. If it is
sorted by date added, I will only hear songs recently added.

~~~
vsnf
This sounds like it could be the well-known bug with Spotify Connect, where
only the first 100 songs in any given playback context are submitted to the
queue[1].

This particular bug has been around since at least 2016.

[1] [https://community.spotify.com/t5/Other-Partners-Web-
Player-e...](https://community.spotify.com/t5/Other-Partners-Web-Player-
etc/BUG-Spotify-Connect-only-shuffles-100-songs/td-p/1299418)

------
garyfirestorm
Google Play Music seems to truly understand shuffle. Everytime you press
shuffle button, you can see the playlist change randomly. I think it is very
straight forward, randomize without repetition, still many streaming apps fail
to implement it - add Saavn, Gaana to the list too.

------
Alupis
I first noticed this with Spotify's "Shuffle" \- it was so infuriating,
particularly when I'd skip a song, it would just play another song from the
same artist... sometimes even the same album! That's from a playlist with
hundreds of artists and songs...

~~~
ivolimmen
I noticed the same; and it seems to be getting worse...

------
moron4hire
Seems like a Markov Chain approach--considered over artist and genre--would be
a good idea.

------
ringshall
This talk by Sid Meier is a good description of the problem of true
randomness, from a game perspective:

[https://youtu.be/MtzCLd93SyU?t=1166](https://youtu.be/MtzCLd93SyU?t=1166)

------
scottlegrand2
Seems to me like a perfect opportunity for a simple neural network or machine
learning model to predict the next song to play based on the last k songs
having been trained on a bunch of existing playlists.

~~~
xj9
a NN is overkill for something like this. you don't even complex logic to make
a good shuffled mix.

------
pibi
This is exactly the reason why I'm stuck with Deezer. The random selection,
which is called Flow, it's just a never-ending stream of music from the track
I tagged and similar songs.

------
jermaustin1
I've always assumed the royalty cost and popularity factored in, but I've
never tried to dig to deep into it.

When I shuffle a playlist on Amazon Music, it wont repeat until the end of the
playlist.

------
apaprocki
Not all music players. I highly suggest you give Roon
([https://roonlabs.com](https://roonlabs.com)) a try, if you haven't already.

~~~
llao
What does it do specifically on shuffling?

------
overcast
The answer is that people(like OP) who think they want random, really want
shuffle. Or randomly choosing from whatever songs have NOT yet played.

------
wozer
Foobar2000 is pretty good. It seems to have a bias to play two songs of the
same interpret in a row. But I don't mind that.

------
ssivark
Dunno about contemporary music players, but:

> no tune was played twice until all of the tunes were played

That is definitely not compatible with actual mathematical “randomness”. Try
rolling a die multiple times and see whether you get all six numbers before
repeats. It’s very unlikely (probability of all six rolls being unique =
6!/6^6 = 1.5%)

Which brings up the interesting question — what do humans actually expect from
“shuffle” mode?

~~~
egypturnash
Think of every single erroneous belief that people have about randomness. A
pleasing music-randomizer algorithm obeys _all_ of these.

The term found on a lot of music players is not "random", it is "shuffle", and
this is an important distinction. The term comes from _cards_. Take a deck of
cards, shuffle it, and turn each card over in order from top to bottom. You
expect that every card in the deck will be seen once and only once; turning
up, say, two eights of clubs in a row means that something is _dreadfully
wrong_ with your deck.

Humans tend to expect a similar behavior from "shuffle" modes: the same song
does not repeat for a while. If people are shuffling by song, then they may
also expect that _performers_ don't repeat within a (smaller) timeframe.

Nobody expects "pick a random number between 1 and numsongs, play that song,
repeat, and be perfectly happy to play Baby Shark forty-seven times in a row
if that number keeps on coming up".

------
gatesphere
My FiiO M9 does a real good job at random. But the UI leaves a lot to be
desired.

------
dec0dedab0de
I haven't listened to randomized music since Winamp 2 was my primary player.

------
ianamartin
They aren’t. People are bad at understanding randomness.

------
mrinfinite
vlc with music in folders not individual files is where I would like some
better randomness... it favors the folders already open for sure.

------
ricardobeat
Why do you need to remind me of Rdio again? :(

------
aidenn0
Gone mad music player for android can shuffle your play-queue which is
possibly what you want?

