INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Smartlist, 2 Songs Per Artist, Grouped By Artist  (Read 1675 times)

AlreadyFree

  • Junior Woodchuck
  • **
  • Posts: 56
Smartlist, 2 Songs Per Artist, Grouped By Artist
« on: November 25, 2020, 11:58:07 pm »

I'm trying to create a smartlist that plays two random songs by any given artist set to play back to back.

[Song #52] by [Artist #6]
[Song #11] by [Artist #6]
[Song #43] by [Artist #24]
[Song #29] by [Artist #24]
Etc
Etc

I've come up with this:

[Media Type]=[audio] -[Genre]=[Comedy],[Spoken Word],[Xmas] ~limit=-1,2,[artist] ~dup=[Artist] ~sort=[Artist]

I want the songs to be grouped by artist but I don't want the playlist to be in alphabetical order. Anybody have any suggestions on how to achieve this? I've pretty much run out of ideas. I also might want to set it so that each song by the same artist has to be from a different album but can't think of a way to achieve that either.

I posted about this before but now 2 years and 3 versions on is there a way to do this now?
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #1 on: November 26, 2020, 12:21:02 am »

I've never seen a request quite like this. Out of curiosity, what is the significance or importance of this exact configuration that makes you keep chasing it after 2 years?

And when you say you don't want the list in alphabetical order, do you mean that you don't want the artists to be sorted alphabetically either (seemingly contrary to your example), that you want the order of the artists to be random?
Logged

AlreadyFree

  • Junior Woodchuck
  • **
  • Posts: 56
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #2 on: November 26, 2020, 01:39:02 am »

Yes, the order of the artists should be random but grouped in pairs.

They do it on the radio stations around here from time to time, though not a whole playlist, just a two song selection by an artist thrown in the middle of the regular playlist. It's an interesting way to get a small sampling of an artists style & mood before moving on to the next. I think it would flow better as a random playlist. A middle ground between listening to whole albums by different artists back to back and listening to single songs by different artists back to back.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #3 on: November 26, 2020, 02:23:55 am »

You've always been able to do that (well, at least since ~expand was added, you're welcome):
Code: [Select]
[Media Type]=[Audio] [Media Sub Type]=[],[Music] -p="Utility\View Filters\Standard View Filters" ~limit=-1,1,[Artist] ~expand=Artist ~seq ~sort=Random ~limit=-1,2,[Artist] ~sort=[Sequence]
Replace -p="Utility\View Filters\Standard View Filters" with your Genre exclusions. However, I'll note: if you use those same exclusions on multiple Smartlists, you'd be better off making a Utility smartlist of the exclusions, and excluding them the way I do above instead. That way, if you later decide to modify the exclusion list, you only have to modify your "Standard Filter" list.

You may also want to add a max number of tracks to the very end (just pick an even number), as this results in all Artists in my Library, and is a fairly large list. Also, if you tag any of your files with multiple-artists, you may want/need to modify it to use [Album Artist (Auto)] (or your own version if you don't like the built in logic) to avoid it getting confused over list-type Artists.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #4 on: November 26, 2020, 02:24:45 am »

It can be done (and it could have been done years ago), but it would require the clever use of global variables. Unfortunately I can't just point you at a wiki article or tutorial that would help you on your way to do it yourself. Doing this would require a very advanced level of knowledge. It's a more difficult request than perhaps you realize.

Nope. You forgot about ~seq, I think.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #5 on: November 26, 2020, 02:27:14 am »

Yep, I did!  You're not just another pretty face after all, Glynor!  :P

I dropped my useless post as you had a much better answer.
Logged

AlreadyFree

  • Junior Woodchuck
  • **
  • Posts: 56
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #6 on: December 01, 2020, 02:46:35 am »

You've always been able to do that (well, at least since ~expand was added, you're welcome):
Code: [Select]
[Media Type]=[Audio] [Media Sub Type]=[],[Music] -p="Utility\View Filters\Standard View Filters" ~limit=-1,1,[Artist] ~expand=Artist ~seq ~sort=Random ~limit=-1,2,[Artist] ~sort=[Sequence]
Replace -p="Utility\View Filters\Standard View Filters" with your Genre exclusions. However, I'll note: if you use those same exclusions on multiple Smartlists, you'd be better off making a Utility smartlist of the exclusions, and excluding them the way I do above instead. That way, if you later decide to modify the exclusion list, you only have to modify your "Standard Filter" list.

You may also want to add a max number of tracks to the very end (just pick an even number), as this results in all Artists in my Library, and is a fairly large list. Also, if you tag any of your files with multiple-artists, you may want/need to modify it to use [Album Artist (Auto)] (or your own version if you don't like the built in logic) to avoid it getting confused over list-type Artists.

Wow, that works. I don't know how, but it works. Is there a detailed explanation of the use of modifiers somewhere. The only info I can find is very vague.

And I'm definitely probably asking for too much now but is there any way to use [Artist] for multiple artists albums (or based on the [Grouping] value] and use [Album Artist (Auto)] for everything else? Also is there a way to exclude artists if I only have one song by them?
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Smartlist, 2 Songs Per Artist, Grouped By Artist
« Reply #8 on: December 01, 2020, 09:37:25 am »

Wow, that works. I don't know how, but it works.

The reason it works is that the modifiers are applied in-order, and they do this:
~limit=-1,1,[Artist]: Limits the list to one randomly-selected track from every artist currently in the list, in a shuffled order.
~expand=Artist: Expands the list to include ALL tracks from each artist. Note: ~expand works in-place on the list, so each of the randomly selected single-tracks from the first ~limit "blow up" where they are in the list to include all of the tracks by that artist, but the list overall retains the shuffled order (with all the Artists grouped together).
~seq: Saves the list order.
~sort=Random: Shuffles the list (this is actually probably not needed, but doesn't hurt).
~limit=-1,2,[Artist]: Re-limits the new list to 2 randomly-selected tracks by every artist.
~sort=[Sequence]: Puts the list back into the order saved before, which will re-group the Artist tracks together (because the ~expand works in-place, so that order had all the Artist's tracks grouped together).

is there any way to use [Artist] for multiple artists albums (or based on the [Grouping] value] and use [Album Artist (Auto)] for everything else?

Not really. But you could make your own version of [Artist Album (Auto)] that doesn't do the Various Artists thing that the built-in one does. I, for example, don't use [Artist Album (Auto)] in my Library and have my own [Artist Album (Smart)] expression-field which does:
Code: [Select]
FirstNotEmpty([Album Artist], ListItem([Artist],0))
If you implemented that and used it, then I think that would do what you want. It outputs [Album Artist] if the track has one, and if not, it outputs the first (and only first) entry in the [Artist] field.

Also is there a way to exclude artists if I only have one song by them?

Yes. But this is a bit more complicated.

The ~expand modifier will always expand the selection to ALL matching files across your Library, and since it is a Modifier to the search, it always happens after the "limits" applied by the search. So, you can't re-limit a search to exclude files in any search that includes an ~expand (because the ~expand will "override" the limitations). To make this more clear:

If you do a search for:
[Media Type]=[Audio] [Media Sub Type]=[],[Music] -[Genre]=[Electronic]
(all music files, except those in Genre "Electronic".)

And then add an ~expand=Artist to it, the resulting list MAY include some files in Genre "Electronic" if you have some Artists which have some tracks tagged as Electronic and others that are not. If the Artist only has tracks tagged as Electronic, then it won't be in the list at all, because it will have been excluded from the ~expand. But if it has even one non-Electronic track, then it'll still be there, and then the ~expand will expand it to all tracks.

So, to accomplish your goal, you need to be able to re-filter your search AFTER the ~expand with another, separate search, so that you can still do the ~expand but then afterwards "filter out" those tracks where you only have a single artist. You can do this with multiple smartlists which point to each other. To exclude all single-track Artists, you'll only need one extra "utility" list.

Make a separate smartlist called "One Track Artist Remover" (or whatever you want, but that's what mine is called). You won't actually use this List for anything other than "filtering" so you might want to bury it in a "utility" Playlist Group (mine are in Utility\View Filters\ under Playlists). Give it this Search:
Code: [Select]
[Media Type]=[Audio] [Media Sub Type]=[],[Music] ~limit=-1,1,[Artist] ~sort=[Artist]
That makes a list of all Artists in your Library, with one randomly-selected track per Artist. Here's the beauty part: If you only have one track for a particular Artist, then that will be the track "selected" for that Artist (the ~limit won't be random in that case, it'll select the only one there is).

Then, take that list, and filter your expanded-list with it:
Code: [Select]
[Media Type]=[Audio] [Media Sub Type]=[],[Music] -p="Utility\View Filters\One Track Artist Remover" -p="Utility\View Filters\Standard View Filters" ~limit=-1,1,[Artist] ~expand=Artist ~seq ~sort=Random ~limit=-1,2,[Artist] ~sort=[Sequence]
That way, any artists that only have a single file will be filtered out entirely before the ~expand happens. But, for any Artist in the One Track Artist Remover that do have more than one file in the Library, it won't matter that the one random file is excluded, because the ~expand will "override" that after the fact.

If you want to limit it instead to only Artists which have more than 3 or 15 tracks, you just change the ~limit on your One Track Artist Remover list to ~limit=-1,3,[Artist] or ~limit=-1,15,[Artist] or whatever.

I use this same type of "trick" extensively in my Library. I have lots of Smartlist filters like that that apply to all kinds of things. For example, I have Views that are limited to "Favorite Artists" which are defined as Artists which have at least 4 tracks rated 3 stars or better, or those that are in one of my "top hits" lists. I accomplish this by having a "Utility\View Filters\One Hit Artist Remover" that has filters to limit it to only highly-rated tracks, and then has ~limit=-1,3,[Artist]. Then, in separate lists, gets filtered out before an ~expand (much like I explained here) to eliminate Artists which have only a few highly-rated tracks, but keep those with lots.

This same idea lets you make all kinds of cool lists.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up