Author Topic: Additional Tagging & Reporting Tools  (Read 917272 times)

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Hello, I'm getting Out of Memory Exception when I try to Backup tags for all tracks.
I have 32 Gb of RAM and about 22% is being used when this happens.
The process starts, then between 30-40 % it halts giving error.
Code
16/09/2021 19:22:34 - 10.0.19043.0 - 3.4.7805.33439D - System.OutOfMemoryException: Generata eccezione di tipo 'System.OutOfMemoryException'.
   in System.Collections.Generic.SortedSet`1.AddIfNotPresent(T item)
   in System.Collections.Generic.TreeSet`1.AddIfNotPresent(T item)
   in System.Collections.Generic.SortedDictionary`2.Add(TKey key, TValue value)
   in MusicBeePlugin.BackupType.setValue(String valueParam, Int32 trackId, Int32 tagId)
   in MusicBeePlugin.BackupIndex.saveBackup(String backupName, String statusbarText, Boolean isAutocreatedParam)
   in MusicBeePlugin.BackupIndex.saveBackupAsync(Object parameters)
   in #=zlFwaJ1S_oYR_8J8laA==.#=zyNO4kjvnVZVY6HOBVD_9GiRtxZo6os9OGA==(Object #=zK7i1NeE=)


try not to back up artworks

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Can you help me in calculating the total duration based on track length and play count? (Track duration x play count)

I'm not sure how to do this. Tried this so far but this doesn't work: $AddDuration(<Play Count>,<Time>)

I want it to show 0:00 (or nothing) when the play count is 0, since, well, no time was spent listening to the song.

As well, I want it to show the sum of the time listened to all highlighted tracks, so if I highlight an album of 100 minutes where I've listened to every track 10 times, for example, it will show 1000 minutes time listened.

I made a post about it here https://getmusicbee.com/forum/index.php?topic=35695.msg195187#msg195187 but it might be better asking here.
redownload latest plugin version, use formula: $MulDuration(<Time>,<Play Count>)

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Hi

I'd like to copy everything before (or after) a certain character to another tag, using only a single step. Would this be possible to do via Multiple S&R? This title could serve as an example:

Concerto no. 4 in E major, RV 263a∶ II. Largo

I'd like to copy everything before the ":" to the <set subtitle>. As of now, I use the Copy Tags, and then the ATRT command "remove after...", but I'd like to everything in a single step if possible.

All help much appreciated!
try multiple search & replace, you can achieve this in 2 steps.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
In Change Case I couldn't manage to realize the following examples:

T'Aggio → t'Aggio



No matter what I have tried, it didn't change at all. Same as L'Amour → l'Amour didn't work either.
I have put t in the exception list, and ' in the word splitter list. Any idea?
untick "or only words" option

boroda

  • Sr. Member
  • ****
  • Posts: 4595
But I am wondering to achieve this in advanced search and replace. However I couldn't figure out what to use in regular expressions for setting upper case or lower case in "replace" field. The only guide for case change in this forum is not clear with the regular expressions.
redownload latest plugin version, use "$Capitalize(string)" or "$UpperCase(string)" or "$LowerCase(string)" in virtual tag or ASR preset. 

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Is there a way of getting ATRT to be able to edit Instruments: Performer and similar tags?
use in search pattern .*(\0\u0002.*) to find performer(s) in artist tag and plugin's functions \@null[[]]\@char[[2]] in replace pattern to write performer(s) in artist tag.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Is there a way of getting ATRT to be able to edit Instruments: Performer and similar tags?
'Instruments: Performer' is a virtual tag used by MusicBee for displaying purposes.
If you edit 'Artists: Performer', the results should be reflected in 'Instruments: Performer'.
not at all. mb api uses string for artists where individual artists are separated by U+0000 char and performers names start with U+0002 char.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
Presets are there to make some common operations available, but more importantly, they have the purpose to be an example and can be used as a template (copy them) to create a preset that does specifically what you want.
So you would either need to learn how to create such a preset yourself, or ask others to help you with it.
Absolutely, I'm with you on this. However, if I reformulate my question, how come that some presets (on my setup, only Example: Write result of virtual tag expression defined in <Custom text 1> to <Tag 2>) list all virtual tags in the <tag 1> drop-down, while all others don't? For example, I'm trying to use your recent preset for adding values to tags, but Artist:Performer simply isn't there.
Artist:Performer is some kind of virtual tag, so it's read-only. to *write* Artist:Performer to Artist tag add \@null[[]]\@char[[3]] to the beginning of performer name (if you use ASR).
Last Edit: June 07, 2022, 08:29:18 PM by boroda

boroda

  • Sr. Member
  • ****
  • Posts: 4595
I use additional tagging tools so much that I forget that it's a plugin and not part of MusicBee. In fact, I was close to ditching MusicBee until I found it. The stuff that works is <Chef's Kiss>. To answer the questions;

I'm never certain about anything, so I removed and reinstalled the latest version.
I think my most recent successful backup was in the beginning of 2021, so it worked at one time.
I use the other features of Advanced tagging constantly. Especially "Advanced Find and Replace," "Reports," and "copy / Paste tags."

I was poking around and created a temporary library to test with. That one worked perfectly. I must be running into a limit based on my library size. It would explain why it worked just fine for a while; my library continues to grow.
try to disable backing up artworks, probably one or several tracks have corrupted artworks. corrupted artworks very frequently cause 'out of memory' errors (in .net in general, not only in at&rt plugin).

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
use "$Capitalize(string)" or "$UpperCase(string)" or "$LowerCase(string)" in virtual tag or ASR preset.
1.
$Upper and $Lower are already available by default in MusicBee.
Are these two new ones doing something different?

2.
$Capitalise is doing 'sentence case', correct?
Not 'word case'.
Perhaps it would be good to have both options available.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
1.
$Upper and $Lower are already available by default in MusicBee.
Are these two new ones doing something different?
i'll remove $UpperCase(string) or $LowerCase(string) functions from plugin.

2.
$Capitalise is doing 'sentence case', correct?
Not 'word case'.
Perhaps it would be good to have both options available.
sentence case.

boroda

  • Sr. Member
  • ****
  • Posts: 4595

barlet

  • Jr. Member
  • **
  • Posts: 120
The following error was thrown today when invoking Advanced Tagging Tools;

MusicBee v3.5.8167.33754P  (Win10.0), 12 Jun 2022 18:55:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MusicBeePlugin.SettingsPlugin.InitializeComponent()
   at MusicBeePlugin.SettingsPlugin..ctor(Plugin TagToolsPluginParam, PluginInfo aboutParam)
   at MusicBeePlugin.Plugin.Configure(IntPtr panelHandle)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at #=zoKrwgApZgrpBSGsmYQ==.#=zJ9TUB2A=(IntPtr #=zPAzIZva3ahh8)

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9302
The following error was thrown today when invoking Advanced Tagging Tools;
Searching the forum before posting is always a good idea.
As is posting bug reports in the plugin's thread.
https://getmusicbee.com/forum/index.php?topic=35245.0
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

alec.tron

  • Sr. Member
  • ****
  • Posts: 752

So what the 'script' is meant to do:
- it's based on one of the default combine scripts
- it's meant to take the rating (star) value [with half-stars] as numerical [not the actual numerical rating value - which it always just worked, regardless of the format - since id3 & vorbis have different absolute rating values, I assumed this was some magic musicbee api bit inbetween that was converting this correctly...]
- then, take a numeric value from a second [custom] field (call 'Energy' that could have values from 0 -10)
- then combine the 2 with a ' - ' inbetween and write them to 2 other fields (so '10 - 5' would be the resulting tag value for a 5 star rated track, with an Energy value of 10...)

What it now does:
- the energy value gets always written correctly still
As for the weird bits:
- the star value now gets written as:
   - sometimes the numerical value (only on flac files, I have not seen this happen on id3 tags, so a vorbis rating of 60 for a 3 star track, 20 for a 1 star track, etc pp)
   - sometimes the rating value gets written as 1 (regardless of the actual rating / star value)
- on top, IF the rating value gets written as 1, the [custom text 1] ' - ' always gets written twice [minus a ' '...], resulting in '10 - - 1' [instead of '10 - 5']

So, in the above example track [with 10 & 5 respectively] I may end up with '10 - - 1' or,  ' 10 - 100'
I'm a tad lost there.


flac, mp3 and ogg and various combinations of them.
Thanks muchly for testing. (which Advanced Tag & Reporting Tool version are you using, out of curiousity ? Not 100% certain if I am on the latest version Boroda published... and that could be a last option to try - as that's so odd that I get a random mix of absolute as well as properly parsed (star count) values from rating fields.)

Eh - I found part of the problem - this only happens to flac files when the ASR preset is run in the inbox. As soon as I run the same scripts on flac files in a playlist or library, all is fine and the rating gets written as the star equivalent as usual.
Which gives me a work around - in case this helps anyone else
c.

ps. welcome back Boroda!