Author Topic: Useful virtual tag formulas  (Read 75433 times)

redwing

  • Guest
How to Display Web Lyrics for Playing Track

For v2.5
You can add custom web links to Playing Tracks panel (either tab or bar at the bottom). The nice thing is it updates when playing track changes.
 
For v3
Custom web links can be configured in configuration dialog of Track Information element. And they can be run either from track info element or now playing tab/bar via context menu. If you have web browser plugin installed, the web content will be displayed inside MB.

Genius.com
http://genius.com/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-),the,)-$Split(<Title>,"(",1)," ",-),',),?,),&,and),",",),!,),.,)-lyrics

Musixmatch.com
https://www.musixmatch.com/lyrics/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-)," ",-)/$Replace($Split(<Title>,(,1)," ",-),',),.,),?,),!,),&,),',)

MetroLyrics.com
http://metrolyrics.com/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Split(<title>,"(",1)-lyrics-$Replace($Replace(<Artist>,/,),the,)," ",-),',),?,),&,and),",",),!,),.,)

Note: It should work for most songs with standard artist names and song titles, but could fail for some in which cases you will need to edit the generated query manually or use the site's search function.
Last Edit: March 19, 2016, 03:23:41 PM by redwing

redwing

  • Guest
How to Identify Tracks with a Cue Sheet File

To identify tracks with a cue sheet file, you can use the following virtual tag using MB's internal tag <FileCueSheet>:

Cue = $IsNull(<FileCueSheet>,,<FileCueSheet>)

If you add the "CUE" field to the main panel, the column will show the entire content of the cue sheet just like when using Edit Cuesheet button on Tag Editor.
 
Then create an auto-playlist using the rule of "CUE" field "has a value".
The auto-playlist will only contain tracks with a cue sheet.

Also you can make file extension column of tracks with a cuesheet file displayed in the main panel as something like "flac/cue" with the following virtual tag:

$IsNull(<FileCueSheet>,<.Ext>,<.Ext>/cue)
Last Edit: July 13, 2016, 03:26:15 AM by redwing

thesket

  • Newbie
  • *
  • Posts: 2
Oh my god, redwing, thank you for those custom web links.

I've been trying for hours to figure out how to do this; tried using virtual tags, and got it to work for some cases but not all. Your solution is much more elegant. Actually I didn't realize you could use functions in the custom web links section.

I wasn't able to fully wrap my head around your logic, but was able to reverse-engineer them enough to at least get Ultimate-Guitar tabs and chords working.

Thanks, you're brilliant.

redwing

  • Guest
Oh my god, redwing, thank you for those custom web links.

I've been trying for hours to figure out how to do this; tried using virtual tags, and got it to work for some cases but not all. Your solution is much more elegant. Actually I didn't realize you could use functions in the custom web links section.

I wasn't able to fully wrap my head around your logic, but was able to reverse-engineer them enough to at least get Ultimate-Guitar tabs and chords working.

Thanks, you're brilliant.

That's great! Feel free to post the web link formula you've come up with so that others can benefit from your work.

thesket

  • Newbie
  • *
  • Posts: 2
Sure thing! If you ever have time and feel like explaining exactly how this logic works, I'd appreciate it lol. There are so many replaces, parameters and parentheses that it's hard to follow.
Here's the UG web link I got from modifying yours:

UG Chords
https://tabs.ultimate-guitar.com/traesmusicbee/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-)," ",_)/$Replace($Split(<Title>,(,1)," ",_),',),.,),?,),!,),&,),',)_crd.htm

UG Tab
https://tabs.ultimate-guitar.com/traesmusicbee/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-)," ",_)/$Replace($Split(<Title>,(,1)," ",_),',),.,),?,),!,),&,),',)_tab.htm

(and)

UG Search
https://www.ultimate-guitar.com/search.php?search_type=title&order=&value=<Title>+<Artist>
Last Edit: April 26, 2016, 10:32:07 AM by thesket

Iasc

  • Sr. Member
  • ****
  • Posts: 788
Sure thing! If you ever have time and feel like explaining exactly how this logic works, I'd appreciate it lol. There are so many replaces, parameters and parentheses that it's hard to follow.
Here's the UG web link I got from modifying yours:

UG Chords
https://tabs.ultimate-guitar.com/traesmusicbee/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-)," ",_)/$Replace($Split(<Title>,(,1)," ",_),',),.,),?,),!,),&,),',)_crd.htm

UG Tab
https://tabs.ultimate-guitar.com/traesmusicbee/$Replace($Replace($Replace($Replace($Replace($Replace($Replace($Replace(<Artist>,/,-)," ",_)/$Replace($Split(<Title>,(,1)," ",_),',),.,),?,),!,),&,),',)_tab.htm

(and)

UG Search
https://www.ultimate-guitar.com/search.php?search_type=title&order=&value=<Title>+<Artist>

I will definitely use these. Thanks thesket.

redwing

  • Guest
Sure thing! If you ever have time and feel like explaining exactly how this logic works, I'd appreciate it lol. There are so many replaces, parameters and parentheses that it's hard to follow.

Thanks for sharing them! Sure, I'll try to find time to write a short guide.

Abers86

  • Newbie
  • *
  • Posts: 6
Not sure if anyone might be interested in this very short virtual tag formula to easily display whether a track is in a specified playlist. I have a 'Phone' playlist, unsurprisingly used for syncing music with my phone. Since it has hundreds of tracks and I regularly add / remove albums it's hard to keep track of what's in it or not. I was getting more and more annoyed when sending tracks to the playlist to be notified that they would be duplicates as they were already in it. This little formula fixed that issue:

$If(<Playlist>="Phone","  ?"," ")

Now if a track is in the specified playlist I have a tick displayed after all the other fields.

Edit: Quick question - would it be possible to create a checkbox similar to the one that can enable or disable whether a file is synced / played but instead that when ticked adds a track to a specified playlist and when unticked removes it?
Last Edit: August 12, 2016, 04:02:52 PM by Abers86

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
Edit: Quick question - would it be possible to create a checkbox similar to the one that can enable or disable whether a file is synced / played but instead that when ticked adds a track to a specified playlist and when unticked removes it?

You can use the tick box as a criteria for auto playlists.  So you can just use that to keep track of which tracks are included.
MusicBee Wiki
Use & improve MusicBee's documentation!

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

Abers86

  • Newbie
  • *
  • Posts: 6
You can use the tick box as a criteria for auto playlists.  So you can just use that to keep track of which tracks are included.

Thanks for the reply. Huh, I always thought the built-in tick box if unticked meant that tracks would be skipped during playback. Double checked and that's not the case. Does the field then have no intrinsic purpose / effect unless the user specifies one for it in playlists etc?

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
It can also be used to select tracks in groups, ie all checked or all unchecked, flee editing our whatever.  But just ticking a track doesn't have any effect that I'm aware of.

To prevent a track from playing, you can ban it I the tag editor or click the space to the left of it in the playing tracks list (makes a - appear)
MusicBee Wiki
Use & improve MusicBee's documentation!

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

Abers86

  • Newbie
  • *
  • Posts: 6
Magic thanks. Fortunately my formula was handy to quickly tick all those that were in my existing playlist. Only issue I am having with using the 'ticked' special field is that you can't display it in the compact view - or I am just being glaikit. Not the end of the world but tad annoying.

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10691
You can always make a wishlist request.  :)
MusicBee Wiki
Use & improve MusicBee's documentation!

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

redwing

  • Guest
More Informative Track Properties Display

Track information panel has an option to show track properties for playing/selected track. Very useful but it has some limitations. I have lots of ALAC files but it only shows them as "m4a", which is not quite helpful if you also have lots of AAC files that are using the same MPEG-4 container format. Another info that I'd like to see is whether it's a file with a cue sheet.

So now I am using the following formula for the track info panel in place of the in-built track properties option.

Code
$IsNull(<FileCueSheet>,$Replace($Split(<Kind>," ",1),MPEG,MP3),$Replace($Split(<Kind>," ",1),MPEG,MP3)" (cue)") <Bitrate> / <Sample Rate> (<Channels>)

redwing

  • Guest
How to Display and Sort Tracks by Clipping Gain

If you run volume analysis, it can optionally show in its result window which tracks will clip when the current ReplayGain values are applied and how much gain reduction is required to avoid clipping. The problem is there's no way to save or export those figures. Thanks to Additional Tagging Tools plugin's support for various math functions, now it's possible to instantly display those figures as a virtual tag and you can sort tracks by it (or save it as a custom tag to files) to find out which tracks will likely to clip while playing with ReplayGain on.



Needless to say, this assumes you have already run volume analysis on your tracks. Without existing ReplayGain tags, these virtual tags won't work at all.

First, you need to map album peak and track peak tag to custom tags to access their values as MB doesn't support this natively.
Go to Preferences> Tags (1)> Define new tags and enter the following in identifier box and press tab to populate it in other boxes.

Code
REPLAYGAIN_ALBUM_PEAK
Code
REPLAYGAIN_TRACK_PEAK



Save and close the dialog and return to Tags (1) panel.

In custom tags configuration setting, create two custom tags "Album Peak" and "Track Peak" and select the pre-defined tag code REPLAYGAIN_ALBUM_PEAK and REPLAYGAIN_TRACK_PEAK using dropdown button.



Save the dialog, now you will see MB rescans all files in your library. When it's done, confirm Album Peak and Track Peak tags are properly mapped by adding those columns to the main panel.

Now you need to define two virtual tags that will show the clipping gain. As stated earlier, these virtual tags require latest version (2018-02-03 or later) of Additional Tagging Tools plugin (https://getmusicbee.com/addons/plugins/49/additional-tagging-and-reporting-tools/) installed and enabled. Without the plugin, this won't work.

Clip (album)
Code
$IsNull(<Album Peak>,,$If($Add($Mul(20,$Lg(<Album Peak>)),$Split(<Album Gain>," ",1))<0.00,,$Round($Add($Mul(20,$Lg(<Album Peak>)),$Split(<Album Gain>," ",1)),2)))
Clip (track)
Code
$IsNull(<Track Peak>,,$If($Add($Mul(20,$Lg(<Track Peak>)),$Split(<Track Gain>," ",1))<0.00,,$Round($Add($Mul(20,$Lg(<Track Peak>)),$Split(<Track Gain>," ",1)),2)))
Now you can sort albums/tracks by the clipping gain and identify tracks that would most likely to clip while playing. This will allow you to test which tracks are most audibly clip and what means are mostly effective to avoid clipping.
Last Edit: February 08, 2018, 01:47:07 AM by redwing