# Flatten Track#s for multiple disc sets

**URL:** <https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165>\
**Category:** Support\
**Created:** [November 26, 2019, 5:59pm UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165 "2019-11-26T17:59:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lugosi84](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/848f3c/32.png) [@Lugosi84](https://community.mp3tag.de/u/Lugosi84)\
**Post date:** [November 26, 2019, 5:59pm UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/1 "2019-11-26T17:59:36Z")

</div>

Hello,  
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.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 26, 2019, 6:01pm UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/2 "2019-11-26T18:01:39Z")

</div>

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%

---

<div class="post-metadata">

**Author:** ![Lugosi84](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/848f3c/32.png) [@Lugosi84](https://community.mp3tag.de/u/Lugosi84)\
**Post date:** [November 26, 2019, 6:04pm UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/3 "2019-11-26T18:04:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)\
**Post date:** [November 27, 2019, 5:44am UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/4 "2019-11-27T05:44:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 27, 2019, 5:55am UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/5 "2019-11-27T05:55:59Z")

</div>

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

> [@Crissov](#):
>
> `$max()` function or a `%_track_total% variable`

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)

---

<div class="post-metadata">

**Author:** ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)\
**Post date:** [November 27, 2019, 9:00am UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/6 "2019-11-27T09:00:13Z")

</div>

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

or

- 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.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/flatten-track-s-for-multiple-disc-sets/47165/7 "2026-02-09T12:28:20Z")

</div>


