INTERACT FORUM

Please login or register.

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

Author Topic: Listcombine mode request  (Read 9295 times)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Listcombine mode request
« Reply #50 on: February 04, 2013, 05:02:36 pm »

What might be going wrong?  My hunch is that this is due to using a calculated user field, and how it interacts with Set rules for file display.  We are playing tricks on MC to get this stuff to work.  If you are going to do things this way, you need to understand how and when MC runs and updates:

  - Rules for file display
  - Panes and file list expression columns
  - Calculated fields
  - Global variables

Explaining what I've learned about this stuff might be more complicated than its worth.  So, I'd suggest using the approach we know works, and then branching out from there.

A good way to test this stuff out is with small, well-defined data sets.  When testing, I used rules for file display to narrow down my file list to a strict few, to see how each component interacts with the others.

I don't think I understand the question about using regex() and multiple remixers, capturing a remixer that does have an album.  An example from both fields, and what you want would be help.

Yes, you can create a calculated field that combines the values from [Artist], [Remixer], and [Supporting Artist], and use this anywhere.

ps.  it might be time to rename list1 and list2 to something more meaningful.  :-)
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Listcombine mode request
« Reply #51 on: February 04, 2013, 08:10:13 pm »

Quote
I don't think I understand the question about using regex() and multiple remixers, capturing a remixer that does have an album.  An example from both fields, and what you want would be help.

Originally I meant, to somehow check the remixer field against the values that the expression below generates, for equality. Say I have a track whose remixer field contains Joy Orbison;Com Truise and I only have an album by Joy Orbison not Com Truise. An expression to use in the tag window (Or somewhere?) that would check each remixer within the field against the expression below, and only output the value of the remixer that exists in the expression below. So in this instance it would only output Joy Orbison, but if I had albums by both it would output Joy Orbison;Com Truise. I would use this to keep a permanent copy of which remixers have albums in another custom field, also it would mean I wouldn't manually have to check them all myself.

But if I can't put the expression below into a custom field I don't know of any other way to use an expression check check it and tag the results to another field
listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0)&datatype=[list]

Quote
ps.  it might be time to rename list1 and list2 to something more meaningful.  :-)
True, I'll need to come up with something, I'm quite bad at giving meaningful names to things. I've got a handful of calculated fields that have terrible names and it takes a while to remember what they were for.. It's will probably take me a little while :)
Logged

syndromeofadown

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 812
Re: Listcombine mode request
« Reply #52 on: February 05, 2013, 01:29:18 am »

Using 18.0.128

Im confused about listcombine in mode 1

When i read
Quote
outputs only items contained in both lists
I interpret it as applying to the lists in their entirety
Example:
When combining [Artist] and [Album Artist].
If you have a file with the Album Artist Radiohead and a different file with the Artist Radiohead then all files that have Radiohead as Artist OR Album Artist will be included in the list.


As far as i can tell listcombine in mode 1 compares fields of individual files.
Example of how its working for me.
When combining [Artist] and [Album Artist].
Only files that have Radiohead as Artist AND Album Artist will be included in the list.



As it is working for me now i can't think of any use for it, though i may be missing something.
Please let me know.

If it worked like my first hypothetical example (applying to the lists in their entirety) it could be very useful.

Thanks for any help/clarification.


Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Listcombine mode request
« Reply #53 on: February 05, 2013, 03:29:00 am »

All expressions in MC's expression language operate file by file.  More precisely, as far as a user is concerned, MC iterates over the list of files in a given context, and then evaluates any expressions for each file one at a time.  Values are not remembered from one file to the next.  The exception to this is the recent global variables set via Load() and retrieved via Save().

ListCombine() operates no differently.  It will combine values from any lists (examples here), including arbitrary strings.
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Listcombine mode request
« Reply #54 on: February 05, 2013, 09:13:09 am »

Never thought before.. I can just use your expression directly in the tag window
=if(isequal(listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0),[Remixer],8),[Remixer],)
(It was pretty slow probably best done in batches, edit that, It wasn't slow at all after I removed my calculated field.)

Just unsure now if it is possible to add to that expression, using regex

Both have albums (And so on for all delimited artists in the field)
Artist A;Artist B to output Artist A;Artist B

Only Artist A has an album
Artist A;Artist B to output to Artist A

I thought this could be possible using Regex captures some how in conjunction with the above expression, just like how you helped me out with the images pane, numbering the amount of images in each category using captures. It would be limited to a certain amount of captures but would probably be enough.. If at all possible..

Then once complete I could possibly list combine Album Artists and the new remixers filtered field, to build a view that contains all work of album artists..

Edit
Right now this expression only works if there is one artist in the remixer field..
=if(isequal(listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0),[Remixer],8),[Remixer],)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Listcombine mode request
« Reply #55 on: February 05, 2013, 12:45:22 pm »

I'm happy to help, and sorry I haven't responded fully to your questions.  I am having a hard time keeping track of what you have so far, what you don't  have, etc.

I'm not sure how to answer your question regarding Regex().  So I'll give you a framework for understanding what it can/cannot do, and maybe that will help:

  - Regex() matches patterns, using the input and comparing it against a template (the regular expression or RE).
  - Regex() can indicate if the match succeeds or fails.
  - Regex() can remember a finite number of segments of the matched pattern for later use (either as part of the pattern itself, or elsewhere).
  - Regex() cannot look at two lists, and iterate over each item in one list comparing it to the other list.

In my post above, I indicated the different stages to be considered. I'm not sure which of those stages you're working on. For example, are you trying to build a large list at the Rules for file display stage?  Or do you already have a combined list and want to compare each track's field(s) against that list already generated and do something with the result?

Can you again restate exactly what you would like to see, and where (panes, file list column)?  (In reply #9, you gave your incorrect results, not what you are want)

----- Have ------
Album   Album Artist       Remixer
One      A                        r1
Two      B                        r1
Three    C                        r3

----- Want ------
Panes:
          [Artist]     [Remixer]          [Some calculation]
...

File list:
           [Artist]     [Remixer]         [Some other calculation]
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Listcombine mode request
« Reply #56 on: February 06, 2013, 08:16:09 am »

Thanks MrC I appreciated the help would never as go this far without you.

As of now I have two views, the first is just the rules for file display. The rules are perfect I don't need to change anything with them.
[=save(listcombine([Album Artist,0],load(list1),;,;,0),list1)save(listcombine([Remixer,0],load(list2),;,;,0),list2)1]=1

And the second view has no rules, columns or panes, it is just a view containing the file list I will use for tagging with the tag window from the action menu using this expression below.. I have a custom field called Remixer Filtered which I apply the following expression to in the tag window

=if(isequal(listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0),[Remixer],8),[Remixer],)

What I'd like to see is that when I apply this expression or a form of it to the Remixer Filtered field in the tag window, is that when there are several remixers separated by the ; delimiter for a single track, that I could some how split each remixer up and check that they each exist in the values created by the rules for file display above.. Either by using extra global variables or the regex captures if at all possible. Then only output existing remixers followed by a ; in to the remixers filtered field..

So imagine this is all the music I have. An expression that utilizes a form of this expression listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0)
To get the desired output below
Album | Album Artist | Remixer | Remixer Filtered Output
OneAC;BC;B
TwoBAA
ThreeCA;DA

I think it is possible as you said
Quote
Regex() can remember a finite number of segments of the matched pattern for later use (either as part of the pattern itself, or elsewhere)

can regex remember the segments in the remixer field, between ";" including the first entry that doesn't have a ";" before it and then check if any of them are equal to listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0), and if they are output the capture folllowed by a ";", otherwise output nothing..

Whoops just understood the implications of another point you said
Quote
Regex() cannot look at two lists, and iterate over each item in one list comparing it to the other list.

Long shot here, could I use regex to capture each segment in the remixer field between the ";" and then pass over each capture separately to different global variables, each capture would have it's own global variable. Then to check the global variables if they are equal to listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0) to output the desired results

wouldn't this allow me to use regex to iterate over each item in the remixer field, but still being able to compare it to another list by using global variables?

Otherwise I don't believe there to be a way to get the desired results using an expression & this maintenance view will still have a significant level of manual checking & tagging required for every track where there are two or more remixers.

Hope I've explained everything clearly, I'm not the best at trying to explain what I'm trying to achieve sometimes..
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Listcombine mode request
« Reply #57 on: February 06, 2013, 11:30:44 am »

From your table above, it appears you want:

foreach track {
   output remixer - remixer values not in global AA list.
}

and that really is a duplicates-only problem:

foreach track {
   output DuplicatesOnly(remixer, global AA list)
}

and we know how to do that:

   listcombine([remixer], [global AA list], ;, ;, 1);
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Listcombine mode request
« Reply #58 on: February 06, 2013, 12:46:51 pm »

 :o ;D

Me always trying to take the complicated route..

Works perfect :)
After activating the first view using this expression to tag the files works absolutely perfect..
=listcombine([remixer], listcombine(ListCombine([list1],[list2],;,;,1), [list1],;,;,0), ;, ;, 1)

Now just to alter it so it includes artists and supporting artists.. Easy enough

I can't thank you enough for your help, time & patience.. I can finally make the view I want with minimal effort..

Thanks Matt for bringing adding the mode to listcombine even though I know expressions work on a single file basis I thought it would work on it's own. Even though there is quite a bit extra to it I'm glad it can be done using this crazy workaround..

Thanks
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Listcombine mode request
« Reply #59 on: February 06, 2013, 12:56:53 pm »

Excellent!

Off topic: Its usually more productive to try to ignore Implementation (How do I do it?) details and instead focus on Goals (What do I have, What do I want to achieve?).  If the Goals can't clearly and simply be defined, most like the problem needs more thought and refinement.  Most of us get lost in implementation details and lose sight of our lack of clarity on our goals.  "I've got a hammer, how do I use it to...".
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: Listcombine mode request
« Reply #60 on: February 06, 2013, 01:23:37 pm »

Understood :)

Thank you
Logged
Pages: 1 [2]   Go Up