INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist Challenge: The Ultimate Self Populating Music List  (Read 6518 times)

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007

Over in this thread:

http://yabb.jriver.com/interact/index.php?topic=105849.new;topicseen#new

I am continuing to experiment with a SL sample from the wiki - that uses the "mix" parameter with syntax like this:

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[number plays],[Last Played]-d,[date imported]-d ~%=50 ~sort=random}

According to our discussions in the thread - this specific piece:

~sort=[number plays],[last played]-d,[date imported]-d -

"pushes" least played stuff to the top of the list, so they get caught by the ~%=50 rule. As you play these more, they will drop down the list, and new stuff will become "least played" and so the list remains fresh, automatically"

This is exactly what I am looking for but then after testing it out - found that this logic is not considering any tracks that have NEVER been played at all. Bummer.

Simple Ex: I have 100 5 star rated songs. 10 of them have been played at various times in the last week.

The Challenge: How to make a SL in MC (using "mix" or otherwise) that automatically (via the syntax) favors "Never played" songs BEFORE coming back to any songs that saw some play in the past? Then when all songs have at least one play - have selection cycle continue (based on "oldest" last played - forever.

Any examples or suggestions would be greatly appreciated.

VP
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #1 on: July 19, 2016, 01:54:57 pm »

Following. Love me some ~mix discussion.

What about using a calculated field instead of the actual Last Played field that assigns a value to empty (never played) files?
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #2 on: July 19, 2016, 02:08:33 pm »

Following. Love me some ~mix discussion. What about using a calculated field instead of the actual Last Played field that assigns a value to empty (never played) files?

Interesting. Never have tried calc fields but would love to learn.

I am thinking such a field (ideally) would need to start at zero (I guess) and then move up the line as the plays start to rack up. But for the list to remain relevant and fresh - it would have to make use of "last played" once a play has actually occurred.

I would always want the oldest tracks (that meet the criteria) - with the least amount of plays to get consideration before anything newer.

Ideas?

VP

Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #3 on: July 19, 2016, 05:54:20 pm »

Interesting. Never have tried calc fields but would love to learn.

I am thinking such a field (ideally) would need to start at zero (I guess) and then move up the line as the plays start to rack up. But for the list to remain relevant and fresh - it would have to make use of "last played" once a play has actually occurred.

I would always want the oldest tracks (that meet the criteria) - with the least amount of plays to get consideration before anything newer.

Ideas?

VP



I made a calculated field based on Last Played using this expression. I brilliantly called mine Last Played (Calculated) but you could use any name you like.

FormatNumber(if(isempty([Number Plays], 1), 20000, ConvertDate([Last Played])), 0)

This assigns a value of 20000 to every unplayed track and a internal floating point value based on the last played date to every other file. Mine ranged from 39118 for the oldest date played to 42570 for the newest. You could choose any value you want for the unplayed tracks by editing the expression above.

Now if I use the expression ~sort=[Last Played (Calculated)] it will return all the tracks with the unplayed ones sorted first.

I could also use [Last Played (Calculated) in additional calculated fields. I'm contemplating a calculated field that incorporates rating, last played date, and #plays to come up with a Play Number, but I'm not sure how I can come up with a useful number.

I hope someone finds my rambling useful  :)



(weird sidenote - out of my 34,000 tracks I did have 23 that had no Last Played (Calculated) value becuase they had > 0 plays but no last played data. I'm chalking this up to an old, abused database)

Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #4 on: July 19, 2016, 11:00:25 pm »

I made a calculated field based on Last Played using this expression. I brilliantly called mine Last Played (Calculated) but you could use any name you like.

FormatNumber(if(isempty([Number Plays], 1), 20000, ConvertDate([Last Played])), 0)

This assigns a value of 20000 to every unplayed track and a internal floating point value based on the last played date to every other file. Mine ranged from 39118 for the oldest date played to 42570 for the newest. You could choose any value you want for the unplayed tracks by editing the expression above.


How does this expression actually create the values? Does it happen when adding the field to the db? (selecting Calculated Data->Expression)?

VP



Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #5 on: July 20, 2016, 06:22:13 am »

How does this expression actually create the values? Does it happen when adding the field to the db? (selecting Calculated Data->Expression)?

VP

You have to create a new Field. Tools -> Options -> Library & Folders -> Manage Library Fields.

Click Add New Field, choose a name. Then change the type from User data to Calculated data and paste the expression into the box provided. 
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #6 on: July 20, 2016, 06:30:53 am »

You have to create a new Field. Tools -> Options -> Library & Folders -> Manage Library Fields.
Click Add New Field, choose a name. Then change the type from User data to Calculated data and paste the expression into the box provided. 

Cool. And then does MC reach out to the entire database and create a new value in the field?

And once that is done - how would I incorporate the new field into my "Mix" construct?

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[number plays],[Last Played]-d,[date imported]-d ~%=50 ~sort=random}
 
Let's say I call the new field "Last Play Age"  - Something like this?

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[Last Play Age]-d ~%=50 ~sort=random}

Cheers!

VP

Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #7 on: July 20, 2016, 07:20:19 am »

Cool. And then does MC reach out to the entire database and create a new value in the field?

Yes, MC will populate the field for your entire database, automatically.

Quote
And once that is done - how would I incorporate the new field into my "Mix" construct?

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[number plays],[Last Played]-d,[date imported]-d ~%=50 ~sort=random}
 
Let's say I call the new field "Last Play Age"  - Something like this?

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[Last Play Age]-d ~%=50 ~sort=random}

Cheers!

VP


Yep. One change; your most recently played songs will have the highest values in [Last Play Age], so you won't want to sort descending. Get rid of the -d parameter and it should work how expect.

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[Last Play Age] ~%=50 ~sort=random}





Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #8 on: July 20, 2016, 07:24:32 am »

Yes, MC will populate the field for your entire database, automatically.

And I assume as a play occurs on a given track - that field gets a new value?

Yep. One change; your most recently played songs will have the highest values in [Last Play Age], so you won't want to sort descending. Get rid of the -d parameter and it should work how expect.

~Mix=40 ,50%,{[rating]= 4,5 [date (year)]=2005-2016 ~sort=[Last Play Age] ~%=50 ~sort=random}

Ah - so dropping -d implies Ascending? Cool!

Thanks again for all the ideas - this looks really good!

VP
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #9 on: July 20, 2016, 07:38:53 am »

And I assume as a play occurs on a given track - that field gets a new value?

Ah - so dropping -d implies Ascending? Cool!

Thanks again for all the ideas - this looks really good!

VP


The values are calculated and as the referenced fields ([Last Played] and [Number Plays]) change, the calculations are instantly updated. Pretty sweet.

Yes, -d stands for descending, the default value is ascending. If you really want to make your Smartlists come alive, dig into JRiver's expression language and learn about all the great possibilities -

https://wiki.jriver.com/index.php/Expression_Language


Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #10 on: July 21, 2016, 09:17:52 pm »

Wig

Found some time to get this going and it's working well. Did notice some oddities tho. In the first test SL using the new field - the expression is like so:

[Media Type]=[audio] +[Chart]=[Billboardİ Rock Tracks] -[Style]=[Alternative Metal],[Hard Rock],[Heavy Metal],[Pop Adult],[Post Grunge] ~mix=50
,60%,{[rating]=3-5 [date (year)]=1971-1992 ~sort=[Play Age] ~%=50 ~sort=random}
,25%,{[rating]=3 [date (year)]=1971-1992 ~sort=[Play Age] ~%=50 ~sort=random}
,15%,{[rating]=3-5 [date (year)]=<1970 ~sort=[Play Age] ~%=50 ~sort=random}

~nodup=[Artist]

The list acts a bit odd - in that it never returns 50 tracks - always less. And it always includes one of two tracks with a "Play Age" (my new field) of somewhere like 43523 - when there is certainly lots of other tracks to fit the bill. Ideas on why that might be happening? I cannot see any reason this list would target something that does not have a value of 20000 until I blaze thru every track at least once.

Then - I have 183 tracks that have a Play Age of 0. All these tracks had a "number of plays" value of 1 or 2 but strangely the Last Played Value = Never Played.

EDIT: Fixed. Realized I could simply blank the Number Plays field. Thus setting Play Age to 20000. Perfect.

Then - I found a 1600+ tracks that had a date value in the Last Played field AND a Number Plays = Null. But they all received a Play Age value of 20000.

EDIT: Also fixed. Adding a Number Plays of 1 to all tracks kicks in the expression and places a value into the Play Age. Nice!

VP
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #11 on: July 22, 2016, 09:29:14 am »

Wig,

More testing on the your ideas - going well.

However I have noticed a trend that may have a negative effect later on. Using the current formula - if I cue up an album of 10 tracks whose Play Age = 20000 and then I roll the entire album = the resulting play age is the same for all songs.

I was hoping that when converting Last Played based on date and time - the resultant "play age" value would be unique - just as the date and time (7/21/2016 6:40am) is unique as each play occurs. I am wondering if there is something we can change to make the Play Age more granular and unique - since each song play occurs in a unique point in time.

Picky I know - but I figured I may as well try and get this as tight as I can.

Also - and thoughts on generating a "higher" play age - the more times a track has been played. I noticed that the Play Age is the same whether a song had 1 play or 10 plays in the past.

Was also thinking - since this is the first time I have really taken an interest in Last Played and Number Plays - I might just reset the whole library and start everything off @ 20000 and go from there.

Thoughts?

VP
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #12 on: July 22, 2016, 02:35:42 pm »

Wig

Found some time to get this going and it's working well. Did notice some oddities tho. In the first test SL using the new field - the expression is like so:

[Media Type]=[audio] +[Chart]=[Billboardİ Rock Tracks] -[Style]=[Alternative Metal],[Hard Rock],[Heavy Metal],[Pop Adult],[Post Grunge] ~mix=50
,60%,{[rating]=3-5 [date (year)]=1971-1992 ~sort=[Play Age] ~%=50 ~sort=random}
,25%,{[rating]=3 [date (year)]=1971-1992 ~sort=[Play Age] ~%=50 ~sort=random}
,15%,{[rating]=3-5 [date (year)]=<1970 ~sort=[Play Age] ~%=50 ~sort=random}

~nodup=[Artist]

The list acts a bit odd - in that it never returns 50 tracks - always less. And it always includes one of two tracks with a "Play Age" (my new field) of somewhere like 43523 - when there is certainly lots of other tracks to fit the bill. Ideas on why that might be happening? I cannot see any reason this list would target something that does not have a value of 20000 until I blaze thru every track at least once.

Then - I have 183 tracks that have a Play Age of 0. All these tracks had a "number of plays" value of 1 or 2 but strangely the Last Played Value = Never Played.

EDIT: Fixed. Realized I could simply blank the Number Plays field. Thus setting Play Age to 20000. Perfect.

Then - I found a 1600+ tracks that had a date value in the Last Played field AND a Number Plays = Null. But they all received a Play Age value of 20000.

EDIT: Also fixed. Adding a Number Plays of 1 to all tracks kicks in the expression and places a value into the Play Age. Nice!

VP

A couple updates here

  • I updated the base expression to FormatNumber(if(isempty([Last Played], 1), 20000, ConvertDate([Last Played])), 0) which removes Number of Plays from the equation and only looks at the Last Played field. That should get rid 0 values in Play Age.
  • If you'd prefer to have actual dates instead of the floating point number, you can substitute this expression - if(isempty([Last Played], 1), formatdate(36000, %Y//%m//%d %X ),  formatdate([Last Played,0], %Y//%m//%d %X )) . This sorts descending so you'll need to put the -d back into expression behind [Play Age]
  • Your smartlist is likely returning fewer than 50 tracks because of ~nodup=[Artist] which will remove additional tracks by the same artist. This takes place after the 50 tracks are selected.
Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #13 on: July 22, 2016, 02:44:16 pm »

However I have noticed a trend that may have a negative effect later on. Using the current formula - if I cue up an album of 10 tracks whose Play Age = 20000 and then I roll the entire album = the resulting play age is the same for all songs.

I was hoping that when converting Last Played based on date and time - the resultant "play age" value would be unique - just as the date and time (7/21/2016 6:40am) is unique as each play occurs. I am wondering if there is something we can change to make the Play Age more granular and unique - since each song play occurs in a unique point in time.

Picky I know - but I figured I may as well try and get this as tight as I can.

Also - and thoughts on generating a "higher" play age - the more times a track has been played. I noticed that the Play Age is the same whether a song had 1 play or 10 plays in the past.

Was also thinking - since this is the first time I have really taken an interest in Last Played and Number Plays - I might just reset the whole library and start everything off @ 20000 and go from there.

Thoughts?

VP

As I mentioned earlier, I'm interested in an additional calculated field (let's call it Play Score) which will consider Play Age, Number of Plays, and eventually Rating. My early attempts didn't turn out well, as the number either mirrored the Play Score or Number of Plays too closely. I'm hoping to take another swing at it over the next week when I have some free time, though.
Logged

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #14 on: July 22, 2016, 03:32:40 pm »

You didn't do a Forum search.

glynor already created such a smartlist (in order of number of plays) which automatically plays in my house every morning (using a subset of music that is classical prior to roughly 1820).

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #15 on: July 22, 2016, 03:53:32 pm »

You didn't do a Forum search.

glynor already created such a smartlist (in order of number of plays) which automatically plays in my house every morning (using a subset of music that is classical prior to roughly 1820).

Of course he did  ;D

Share the code when you get a chance! I've been enjoying the challenge but always happy to look at Glynor's solutions.
Logged

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #16 on: July 22, 2016, 04:14:30 pm »

You didn't do a Forum search.glynor already created such a smartlist (in order of number of plays) which automatically plays in my house every morning (using a subset of music that is classical prior to roughly 1820).

Care to share the link?

VP
Logged

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #17 on: July 22, 2016, 08:48:58 pm »

Care to share the link?
I was able to find it quickly.... only .... because I once PM'ed the link to glynor to ask a question about it:

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

Vocalpoint

  • Citizen of the Universe
  • *****
  • Posts: 2007
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #18 on: July 22, 2016, 10:40:59 pm »

I was able to find it quickly.... only .... because I once PM'ed the link to glynor to ask a question about it: http://yabb.jriver.com/interact/index.php?topic=96718.0

Awesome.

I followed the instruction to a tee but my "mix" results do not give me what Glynor was describing. For example - here is the code:

[Media Type]=[audio] +[Chart]=[Billboardİ Rock Tracks] -[Style]=[Alternative Metal],[Hard Rock],[Heavy Metal],[Pop Adult],[Post Grunge]
[Last Played]=>1d

~mix=50

,75%,{[rating]=4-5 [date (year)]=1971-1992}
,15%,{[rating]=2-3 [date (year)]=1971-1992}
,10%,{[rating]=3-5 [date (year)]=<1970}

~sort=[Played Ever],[Number Plays],[Last Played]

~limit=-1,1,[Artist]


Within this part

,75%,{[rating]=4-5 [date (year)]=1971-1992}
,15%,{[rating]=2-3 [date (year)]=1971-1992}
,10%,{[rating]=3-5 [date (year)]=<1970}

I have literally hundreds of songs with a Played Ever value of zero AND that fit the ratings criteria - all of which should easily appear on a run of this list.

Yet when ever I fire up this list - about the first 16 or so tracks have a Played Ever value of zero and then the rest of the list is all Played Ever values of 2. Including some very recent items.

Now i realize I am limiting Artist as well as style - but I know I have tons of Played Ever tracks with a value of 0 - so I should be able to run this thing many times before hitting a track that was actually played in the past.

What is causing me to only get 17 songs off the top of the list that have never been played and then 33 songs that have been played - some of those very recently.

Also noticed that during each list refresh - the last half dozen or so songs have a Number Plays value reaching into 4,5 and higher. One refresh put a song with 10 plays at the bottom of the list. When I have literally hundreds of tracks that have never ever been played once yet.

I must be doing something really wrong.


VP

Logged

wig

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 750
Re: Smartlist Challenge: The Ultimate Self Populating Music List
« Reply #19 on: July 28, 2016, 11:51:03 am »

I've finally made some progress on a combined Last Played and #Plays field.

I created a new calculated field I called Play Number. Here's the expression.

formatnumber(math(((FormatNumber(if(isempty([Last Played], 1), 39000, ConvertDate([Last Played])), 0))/100)- if(isempty([Number Plays]), 0, [Number Plays])), 3)

Very simply, Play Number is {Last Played Value/100 - #Plays}.

The expression assigns every track without a Last Played date of 10/10/2006 (representing by the number 390000). That's slightly older than the oldest Last Played date in my library.

  • A track with no Last Played date and 0 plays has a Play Number of 390.
  • A song with 1 play that was played today (7/28/2016) has a play number of 424.8. That's the Play Number currently available.
  • The lowest Play Number is 338.15, held by Doreen by the Old 97's. Is was last played 5/25/2016 (42515) and has 88 plays. 42515/100-88 is 338.15.

Here's a very simple playlist I made as an example of how to use the field. It returns 50 songs from the top half of the play number spectrum, and 50 from the bottom half.

~mix=100,50,{[media type]=[audio] ~sort=[Play Number] ~%=50},50,{[media type]=[audio] ~sort=[Play Number]-d ~%=50} ~sort=[Play Number]

Let me know what you think. My next step is figure out the best way to incorporate ratings into my Play Number.  
Logged
Pages: [1]   Go Up