INTERACT FORUM

Please login or register.

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

Author Topic: Expression Language Coolness  (Read 977 times)

timwtheov

  • Galactic Citizen
  • ****
  • Posts: 354
Expression Language Coolness
« on: March 19, 2020, 12:33:52 pm »

After reading Matt's post about possible new expressions, I got to thinking about how some of you all use expressions.

What are some of the cool things you do with expression language? Do you have an interesting view scheme? Or some kind of interesting smartlist? Or some tagging apparatus? Essentially, I'm just looking to steal some ideas or think differently about how I view/list/tag what I have.

On my end, though I'm not sure it's entirely expression language, or if it is, a really rudimentary use of it, at least on my end, I use MCUtils to populate a field called "Styles" and then create interesting, genre/sub-genre-based smartlists to listen to stuff I may have accumulated but not really listened to (or not listened to in a long time)--kind of MC-as-Roon but without the graphics. So right now I have a "Britpop" smartlist and "Dream Pop" and "Shoegaze" (yes, I was in college in the early 90s) and so forth.

What kind of cool/interesting things do you all do?
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Expression Language Coolness
« Reply #2 on: March 19, 2020, 02:29:22 pm »

I don't like when I acquire music and the song titles are something like:

So and So and the Whoevers Feat. That guy
MC Cooly Rap ft. Snoop Kitty Kat
Jayonce Featuring Bay-Z

I created a new field called [Featuring] where I want the featured artist displayed. 

I created two regex expression that separate the featured artist name from the song title.

To get the featured artist name I have this expression
Code: [Select]
regex([Name], /#^(.+?)(?:\s[([{]?(?:f(?:ea)?t\.?|featuring)\s([^)\]}]+)(?:[)\]}]?|$)|$)#/, -1) [R2]
To get a clean song title I have this expression
Code: [Select]
regex([Name], /#^(.+?)(?:\s[([{]?(?:f(?:ea)?t\.?|featuring)\s([^)\]}]+)(?:[)\]}]?|$)|$)#/, -1) [R1]
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression Language Coolness
« Reply #3 on: March 19, 2020, 02:35:13 pm »

Good thinking, Moe.  I feel the same way...

I address that problem by just not buying that kind of music.   ;D
Logged

timwtheov

  • Galactic Citizen
  • ****
  • Posts: 354
Re: Expression Language Coolness
« Reply #4 on: March 19, 2020, 02:46:01 pm »

Wer and Moe: great posts--exactly the sort of thing I was looking for!

Thanks!
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Expression Language Coolness
« Reply #5 on: March 19, 2020, 02:54:39 pm »

Import Stats in a pane:
https://yabb.jriver.com/interact/index.php/topic,102319.msg709847.html#msg709847
Your exercise if you want it is to convert these for "Last Played" stats :)

Work out and display a person's age at the time a photo was taken:
https://yabb.jriver.com/interact/index.php/topic,117116.0.html

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Expression Language Coolness
« Reply #6 on: March 19, 2020, 03:22:32 pm »

Yeah I have to hand it to you Marko... I remember when that age/photo thread came out.  Impressive. Speaking admittedly as someone who doesn't really use MC for photos, I thought that was one of the most mental things I'd seen done with this program.

You missed your calling as a mad scientist!  :)
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: Expression Language Coolness
« Reply #7 on: March 19, 2020, 04:24:02 pm »

Thanks :) It really is set and forget. Every photo gets the birth date tag via auto import, then, as soon as a person tag matches, the age is calculated. Was a great idea from the OP. looking at photos of my daughter and granddaughter at the same age is mental. Lightroom's face tagging is always getting them mixed up!

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Expression Language Coolness
« Reply #8 on: March 19, 2020, 04:34:00 pm »

I was pretty happy with this solution I came up with https://yabb.jriver.com/interact/index.php/topic,123182.0.html

I also like this one that tells you what time a movie will end

Code: [Select]
FormatDate(math(now() + ([Duration,0]/86400)),h:mm)

Logged

timwtheov

  • Galactic Citizen
  • ****
  • Posts: 354
Re: Expression Language Coolness
« Reply #9 on: March 19, 2020, 04:45:42 pm »

Yes, agree on the movie ending time: I adopted and use that one a lot.
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: Expression Language Coolness
« Reply #10 on: March 20, 2020, 01:49:41 pm »

This is one I get a lot of mileage out of

Code: [Select]
IfElse(
   regex([Keywords], /#(Soundtrack|Compilation)#/, 1), / [R1],
   regex([Genre], /#(Comedy)#/, 1),                    / [R1],
   regex(Left(Clean([Artist Sort], 2), 1), /#^([A-Z])#/, 1),  FixCase([R1], 3),
   1, 0-9 etc.
)


This works great in a pane or in Theater View.  What it does is this



Grouping all my comedy, compilation and soudtracks in their own individual groups.  Then putting all artist that start with something that isn't a letter in a group and then a group for every individual letter of the alphabet.  I use this view probably 80% of the time I am viewing my library.

I have slight variants for TV and movies as well.

Logged
Pages: [1]   Go Up