Help with ML reorganization

Hi all guys, I'd like to reorganize my music library but I'm a real noob when it comes to regexs.
Well, all my mp3s are in a big folder and are properly tagged.
I would like to put them in a directory structure like this:

+%Album artist%
.....+%Album title% (published in %year%)
..........+if there are more discs -> Disc %disc% of %totaldisc%,
_______if there's just one disc -> nothing
_______and in both cases after the two options above (after the comma) ->
_______track %track% of %totaltrack%. %actualfilenamewithext%
+%Composer%
.....+Composed in %year%
..........+%actualfilenamewithext%

I hope I've been clear the most. I want to underline that mp3s with %albumartist% do not have %composer% tag and viceversa, I hope this helps.

TIA to everybody willing to spend time for this (at least for me) challenge.

Your description was helpful, and there are properly tagged files.
So you may try following actiongroup.

  1. Choose a subset of your files to play around with and be aware to loose them.
  2. Choose a rootfolder where the new tree of files should be created, write it to action #1.
  3. Run the actiongroup (note: modify action #3 for test mode).
  4. Check if FILENAME_NEW contains the filepathes you need.
  5. If all looks good, then run the actiongroup (note: modify action #3 for reality mode).
  6. Ready.

Begin Actiongroup TEST

Action #1
Actiontype 5: Format tag field
Field: RF
Formatstring: O:\TEST\ROOTFOLDER (choose a rootfolder of your own)

Action #2
Actiontype 5: Format tag field
Field: FILENAME_NEW
Formatstring: $if(%composer%,%rf%\%composer%\%year%\%_filename_ext%,$ifgreater(%totaldisc%,1,%rf%\%albumartist%\%albumtitle%÷'('%year%')'\disc÷%disc%÷of÷%totaldisc%','÷track÷%track%÷of÷%totaltrack%.÷%_filename_ext%,%rf%\%albumartist%\%albumtitle%÷'('%year%')'\track÷%track%÷of÷%totaltrack%.÷%_filename_ext%))

Action #3
Actiontype 5: Format tag field
Field: _FILENAME
Formatstring: %_FILENAME% (should change nothing while testing)

Action #3
Actiontype 5: Format tag field
Field: _FILENAME
Formatstring: %FILENAME_NEW% (create new foldertree and move files)

Action #4
Actiontype 9: Remove fields
Fields to remove (semicolon separated): RF;FILENAME_NEW

Note: Replace one special character ÷ with one space character.
End Actiongroup TEST (4 Actions)

Good luck!
DD.20080318.1928.CET

Ok, you look pro with regexs, but I'm a user who wants to understand what he does and the more I play with the more problem rise.
Well the first problem comes from track numbers, the way you decribed produces results like xxy in the filename from xx/y looking tags. Then the discnumber doesn't show in case of multicd album.
I played a little and discovered that I can do the work even from the tag->filename panel, and digging in the forum I discovered several interesting formatting inputs.

%band%\%album% '('%year%')'$validate(%track%, of ). %_filename%

A good base for my job, but it lacks the condition band vs composer, the discnumber condition, plus I'd want it to show two-digit track numbers. Here's what I'm trying to obtain:

Normal music has the %band% field, so

%band%\%album% '('%year%')'*something for discnumber with the validate thing for removing the slash*$validate(%track%, of ). %_filename%

Example: "The Who\Quadrophenia (1973)\Disc 1 of 2, track 01 of 10. The Who - I Am the Sea.mp3"

Classical music has the %composer% field, so

%composer%\Composed in %year\%_filename%
That's easier, I just need to merge it with the above one.

There was no regexp involved, this was just plain use of your given tagfield names and two functions $if() and $ifgreater() and your given logic.

I know that the TRACK tag field can be formatted as 'n' (track) or somewhat like 'nn/nn' (track/totaltracks) (so DISCNUMBER too), but you've said that you have properly filled tags on which you have referred going along with your description.

And I thought you are familiar with Mp3tag and tagging in general, so you should know that a DISCNUMBER tag field is a user field, that you have to fill in with proper values (so far as I know).

Avoid such filenames, I do not think that they are sortable in correct order.

You may play around with the following actiongroup.

Begin Actiongroup TEST

Action #1
Actiontype 5: Format tag field
Field: TMP_RF
Formatstring: O:\TEST\ROOTFOLDER

Action #2
Actiontype 5: Format tag field
Field: TMP_T
Formatstring: $regexp(%track%,0*(\d+)/0*(\d+),$1)

Action #3
Actiontype 5: Format tag field
Field: TMP_TT
Formatstring: $regexp(%track%,0*(\d+)/0*(\d+),$2)

Action #4
Actiontype 5: Format tag field
Field: TMP_D
Formatstring: $regexp(%discnumber%,0*(\d+)/0*(\d+),$1)

Action #5
Actiontype 5: Format tag field
Field: TMP_DT
Formatstring: $regexp(%discnumber%,0*(\d+)/0*(\d+),$2)

Action #6
Actiontype 5: Format tag field
Field: TMP_FN
Formatstring: $if(%composer%,%TMP_RF%\%composer%\%year%\%filename_ext%,$ifgreater(%TMP_DT%,1,%TMP_RF%\%artist%\%album%÷'('%year%')'\D.%TMP_DT%.%TMP_D%''T.%TMP_TT%.%TMP_T%'_'%filename_ext%,%TMP_RF%\%artist%\%album%÷'('%year%')'\T.%TMP_TT%.%TMP_T%''%_filename_ext%))

Action #7
Actiontype 5: Format tag field
Field: _FILENAME
Formatstring: %TMP_FN%

Action #8
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TMP_RF;TMP_T;TMP_TT;TMP_D;TMP_DT;TMP_FN

Note: Replace one special character ÷ with one space character.
End Actiongroup TEST (8 Actions)

DD.20080319.1621.CET

Oh yeah, now I've understood the logic behind that all! Works perfectly now, thanks!

A simpler solution (since classical music mp3s are less I can select'em by myself):

%band%$validate(%album%,-) (%year%)[\Disco [$num(%discnumber%,1)]][$num(%track%,2)]. %_filename%

%composer%\%year%\%_filename%