Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to shuffle one song from each tag #144

Open
MacTheZazou opened this issue Jun 14, 2022 · 5 comments
Open

How to shuffle one song from each tag #144

MacTheZazou opened this issue Jun 14, 2022 · 5 comments

Comments

@MacTheZazou
Copy link

Is it possible to shuffle song from 2 artist like this:

Artist A: [A1, A2, A3]
Artist B: [B1, B2, B3, B4, B5]
Queue: [B2, A1, B3, A3, B5, A2, B4, A3, B1, A2....]

Thank you for your help..

@joshkunz
Copy link
Owner

Just so I'm understanding correctly, the idea is to interleave the values of the tag (in this case artist) in a random order. E.g. [B3, A1, B2, A4, B5, A2, ...] would also be valid ordering. How would this generalize to more than 2 values? E.g., what if I have A, B, and C? Would it be [A1, B4, C2, A3, B1, C3, ...] or something else? What if there's only one unique tag value, would that just be the normal shuffle that ashuffle already implements?

Assuming my understanding is correct, there's no support for this today. Songs are pulled from a common pool without regard for their attributes. So, this would need to be implemented to be supported.

I think interleaving in this way wouldn't work super well with ashuffle's shuffling algorithm. If you'd like this feature in ashuffle, I'd propose instead a more configurable window-uniqueness. E.g. no two songs by the same artist can be in the window at the same time. With the standard window size of 7, and songs by artists A..Z, this would end up doing a shuffle like [A1, X9, F2, Q7, B2, R5, M1, A3, ...] Notice that A repeats before a song by every letter is played. This means that it wouldn't guarantee the interleave across all songs, just for the window length. I think that should be enough space between the artists to be good enough, and it fits better with ashuffle's model.

@MacTheZazou
Copy link
Author

MacTheZazou commented Jun 14, 2022 via email

@Uk0kA
Copy link

Uk0kA commented Mar 6, 2024

Just so I'm understanding correctly, the idea is to interleave the values of the tag (in this case artist) in a random order. E.g. [B3, A1, B2, A4, B5, A2, ...] would also be valid ordering. How would this generalize to more than 2 values? E.g., what if I have A, B, and C? Would it be [A1, B4, C2, A3, B1, C3, ...] or something else? What if there's only one unique tag value, would that just be the normal shuffle that ashuffle already implements?

Assuming my understanding is correct, there's no support for this today. Songs are pulled from a common pool without regard for their attributes. So, this would need to be implemented to be supported.

I think interleaving in this way wouldn't work super well with ashuffle's shuffling algorithm. If you'd like this feature in ashuffle, I'd propose instead a more configurable window-uniqueness. E.g. no two songs by the same artist can be in the window at the same time. With the standard window size of 7, and songs by artists A..Z, this would end up doing a shuffle like [A1, X9, F2, Q7, B2, R5, M1, A3, ...] Notice that A repeats before a song by every letter is played. This means that it wouldn't guarantee the interleave across all songs, just for the window length. I think that should be enough space between the artists to be good enough, and it fits better with ashuffle's model.

Old discussions but I'm left wondering if you meant that "no two songs by the same artist can be in the window at the same time" is already possible? if so, how ? This is exactly what I'm hoping to do as I mainly listen to a huge music library on random and would like to avoid hearing the same artist within the defined window.

@Uk0kA
Copy link

Uk0kA commented Mar 10, 2024

@joshkunz I'm unfortunately unable to contribute code but I can say that I,d very much like to have the feature "no two songs by the same artist can be in the window at the same time" added if it's not too much trouble or out of scope.

@Uk0kA
Copy link

Uk0kA commented Dec 13, 2024

@joshkunz , me again with some data to support the request for "no two songs by the same artist can be in the window at the same time"

I use Moode audio to listen to a vast library of digital music of over 500 different artists on shuffle.
After 400 plays, the shuffle algorithm has only returned 207 different artists, often playing the same artists
And playing the same 40 artists more than 3 times and up to 10 times

My usercase might be too niche but it does show that the shuffle algo could benefit from the added tweak of "no two songs by the same artist can be in the window at the same time" to truly be shuffling big music libraries.

I'd really like to figure this out. I know nothing but perhaps you can point me in the right direction so I could possibly learn andcontribute code for this new option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants