Live data from Hacker News

How to Shuffle Songs? (2014)

engineering.atspotify.com

11–20 of 66 posts

Re: How to Shuffle Songs? (2014)

#11

> Let’s go back to our users who have also fallen victims to Gambler’s fallacy. If you just heard a song from a particular artist, that doesn’t mean that the next song will be more likely from a different artist in a perfectly random order. Wait no, it does, right? Since we are not doing random independent events, but taking things out off a finite set. Going back to the colors, if there are 4 green and 4 not-green,…

Yeah, you’re right. I think this is a case of simplification in communication over perfect technical accuracy. What he meant was more that song “similarity” (as in artist, album, etc) is not taken into account by the algorithm. But yes you’re absolutely right.

Re: How to Shuffle Songs? (2014)

#12

Supposedly, the "pros" use a combination of one-step key shifts, similar tempos, and slowly ascending "energy" (which I've never found a good definition of) to pick the next song. Key-finding algorithms don't seem to be particularly accurate from what I have heard of. Ideally, you'd use this, plus the year and metadata about whatever microgenre. Use the radio adage of "don't hit me with a brick after you tickle me wi…

It's almost impossible to define those microgenres per song because the metadata for music is shit :)

Spotify does try to do it, but it's not an exact science: https://everynoise.com

From https://everynoise.com/EverynoiseIntro.pdf

--- start quote ---

There are other ways to plot music genres, of course, than the one used by the map at any given time. We use 10 dimensions internally, and two completely independent measures of genre similarity. Iʼve flipped the map once already since first publishing it, and I might do so again without warning if I find another configuration that seems more interesting.

--- end quote ---

Re: How to Shuffle Songs? (2014)

#14
Not so related, but I actually like Spotify’s algorithm for suggesting new music a lot. Currently my daily routine for discovering new music is 1) pick an album that has something to do with what I want, 2) start the last song in the album, 3) skip it. It works pretty well!

Re: How to Shuffle Songs? (2014)

#15
post #10

This is one of my favourite things about psychology, perception and programming. When people say they want to "randomly shuffle a playlist", they really don't want that. They want the perception of randomness, but _true_ random doesn't abide by rules. If you're actually random, there is a probability that it might just play all the songs straight through. Or just pick songs by a single artist back-to-back.

> When people say they want to "randomly shuffle a playlist", they really don't want that. Same in games. "I had an 80% chance to hit and didn't" is a perfect example.

Leading to features like "Karmic Dice" in the recent Baldur's Gate 3

Re: How to Shuffle Songs? (2014)

#16

This is one of my favourite things about psychology, perception and programming. When people say they want to "randomly shuffle a playlist", they really don't want that. They want the perception of randomness, but _true_ random doesn't abide by rules. If you're actually random, there is a probability that it might just play all the songs straight through. Or just pick songs by a single artist back-to-back.

I want all songs truly randomized once, then playing in that order. Sadly youtube just picks the next one based on the current ones ID + some seed, so it constantly gets stuck in loops

I'm amazed youtube hasn't figured out a way to detect and avoid these loops, it seems like a solvable problem. Even a naive solution like having the client remember the last n played tracks, and not auto-play any of them (picking the next one down) would be a big improvement.

Re: How to Shuffle Songs? (2014)

#17

This is one of my favourite things about psychology, perception and programming. When people say they want to "randomly shuffle a playlist", they really don't want that. They want the perception of randomness, but _true_ random doesn't abide by rules. If you're actually random, there is a probability that it might just play all the songs straight through. Or just pick songs by a single artist back-to-back.

Back in the 90s, when portable CD players were still a thing, I had one.

It had a toggle for random play. It indeed apparently played the tracks at random.

By random I mean random, not shuffle. It would play the same track multiple times during a listening session. For example tracks in order like 2, 2, 7, 8, 7, ...

I actually liked that.

If memory serves, it would stop playing after it had played each track at least once. If there were a lot of tracks it would not finish, at least not before the batteries ran out.

Re: How to Shuffle Songs? (2014)

#18

I actually just wish Spotify stop spamming me the very same songs and artists over and over in virtually any "made for airstrike" radio / playlist. Give me "NOT made for airstrike", please. I often want to start a radio off a song precisely because I'm trying to find new songs that go with that one, not so I can have an excuse to unironically listen to "More Than This" for the 20th time this week...

Yes, Spotify seems to want to force you to listen to the same things over and over, almost as if someone wants to boast about how many millions of seconds of loading time is saved by their clever caching.

Re: How to Shuffle Songs? (2014)

#19

This is one of my favourite things about psychology, perception and programming. When people say they want to "randomly shuffle a playlist", they really don't want that. They want the perception of randomness, but _true_ random doesn't abide by rules. If you're actually random, there is a probability that it might just play all the songs straight through. Or just pick songs by a single artist back-to-back.

Rob Pardo (Blizzard, World of Warcraft (2004)) said they decided to model randomness after how players thought it worked.

> ..at least once a week, a developer would come to my office, and say "the random number generator is broken, we need to look at it."--It's because they hit a streak. [1]

[1] https://www.youtube.com/watch?v=FhC0NaB6ock&t=2343s

He shares more details about game design choices in the video.

Re: How to Shuffle Songs? (2014)

#20
Ok, so this article proves that they know how to do it, but they seem to have forgotten over the intervening 9 years - according to some, the shuffle function now prefers similar songs to "keep the vibe", but according to the Spotify support pages, that's a "smart shuffle" feature, and I don't have that because I'm too cheap for the paid plan. Anyway, shuffle should play the songs in a playlist in random order, but make sure to play all the songs (like shuffling a pack of cards and then looking at the cards one by one)! While Spotify's current "shuffle" just seems to pick a random song to play after the current one, with some songs repeating three times while others are never played. Annoying as hell...
Post reply on HN