Lots of music players started out with true randomness and then dialed it back because people complained that it wasn’t very random.
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.
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.
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.
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.
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...
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.
Using random number generators for shuffle mode was a stopgap measure that everyone else cargo culted because it's easier than critical thought.
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...
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.
I'll work on it when I can get a bit of free time.
Edit: Oh, and it is always on top, you are my favorite open source contributor.
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).
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.
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...
“What is the best to listen after this track?” - just with a super small subset of tracks.
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.
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!
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
We've come so far with UI design now that we can't have that.
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.
It's odd to hear that this is not standard, given that it's a standard algorithm. Maybe memory limitations?
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?
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.
I’ve definitely seen scenarios where I’ve heard the same random play order due to some fuckery with a car Bluetooth connection.
This could have the appearance of #4.
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.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.
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?