Author Topic: Changing how 'artist' is displayed on album cover view?  (Read 2733 times)

edcase

  • Jr. Member
  • **
  • Posts: 36
Albums with featured artists used in the <artist> tag display the full string, any way to detect the matching artist bit and only display the difference?



Don't want to alter the actual text of the <artist> tag, just the display, is this doable with virtual tags or something, even just being able to remove the square brackets "[ ]" surrounding it would be nice since I like to use them for [ft: artists]. ^^

proph

  • Newbie
  • *
  • Posts: 2
Edit the tags on auto tag by album one by one to be whatever you want it to show. Just know with lastfm uless you do just the artist name on the tags it will scrobble the actual artist tag.

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
Don't want to alter the actual text of the <artist> tag, just the display, is this doable with virtual tags or something, even just being able to remove the square brackets "[ ]" surrounding it would be nice since I like to use them for [ft: artists]. ^^

Yes, but not with the "compact grid" layout you're using.
One of these days, I'm going to get around to asking Steven if he'll let us use a Custom or Virtual Tag as a substitute for <Title> there and I can link you to the wish if you'd like to +1 it.

edcase

  • Jr. Member
  • **
  • Posts: 36
proph, that would be altering the actual info in the tag, don't wanna do that as it just removes the artist name in the now playing / scrub area / other devices.
issue is over readability and redundant-ness... also my library is a bit too large to manually go through.

What's the non-compact view? I really like the album cover layout when outside of playlists so doubt I'd change for it. Yah I'll +1 that, thanks for the replies guys.



Wouldn't pulling from the artist split section make some sense there? The whole issue is sorta odd considering MusicBee already detects album artist = artist and avoids display, feel like it's pretty close to being standard feature / option. ^^
Last Edit: August 31, 2021, 02:03:04 AM by edcase

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
Create a virtual tag using the code below and display that instead of the normal Title tag:

Code
<Title>$If($Contains(<Artist>,[ft:),{font: Segoe UI Semibold;Regular;9}{contrast: 50}"    [ft: "$RxSplit(<Artist>,"\[ft: ",2),)
Replace the font and contrast values to suit your own layout, obviously, or remove them completely if you want the guest artist name to match the title formatting.

It should be noted that when you display the normal Title in this view, MusicBee does its own checking: If the track Artist differs from the Album Artist MusicBee will append it to the Title like in your screenshot. By opting to show a different tag, you'll lose that functionality. I think it should be fine if your whole library is consistently tagged with the guest artist included in the Artist tag, but it's something for other users to be aware of if they try to implement something similar.
Bee excellent to each other...

edcase

  • Jr. Member
  • **
  • Posts: 36
Wow! That's great, um is there a more comprehensive listing of commands / syntax for virtual tags? So my library is consistent [mostly] but there are more cases than just featured artists, eg remixes or just album artists being various or soundtrack where this falls apart. Does virtual tag support something like a CASE instead of IF?

I played with it a bit and did essentially 2 more if statements following yours [one for splitting out rmx: and another for <artist>!=<album artist>] with the obvious pitfall of repeating in cases where multiple criteria were met. I figured actually something along the lines of

Code
<Title>$If(<Artist>!=<Album Artist>,{fontchoices}"  ["$RxSplit(<Artist>,<Album Artist>,2)"]",)

If <artist> doesn't match <album artist>, display everything after the matched text. Issues maybe when there is no match?
Doesn't work anyway, RxSplit wants an actual string, so then I tried something more messy

Code
<Title>$If($And(<Artist>!=<Album Artist>,$Contains(<Artist>,<Album Artist>){fontchoices}"  ["$RxSplit(<Artist>,$Left(<Album Artist>,),2"],)

If <artist> doesn't match <album artist> but does contain it, split <artist> after the amount of characters in <album artist> display that.
I was hoping Left might return number of chars and Split might use that as a value, silly really.

Code
<Title>$If(<Artist>!=<Album Artist>,$If($Contains(<Artist>,[)"    ["$RxSplit(<Artist>,"\[",2),"    ["<Artist>"]"),)

So I tried a sorta nested If, but that fails to compile at the end of the statement "@ ist>"]"),)

Is there an inverse to $Contains? A command to return amount of characters in a tag? A way to $Split by position / number of characters?
Super to know this is possible, thanks for the help!
Last Edit: August 31, 2021, 04:16:45 PM by edcase

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
Overview of MusicBee functions is here:

https://musicbee.fandom.com/wiki/Functions

If you need to cater for more than just guest artists, regular expressions are where it's at.
Otherwise, as you've discovered, you'll end up having to write and debug a heap of nested $If functions to match each possible variation.
Regular expressions can search for anything that matches a pattern, not just specific characters.
(I accidentally used the $RxSplit function in my previous example when I didn't need to - a normal $Split would have also worked there)

It's hard to know exactly what you're trying to do without seeing other examples of your tags, but I made this to display anything in brackets at the end of the Title tag in a dimmer font:

Code
$If($IsMatch(<Title>,".* \[.*\]"),$RxSplit(<Title>,"\[.*\]",1)"  "{contrast: 65}$RxMatch(<Title>,"(\[.*\])"),<Title>)
Which reads as: if the Title contains text in brackets, display the Title value up to that point, followed by the bracketed text with lower contrast .

It sounds like you could adapt this for your Artist tags.
Note that brackets have special meanings in regular expressions so you have to include a backslash to match them in the tag. i.e. \[ and \]
Bee excellent to each other...

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
Wow! That's great, um is there a more comprehensive listing of commands / syntax for virtual tags? So my library is consistent [mostly] but there are more cases than just featured artists, eg remixes or just album artists being various or soundtrack where this falls apart. Does virtual tag support something like a CASE instead of IF?

As @Zak says, it's difficult to help because you know which artist-related tags you're using and how, but we don't.
It would also help to write out as many different examples of what you what your Virtual Tag to display, depending on tag parameters.

In my library...
<Artist> splits up primary track artists
<Artist (displayed) formats above primary track artists
<Artists: Guest> feature credited artists
<Artists: Performer> normally musicians and choir/chorus directors or leaders, but I put tracks credited as "with Second Artist" here too
<Title> just the plain ol' title
...which is displayed as...
<Artist (displayed)>          <Title> <SUB-LABEL>

<SUB-LABEL> is another Virtual Tag, where featured artists and musicians (among many other details) are parsed.

Normal
Code
<Artist> The Chemical Brothers
<Artist (displayed) The Chemical Brothers
<Artists: Guest>
<Artists: Performer>
<Title> Piku

The Chemical Brothers          Piku

Multiple Artists + Guest Artist
Code
<Artist> Eightball; MJG
<Artist displayed> Eightball & MJG
<Artists: Guest> MC Breed
<Artists: Performer>
<Title> Sesshead Funk Junky

Eightball & MJG          Sesshead Funk Junky [feat. MC Breed]

"Artist with..." Credited Performer(s)
Code
<Artist> Frank Sinatra
<Artist (displayed)> Frank Sinatra
<Artists: Guest>
<Artists: Performer> Big Crosby; Fred Waring & His Pennsylvanians
<Title> Go Tell It on the Mountain

Frank Sinatra          Go Tell It on the Mountain [with Bing Crosby and Fred Waring & His Pennsylvanians]

Dumb Complicated Code, because Track has Both Featured Artist(s), "Artist with..." Credited Performer(s) and Musician Credits
Code
<Artist> Kirk Franklin
<Artist (displayed)> Kirk Franklin
<Artists: Guest> Bono; Crystal Lewis; Mary J. Blige; R. Kelly
<Artists: Performer> The Family; Nu Nation
<Title> Lean on Me

Kirk Franklin          Lean On Me [with The Family, Nu Nation and feat. Bono, Crystal Lewis, Mary J. Blige and R. Kelly]

Obviously you don't have to match your tags to mine, I'm just giving you some examples of how to write things out, so it's easy to write your code around and for others to help you get things straight.
Last Edit: August 31, 2021, 07:31:07 PM by The Incredible Boom Boom

edcase

  • Jr. Member
  • **
  • Posts: 36
Late reply cause finding time is hard. That functions page is a bit sparse when coming into the code world cold, was using it with my experimenting before.

Quote
It's hard to know exactly what you're trying to do without seeing other examples of your tags
My bad, should of given more context, at the same time didn't want to just dump my problem fully onto the community, difficult balance =]

Full outline of my tagging wish: To display the <Artist> when it differs from <Album Artist> (eg Various Artists, Soundtrack) but when the difference is minor like a featured artist or a remix to only display that difference, that way it's more likely visible before truncation.

eg: "Mass    [EOB [ft: Laura Marling]]"
==: "Mass    [ft: Laura Marling]"

Since I consistently use square brackets for my featured artists or remixes this makes it a good split point like you helped me initially, but I needed to add the ability to display the full <Artist> in cases where they differed for whatever reason from the <Album Artist> so a good example would be VA or Soundtracks* (which I use as <Album Artist> to group Soundtracks).

This is the same functionality as MB defaults, I just needed to add this back in without causing duplicates where a square bracket might be used.

eg: "Piano Black    [Seatbelts [rmx: Ian O'Brien]]    [rmx: Ian O'Brien]"
==: "Piano Black    [Seatbelts [rmx: Ian O'Brien]]"

I'm only doing comparative jobs on <Artist> and <Album Artist> boom boom, I'm fussy about my labelling but that amount of precision is beyond me (impressive but daunting, meant as a compliment ^^)

These screenshots show how I do want the titles to display, I got it to work but it feels messy.
Code
<Title>$If($Contains(<Artist>,<Album Artist>),$If($Contains(<Artist>,[),{Contrast: 35}"    ["$RxSplit(<Artist>,"\[",2),),{Contrast: 35}"    ["<Artist>"]")
If <artist> contains <album artist>
    (T) if <artist> has a "["
        (T) display text from after that "[",
        (F) display nothing from <artist>
    (F) display <artist>

Thanks again, if I get a reply pointing out something to neaten it up I will, might post a tips post about this with area's denoted where it might apply to their tagging scheme and also a sorting virtual tag with mention of users like yourselves who basically did the work / heavily guided me if you guys aren't opposed?

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
These screenshots show how I do want the titles to display, I got it to work but it feels messy.
Code
<Title>$If($Contains(<Artist>,<Album Artist>),$If($Contains(<Artist>,[),{Contrast: 35}"    ["$RxSplit(<Artist>,"\[",2),),{Contrast: 35}"    ["<Artist>"]")
If <artist> contains <album artist>
    (T) if <artist> has a "["
        (T) display text from after that "[",
        (F) display nothing from <artist>
    (F) display <artist>

I see now... I had been thinking your featured artists were split to the <Artists: Guest> field, but they're still in the <Artist> field.

Code
<Title>$If($Contains(<Artist>,<Album Artist>),{Contrast: 35}$RxMatch(<Artist>,"\s+\[.+\]"),{Contrast: 35}"    ["<Artist>"]")

I think that's "cleaner" equivalent that what you're doing. It should match whitespace and then anything in brackets and nothing when no bracketed information is present.