Flatten Track#s for multiple disc sets

I am not sure if this can be done or not, but I would certainly like to try.

I have a 4 disc set, and I would like to 'flatten' the track#s such that, say disc 1 has 12 tracks, the track #s for disc 2 will start at 13, and so on for the rest of the discs.

Is there a way within the MP3Tag scripting environment to do that programatically (is 'programatically' even a word??)?

I am trying to think of at least an algorithm that would do it, then try to figure out HOW to do it on MP3Tag.

See the track numbering wizard and its various settings.
Or see an action of the type "Format value" for TRACK with a format string containing %_counter%

1 Like

Thank you! I hadn't even gotten to looking at that!

Knowing what an awesome program this is, I knew that there would be a way.

Unfortunately, this will only work if all tracks are available as files. If a single one is missing, all subsequent numbers will be off. If MP3Tag had a $max() function or a %_track_total% variable, it could work wherever the last track of the previous disc was available. This caveat could be overcome if the track numbers are stored with the total number of tracks on that medium, e. g. 11/18, and if MP3Tag offered a simple way to access that piece of information.

I do not see anything unfortunate about the requested function: a sequential row of numbers.
To revert that to the original numbers, you would have to consult other sources of information (e.g. you store also the discnumber and use that as indicator).

I also do not see the benefit of

in this context - what would a number like 13/12 deliver as sensible information? (Where I assume that you keep the totals of the individual disc but renumber each TRACK so that you have the smooth sequence as the OP requested).

If I wanted to keep the old track numbers but still get the order of the CDs - and not listen to all the number 1 tracks from each disc and then the number 2 ones - I would add the discnumber in front of TRACK so that the first track from the first CD becomes 101, the second 102, the ones from the second CD 201, 202, 203 ...
Like that you keep the original data in TRACK (and see perhaps even the gaps) and have all CD tracks in sequence.
If you do not like that big number in TRACK anymore, you can easily remove it with an action of the type "Format value" for TRACK
Format string: $num($mod(%track%,100),2)

Personally, I prefer “1.23” over “123”, although CDs are limited to 99 tracks, making the latter unambiguous as well. $if2(%contentgroup%,$if2(%albumartistsort%,$if2(%albumartist%,$if2(%artistsort%,%artist%))))\$if(%album%,$if2(%releasetime%,%year%) $if2(%albumsort%,%album%)[ (%setsubtitle%)]\,)[%discnumber%.]$num(%track%,2) $if2(%titlesort%,%title%)[ ([%mixartist% ]%subtitle%[ %origartist%][ - %origyear%][ %origalbum%])]

Anyway, my point was, that in, for instance,

  • 1/2.01/05 foo
  • 1/2.02/05 bar
  • 1/2.04/05 baz
  • 2/2.01/01 quz

your approach would yield

  • 01 foo
  • 02 bar
  • 03 baz
  • 04 quz

which might be fine, whereas something like $max(%track%,%discnumber%==1) = 4 would yield

  • 01 foo
  • 02 bar
  • 03 baz
  • 05 quz


  • 01 foo
  • 02 bar
  • 04 baz
  • 05 quz

and when respecting the part after the forward slash, it would give

  • 01 foo
  • 02 bar
  • 04 baz
  • 06 quz

This way, missing tracks can easily be added later. Iʼm frequently downloading recently aired episodes from the broadcasterʼs library and it may take a while until all of them have become available, sometimes being released in random order.