Track # issue


#1

itunes will number tracks, "1 out of 13" Can you all your program to not just assign the track number but also how many tracks are on the cd. One way to do this might be " / 13"

Unless it can already do this and i haven't found it.

I love your program by the way. For years I have been manually renaming...that could have been cut down to days if I knew of your program.


#2

Have a closer look at the numbering assistant that you find in the menu Tools.


#3

If you already have that info in the TRACK field then you might want to backup the totaltracks into the TOTALTRACKS field. If you don't then just use action #2.

Try this group action. _Script_Test_TEST.mta (215 Bytes)
Begin Action Group _Script Test#TEST

Action #1 Actiontype 5: Format value Field ______: TOTALTRACKS Formatstring: $replace($num($if($eql($regexp(%track%,'^\d+\/\d+$','yes'),'yes'),$regexp(%track%,'^\d+\/(\d+)$','$1'),%totaltracks%),1),0,) Action #2 Actiontype 5: Format value Field ______: TRACK Formatstring: $num($fmtNum(%track%),1)

End Action Group _Script Test#TEST (2 Actions)

_Script_Test_TEST.mta (215 Bytes)


#4

I'm new to the forum, and was just searching for the tag for Total Tracks.

I have quite a few Track tags formatted as #/#, and your script worked.

I see that TOTALTRACKS is stored as a user-defined TXXX field, as shown in this capture from MP3Diags.

I created a custom column for the %TOTALTRACKS% tag, and it displays just fine.

Thank you.

Edit: I should add that I renamed your script as "Add-Edit_Total-Tracks".

Edit: I use foobar2000 as my player, with Columns UI and NGPlaylist. I hadn't noticed previously, but if I add a Total Tracks column, formatted as [%TOTALTRACK%], then foobar reads the #/# in the %track% field and displays the total # in the new Total Tracks column. I used your script on only one album, but after adding the new column, all albums with #/# display properly.

--DS


#5

After discovering that foorbar2000 properly handles #/# in the %TRACK% tag without using the script that "stevehero" shared with us, I noticed that too many of my %TRACK% tags are missing the #/# formatting, but at least have the track number. Out of 11,000+ songs, in 1,000+ folders, most also have numbers 1-9 with leading zeros.

I took the advice of "ohrenkino" and looked at the Autonumbering Wizard in the Tools menu (Ctrl-K). Using the settings shown below, it fixed the missing #/# very nicely. The folder that I tried it on had some numbers with leading zeros, and some without.

Are leading zeros a personal preference thing, or is there a recommended best practice that says either use them, or don't use them.

--DS


#6

I like leading zeros in track file name. Looking at file listings in non audio programs show files in track order instead of tracks like 10 coming before 2.


#7

Try the following action group with TRACK content like ...
123
Track 123 out of 333 tracks.
1/14
01/09
001/333
Unknown

Begin Action Group Format TRACK#Set TRACK and TOTALTRACKS

Action #1
Actiontype 5: Format value
Field ______: TEMP
Formatstring: $if($eql($regexp(%TRACK%,'^0*(\d+)$','match'),'match'),$regexp(%TRACK%,'^0*(\d+)$','$1==='),$if($eql($regexp(%TRACK%,'^\D0(\d+)\D0(\d+)\D*$','match'),'match'),$regexp(%TRACK%,'^\D0(\d+)\D0(\d+)\D*$','$1===$2'),%TRACK%'==='))'==='

Action #2
Actiontype 7: Import tag fields (guess values)
Source format __: %TEMP%
Guessing pattern: %TRACK%===%TOTALTRACKS%===%TEMP%

End Action Group Format TRACK#Set TRACK and TOTALTRACKS (2 Actions)

DD.20121225.1655.CET


#8

I agree for file names. But for MP3 tags, I was thinking that no leading zeros might be best. But foobar2000 uses leading zeros regardless of what the tag shows, so I'll be using leading zeros in the MP3Tag Autonumbering Wizard.

DetlevD: I was trying to figure out regular expressions for this purpose, but your action beat me to it.

Thanks for your help.

--DS


#9

I use leading zeros in my tags too for both flac and mp3. Works with everything I use.


#10

Is there a way to only change single digit tracks to leading zeros (#/## to ##/##) to what is already in the track number. Some of my folders have only one or two songs from an album that originally had 15 songs, but I want to preserve the original track number.

I've tried the different settings in Autonumbering wizard, but it only counts the total count.

--DS


#11

See scripting function $num, e. g. $num(%TRACK%,2).

DD.20121225.1904.CET

You may apply the following action group to adjust the format of a tag-field TRACK with a given format from ...
"#/##" to "##/##"
"#/###" to "###/###"
"#/####" to "####/####"
... and so forth.

It helps to understand the string "#/##" as a list of numbers separated by the slash character.
The first number of the given number list will be prepended with zero digits to reach the width of the second number.

Begin Action Group Format TRACK#Format TRACK #.## to ##.##

Action #1
Actiontype 5: Format value
Field ______: TEMP
Formatstring: $replace(%TRACK%,'/','\\')

Action #2
Actiontype 5: Format value
Field ______: TRACK
Formatstring: $num($meta(TEMP,0),$len($meta(TEMP,1)))'/'$meta(TEMP,1)

Action #3
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TEMP

End Action Group Format TRACK#Format TRACK #.## to ##.## (3 Actions)

DD.20121227.0915.CET