• danekrae@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    18 days ago

    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.

    • ExLisper@lemmy.curiana.net
      link
      fedilink
      arrow-up
      3
      ·
      18 days ago

      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
        link
        fedilink
        English
        arrow-up
        2
        ·
        18 days 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.

    • Zarobi@aussie.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      18 days ago
      def getNextShuffle(songs):
          return random.choice(songs)
      

      Vs

      def getNextShuffle(songs):
          randList = random.sample(songs, k=len(songs))
          for song in randList:
              yield song
      

      Didn’t include persisting it to storage for brevity. Only tricky part would be detecting when the source playlist changes and how to handle that. Personally I’d just append any new songs to a random position in the unplayed portion, while removal is obviously simple

  • aeronmelon@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    18 days ago

    Algorithm shuffle is garbage.

    2026, and I’m still using iTunes and actual music files loaded on my phone.

    It actually shuffles, plays everything in a playlist exactly once, reshuffles everything, and does it again.

  • ThunderLegend@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    17 days ago

    I have this problem with tempus and navidrome. I don’t which one is the guilty one but my random and discovery playlists almost always play the same 500 songs of my 7k songs library.

  • 9gagescapee@altgag.net
    link
    fedilink
    arrow-up
    1
    ·
    16 days ago

    What makes these super-funny is the concept of “shuffle bag” is a million years old [citation needed] yet still very, very rarely used… Or even, do a Fisher–Yates on the full set and when finished playing, do again…

  • x00z@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    17 days ago

    My car stereo has this problem. Its randomization always results in the same list. I have to trick it by doing something random myself first.