Author Topic: Virtual tag to split <album duration> into hours, minutes, seconds  (Read 5217 times)

garbanzo

  • Newbie
  • *
  • Posts: 12
Can someone help me with this? I could probably figure it out eventually, but it would take a lot of trial-and-error.

What I want is to split a duration like 356:25 into 5 hours, 56 minutes, 25 seconds, including some conditional checks to only display the hours bit if the duration is actually greater than an hour.

Huge thanks hanks to anyone who offers to help me out 8)


redwing

  • Guest
Additional Tagging Tools plugin now supports arithmetic operations. Check out the wiki for the list of supported functions.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
there is ASR preset for this. you can use any ASR preset as virtual tag function.

Droppisalt

  • Newbie
  • *
  • Posts: 12
I have no idea how this works. I tried looking at the wiki and I still don't get how this works.
I installed ATT and I'm trying to figure it out.

Also
there is ASR preset for this. you can use any ASR preset as virtual tag function.
I can't find ASR presets :/

If anyone knows how to do it quickly, please let me know.
Any help is appreciated

boroda

  • Sr. Member
  • ****
  • Posts: 4595
its "Convert 'mmm:ss' or 'mmm.ss' in '<Tag 1>' to 'hh:mm:ss' in '<Tag 2>'" preset. to make it to work as virtual tag function select it, then enter some word in "assign virtual tag function id" field, click 'save all' button and restart mb.

use function $ASR(<URL>,your_id) in virtual tag.

redwing

  • Guest
Also you can use this, modifying the format to your liking:

Code
$If($Div($Split(<Album Duration>,:,1),60)<1,<Album Duration>,$RoundDown($Div($Split(<Album Duration>,:,1),60),0):$Pad($Mod($Split(<Album Duration>,:,1),60),2):$Split(<Album Duration>,:,2))
Last Edit: April 20, 2018, 02:32:42 AM by redwing

Droppisalt

  • Newbie
  • *
  • Posts: 12
its "Convert 'mmm:ss' or 'mmm.ss' in '<Tag 1>' to 'hh:mm:ss' in '<Tag 2>'" preset. to make it to work as virtual tag function select it, then enter some word in "assign virtual tag function id" field, click 'save all' button and restart mb.

use function $ASR(<URL>,your_id) in virtual tag.

For some reason, I can't import any presets. I just get the "No presets were imported." error

boroda

  • Sr. Member
  • ****
  • Posts: 4595
check if there are xml files in 'musicbee\plugins\asr presets' folder.

Droppisalt

  • Newbie
  • *
  • Posts: 12
Oh wow, it was in a subfolder. Just moved it and now it works!

Thanks everyone!

Boll Weevil

  • Jr. Member
  • **
  • Posts: 27
its "Convert 'mmm:ss' or 'mmm.ss' in '<Tag 1>' to 'hh:mm:ss' in '<Tag 2>'" preset. to make it to work as virtual tag function select it, then enter some word in "assign virtual tag function id" field, click 'save all' button and restart mb.

use function $ASR(<URL>,your_id) in virtual tag.
Hi!
I have spent entire evening yesterday but didn't succeed to make it work. What do I do wrong? I need help.
This is what I made. First I installed ATT and unsuccesfully tried to find a 'musicbee\plugins\asr presets' folder, because I had MS Store version installed, so I deleted it and installed a version from site. Then I checked and found that folder, installed ATT and imported ASR scripts. This is what I made next:



Not sure if I dealed right with <Tag 2> Maybe I should have input something there?
Then I defined a virtual tag <Duration> with formula you posted above:



Then customized panel this way using virtual tag <Duration>:



The result is:



Instead of album duration it shows just duration of first track.
I'm sure I did something wrong, please help to find error

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
Looks to me like <Time> is the track time tag. Is there an <Album Duration> one in the drop-down list? If not, you can use @redwing's Virtual Tag.

Boll Weevil

  • Jr. Member
  • **
  • Posts: 27
No such tag in menu, and afaik <Album Duration> isn't tag, it is an MB embedded function

I tried your suggestion: SYNTAX ERROR.
Last Edit: October 14, 2021, 07:55:39 PM by Boll Weevil

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
No such tag in menu, and afaik <Album Duration> isn't tag, it is an MB embedded function

I tried your suggestion: SYNTAX ERROR.

@redwing's Virtual Tag is standalone, like your first three tags. Assuming you're using the Additional Tagging and Tools plugin still, it should work as copy/pasted.

Boll Weevil

  • Jr. Member
  • **
  • Posts: 27
I tried that way also and it didn't work for me. I'm pretty sure that I do something wrong. Maybe somebody who did it successfully could post a step by step guide for idiots, please)

Update:

redwing's code finally worked! Thanks
Last Edit: October 15, 2021, 05:41:38 PM by Boll Weevil