Author Topic: Virtual Tag Function Anomaly  (Read 787 times)

tjinc

  • Sr. Member
  • ****
  • Posts: 383
I was playing with some of the functions provided by the AT&RT plugin when I noticed this behaviour/quirk/anomaly/bug/lack of understanding on my part:

To illustrate this I set up a few virtual tags as per the following image - you can see in the tracks listing that all works well:


But, if I delete Virtual3, Virtual4 and 5 stop working:


If I then introduce another $Count function in Virtual6 (this time nested within another function), Virtual4 and 5 work again:


There seems to be some dependency between the additional AT&RT tags and the $Count function (and, I believe $Sum). I'm struggling to understand the dependency and would be grateful for any insights on this. Or is it a bug or a quirk or am I not understanding something/doing something silly?


(Note: Although I do love a square root, and who doesn't, I am not actually interested in calculating the square root of the release year - just using it as an illustration.)

boroda

  • Hero Member
  • *****
  • Posts: 4748
what happens if you just press F5 after any change in VT definitions? all v.tag values are cached by mb and i'm not sure how and when the cache is recreated by mb.

tjinc

  • Sr. Member
  • ****
  • Posts: 383
Hi Boroda, thank you for responding.

I have tried F5 (I also set up a 'Refresh' button on the toolbar) but this makes no difference.
When starting MusicBee none of the virtual tags, which use the additional AT&RT functions, are populated - 'F5' or 'Refresh' populates them but the issue described persists.

To be honest, for me this is more of a curiosity than anything, but it would be nice to understand.
Just for reference: MusicBee 3.5.8631 P, AT&RT plugin 7.0.8638.34960, clean MusicBee install (as I wanted to rule out anything else I might have done on my main installation).

Thanks for any insights you might have.

boroda

  • Hero Member
  • *****
  • Posts: 4748
To be honest, for me this is more of a curiosity than anything too, because nobody else has reported this issue. but i would want to resolve it if i'm able to reproduce it.

boroda

  • Hero Member
  • *****
  • Posts: 4748
tjinc, you are right. this is quite easily and reliably reproducible. also, this concerns only using nested mb native "aggregated functions" like $Count or $Sum inside plugin functions. there are no problems in the case of using native "generic" functions. for example, i've tried the VT formula: $Sqrt($Add(<Track #>,1)) - all is working fine ($Sqrt is plugin function and $Add is native function).

p.s. it's interesting that $Sqrt function receives the string "0" (not null or whitespace) in the formula $Sqrt($Count(<Album>)).

p.p.s also, $Sqrt($Count(<Album>)) is working fine if i define any v.tag which uses $Count function in any combination with only native functions, e.g. $Add($Count(<Album>),1)

 ;D

tjinc

  • Sr. Member
  • ****
  • Posts: 383
Quote
this concerns only using nested mb native "aggregated functions" like $Count or $Sum inside plugin functions. there are no problems in the case of using native "generic" functions. for example, i've tried the VT formula: $Sqrt($Add(<Track #>,1)) - all is working fine ($Sqrt is plugin function and $Add is native function).

p.s. it's interesting that $Sqrt function receives the string "0" (not null or whitespace) in the formula $Sqrt($Count(<Album>)).

p.p.s also, $Sqrt($Count(<Album>)) is working fine if i define any v.tag which uses $Count function in any combination with only native functions, e.g. $Add($Count(<Album>),1

That's exactly what I was attempting to put across - you seem to have achieved this far more succintly (even if English is not your native language).

Thanks for checking and I am glad that you could reproduce - it means it is not me being dim! Can't say I currently have much more input on this as I have no idea where the issue originates (native MusicBee or AT&RT functions).

p.s. Just saw that you have posted this on the bugs board - thanks.
Last Edit: September 14, 2023, 07:02:39 AM by tjinc