Author Topic: Virtual Tag on BPM Field  (Read 1597 times)

soul247

  • Newbie
  • *
  • Posts: 7
New to MusicBee in earnest and am finding my round slowly. Newb query if I may...

My existing iTunes files were written with a BPM value by BPM Analyzer and displayed as a 2/3 digit number.

Following the import, the existing BPM has disappeared in some cases but in many cases has 'added a decimal point and two places after.

I tried to add a virtual tag to the BPM and apparently it can't as it exists? So i added a new field called 'BPM#' and added a virtual tag to that.

After some trial and error, the following works and remove last 3 characters - $Left($Trim(<BPM>),3) on the new field. But...

...this is OK for 3 digit BPM's but it leaves the decimal point for two digit BPM's - can anyone help with code with some sort of IF statement please?

If there is a hugely simpler solution please let me know  :)

Thank you

hiccup

  • Sr. Member
  • ****
  • Posts: 7908
This should work:

$Split(<BPM>,",",1)

(depending on localisation, if your digit grouping symbol is . instead of ,
use: $Split(<BPM>,".",1)

soul247

  • Newbie
  • *
  • Posts: 7
The latter option worked perfectly...thank you! 8)