Author Topic: [Solved] Some function to help remove arbitrary text from tags, like from "fe...  (Read 6202 times)

paq

  • Sr. Member
  • ****
  • Posts: 386
Hello all and happy holidays to everyone!

First off, a big thank you for "access to Multiple Artist Splitter entries". It's awesome and I really mean it!

I have been using the multiple artist splitter and filled guest artist fields in. But I have also tagged my music files so that <Title> included some information about guest artists. For example: Foo Bar (feat. Alice and Bob)

Now I wish to display <Title> without that extra part (from where "feat" starts) along with a column showing <Artists: Guest>. Fixing the first is not as easy as the latter:
  • I can manually re-tag every <Title> and remove (feat. Alice and Bob)
    -- but that is very time consuming and leaves me unable to undo the changes
  • I can create a Custom Tag, <Title without feat.>, and use the "Advanced search and replace" to fill in all custom tags with this alternative title.
    -- However it needs to constantly look for changes in the library to have the tags in sync and it costs one custom tag
  • Using the available functions I can sort of create a virtual tag that fixes this:
    $Replace($Replace($Replace($Replace($Replace(<Title>," and ","; "),", ","; "),<Artists: Guest>," ")," (feat. )"," "),"; "," and ")
    -- However, it is quite... ugly. And with its flaws. But it actually works with multiple guest artists in some cases! :P

I'm thinking that the best way to go is to use Virtual Tags, but I don't think current functions will do it. Or maybe I have overlooked something? The one I created tries to replace Foo Bar (feat. Alice and Bob) into Foo Bar (feat. <Artists: Guest> and after that replace the whole last part with nothing.

Now, what would be the best field function to add to MusicBee to solve this problem? And at the same time which might solve other problems too? I'm looking for something more general than specific to this particular problem.

I'm thinking that if the $Contains function would return a number of the index where the string first was found, then it could be combined with the $Left function to solve this case. But then, changing the behaviour of a function would simply cause even more errors...

What about some substring function, which returns the text between two indexes? And where the index can be 0 to mark the beginning of the string and -1 to mark the end so you don't also need a function to count how long the string is. If that was available and also some function which could return where (feat is located in the string, then that would be awesome. And probably good for many other tagging purposes as well! :)

What do you think? Any other ideas?

Last Edit: December 21, 2013, 05:35:14 PM by paq

Alumni

  • Sr. Member
  • ****
  • Posts: 1007
I would suggest mp3tag. I also wanted to clean up my music files so I programmed an action that would bulk edit my entire library, removing the (feat.) expression from the title and adding it to the artist. You could also copy the expression to a new tag if you wanted.
It would be nice if MusicBee could do the same but this might help you for the time being.

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2450
Sounds like the sort of thing that could be handled with proper use of regular expressions.
I'm not sure if MusicBee RE implementation is sufficient, but mp3tag should be able to take the guest artists from the title and move them to another tag.
Bee excellent to each other...

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Actually, if OP is wanting to change the track title, rather than display it differently, I'd suggest sticking with Additional Tagging & Reporting Tools plugin.  There are presets for this kind of scenario, and it minimizes the risk of having to redo multiple artist tags because another program changed them...
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

paq

  • Sr. Member
  • ****
  • Posts: 386
Thanks for the replies!

I am familiar with the Additional Tagging & Reporting Tools plugin and it could certainly solve my problem, just like mp3tag would. However, I think I'm leaning more towards just display it differently than changing it, as that offers more flexibility and has less effect on the music files.

Now, what would be the minimum required function(s) to add to MusicBee to solve this without implementing too specific ones? Some search and replace function using Regexp would definitely be one way to go, but I'm thinking that might be too difficult to implement and there might be better alternatives out there, both for us and for Steven.

paq

  • Sr. Member
  • ****
  • Posts: 386
Good news everyone! I managed to solve the problem with existing functions and virtual tags :-D The $Split function did the trick!

Virtual tag: $Split(<Title>,"(feat",1)
Foo bar (feat. Alice and Bob) --> Foo bar

This is a picture of what it was that I had in mind and can now achieve. In the main view the titles are shown without "feat..." but in other places they are with, just like I want. The Featuring column is simply <Artists: Guests> renamed in the preferences. Happy holidays!
Last Edit: December 21, 2013, 05:35:56 PM by paq