Author Topic: How to use $Min/$Max?  (Read 3517 times)

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
Hi!

I'm trying to organize my classical music folders in a nice way but have basically just ended up trying multipe ways as a procrastination tactic instead of finshing up my dissertation :/ One question to the experts here: I have a couple of "Beethoven - The Complete Symphonies"-boxes from various conductors. I'd like to use the recording years on the folder structure but haven't found a good way. As of now, I use the <year> for the year the year the boxes were released, and <original year> for the recordings. However, for the box by Toscanini, the recordings are 1939-1952. I'd like to avoid using a span of years in the <original year> (e.g. 1939-1952) since I'd like that tag to be specific for every record. How would you go about doing this? I still want the separate albums to end up in the same folder, so what I'm doing now in the case the box isn't really a box but more a collection of albums for that symphony cycle, I make up an album name (e.g. "Comlete Symphonies") and then use <disc subtitle> for the separate albums. Would it be easier to still use a span of years in <original year> (but the same span for all participating discs) and the use $Min/$Max? If so, I can't figure otu how to use them, I don't understand the <grouping-field>.
Ok, very diffusely put question, I realize that now...



My goal...

Last Edit: November 26, 2021, 11:55:12 AM by Johan_A_M

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
I've read over this post twice, but still find it confusing to follow.

Are you trying to display them in a "nice way" or sort the files as such?
When you say "My goal..." what is image are we looking at? Is it from another program
showing what you wish to accomplish? What does your MB layout look like now?
What do you mean by wanting "separate albums to end up in the same folder?"
MusicBee doesn't display follow a folder design format.


Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
I've read over this post twice, but still find it confusing to follow.

Yeah, sorry for the badly put question, I'll try to rephrase.

My goal for classical music is to have a folder structure that includes the year a piece was recorded/performed. My problem is how to do this when a CD have pieces recorded in different years. Right now, I have a tag <original year> in which I write the span for all pieces on the CD/box (e.g. 1942-1952). That way, it ends up as in my image. However, I'd rather put the correct year in every single file, and then find a way in which I could check for the span of years on that CD/box and add something like "lowest year - highest year" when organizing. I'm not good with the functions and was thinking that perhaps $Min/$Max could be used for this?
Regarding "separate albums end to end up in the same folder", as of now, I put a box's name in the <album> and then use <disc subtitle> for the individual CDs. However, if I use different <original year> for the different <disc subtitle>, they will end up in separate folders. Not sure if it helps, but here's my exception:

Code
• <Genre> •\· · $First($IsNull(<Composer>,,$RSplit(<Composer>," ",1))) · ·\· symfonier ·\$First(<Album Artist>) | <Original Year> | <Album> | <Publisher>$If(<Original Year>=<Year (yyyy)>,,$IsNull(<Album Mastering>,," │ "<Year (yyyy)>" "<Album Mastering>))\$IsNull(<Disc Subtitle>,<Set Subtitle>\,<Disc Subtitle>\)<Track#> │ <Title>

Hope this clarifies, and once again, sorry for the initial confusion and thanks for still trying to understand.

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
I'm not good with the functions and was thinking that perhaps $Min/$Max could be used for this?
Yes, you can.
E.g. using it in a virtual tag would look like this:

$Min(<original year>, <album>)

This will produce the earliest year that exists for a track within an album.

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
I'm not good with the functions and was thinking that perhaps $Min/$Max could be used for this?
Yes, you can.
E.g. using it in a virtual tag would look like this:

$Min(<original year>, <album>)

This will produce the earliest year that a track within an album has.
Thank you! That also explains the grouping-field part.

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
I'm not good with the functions and was thinking that perhaps $Min/$Max could be used for this?
$Min(<original year>, <album>)
Using this in an Exception rule, it turned out a nice and working monster :)

Code
$If($Contains(<Original Year>,-),<Original Year>,$Min(<Original Year>,<Album>)$If($Min(<Original Year>,<Album>)=$Max(<Original Year>,<Album>),,-$Max(<Original Year>,<Album>))
)

Not sure if there would be any way of simplifying this. What I was trying to acheive was that if I don't know the individual recordings' year and only had a span of years (hence if <original year> contains a "-", then the rule would not apply. Also, if everything had the same <original year> I don't want to end up with a zero.

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
A thought just came up:

You may want to check what happens if you have several albums with the exact same album title.
E.g. when you have different albums named 'Mattheus Passion' by different conductors/orchestras/dates.
It could be that the current virtual tag outputs the same year for all albums having the same name, so maybe you'll need to further specify things.
Last Edit: November 27, 2021, 02:54:09 PM by hiccup

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
A thought just came up:

You may want to check what happens if you have several albums with the exact same album title.
E.g. when you have different albums named 'Mattheus Passion' by different conductors/orchestras/dates.
It could be that the current virtual tag outputs the same year for all albums having the same name, so maybe you'll need to further specify things.
Thanks for your thoughts hiccup. As a matter of fact, I didn't get it to work after all. It ends up like this:



that is, as separate folders. However, since it's used as exceptions in the naming templates, I don't use it through virtual tags but simply as functions. Could this explain why it doesn't work?

hiccup

  • Sr. Member
  • ****
  • Posts: 7790
… I didn't get it to work after all. It ends up like this: …
I'm sorry, I don't know.
And personally I am not that interested in putting much effort in getting file and folder names 'right'.
I am much more interested in getting the metadata right so that everything can be managed well within MusicBee.
File and folder names won't do anything to improve on that.

Hopefully somebody else has some bright ideas and suggestions on this?

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
Thanks for your thoughts hiccup. As a matter of fact, I didn't get it to work after all. It ends up like this:



that is, as separate folders. However, since it's used as exceptions in the naming templates, I don't use it through virtual tags but simply as functions. Could this explain why it doesn't work?

It looks to me like the $Max()/$Min() functions aren't able to do what you're wishing, but you'd have to test them on multiple files, using the Track Information panel and "Selected files" to confirm.

Johan_A_M

  • Jr. Member
  • **
  • Posts: 117
It looks to me like the $Max()/$Min() functions aren't able to do what you're wishing, but you'd have to test them on multiple files, using the Track Information panel and "Selected files" to confirm.
Didn't know one could use that panel to try different templates, thanks! You're right about the functions. Using $Max(<Original Year>,<Album>) on two files from the same album but with different years, the end result still is: