INTERACT FORUM

Please login or register.

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

Author Topic: Smartlist using ~mix in formula -- what am I doing wrong?  (Read 2096 times)

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Smartlist using ~mix in formula -- what am I doing wrong?
« on: August 13, 2007, 10:43:51 pm »

I'm experimenting with the "lightly documented" ~mix feature of MC smartplaylist formulas. (Using MC 12.0.301)

My simple goal is to randomly play a 50/50 mix of songs I've Rated 4 and 5. Letting the list play without forcing this mix results in more like 95/5 because there are far fewer "5" rated songs.

Here's what I tried:
[Keywords]=[el] [Rating]=>=4 ~mix=999999,50%,[Rating]=4,50%,[Rating]=5

What I got was a bizarre playlist with just a few songs, but EACH SONG LISTED 102 TIMES! What?

I don't know where 102 came from.

The 999999 in my formula is because ~mix apparently requires the total number of songs, and my "el" category keeps growing, I want the smartlist to include ALL "el" songs rated 4 or 5, and I don't want to have to keep counting and updating the formula.

I experimented with parentheses and curly brackets but they didn't help ... OR, I don't know which to use where.

What am I misunderstanding?

Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #1 on: August 14, 2007, 01:18:08 am »

each song is listed 102 times because the ~mix modifier keeps on going untill the list contains the specified 999,999 tracks. Once all possibilities have been used, it adds duplicates, and keeps on adding them until the "number of tracks" rule has been met.

It's not ideal, and it may get reworked in the future, but for now, that's how it works and we have to live with it.

The 'curly braces' are only really needed if the search contains quotes or commas, but I find it good practice to always use them, then you don't have to worry about it at all.

You don't need the rating rule in there at all. It's redundant as the mix rules take care of filtering by rating.

So, to get at what you're after:

[keywords]=[el] ~mix=50000,50%,{r=4},50%,{r=5} ~nodup=[album],[artist],[name]

should take care of it. Obviously, after removing the duplicates, the ratio won't be 50:50 if there are not enough tracks to satisfy the requirement, but as more are added, it will get closer to the goal. I went for a mere 50,000 tracks as just shy of a million tracks is overkill and slows the list creation down too much. If you don't specify a sort order, you'll get a random list order every time the list is refreshed.

regards,
-marko.

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #2 on: August 14, 2007, 09:53:30 am »

Thank you for clarifying and providing a good example.

I'm trying to tone-down the number of songs value .... don't really have a million.<g>

Interesting results when experimenting on two playlists.

I put your suggested formula into a new smartlist, just changing the number of songs from 999999 to 10000 (to start). FYI, on saving, the smartlist editor  drops [name] from the nodupe parameters. (I'm not 100% sure of what ~nodup=[album],[artist],[name] does -- eliminate dupes that are exactly [album]AND[artist]AND[name]?)

Here's the formula I tried:
[Keywords]=[el] ~mix=10000,50%,{r=4},50%,{r=5} ~nodup=[album],[artist]
This resulted in 2344 songs, yet there are apparently 6022 potentially-matching songs. My guess is, it used all my r=5 songs, than selected r=4 songs of an equal quantity, and that's all. I was hoping to override this behavior by giving it a much larger potential list size, but apparently the smallest matching selection controls the overall list.

In another smartlist, I selected the same keyword, but without trying to ~mix the selection:
[Keywords]=[el] [Rating]=>=4 ~sort=[Random]
This resulted in 6022 songs, which I presume is ALL the songs with the specified keyword value and rating of 4 or 5. I don't specify nodupe because I don't expect (and haven't observed) the list to add anything to what's already naturally selected, and my total MC library (about 60,000 and growing) is already de-duped.

My confusion is in thinking (hoping) that the playlist is built on-the-fly, using the formula to decide what to SELECT NEXT, endlessley. "I just played a 4, need to select a 5 next..."

But since the list is apparently built in-full based on the formula, and remains static until refreshed (what triggers this to happen?), if the ~mix percentages override everything, the outcome is as noted above.

Sorry to have introduced an incorrect notion. I used to program "real" radio stations where the automation systems (and even systems that guided live DJs) behaved as I was thinking MC does.

PS: Further complicating is that I use MC to "play" three ways: Directly from an MC playlist on my PC via a Linksys WMB54 to my stereo (the best playback control/behavior but not especially convenient for family members), or with an MC playlist transferred to an iPod (where presumably iPod's semi-random shuffle takes over), or via a Netgear MC101 to my stereo, which has its own semi-documented behavior.



Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #3 on: August 14, 2007, 01:12:56 pm »

I put your suggested formula into a new smartlist, just changing the number of songs from 999999 to 10000 (to start). FYI, on saving, the smartlist editor  drops [name] from the nodupe parameters.
I am not seeing that here, and I'm not quite sure why that's happening for you. Could there possibly be a rogue space in front [name]?

(I'm not 100% sure of what ~nodup=[album],[artist],[name] does -- eliminate dupes that are exactly [album]AND[artist]AND[name]?)
Yes, that's exactly what it does. It removes all duplicates where the Artist, Album and track name are identical, leaving a single example in the list.

Here's the formula I tried:
[Keywords]=[el] ~mix=10000,50%,{r=4},50%,{r=5} ~nodup=[album],[artist]
This resulted in 2344 songs, yet there are apparently 6022 potentially-matching songs. My guess is, it used all my r=5 songs, than selected r=4 songs of an equal quantity, and that's all. I was hoping to override this behavior by giving it a much larger potential list size, but apparently the smallest matching selection controls the overall list.
What's happened here is that you have dropped the [name] field from the ~nodup modifier. This means that tracks with matching [artist] and [album] fields will be considered duplicates, effectively leaving you with just one track from each album (apart from multi-artist albums, naturally)
The way it works is:
  • [keywords]=[el] - returns all files with exactly el in their keywords field.
  • ~mix=10000,50%,{r=4},50%,{r=5} - modifies the list by producing 5000 '4' rated tracks and 5000 '5' rated tracks. If there are not 5000 individual tracks in the library, duplicates will be used until the specified number of tracks are in the list.
  • ~nodup=[album],[artist],[name] - removes all of those duplicates.

In another smartlist, I selected the same keyword, but without trying to ~mix the selection:
[Keywords]=[el] [Rating]=>=4 ~sort=[Random]
This resulted in 6022 songs, which I presume is ALL the songs with the specified keyword value and rating of 4 or 5. I don't specify nodupe because I don't expect (and haven't observed) the list to add anything to what's already naturally selected, and my total MC library (about 60,000 and growing) is already de-duped.
Take this one step further. How many tracks are returned if you used [keywords]=[el] [rating]=5? Let's assume there's 1000 of them.
This means that there's 5022 tracks rated 4. Every time you refresh the ~mix=10000 smartlist, 5000 of those 4 rated tracks will be selected randomly and added to the list. Each of the 5 rated tracks will be added 5 times to satisfy the 5000 5 rated tracks rule, and then finally, duplicates will be removed by the ~nodup modifier, leaving you with 6000 tracks in the list.


My confusion is in thinking (hoping) that the playlist is built on-the-fly, using the formula to decide what to SELECT NEXT, endlessley. "I just played a 4, need to select a 5 next..."

But since the list is apparently built in-full based on the formula, and remains static until refreshed (what triggers this to happen?), if the ~mix percentages override everything, the outcome is as noted above.
You are again correct. The list is built and remains static until refreshed.
A refresh is triggered in a few ways. Pressing the F5 key while the list is being viewed, clicking on the refresh toolbar button, or navigating away from the smartlist then returning to it.
Note that after a list has been returned and you hit "play", that list is sent to "Playing Now" to be played. Refreshing the list will have no effect at all upon the list that is being currently played.

PS: Further complicating is that I use MC to "play" three ways: Directly from an MC playlist on my PC via a Linksys WMB54 to my stereo (the best playback control/behavior but not especially convenient for family members), or with an MC playlist transferred to an iPod (where presumably iPod's semi-random shuffle takes over), or via a Netgear MC101 to my stereo, which has its own semi-documented behavior.
I don't have any experience with these usage scenarios, (apart from desktop and iPod). I would think it very likely that the smartlist would refresh each time it's accessed by one of your remote devices. The playlist will transfer to the iPod in much the same way as it transfers to MC's Playing Now list. ie. it will refresh each time you sync, and remain a static playlist on the iPod inbetween syncs.

-marko.

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #4 on: August 14, 2007, 01:21:28 pm »

> I put your suggested formula into a new smartlist, just changing the number of songs from 999999 to 10000 (to start). FYI, on saving, the smartlist editor  drops [name] from the nodupe parameters.
>> I am not seeing that here, and I'm not quite sure why that's happening for you. Could there possibly be a rogue space in front [name]?

I think it disappears because Name, using the smartlist editor, isn't a field name in the list. But Title is, and I think that's the desired field.

Adding [title] works. The resulting list is 2344 songs, just slightly larger, so apparently there weren't that many with the same name...er, title.
Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #5 on: August 14, 2007, 01:30:59 pm »

[name] is the default field that MC uses for track names. if you do not have that as an option, something does not feel 'right' about your library.





depending on the exact number of 5 rated "el" tracks you have, I would expect your list to contain a lot more than 2344 tracks.

-marko.

MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #6 on: August 14, 2007, 06:51:06 pm »

I changed the playlist to get counts:

keywords=el: 6042 songs
comprised of
r=5: 1111 songs
r=4: 4931 songs

Compare that to what I get using this ~mix formula:

[Keywords]=[el] ~mix=10000,50%,{r=4},50%,{r=5} ~nodup=[Artist],[Title]

The resulting playlist has 759 songs. But this isn't following the presumed logic. If it is being limited by the lowest max count, there should be 1111 + 1111 = 2222. Hmmmmm....

(Title is correct for me; see below. I dropped [Album] because that doesn't define a dupe in my library.)

One theory is that it first builds the list based on ~mix, choosing 2222 songs. Then it applies ~nodup, reducing the list to 759. But I really don't think there are many, maybe ZERO, Artist+Title dupes with keyword "el", IF the list is first filtered to only include r=4 or r=5. However, if MC first looks through the entire library, it might find lower-rated songs with the same artist+title.

Thinking maybe the formula should include r values for selection before the ~mix portion, I added that but still got only 759 songs.

I wonder how the formula is parsed/executed? I think left-to-right, because if I put ~nodup section BEFORE the ~mix section, I get a full 10000 songs -- lots of repeats.

MORE TO PONDER.... Something about the mix SIZE value is doing this. If I change the formula to this:

[Keywords]=[el] ~mix=5000,50%,{r=4},50%,{r=5} ~nodup=[Artist],[Title]

I end up with 627 songs. Even though I'm still telling it to create a much larger list if it can.

Theory: It uses only the specified number of songs (10000, 5000, whatever) as the starting list, apparently selecting them randomly (there's no apparent pattern), but doing this results in far fewer r=5 songs than I see in the complete keywords=el list.


Re what you see vs. what I see for field names, mystery solved! In my MC, Title is the "display name" of field Name. I've been using MC (and MJ) for many years so I don't recall changing this, but apparently I did.

I tracked this down by opening Options > Library & Folders, and seeing Name IS a Standard Library Field, and Title isn't there at all! (Nor is it a Custom Field, though I have added a few for other data). Then I selected Name and clicked Edit This Field and there's a dialog to Configure Library Field. Mine shows Title is the name to display for field Name.

What's interesting is that the smartlist formula seems to REQUIRE that I use the "display name" of a field, Title in my case, Name in your case. It simply won't accept the "wrong" name for the field.I assume this means that if I reverted this field back to default name "Name" it would break any formulas where it is referenced as "Title". There aren't any other than the current ~mix experiment, but it could be a factor for other fields or users.

The biggest question is about TAG contents. I have 60,000 songs with data in what to me is the Title tag field. If I changed the field back to Name, what would happen to the data? Looking at the tags by adding the Format field to a view, I see that it's called Name in ID3v1 tags. But it seems to be called Title in ID3v2.3 tags, or maybe it's TIT2 and Title is an alias/display name?

I don't know who has the facts, but it would terrific to document ALL the effects of using a field/tag "display name" different than the default, AND especially the consequences of later changing it -- to another name, or back to the default/real name.

Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9140
BUG? Re: Smartlist using ~mix in formula -- what am I doing wrong? BUG?
« Reply #7 on: August 15, 2007, 03:52:55 am »

Quote
If it is being limited by the lowest max count, there should be 1111 + 1111 = 2222. Hmmmmm....
It does not work like that. See my quote below...

The way it works is:
  • [keywords]=[el] - returns all files with exactly el in their keywords field.
  • ~mix=10000,50%,{r=4},50%,{r=5} - modifies the list by producing 5000 '4' rated tracks and 5000 '5' rated tracks. If there are not 5000 individual tracks in the library, duplicates will be used until the specified number of tracks are in the list.
  • ~nodup=[album],[artist],[name] - removes all of those duplicates.
Take this one step further. How many tracks are returned if you used [keywords]=[el] [rating]=5? Let's assume there's 1000 of them.
This means that there's 5022 tracks rated 4. Every time you refresh the ~mix=10000 smartlist, 5000 of those 4 rated tracks will be selected randomly and added to the list. Each of the 5 rated tracks will be added 5 times to satisfy the 5000 5 rated tracks rule, and then finally, duplicates will be removed by the ~nodup modifier, leaving you with 6000 tracks in the list.

I do believe you have found a bug!! Matt, are you there?
this, [Keywords]=[el] ~mix=50000,50%,{r=4},50%,{r=5} ~nodup=[Artist],[Title], should return you 6042 files, every time. It works for me, so why not you?

To test, I created a new field called [title] that should be displayed as "test".
I then selected all audio files in my library and copied the [name] data into the [title] field (which was correctly displayed as test).
I then changed my test smartlist to read ~nodup=[artist],[album],[test] and instead of returning the 379 files I was expecting, and had been reliably receiving using the [name] field, all I got was 54 files!!

I then went back to the field properties and changed its display name to "title" to match its internal name.
fixed the smartlist so that it was using "title", not "test".
Closed/opened MC to refresh the cache.
The smartlist is now correctly showing the expected 379 files!!

MusicHawk, I found no apparent problems with my albeit brief dalliance with this temporary custom field after changing its display from test to title.
More crucial for you, obviously, but if you make a library backup before changing to be safe, I don't think you'll have any problems with changing the display name back to "Name".
Just remember to restart MC afterwards to flush out its cache and you ( /me crosses fingers and knocks on wood ) should be OK.

-marko.


MusicHawk

  • Citizen of the Universe
  • *****
  • Posts: 796
Re: Smartlist using ~mix in formula -- what am I doing wrong?
« Reply #8 on: August 15, 2007, 10:00:47 am »

Sorry I misunderstood the order in which the ~mix is applied. Thanks again.

Looks like a bug, but I'm concerned about where it arises. If MC simply didn't use the Name field's display name "Title" it should apply nodup to all or nothing where there's a match, but apparently it's applying it to some but not all.

re reverting the field name, which would eliminate a point of confusion/consistency, my big concern is about not messing up the ID tags in the files. What do they think the field/tag name is that I see as Title and you see as Name, and what would happen if it's changed in MC's Library? Do I need to change the field display name, then rewrite ALL the file tags from properties "just in case"? Do-able, but a big job with 60,000 files.

If you have suggestions, I can experiment more later today (gotta go to the office!), maybe after 3pm Pacific time.



 

Logged
Managing my media with JRiver since Media Jukebox 8 (maybe earlier), currently use Media Center for Audio/Music and Photos/Videos.
My career in media spans Radio, TV, Print, Photography, Music, Film, Online, Live, Advertising, as producer, director, writer, performer, editor, engineer, executive, owner. An exhausting but amazing ride.
Pages: [1]   Go Up