News for hackers. Stuff that matters.
Re:Ask HN: Why are modern music players so bad at playing mu... by patmcc on Wednesday July 03, 2019 @01:54PM (#20346747)
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?

Re:Ask HN: Why are modern music players so bad at playing mu... by mikeash on Wednesday July 03, 2019 @04:12PM (#20348271)
Further complicating things, lots of people will say they want 1 or 2, but really want one of the others, because they don’t really understand what randomness looks like.

Lots of music players started out with true randomness and then dialed it back because people complained that it wasn’t very random.

Re:Ask HN: Why are modern music players so bad at playing mu... by gervu on Wednesday July 03, 2019 @06:01PM (#20349343)
Because users never wanted mathematical randomness. They wanted variety.

Not that saying "random" is wrong, but users mostly mean it in a colloquial sense, while programmers are apt to interpret it in a technical sense. But one leads to math.urandom() and the other to shuffle algorithms.

Re:Ask HN: Why are modern music players so bad at playing mu... by winternett on Wednesday July 03, 2019 @02:07PM (#20346881)
Good point...

I mainly dont want to hear a playlist that starts with the same tune every time and then progresses through the same order of tunes when I select Random.

So often, in Google Play Music selecting random will play any of of 10 pre-set playlist cues.... The tunes will be a mix of one big polaylist that just starts at various points on the master playlist. This is why I often run across the same tunes, and why they follow each other in the exact same order.

e.g.

Normal Play Cue: A-B-C-D-E-F-G

Random is selected -

Random play attenpt 1. B-A-C-D-F-G-E (Several tunes present on the micro SD card never play)

Random play attenpt 2. F-G-E-B-A-C-D (Several tunes present on the micro SD card never play)

Random play attenpt 3. B-F-G-E-A-G-E (Several tunes present on the micro SD card never play)

I prefer the "Shuffle" feature I guess if you want to look at the semantic side of this discussion, where not tune is played twice or in the same order whenever the random button is pressed, and every time I press random, the player should recall the last tune, and pick a new playable tune each time the skip button is pressed or after the prior tune comes to an end.

Re:Ask HN: Why are modern music players so bad at playing mu... by kstenerud on Wednesday July 03, 2019 @03:39PM (#20347939)
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.

Re:Ask HN: Why are modern music players so bad at playing mu... by ilikehurdles on Wednesday July 03, 2019 @03:52PM (#20348070)
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.

Re:Ask HN: Why are modern music players so bad at playing mu... by shados on Wednesday July 03, 2019 @04:09PM (#20348251)
Thats why the feature is usually called "shuffle" rather than "random". Then if you stop to think about it a bit, the expected meaning is reasonably clear.
Re:Ask HN: Why are modern music players so bad at playing mu... by kstenerud on Wednesday July 03, 2019 @03:57PM (#20348124)
So... what you're saying is that you don't want to hear the same song too soon after hearing it before?
Re:Ask HN: Why are modern music players so bad at playing mu... by ilikehurdles on Wednesday July 03, 2019 @04:43PM (#20348564)
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.
Re:Ask HN: Why are modern music players so bad at playing mu... by iforgotpassword on Wednesday July 03, 2019 @05:31PM (#20349029)
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...

Re:Ask HN: Why are modern music players so bad at playing mu... by IanCal on Wednesday July 03, 2019 @06:37PM (#20349622)
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.
Re:Ask HN: Why are modern music players so bad at playing mu... by kstenerud on Wednesday July 03, 2019 @05:26PM (#20348983)
So... You'd say that my summary gets you 80% of the way there?
Re:Ask HN: Why are modern music players so bad at playing mu... by craftinator on Wednesday July 03, 2019 @03:59PM (#20348144)
Lack of RAM? Make an array of pointers or ints or whatever corresponding to the current order of songs, then lookup each new song as the current song ends. Maybe 1kB RAM...
Re:Ask HN: Why are modern music players so bad at playing mu... by kstenerud on Wednesday July 03, 2019 @04:13PM (#20348278)
Yes, lack of RAM. First mp3 player I ever worked on consisted of a PIC driving an IDE hard drive over I/O pins, and an mp3 chip over I2C, with 2k RAM for the whole shebang. If you want to support more than 256 songs, you'll need 2 bytes per index value, so 2k RAM just for the shuffle table if you have 1000 songs. Then there's the hard drive controller, the FS driver and file I/O interface, the LCD driver, the send buffer to the mp3 chip, etc, etc.
Re:Ask HN: Why are modern music players so bad at playing mu... by BoiledCabbage on Wednesday July 03, 2019 @04:32PM (#20348457)
Mp3 players have had more than 2k of RAM for way longer than two decades.

The hardware restrictions of the earliest IDE HD based MP3 players really have nothing to do with any limitations on modern shuffle ability.

IPod in 2001 had 32MB of RAM. 2k RAM is not relevant to this discussion. You getting close to discussing 3 decade old technology.

Re:Ask HN: Why are modern music players so bad at playing mu... by kstenerud on Wednesday July 03, 2019 @05:25PM (#20348969)
It's very relevant. The early technological restrictions become the standard practice, which fail to change after the original restrictions no longer apply.

Using random number generators for shuffle mode was a stopgap measure that everyone else cargo culted because it's easier than critical thought.

Re:Ask HN: Why are modern music players so bad at playing mu... by magicalhippo on Wednesday July 03, 2019 @06:30PM (#20349577)
> Yes, lack of RAM

So how about using a maximal linear feedback shift register of smallest size greater than the number of songs, skipping entries that are beyond the end of the list?

Either keep the polynomials[1] in a small list, or implement them as separate functions, invoking the one you need via a function pointer. Both approaches take just a wee bit of extra FLASH/ROM, and just a few bytes of RAM.

https://en.wikipedia.org/wiki/Linear-feedback_shift_register...

Re:Ask HN: Why are modern music players so bad at playing mu... by Franciscouzo on Wednesday July 03, 2019 @11:20PM (#20351220)
So a permutation? There's no need to store the whole shuffled array in RAM, a big 64-bit co-prime number is enough, you don't care about cryptographically secure numbers, so even 32 bits could work.

For example for a 1000 songs playlist, you choose n to be 2416648531, start with i = 0, you then get the following permutation: 0, 531, 62, 593, 124, 655, 186, 717, 248.

Re:Ask HN: Why are modern music players so bad at playing mu... by rdiddly on Wednesday July 03, 2019 @05:32PM (#20349042)
Take that comment almost verbatim, and turn it into a menu in the options/config area, and you can have my money!
Re:Ask HN: Why are modern music players so bad at playing mu... by dvt on Wednesday July 03, 2019 @05:37PM (#20349080)
I love this idea so much, I made it an issue on a the Lofi repo -- a somewhat popular Spotify player I built: https://github.com/dvx/lofi/issues/37

I'll work on it when I can get a bit of free time.

Re:Ask HN: Why are modern music players so bad at playing mu... by eralps on Wednesday July 03, 2019 @06:50PM (#20349718)
That is a really cool app. I have been using Miniplay for this. Already installed it and uninstalled Miniplay.

Edit: Oh, and it is always on top, you are my favorite open source contributor.

Re:Ask HN: Why are modern music players so bad at playing mu... by rdiddly on Wednesday July 03, 2019 @06:01PM (#20349334)
Even better, heh heh!
Re:Ask HN: Why are modern music players so bad at playing mu... by Nydhal on Wednesday July 03, 2019 @05:42PM (#20349138)
Users want more control. Take this idea apply it to what shows up on your favorite social network feed/timeline.
Re:Ask HN: Why are modern music players so bad at playing mu... by Fellshard on Wednesday July 03, 2019 @02:17PM (#20346985)
Also, "I want 'random' songs that are musically appealing to hear in sequence." A sort of lite DJ logic, really; not necessarily modifying the songs' entrances and exits, but more selecting keys and tempos.
Re:Ask HN: Why are modern music players so bad at playing mu... by kleer001 on Wednesday July 03, 2019 @03:34PM (#20347883)
From what I remember, Pandora did that really well. It's been a while since I've used it, but their classification system was really cool.
Re:Ask HN: Why are modern music players so bad at playing mu... by kbenson on Wednesday July 03, 2019 @03:44PM (#20347989)
I switched from Pandora to Spotify a couple months back because my daughter wanted Spotify and they have a family plan, and I didn't want to pay for both services. I really, really miss Pandora, to the point I may pay for it separately (and I don't listen all that often), specifically because I love how their radio station type format works. If they had their "play this exact song I want" offering working before Spotify entrenched itself, I can't imagine why anyone would choose Spotify over it.

I'll probably spend a bit more time trying to get Spotify to work as I want, but in general it's resulted in me just listening to less music. I guess that's good for Spotify, since they're still getting paid (but not if it makes be question why I'm still paying them).

Re:Ask HN: Why are modern music players so bad at playing mu... by Renevith on Wednesday July 03, 2019 @03:42PM (#20347962)
Yes, this is still true, and it's great. Within the songs and artists that typically play on my Pandora stations, it will play similar songs in clusters, with the exception that it won't play the exact same artist twice in close succession. This makes the playlist a lot better (in my opinion).

The only quirk I've noticed is when the same person has multiple bands... I've had it play Jack White or Les Claypool 4 times in a row, for example.

Re:Ask HN: Why are modern music players so bad at playing mu... by saltcured on Wednesday July 03, 2019 @06:08PM (#20349410)
That's funny, I don't like how Pandora works on the custom stations I've tried to build. It feels too much like it is going through the set of seed artists in some repeating order, playing a batch of similar items to one seed before switching to the next batch.

I'd much rather have these sub-genres woven together with changing styles at each track boundary, as a sort of counterpoint.

If I can remember all the way back to when I used to make my own "mix tapes" transferred from vinyl records, I think I used to do this sort of interleaving. So, I think my preference existed before I ever experienced the shuffle of a 5 or 10 disc Sony CD changers, which usually changed discs on every track change and avoided any repeats until the entire set was done.

Because of my preference for shuffle, I used to burn a CD or two for use in rental cars, where I added a pseudo-random prefix to the file names. This gave me a shuffled play when the in-dash player was set to just play sequentially, so I didn't have to discover a random mode with repeats in one particular car...

Re:Ask HN: Why are modern music players so bad at playing mu... by EdwardDiego on Wednesday July 03, 2019 @05:31PM (#20349025)
I was very sad when Pandora left the NZ market. :(
Re:Ask HN: Why are modern music players so bad at playing mu... by bromuro on Wednesday July 03, 2019 @08:42PM (#20350504)
It must be the same algorithm they use to propose new tracks, eg when we play “similar artists”.

“What is the best to listen after this track?” - just with a super small subset of tracks.

Re:Ask HN: Why are modern music players so bad at playing mu... by jbob2000 on Wednesday July 03, 2019 @01:57PM (#20346784)
Or what about this:

I am indecisive about what music I want to listen to in this current moment and I want you to give me options that I will deny until I become decisive about what I want.

Re:Ask HN: Why are modern music players so bad at playing mu... by abrowne on Wednesday July 03, 2019 @02:58PM (#20347472)
This is basically what want too, so I like Quod Libet's "Random Album" (and Random Artist and Random Genre) command. It simply focuses on a new album each time I press Ctrl+M, which I can play or queue up.
Re:Ask HN: Why are modern music players so bad at playing mu... by alanbernstein on Wednesday July 03, 2019 @05:16PM (#20348879)
This was my favorite feature in winamp and itunes. It doesn't seem to exist in many music apps. I couldn't find an android app that does it, and spotify doesn't do it on any system. On desktop, It's possible to script spotify behavior, so with some work I was able to define a global keyboard shortcut to choose a random album and play it. Not perfect, but gets the job done.
Re:Ask HN: Why are modern music players so bad at playing mu... by larrik on Wednesday July 03, 2019 @01:57PM (#20346787)
I would say what people usually want is "I want my playlist shuffled in a way that feels like variety". But, I don't have any data to back that up ;)
Re:Ask HN: Why are modern music players so bad at playing mu... by winternett on Wednesday July 03, 2019 @07:56PM (#20350227)
Most music player developers assume our music collections are small I guess, and they're trying to encourage cloud storage rather than local saved files as well possibly, because it generates money by encouraging music sales, storage upgrades, and monthly subscriptions.
Re:Ask HN: Why are modern music players so bad at playing mu... by drngdds on Wednesday July 03, 2019 @02:23PM (#20347043)
What I want is to have the options laid out before be so I can pick which one I want. Spotify and friends seem to go with a "fuck you, we know what you want better than you do" approach, which is one of many reasons I prefer to own my music instead of streaming it.
Re:Ask HN: Why are modern music players so bad at playing mu... by majormajor on Wednesday July 03, 2019 @02:22PM (#20347038)
Smart playlists in iTunes were great for solving 5 and 6 with separate auto-updated playlists, but sadly Spotify has no interest in this problem.

I hate the trend from product managers of responding to "wow there's a lot of things people might be intending here" with "let's just pick one in the name of simplicity." Give me the hooks to let me make my own solutions for the other possibilities!

Re:Ask HN: Why are modern music players so bad at playing mu... by tsukikage on Thursday July 04, 2019 @03:53AM (#20352495)
To be fair, Spotify do in fact give you the hooks: https://developer.spotify.com/documentation/web-api/

You can have a script sitting on your machine remotely controlling an internet connected player somewhere else.

e.g. here's one I wrote that makes Spotify not play the same track too often: https://github.com/sl236/spotify-deduplicator

Re:Ask HN: Why are modern music players so bad at playing mu... by nickthegreek on Wednesday July 03, 2019 @02:13PM (#20346942)
#2 seems like it should be the default but I feel I normally get #4.
Re:Ask HN: Why are modern music players so bad at playing mu... by uslic001 on Wednesday July 03, 2019 @02:24PM (#20347068)
I want #2 but most players do not do this. Both Amazon Music and Google Play fail although Amazon does a better job at giving me #2. Sometimes it will give me a different random order but sometimes it gives me the same order as it did last time I asked it to shuffle the playlist. To get it to resent the random shuffle I have to manually close down Amazon Music and restart it. Then it resets the shuffle.
Re:Ask HN: Why are modern music players so bad at playing mu... by hnick on Wednesday July 03, 2019 @07:35PM (#20350098)
In the 90s this would have been solved with a single radio button option in the settings menu.

We've come so far with UI design now that we can't have that.

Re:Ask HN: Why are modern music players so bad at playing mu... by jancsika on Wednesday July 03, 2019 @06:34PM (#20349608)
> 1. I want it to play in a truly random fashion, with replacement (same song twice in a row is possible).

Anyone outside of HN would interpret that as broken random. So we can throw it out.

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

Nope, not good enough for non-specialist randomness.

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

Bingo. It should definitely seem random. Because the string "seem random" equals "random" for someone who isn't a technical expert in randomness.

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

Normies don't care about random seeds for pseudorandom number generators, so nope.

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

That's a bonus feature that can be implemented with a slider.

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

Same as above

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

One obvious definition for normy random, plus a slider with least and most favorited at the left and right, respectively.

Done.

Re:Ask HN: Why are modern music players so bad at playing mu... by winternett on Wednesday July 03, 2019 @07:52PM (#20350201)
Or if the UI allowed me to easily play music based on which folders tunes are in, it would solve most of my problems... I already have my mp3s organized by genre in folders, and updates are easier to manage that way, and then random play can match my mood better, instead of going from wu-tang to Celine Dion (I also keep wedding music in my collection just in case...)
Re:Ask HN: Why are modern music players so bad at playing mu... by 13415 on Wednesday July 03, 2019 @03:49PM (#20348035)
I would expect from a random playlist function to shuffle the playlist once randomly (or using a good PRNG with long period) whenever the function is called. Option 2 sounds closest to this, but there is no need to remove anything, the player always plays the next song in the list.

It's odd to hear that this is not standard, given that it's a standard algorithm. Maybe memory limitations?

Re:Ask HN: Why are modern music players so bad at playing mu... by bromuro on Wednesday July 03, 2019 @08:35PM (#20350475)
Nice written! I have nothing to complain about Spotify. I also like to think they choose the next songs based on the sound of the last ones. Eg no heavy music after a yoga relaxing soundtrack.

Maybe it is not the way i’d order my playlist, but I trust Spotify knows their stuff. There must be a lot of engineering there.

Why not trusting the musical tastes of a robot, after all?

Re:Ask HN: Why are modern music players so bad at playing mu... by c3534l on Wednesday July 03, 2019 @08:53PM (#20350550)
> I have nothing to complain about Spotify.

I do. 1 and 2 aren't even options. I have playlists with 100 or so songs in it. I don't hate that I can predict what the next song will be. Smart Shuffle is fine, so long as you don't say it's random and you offer an actual shuffle button that works the way shuffle has worked since the introduction of the CD player.

Re:Ask HN: Why are modern music players so bad at playing mu... by perfmode on Wednesday July 03, 2019 @05:41PM (#20349129)
the random function in itunes employs heuristics like this. specifically, it avoids multiple songs by same artist in a row.
Re:Ask HN: Why are modern music players so bad at playing mu... by Spooky23 on Wednesday July 03, 2019 @04:03PM (#20348181)
There’s another dimension... the playback mechanism. I think that some of these solutions actually make some sort of hidden playlist to accommodate garbage Bluetooth integrations in cars.

I’ve definitely seen scenarios where I’ve heard the same random play order due to some fuckery with a car Bluetooth connection.

Re:Ask HN: Why are modern music players so bad at playing mu... by TulliusCicero on Wednesday July 03, 2019 @03:42PM (#20347963)
Excellent post. Reminds me of the old Warcraft 3 days when some players would be like, "I got Undead four times in a row, this isn't random Bli$$ard!!!1"
Re:Ask HN: Why are modern music players so bad at playing mu... by winternett on Wednesday July 03, 2019 @07:45PM (#20350173)
They should probably just revive winamp. Winamp really kicked the llama's a$$, and knew what random meant... And also knew how to have a good UI.
Re:Ask HN: Why are modern music players so bad at playing mu... by jayd16 on Wednesday July 03, 2019 @02:19PM (#20346998)
Don't forget that the sufflers will often try to match song outros and intros so they seamlessly cross-fade.

This could have the appearance of #4.

Re:Ask HN: Why are modern music players so bad at playing mu... by gpvos on Wednesday July 03, 2019 @05:24PM (#20348959)
Can you name shufflers which actually do this?
Re:Ask HN: Why are modern music players so bad at playing mu... by mrfusion on Saturday July 06, 2019 @09:55AM (#20369674)
4 basically causes the problems though. Who wants that!
Re:Ask HN: Why are modern music players so bad at playing mu... by FussyZeus on Wednesday July 03, 2019 @06:20PM (#20349507)
I have no idea if this is possible, but it would be awesome to see Spotify implement some kind of learning algorithm that would run your playlists like a professional DJ would, lining them up in progression by tone, tempo, sound, etc. That would be amazing.
Re:Ask HN: Why are modern music players so bad at playing mu... by OJFord on Wednesday July 03, 2019 @03:30PM (#20347826)
> 3. I want it to "seem" random (don't play too many songs by the same artist in a row).

That can still be random, for as long as we're not defining the variable:

    from $artists choose artist randomly
    from $artist.repertoire choose song randomly
    play $song
and then of course with the #2 variation on both variables.
Re:Ask HN: Why are modern music players so bad at playing mu... by kbenson on Wednesday July 03, 2019 @03:38PM (#20347924)
You will get very weird results from that depending on your song library. If you have every song from a prolific artist, and one to two songl you like from a few other artists, you'll get a nice random distribution among artists, but not among your library. For very lopsided libraries, such as people that just started a service and maybe have added one or two full artist catalogues and a smattering of other songs they like that they thought of (which I imagine isn't all that uncommon, it's the state I commonly find myself in on a new service), it will result in a lot of repeats and ignoring a bunch of your library.
Re:Ask HN: Why are modern music players so bad at playing mu... by ghostly_s on Wednesday July 03, 2019 @02:18PM (#20346988)
Um, no? I would argue most people would say they want 1 or 2, and the rest of those are mostly things that developers convince themselves are adequate substitutes for these things.
Re:Ask HN: Why are modern music players so bad at playing mu... by Godel_unicode on Wednesday July 03, 2019 @02:27PM (#20347107)
We made a music system for the office I worked at a few years back; all of these options came up as possible meanings of "random". We ended up with a system where people could vote on which random they wanted, and all of them got used over the course of a few months. 3 and 4 were very popular.

It also sparked a lively debate about whether people actually wanted what they said they wanted or were just being difficult.

People are weird and English is imprecise.