INTERACT FORUM

Please login or register.

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

Author Topic: SMARTLIST: Query n songs of specific Genre (Artist,Album,etc) clumped together?  (Read 6701 times)

scm

  • World Citizen
  • ***
  • Posts: 171

Is it possible to create a Smartlist which would "Shuffle" the tracks but in such a way that I could specify that it, for example, play 5 songs in a row of each Genre (or Artist)?

In other words, maybe I make a Smartlist of all songs in Genres "Blues" and "Jazz" and "Folk", so I want to query the database for those but shuffle them randomly in some fashion so it's always a fresh list, but rather than totally shuffled, have them arranged in series of consecutive songs from a specific artist.  I could specify any number, and select artist or genre or album, etc.

Or another example is Shuffle all songs with 4 or 5 stars in all genres but produce the playlist where it's 6 songs from one genre, then 6 from another, etc. etc.

This way, rather than Shuffling producing the rollercoaster of total randomness, it gives at least a random selections of several songs of the same vibe before moving on to the next vibe.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #1 on: July 23, 2015, 10:29:36 am »

Good question!  Offhand I'd say no, because that math isn't possible.  But there may be a clever use of ~mix and / or ~expand.  I've never tried but it would be useful! 
I will experiment a bit, but I can't see it in my head...
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #2 on: July 23, 2015, 10:42:46 am »

ok, the start point is

~mix=10,50%,{[genre]=jazz},50%,{[genre]=blues} ~sort=[Genre]

this gives 5 jazz followed by 5 blues.  the rub is in making the pattern repeat itself...i hope someone else chimes in, i can't play with it more until later.  i'm suddenly really interested in this working ha ha ha
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #3 on: July 23, 2015, 10:47:32 am »

I'm new to crazy smartlist shuffle control, but I've read a little about it.  I think what you want is quite do-able; it's a matter of figuring out what you want.  I just built a smartlist that does this:

1.  Gets songs from several Genres.  I specified several variations of "alt rock".  Because they were near the top of the Genres list.  I could have picked any combination of genres.
2.  Limits the total number of songs to 50.  Just a number I chose.
3.  Limits the number of songs per artist to no more than 5.  This is random too though.  It will be no MORE than 5, but it could easily be less.
4.  Sort by artist.

Make a new smartlist then go to the import/export box.  Paste in this to try out my list recipe.

Code: [Select]
[Media Type]=[Audio] [Genre]=[Alt Rock],[Alt. Rock],[Alt. Rock, Jam Rock],[Alternative],[Alternative Pop//Rock],[Alternative Rock] ~n=50 ~limit=-1,5,[Artist] ~sort=[Artist]
You can play around with this and come up with all kinds of variations.  For reference, here's a page with a bunch of examples of these kinds of limits, mixes, and combinations:

http://wiki.jriver.com/index.php/Search_Language#Examples

Enjoy,

Brian.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #4 on: July 23, 2015, 11:05:48 am »

Brian

i'm getting a great mix from

Code: [Select]
[Media Type]=[Audio] ~mix=20,50%,{[genre]=jazz},50%,{[genre]=blues} ~limit=-1,7,[genre]~sort=[Genre]
but...it's still pretty random as in there will be 5 jazz, then 1 blues, then 1 jazz, then 4 blues...etc., is there a way to force the limit (so rather than UP TO 5, force BETWEEN 5 and 10?)
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #5 on: July 23, 2015, 04:40:29 pm »

^ I've played with your example and I don't understand exactly what's going on.  I'm not 100% sure there's an easy way to do what you're asking for.  But I'm new to this, so there could definitely be a solution I don't see.  What you want is "stripes" of genres so  you get exactly 7 Jazz, then exactly 7 Blues, etc.

Paging Glynor to the white telephone labeled "~MIX". 

Brian.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8971
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #6 on: July 23, 2015, 05:27:36 pm »

~mix can be grotty because it requires the user to specify a set number of tracks to include in the mix.

I had this last night, working perfectly, except for one problem I ran out odf time on... It always picked the same tracks... I got there by:

In rules:
Media type is Audio
Genre is [pick a selection of genre from the list]

Then, under modifiers:
~limit (advanced) one of each genre (this returns one track from each genre randomly listed, all good so far)
~expand genre (now we have the same list we started with, with the genres all together, but in a different order every time)
~limit (advanced) 6 of each genre

and that last step is where it falls over. It always picks the first six tracks listed in each genre.

you could, of course, skip the first two, and do:

~limit (advanced) to six of each genre
~sort equals genre

You will always get six different tracks, they will always be grouped by genre, but 'Blues' will always play before 'Jazz'

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #7 on: July 23, 2015, 05:48:42 pm »

That's what I'm saying Marko!

It's funny that we have a limit that is <= n...but not a limit = n (or >=n for that matter)

Of course if there was a for-next loop it would be trivial :)

Either way experimenting with this has familiarized myself better with some of the ~modifiers and it's always good to learn!
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #8 on: July 23, 2015, 07:50:37 pm »

There's a similar, but not at all the same, thread I found which might be helpful.

http://yabb.jriver.com/interact/index.php?topic=59282.0

The explanation of the "working solution" is pretty far down the page.  It's a lot to take in all at once.  It's going to take me a while to absorb all this.

Brian.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8971
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #9 on: July 24, 2015, 12:01:45 am »

Well, well, nice one Brian. Five years ago we had all that fun? Wow!

It's more than helpful, it's the answer...

Code: [Select]
[Media Type]=[Audio] [Genre]=[Acoustic],[Blues],[Jazz],[Celtic] ~limit=-1,1,[genre] ~expand=genre ~seq ~sort=Random ~limit=-1,6,[genre] ~sort=[Sequence]

Enjoy. (and thanks again gappie)

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1571
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #10 on: July 24, 2015, 08:28:10 am »

I think your solution is alarmingly simple-
Multiple combining smartlists :)

Now, let's consider our problem succinctly; We want 5 jazz, I'm assuming in a random order, followed by 5 blues etc. etc.

First create a jazz smartlist, with the paramaters you like. 5 songs is a reasonable length for this, or thereabouts.
Name this Jazz1

Create another for blues, again in the length you want.
Name this Blues1

Now, create a final smartlist that looks like this, using a custom rule:
Code: [Select]
[Playlist]="Jazz1","Blues1"
This gives you your basic stripe of 5 blues and 5 jazz.

Now, if you require a 50 file striped playlist, you need to create 5 distinct copies of the blues smartlist, and 5 of the jazz smartlist. Your custom rule will then look like this:
Code: [Select]
[Playlist]="Jazz1","Blues1","Jazz2","Blues2","Jazz3","Blues3","Jazz4","Blues4","Jazz5","Blues5"
Striped playlist :)

Someone pointed me in the direction of a very similar solution to getting a spread mix of rated files, and this is an adaptation of the basic technique.
The 'new' playlists you don't want to see can be hidden inside a playlist group; I've got one specifically for useful blocks like this.

-Leezer-
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #11 on: July 24, 2015, 08:42:23 am »

Marko,

I think my solution or maybe several others might work well for the Original Poster.

But our man ferday is asking for a striped listing.  He wants to see a repeated pattern:  5 blues, 5 jazz, 5 blues, 5 jazz, etc.

The solution from that older thread, and your adaptation, only does a single stripe of each genre, then stops.  As I said, I'm not sure this is possible, but MC continues to surprise me!  :)

Brian.
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1571
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #12 on: July 24, 2015, 08:51:15 am »

See my post above for a solution to ferday's striping ;)

It's clunky, requiring a combination of multiple smartlists, but it does work!

-Leezer-
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #13 on: July 24, 2015, 08:57:40 am »

Yeah, Leezer, I thought about that after I wrote.  I guess what I mean is, a single expression solution.  Or at least a closed form solution.  Even a solution that required one smartlist per genre would be decent.  But a smartlist per stripe?  That's inelegant, clunky, and .... and.... and it works.  :)  But I don't like solutions like that so...

Brian.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #14 on: July 24, 2015, 08:58:31 am »

Ha ha ha thanks all!

The striped lists was how I read the OP, but has become an obsession with myself now...it would really improve a lot of my Era-based lists among others

Thanks leezer!  I have done multiple lists before for other things...I just think it would be grand to do it in one list

I'll continue to crack at it but it may be a lost cause...Without a loop function in the expression language.  But half the fun is trying right!  I've learned a lot from this thread (and Brian's linked thread) so that's awesome!
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2570
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #15 on: July 24, 2015, 09:58:33 am »

If MC added a loop function I would estimate support tickets would increase 10-fold when people start accidentally deadlocking their computers with infinite loops.
Logged

scm

  • World Citizen
  • ***
  • Posts: 171
Re: Smartlist: Can it list X number of songs of specific Genre?
« Reply #16 on: September 05, 2015, 11:18:40 am »

Code: [Select]
[Media Type]=[Audio] [Genre]=[Acoustic],[Blues],[Jazz],[Celtic] ~limit=-1,1,[genre] ~expand=genre ~seq ~sort=Random ~limit=-1,6,[genre] ~sort=[Sequence]


1. This appears to offer up 6 songs from each genre grouped together, but only once for each genre.  You guys mentioned a loop function.  Is a loop the only way to have multiple genre groupings as the playlist progresses?  In other words, maybe I want a playlist with only 2 or 3 genres.  I don't want a playlist of 12 or 18 songs.  I'd be happy to specify the total playlist length, like 200 songs for example.

2. In addition to a rule for Genre, I also have a rule that the Rating should be greater than or equal to 4 stars, and then I copied the rest of your modifiers.  However, the results are not limited to 4+ stars.  Any idea why?  Here's what I have for a Genre and Artist smartlist:

[Media Type]=[Audio] [Genre]=[blues],[cool jazz],[country],[new jazz],[old jazz],[singer songwriter],[world] [Rating]=>=4 ~limit=-1,1,[genre] ~expand=genre ~seq ~sort=Random ~limit=-1,6,[genre] ~sort=[Sequence]

[Media Type]=[Audio] [Rating]=>=4 ~limit=-1,1,[artist] ~expand=artist ~seq ~sort=Random ~limit=-1,6,[artist] ~sort=[Sequence]
Logged

scm

  • World Citizen
  • ***
  • Posts: 171

Is this a job for a "~MIX" expert?

My 2 previous questions are well beyond my pay grade.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009

This smartlist is pretty complicated and I don't know how to make it do "stripes" of genres, as was discussed earlier.  So question #1, I'll say I can't help you with.

Question #2 I think I can help on.  Take a look at your expression.  You have the Rating somewhere near the front of the expression.  But then several terms later, you use the Expand modifier.  Expand takes whatever you give it and expands to everything that matches.  Expand Artist gives you every track by that artist and doesn't obey any previous selection. (for example).

If you want the output of Expand to be limited to Ratings > 4, then you have to add that modifier after the expand.  Do some experiments and you can probably find an order that satisfies your requirements.

Good luck!

Brian.
Logged

scm

  • World Citizen
  • ***
  • Posts: 171

Yes I thought about this and tried moving the RATING criteria farther down in the statement, but it automatically put it back at the beginning, because technically the Rating is a RULE, and the Expand and other commands are MODIFIERS to the rule.  Does anyone have a solution? 

It would seem, and I am not an expert, that you'd have to use some sort of workaround to query for a Rating of 4 stars or more in the "Modify Results" section of the "Edit Smartlist" dialogue.

Someone must know.

This smartlist is pretty complicated and I don't know how to make it do "stripes" of genres, as was discussed earlier.  So question #1, I'll say I can't help you with.

Question #2 I think I can help on.  Take a look at your expression.  You have the Rating somewhere near the front of the expression.  But then several terms later, you use the Expand modifier.  Expand takes whatever you give it and expands to everything that matches.  Expand Artist gives you every track by that artist and doesn't obey any previous selection. (for example).

If you want the output of Expand to be limited to Ratings > 4, then you have to add that modifier after the expand.  Do some experiments and you can probably find an order that satisfies your requirements.

Good luck!

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8009

You're right of course:  The modifiers HAVE to come after the initial selection criteria in a SmartList.  So what do you do if you want to do more criteria *after* modifiers?  You seem to be stuck....  But you're not.  :)

The answer is you build a second SmartList.  The first criteria of SmartList #2, is "Playlist is any Smartlist #1".  Then you add more criteria to it, like "[Rating] =>= 4".

I think that will get you what you want.

Brian.
Logged

scm

  • World Citizen
  • ***
  • Posts: 171

You're right of course:  The modifiers HAVE to come after the initial selection criteria in a SmartList.  So what do you do if you want to do more criteria *after* modifiers?  You seem to be stuck....  But you're not.  :)

The answer is you build a second SmartList.  The first criteria of SmartList #2, is "Playlist is any Smartlist #1".  Then you add more criteria to it, like "[Rating] =>= 4".

I think that will get you what you want.

Brian.

I took the original Smartlist:

[Media Type]=[Audio] [Genre]=[blues],[cool jazz],[country],[new jazz],[old jazz],[singer songwriter],[world] ~limit=-1,1,[genre] ~expand=genre ~seq ~sort=Random ~limit=-1,6,[genre] ~sort=[Sequence]

and this returns 6 songs of each of the listed genres, grouped together by genre, for a total of 42 songs, because there are 7 genres.

However, these include all ratings, including unrated songs.  Looking at the 42 songs, only 3 of them are 4 STARS or higher, so when I make a 2nd smartlist to begin with this list of 42 and add the RULE of only showing the 4+ star songs, it does NOT produce that nice list of 6 songs from each genre grouped together, which is what we are going for.

I'm not entirely sure why the first 2 modifiers are necessary or what they are doing:

the "~limit=-1,1,[genre] ~expand=genre"

I've already specified the 7 genres I want in the initial RULE, so why do I need to then limit it to one of each of the genres and then expand before I sequence them?  It obviously is necessary, and I've read the article "http://wiki.jrmediacenter.com/index.php/Smartlist_and_Search_-_Rules_and_Modifiers" but I still don't understand.

I get what you are saying about how the EXPAND modifier negates any prior 4+ rating filter, so it seems, if I'm following your logic, that it would require these distinct phases:

1. Create a list of all songs in the desired genres
2. Execute any EXPAND modifiers (before filtering ratings)
3. Filter only 4+ star ratings
4. Group together into genre stripes of n number of songs (in my case 6)

So I made Smartlist 1:

[Media Type]=[Audio] [Genre]=[blues],[cool jazz],[country],[new jazz],[old jazz],[singer songwriter],[world] ~limit=-1,1,[genre] ~expand=genre ~seq ~sort=Random

And Smartlist 2:

playlistid==981733592 [Rating]=>=4 ~limit=-1,6,[genre] ~sort=[Sequence]

This did not work because the sequencing done in the first smartlist didn't carry over to the 2nd I assume.

So anyway...

The original Smartlist we started with before today was basically "~limit, ~expand, ~sequence, ~shuffle, ~limit, ~sort", and this worked very well to create the properly sorted stripes of genres, but with no ability to only show 4+ rated songs.

I just attempted to break it in half to "~limit, ~expand, ~sequence, ~shuffle" in the first smartlist.
Then filter all 4+ rated songs and "~limit, ~sort" in the 2nd smartlist.

So we are still back to where we were.  Anyone figure this out?
Logged
Pages: [1]   Go Up