this post was submitted on 09 Oct 2026
201 points (98.6% liked)

memes

22908 readers
2110 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/Ads/AI SlopNo advertisements or spam. This is an instance rule and the only way to live. We also consider AI slop to be spam in this community and is subject to removal.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] danekrae@lemmy.world 26 points 11 hours ago (5 children)

It's been years since I dabbled with programming, but how hard can it be for these music app developers to make a random list of your songs, and pop every played song from the list until it's empty and then repeat.

[–] jballs@sh.itjust.works 1 points 2 hours ago

This dude (famous for "do you guys not have phones?") actually has a pretty good YouTube series on interesting ways to tackle programming challenges. He's got one on randomness that I thought was pretty cool: https://youtu.be/2anY9ICA-Pg

[–] Wirlocke@lemmy.blahaj.zone 5 points 6 hours ago

You wouldn't even need to pop songs off the list, just shuffle, go through the playlist, shuffle then restart the playlist.

But the music app developers aren't trying to give you true randomness. They're using machine learning algorithms to try and guess what you really want.

Nothing does what it says it does anymore, everything's trying to second guess you. I hate it.

[–] ExLisper@lemmy.curiana.net 11 points 10 hours ago (4 children)

I remember reading decades ago how music player devs would implement proper random playback and people would complain that it's not really random because it played the same song second time soon after the first. So the devs had to change it and make it less random...

[–] BeelzebubEiNukuKoskaan@piefed.social 5 points 6 hours ago* (last edited 6 hours ago)

Thats why some players have "random" and "shuffle".

Random is truly random, it might play the same two songs multiple times back to back. Highly unlikely, but it might.

Shuffle has a thing built in that avoids a song if it has been played within X amount of time or plays. Some shuffles might have other criteria as well.

[–] grue@lemmy.world 3 points 7 hours ago

The algorithm the grandparent comment suggests is equally random. It's just that it's a random sequence rather than a random selection.

[–] atomicbocks@sh.itjust.works 2 points 7 hours ago* (last edited 7 hours ago)

I remember reading this about the iPod, where they programed it to not play the same artist multiple times in a row or within certain number of songs of each other.

[–] Dagnet@lemmy.world 2 points 7 hours ago

Previous comment wants random order not fully random

[–] schwifty_squanch@lemmy.ml 5 points 10 hours ago (1 children)

MPD will do that if you enable the 'consume' option.

[–] danekrae@lemmy.world 5 points 10 hours ago

Uuuh, "MPD for Android APK can be installed from F-Droid", nice.

[–] Ephera@lemmy.ml 4 points 10 hours ago (3 children)

Pretty sure that's how most of them work...?

It's a single function call to randomize the order of a list in most randomization libraries. The hardest part would be to persist this randomized list across program restarts, and it's not hard either.

[–] atomicbocks@sh.itjust.works 2 points 7 hours ago

Unfortunately, not Plex. Plex has the absolute worst fucking shuffle mechanism I have ever used in my entire fucking life. It will literally play things in the exact same order multiple times in a row like days later. And in the Plexamp app, it will literally not play past like the fourth track on any album.

[–] lightnsfw@reddthat.com 1 points 7 hours ago

I don't think any of the ones I used are truly random, or there's something else going on. I often just randomize my whole music library and it's always pretty samey. It's often the same songs coming up even though I have 100s and I know for a fact there's songs that have never come up.

[–] thisisbutaname@discuss.tchncs.de 1 points 10 hours ago (1 children)

I bet it's possible to make a function that given a song in a list it returns the next song (or previous) in such a way that it's random but for a given song the previous/next one are always the same, depending on some parameter. That way the only two things the program has to remember is the current song and the parameter used to compute the next one. Then each time shuffle is enabled a new "seed" parameter is rolled.

[–] Ephera@lemmy.ml 2 points 8 hours ago (1 children)

I'm not sure how you would ensure that the songs only show up once in that list, unless you do weird shit like re-rolling the seed until you find one where this happens to be true.

But also, that's a lot harder than just storing the shuffled list. 😅

[–] addie@feddit.uk 2 points 6 hours ago (1 children)

You don't have to do anything fancy, I don't think. Initialise your RNG with the seed that you have stored, shuffle the list, and then rotate the list to get to the 'first song'. Every RNG seed will give a correct result.

If you shuffle using eg. Durstenfeld/Knuth shuffle, which is O(n), then you can make a note of the 'first song's position' and do the rotation at the end of shuffling straight to the first song, in a single pass.

You'll still get a repeatable ordering if songs are added or removed from the playlist - the order will be different, of course - and it takes a lot less storage to write down the seed and the ID of the 'first song', which might matter if you're using a crappy old music player with very limited storage space.

[–] Ephera@lemmy.ml 2 points 5 hours ago

Ah yeah, very good point. Their description didn't have me thinking of this kind of solution, but yeah, that should work.