INTERACT FORUM

Please login or register.

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

Author Topic: [20.0.47] Complex expression language functions for music  (Read 1489 times)

Gatherum

  • Citizen of the Universe
  • *****
  • Posts: 651
[20.0.47] Complex expression language functions for music
« on: December 20, 2014, 04:07:25 pm »

I'm sorry for the vague thread title, but I wasn't sure how to summarise this. An admin can feel free to edit the title accordingly if they figure a better one for me.

So, I just created three new library fields: [Album Genre], [Album Subgenre], and [Album Style]. Naturally, these correspond to the normal [Genre], [Subgenre], and [Style (modified)] fields (the latter two of which, themselves, being custom fields created by me for my own purposes). As you can imagine, the "album" fields are meant to represent the overall genre, subgenre, and style leanings of an entire given album. The non-"album" fields are meant to represent the genres, subgenres, and styles of specific tracks.

Currently, all six of these fields are of the "List (semicolon delimited)" type, but I had wondered if I could go one better and make the three "album" fields expression fields that depend on the data in the other three fields, as well as other album information. To simplify my explanation of this, let me put it in an if/then statement:

For [Album Subgenre] (as an example), I want the expression to translate into this:

If greater than {percentage} of the tracks in [Album] contain {subgenre} in the [Subgenre] field, then add {subgenre} to [Album Subgenre].

Here's where things get really complex:

Since [Subgenre] is a "List (semicolon delimited)" field, there may be multiple subgenres in any given track. Therefore, I need the expression for [Album Subgenre] to be able to look at the [Subgenre] field and add only those items which appear in or above a specified percentage of the album's total tracks to itself, separated again by semicolons (preferably in alphabetical order). Thing is, I have no idea how to tie the [Album Subgenre] field dynamically to both the [Album] and [Subgenre] fields while taking into account how many tracks are in the album.

As a real example, I just went through and tagged Agalloch The Serpent & the Sphere. The first track, "Birth and Death of the Pillars of Creation", is the only track on the album that falls into the "funeral doom metal" genre. There are nine tracks on the album in total, so "funeral doom metal" should not be added to the [Album Subgenre] field (because "funeral doom metal" only describes that one track, and not the album as a whole). However, regular "doom metal" and "neofolk" appear consistently through the album's other eight tracks. Therefore, those subgenres should be replicated and added automatically to the [Album Subgenre] field.

I hope this makes sense. I feel like it's a real longshot that it'd be possible to implement reliably, but I figure it wouldn't hurt to ask.
Logged

Gatherum

  • Citizen of the Universe
  • *****
  • Posts: 651
Re: [20.0.47] Complex expression language functions for music
« Reply #1 on: December 21, 2014, 07:26:38 pm »

Anyone?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: [20.0.47] Complex expression language functions for music
« Reply #2 on: December 22, 2014, 01:59:52 am »

I've read it twice. My head hurts. I still don't fully understand.

My gut tells me "No".

You cannot use an expression to take one file and compare tags against it and any other file without specifically expressing that file by way of it's full file path, and even then, your options are seriously limited. Expressions work on the tags of a given file, they evaluate the result for that file using its metadata, and then move on to the next file, and so on.

You might be able to work something out using 'global variables', but my experience with those is very limited, and they do come with their own set of caveats. mark_h always comes to mind when I think global variable as in my head, he has a pretty good grasp of their concept. This notion is derived purely from this single thread, which will give you at least a feeling for the complexity of what you're asking.
http://yabb.jriver.com/interact/index.php?topic=72049.0

-marko.

mark_h

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1854
Re: [20.0.47] Complex expression language functions for music
« Reply #3 on: December 22, 2014, 02:39:43 am »

Yes, as Marko suggests, any time you want to look across multiple tracks like this you are going to need variables.  From your description I suspect it is very doable if you use variables but it does look pretty complex and so could take some time to iron out all the wrinkles.

If you do go down this route though you will find that you can only auto-assign your sub fields.  You will not be able to mix manual entry along with calculated entries.  It's one or other other...





Logged
Pages: [1]   Go Up