Export Loop question

I am just starting to learn this export function and it works REALLY great (been using Mp3tag for years now so never old to learn hahahahaha)

I have this export script (MTE)

$filename(txt,utf-8)

Quality/Bitrate: %_bitrate%
Size: %_total_size%
Length: %_total_time%
Files: %_total_files%

$loop(%_path%)[CD $num(%discnumber%,01)] 'Track'  %track%. %artist% - %title%	'['%_length%']'
$loopend()

How can I make it that for every CD only one time the "CD & Disc number" is printed, for example like this

CD 1

Track 1 test - test [1:30]
Track 2
etc etc

CD 2

Track 1 test1 - test1 [1:10]
etc
etc
etc

TiA

$loop(%_path%)[CD $num(%discnumber%,01)] 'Track'  %track%. %artist% - %title%	'['%_length%']'
$loopend()

->

$loop(%_path%)$loop(%discnumber%,1)[CD $num(%discnumber%,01)] $loop($num(%track%,3))'Track'  %track%. %artist% - %title%	'['%_length%']'
$loopend()$loopend()$loopend()
1 Like

Wow a bit more complicated then I thought but it makes sense.

Another question if I may, does this go Disc 1->2->3->4 or random!

First you sort by the path ... and if in that path there are files with a discnumber, then this is sorted, ascending, but each number is taken only once. Then the entries for TRACK are sorted, also ascending.

I would say that this is not random (which you could easily try out).
What puzzles me is the first sort criterion _PATH - wouldn't $loop(%albumartist%%album%) make much more sense?

Please do notice this is my first steps on the export path :wink:

It's a compilation of all different artist

CD 1 has artist a, artist b and artist c
CD 2 has artist c and artist d
CD 3 has artist e
etc etc

If I did %albumartist%%album% wouldn't that ... things up?

Not, if ALBUMARTIST is filled with decent data, e.g. "Various Artists" for a compilation.
Alternatively, you could sort by %album%$num(%discnumber%,1) - but there I see the problem that "Greatest Hits" may be sorted all into 1 group.
But I don't know what your data looks like, perhaps _PATH is the best initial criterion.

Thx

I am not using Various Artists

I am only using very BASIC for this one

artist
title
Album Title (same across the whole compilation)
track number (2 digits so no Track/Total Tracks)
Genre
CD Number (2 digits only so no DISC/Total Discs)

and that is it.

edit: So I want sorted by CD nr (low to high) and per CD per track number (also low to high (with 1 being low :rofl:

Have you tried my initial proposition?

Not yet sorry!

We have a massive Thunder storm here, and everything except my laptop is shutdown!

Will of course report back (count on it :wink:)

AlbumArtist is an essential field for most current players. This is the field that will allow their libraries to distinguish common album title like Greatest Hits, but even some others like “Faith” by both Faith Hill and George Michael as an example. For most albums you can simply copy the value you already have from the Artist field. Be sure to remove any contributing artists, etc.

Deciding on an appropriate AlbumArtist name for your library to assign to compilation albums is also key to ensuring good library management. The most common one is “Various Artists” but you can decide what works best for you.

Once you have this field, creating directory folder structures becomes a very simple task.

I am not creating a Directory Structure. I am just creating a text file with the listing of the CD's under divided by CD Nr and within the CD the Tracks sorted by Number 1

It is the same concept whether you are updating the file directory, or exporting the data - if you want to keep the albums grouped together the common factor is a consistent AlbumArtist field. If you make this update it will be much easier to do anything else later on.

Sorry but that did not do it

This is whole script

$filename(txt,utf-8)

$loop(%_path%)$loop(%discnumber%,1)[CD $num(%discnumber%,01)] $loop($num(%track%,3))'Track'  %track%. %artist% - %title%	'['%_length%']'
$loopend()$loopend()$loopend()

Output was this

CD 1 Track 01. Artist 1 - "track1" [01:01]
CD 1 Track 02. Artist 1 - "track2" [01:01]
etc etc etc

Edit: I changed path for %albumartist%%album% and that messes it completely BUT we are almost there :wink:

CD 23 Track 1. blahahahahahaha
Track 2. blahahaha
Track 3. blah
CD 6 Track 1. blahblahblah
Track 2. blahahaha
Track 3. blah

See the sorting

Ps: AlbumArtist I have set NOT to various but to the actual performer

This one seems to do the trick

$loop(%discnumber%)$loop(%discnumber%,1)[CD $num(%discnumber%,01)] $loop($num(%track%,3))'Track'  %track%. %artist% - %title%	'['%_length%']'
$loopend()$loopend()$loopend()

I do not see the logic in looping the discnumber twice ... but if you are satisfied - ok.
I mentioned the sorting criterion

before I knew that you have not filled ALBUMARTIST. See the discussion wit @MotleyG why the lack of data in that field is not the optimum way.

You asked about the loops - and I think you see now how they work.

I was just experimenting because you comment about _path, so I have no idea either why it loops twice, but it works

With some (cosmetic tweaking) I now get this

CD 1

Track 1 artist1 - test1 [1:30]
Track 2 artist2 - test2 [1:10]
etc etc

CD 2

Track 1 artist2 - testx [3:10]
Track 1 artist3 - testxy [1:11]
etc
etc
etc

Thx for the help

Ps: This is not for my own use, my Files have a lot more fields in them.

Edit: I think know why the loop 2x

The Dir structure on the drive is

01
\Track 1
etc
02
\Track 1
etc
03
\Track 1
etc
etc etc etc

Does that makes sense?

If you dare, you could leave out the $loop(%discnumber%,1)

1 Like

Of course I dare because I already have the desired result :wink:

I guess that would mean removing out 1 loopend?

Exactly. The $loop(%discnumber%,1) would limit the occurrance of the sort criterion to the first incidence. But as you alread sorted by path which most likely also includes the discnumber, further limitatons would not be necessary.

1 Like

Yep Suc6

Removed $loop(%discnumber%) and 1 $loopend() and got the same results!!

Thx for the help, really appreciated!