How to make a cue file from MP3 with added up time index

I need to generate a .txt file from a folder with MP3 in this format:

  1. "Time to Relax" 00:00
  2. "Nitro (Youth Energy)" 00:25
  3. "Bad Habit" 02:52
  4. "Gotta Get Away" 06:36
  5. "Genocide" 10:28
  6. "Something to Believe In" 14:01
  7. "Come Out and Play" 17:19
  8. "Self Esteem" 20:37
  9. "It'll Be a Long Time" 24:55
  10. "Killboy Powerhead" 27:38
  11. "What Happened to You?" 29:41
  12. "So Alone" 31:53
  13. "Not the One" 33:11
  14. "Smash" 36:03

As you can see it doesn't list the total time of each song but the "time index" of the complete album, the time at which each song starts in the album as a whole.

This should be possible with mp3tag but I just can't do it. If not possible with mp3tag is the an other way?

There is a zip file, which contains some export scripts, you will find your problem solved by script #9 ...
Timestamps erstellen?

DD.20140413.0945.CEST

I have absolutely no idea what to do with this zip file. Tracklist.Starttime.9.txt is exactly what I need but I have no idea what to do with the mte files!

I've copied the mte file into C:\Users{user name}\AppData\Roaming\Mp3tag

I think that's what I needed to do? So how do I use it?

I've got it, brilliant!

You're my hero!

For other users:
Copy the Export.TXT.20140309.Tracklist.Starttime.9.mte file into:
C:\Users{user name}\AppData\Roaming\Mp3tag

Now open mp3tag, load a folder with mp3's, click export, select Export.TXT.20140309.Tracklist.Starttime.9 in the box and press ok!

It works for MP3 taken from CD's but with music taken from old LP's and 7"EP's it completely messes up.

I get exports like this:

6. "Thrill of it all" 00:00

2. "Self Oppression" 00:39

7. "The Masses" 01:58

5. "Are you ready" 02:43

4. "We don't have to" 03:35
8. "Kill Corps" 04:03

3. "I don't wanna work" 04:39

1. "I hate everything" 05:26

Everything is messed up, wrong titles, wrong numbers, wrong time, extra breaks in between the lines?!

Is there a way to solve this?

I do not understand, don't we speaking of digital music, where tracks are numbered by integer numbers from 1 to last track?

I can not guess what your real situation looks like, a practical example is needed.
Maybe it has something to do with the order of the loops and/or your method of numbering tracks.

Hmm, if you are working with a compilation set, then you may try to remove those code lines from the export script, which do the sorting on ARTIST and ALBUM ...

$loop(%ARTIST%)$replace(
$loop(%ALBUM%)$replace(

,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))$loopend()

... or ...
if you have filled the tag-field ALBUMARTIST with "Various Artists" or such another constant name, ...
then replace the one line in the script regarding sorting ARTIST ...

From:
$loop(%ARTIST%)$replace(
To:
$loop($if2(%ALBUMARTIST%,%ARTIST%))$replace(

DD.20140413.1418.CEST, DD.20140413.1831.CEST

I have added an example, these are mp3 tracks taken from an old 7"EP. As you can see it generates the wrong names and times. (reencoded and shortened the tracks to fit the max ul size but is still makes the errors).

Here's the complete ep also non cut:

Example.rar (4.56 KB)

Thank you, I got it, you can remove the link, my answer see above post #7.

DD.20140413.1435.CEST

I've tried to remove these lines and it didn't work:

$loop(%ARTIST%)$replace(
$loop(%ALBUM%)$replace(

,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))$loopend()

$filename($getEnv('USERPROFILE')'\Desktop\Tracklist.Starttime.9.txt',UTF-8)$puts(info,'This script is a modified "Tracklist.Starttime.2.txt"')$puts(
)$loop(1,1)$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$puts(SumSec,0)$puts(AlbumCount,0)$loopend()$replace(

$puts(AlbumCount,$add(1,$get(AlbumCount)))$ifgreater($get(AlbumCount),1,$get(br),)
$loop($num(%TRACK%,3))$replace(

$num(%TRACK%,1)'. '
'"'%TITLE%'" '
$num($div($get(SumSec),60),2)':'
$num($mod($get(SumSec),60),2)$get(br)

$puts(SumSec,$add($get(SumSec),%_length_seconds%))

,$get(crlf),,$get(br),$get(crlf))$loopend()
,$get(crlf),,$get(br),$get(crlf))

I can't find your second example code line in the file:
$loop($if2(%ALBUMARTIST%,%ARTIST%))$replace(

Hmm, removing the two loop/loopend statements does work for me, see picture ...



... but this change should not need to be done.

I have used your request as an opportunity to adjust all the other example export scripts in the zip package, so that the one sorting loop uses an existing ALBUMARTIST as the first choice, otherwise uses the ARTIST.

DD.20140413.1550.CEST


My apologies, I was using it on another album. It does now work for the example I sent you but it still doesn't work for the rest!

New example, here the titles are missing and the times are miscalculated:
link deleted

Hmm, I've tried your 2nd example file package, and I got all over successful result.


Your second set of files represents a really hardcore test, because there is no tag-value available to control any loop, there is only the filename.

For such cases you may change the script to use a loop statement for the placeholder ...
%_filename_ext% or %_path%.

You may change the code line ...

From:
$loop($if2(%ALBUMARTIST%,%ARTIST%))$replace(
To:
$loop($if2(%ALBUMARTIST%,$if2(%ARTIST%,%_path%)))$replace(

... so that the one sorting loop uses an existing ALBUMARTIST as the first choice, ...
then uses an existing ARTIST as the second choice, ...
otherwise uses the filepath as is.
This assumes that all selected files have the same data format.

Note: Using %_path% or %_filename_ext% in the second $if2 expression creates one extra CRLF in the report. I think this is a Mp3tag bug.

Better you use several adapted export scripts, one for each special case.

DD.20140413.1830.CEST


I'm sorry, Im not a programmer myself!

I can't find the line I should replace:
$loop($if2(%ALBUMARTIST%,%ARTIST%))$replace(

I've been categorising the errors I get:

-The solution you posted in Post#7 for Example1 turned out to fix about 30% of my rogue LP's, sometimes the track numbers are missing or the titles but that's not the biggest problem as long as it calculates the track lenghts!

-Example2 turned out to be very rare so maybe if it's too difficult to fix you shouldn't!

-There's another big group where the titles and the numbering are ok but something goes wrong in the time calculation:

If there's an easy solution for this last example it would be a big help!

The errors seems to be the result of bad formatted or not existing metadata in the media files.

A script always works only as good as its input data. The given export script expects media files, which are well tagged, want to say album, artist, track number should be available as tag fields, to get the sorting correct, in case of more than one album or folder has been selected.

I am sure that my offered export scripts are not ready for every case in the universe ... and if a ready made script does not work in your environment, then feel free to change it to your needs ... and share your adaption with us.

I have already adjusted the export scripts in the zip package, so that they can work with a compilation set, when the files have set a tag-field ALBUMARTIST.

Before releasing I did not made any test with the export scripts using media files, having no tag data at all.
But ... surprise ... see above post #13 ... the export script already works successfully with your 2nd example file package, with files bare of any metadata tag-fields.

We can try to make the export scripts universally usable for all crooked cases you can think of.
Try to explain the different cases.

DD.20140414.0818.CEST

Here is an export script, which takes the files as selected in Mp3tag and sorts them by their filepath.

01: $filename($getEnv('USERPROFILE')'\Desktop\Tracklist.Starttime.0.txt',UTF-8)$puts(

02: )$loop(1,1)$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$puts(SumSec,0)$loopend()$replace(
03: $loop(%_path%)$replace(
04:
05: $num(%_counter%,1)'. '
06: '"'%_filename_ext%'" '
07: $num($div($get(SumSec),60),2)':'
08: $num($mod($get(SumSec),60),2)$get(br)
09:
10: $puts(SumSec,$add($get(SumSec),%_length_seconds%))
11:
12: ,$get(crlf),,$get(br),$get(crlf))$loopend()
13: ,$get(crlf),,$get(br),$get(crlf))

Here is an export script, which takes the files as manually arranged and selected in Mp3tag.

01: $filename($getEnv('USERPROFILE')'\Desktop\Tracklist.Starttime.0.txt',UTF-8)$puts(

02: )$loop(1,1)$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$puts(SumSec,0)$loopend()$replace(
03: $loop(1)$replace(
04:
05: $num(%_counter%,1)'. '
06: '"'%_filename_ext%'" '
07: $num($div($get(SumSec),60),2)':'
08: $num($mod($get(SumSec),60),2)$get(br)
09:
10: $puts(SumSec,$add($get(SumSec),%_length_seconds%))
11:
12: ,$get(crlf),,$get(br),$get(crlf))$loopend()
13: ,$get(crlf),,$get(br),$get(crlf))

DD.20140414.1042.CEST

Haha pfff that took some time figuring out but it seems it's not your fault! Apologies for this!

-mp3tag is sometimes 1 or 2 seconds wrong on the actual time of the mp3's so towards the end of the LP the calculation can be up to 20secs of.

-encoding problem with long time gaps, my fault!

-Wrong tag info on the numbering, nothing can be done, should just correct the numbers manually.

-Somehow track order went wrong in video, my fault!

Want to thank you again for the script!

Great, thanx for the filepath script as well!

Please name me an application, which displays the "actual time of the mp3's". :wink:

DD.20140414.1112.CEST