INTERACT FORUM

Please login or register.

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

Author Topic: Need Expression Help - suppress duplicate tracks based on rules  (Read 1430 times)

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Need Expression Help - suppress duplicate tracks based on rules
« on: February 11, 2013, 02:09:42 pm »

One significant annoyance I've encountered are CD releases with "bonus tracks".

On the face of it, you are getting "more music", and "bonus tracks" are perhaps a reasonable response to the whining which occurred when classic albums were released on CDs with a running time of only 35 minutes.

However, in some cases, "alternate takes" are put right after the original ("master") take, rather than putting all the bonus tracks at the end.

The assumption seems to be that you are a biographer of the musical artist, and are listening with an academic perspective "oh, isn't it interesting that they only repeated the verse in this take", rather than listening for enjoyment.

SO, is there an expression that be put into a View rule saying:

* If the portion of the filename prior to the first "[" or "(" is the same as an already existing track's filename prior to the first "[" or "(", then block the second one.

My guess is that this depends on whether the expressions and rules can know what about other tracks previously processed.

The alternative is to go through an entire library and manually adjust track numbers (or something similar).

Thanks !

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #1 on: February 11, 2013, 02:46:24 pm »

You need MrC's help.

It might not be able to do it based on Play Sequence, but it can probably do it based on Track Order (the [Track #] tag versus the order of Playing Now).  I think with a Regex expression, though, it shouldn't prove impossible to test the [Name] field against ([Track #]-1) or ([Track #]+1) somehow.
Logged
"Some cultures are defined by their relationship to cheese."

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

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #2 on: February 11, 2013, 03:42:24 pm »

It is easy enough to generate a sort order key that forces such tracks to the end.  Would that be sufficient?
Logged
The opinions I express represent my own folly.

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #3 on: February 11, 2013, 03:53:52 pm »

It is easy enough to generate a sort order key that forces such tracks to the end.  Would that be sufficient?
For the stated purpose, yes.

By the way, I assume that you mean just in a view ( as usual ) as opposed to any changing of the track order in the database fields ?

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #4 on: February 11, 2013, 04:00:56 pm »

Try this.

Create a new library calculated field, perhaps named: _Sort_alt takes last

Use the expression:

if(regex([Name], /#[([].*(?:alternat|unissue).*[)\]]#/), z, a)_[Disc #]_[Track #]

Now, in the view, change the Sort Within Groups By > Custom to _Sort_alt takes last.  You can save this as a preset if you'd like.

The expression looks for words like "alternate", "alternative", "unissued", etc. inside parens.  You can add more words to the filter after the | character (words here are separated by a |).  Use the shortest word fragment possible to capture variant spellings but as long as possible to avoid mismatches.
Logged
The opinions I express represent my own folly.

kstuart

  • Citizen of the Universe
  • *****
  • Posts: 1955
  • Upgraded to MC22 Master using preorder discount
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #5 on: February 11, 2013, 04:20:43 pm »

So that is not looking for duplication of the first part of the title ?

The reason I mentioned it in those terms, is that sometimes they will merely name the tracks as:

Blah the blah blah (Take 1)
Blah the blah blah (Take 2)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #6 on: February 11, 2013, 04:39:40 pm »

Comparing one track against another requires doing some stuff that will slow down your view(s) considerably, and will be fairly complex.

While for the case you mention, you can add patterns to the word list, but in the end, this will prove problematic, as there are many valid tracks on, for example, compilations that include a designator such as "Blah blah blag edit" but won't be duplicates.

It might just be better to tag these as alternate take tracks using some custom field, and then modifying the sort rule to use that field to push the tracks to the bottom.
Logged
The opinions I express represent my own folly.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #7 on: February 11, 2013, 05:35:38 pm »

Yeah, actually... The more I thought about this, the more I was skeptical.

How would you "find" (in the expression) the [Name] of the other file to match against (or know the context of the view you are in currently), you could do math on the [Track #] (or maybe even sequence), but you couldn't then (easily) extract the [Name] field to then test it for IsEqual() of the result of a RegEx.  I bet you could hack it together but...  I agree with MrC, you are likely best to just flag the offenders somehow.

You could easily make an integer type field called [Sort Last].  It will be automatically filled with 0 for everything in your Library automatically, so you can just insert it into your sort order before the [Track #] tag.  For any listing where they're all 0, the order will be unaffected.  Then, for any track that you want sorted last, just set it to 1.

You could maybe use this in concert with a Tag On Import rule like the one MrC suggested above, to auto-tag "suspected alternates" with the appropriate tag.  But more importantly, as you go, you can just tag them if they are annoying, and that track will never bother you again.

Tip: You can set the Edit type to Stars, set the Allowed Values to just 0 & 1, and have a star-activated boolean column in details view.  Just squish the column so only 2 stars are visible.  It'll either be "lit" (one star), and if you click the other star, it'll reset to zero (like a toggle).
Logged
"Some cultures are defined by their relationship to cheese."

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

struct

  • Galactic Citizen
  • ****
  • Posts: 380
Re: Re: Need Expression Help - suppress duplicate tracks based on rules
« Reply #8 on: February 12, 2013, 02:54:28 am »

i think musicbrainz often gives the altentative tracks a new disc number, when on extra bonus disc.  otherwise wouldn't you have a track number to put it the correct place? mc handles disc numbers nicely.
Logged
Pages: [1]   Go Up