No track number on files when saved with clustering

Like the title says. I have a lot of music that is too obscure to find metadata on. When I try to save with clustering my files are not renamed with tracknumber. Only title. Please help! Thank you!

Hi Robfan.
More experienced volunteers will be along soon.
Do your files have track number meta-data already?
Have a read of
https://picard.musicbrainz.org/docs/options/
Tags/Before Tagging/

Clear existing tags: Checking this will remove all existing metadata and leave your files with only MusicBrainz metadata. Information you may have added through another media player such as genre, comments or ratings will be removed.
Remove ID3 tags from FLAC files: Check to remove ID3 tags from FLAC files – Vorbis Comments are recommended for FLAC files. Picard will write Vorbis Comments to FLACs regardless of this setting.
Remove APEv2 tags from MP3 files: Check to remove APEv2 tags from MP3 files – ID3 is recommended for MP3s. Picard will write ID3 tags to MP3s regardless of this setting.
Preserve these tags from being cleared or overwritten with MusicBrainz data: This is an advanced option: If you have tags which you need to preserve, enter their names here to stop Picard from overwriting them._

The much slower, perhaps a long term project, is to add your music to the database.
The advantages of that process include:
You will know your music better.
You can very pretty easily update your tags in the future to benefit from others’ additions on Musicbrainz to the releases you have.

3 Likes

If I understand correctly you just cluster your files, than hit save, right? Clustering by itself does nothing to your files, it just uses existing tags in your files to guess which files belong together. When saving it just uses your already existing tags to save and rename, and if there are no existing track number tags the saved filenames also can’t have track numbers.

What you actually should do after clustering is selecting the clusters and then use the “lookup” button. This will search for releases on MusicBrainz matching your clusters, load the data for those releases into the right pane and move your files from the left pane in that right pane matched to the loaded releases. You can then check if everything was matched correctly and save.

General rule: The left pane where you also see the clusters just holds your files with existing tags. You can manually edit tags there, but as long as the files stay in this pane Picard will not use anything from MusicBrainz.org.
The right pane shows data (release and track metadata) loaded from MusicBrainz. Only if you files are matched to those track will they use he new tags from MusicBrainz when being saved.

1 Like

Thank you for your answer. I already knew this. The thing is I have tags, filenames, tracknumbers etc but musicbrainz cant scrobble the info because the releases doesn’t exist. The saving from the cluster pane seems to do part of the job. It makes the folders, renames the files. The only thing missing is the tracknumbers. The filenaming code is set at default. Any ideas or should I just use other software when I have pre existing tags?

I assume you mean that they don’t (currently) exist in the MusicBrainz database, to which the answer is that you should add them to the MusicBrainz database:
https://musicbrainz.org/doc/How_to_Add_a_Release

That’s a good idea of course! Is that ok to do even if I only have minimal info? No year, no publisher etc.

Are you sure your files have track numbers in the tags? Because if they have the file naming should use it.

Yes, this works for renaming with existing tags. You can even skip pressing cluster, clustering really does nothing to the saving and renaming. It is only really useful in combination with lookup.

1 Like

100 percent sure! Maybe time to reinstall!

I’m wondering if your file naming script got changed, then. Mind going to that page in the options and checking it, or posting it here for us to check? I’m going to be a bit busy today so I won’t be able to fix it myself if that is the problem, but there’s definitely others here who can do so. The only other thing I can think of is if your track numbers got saved to the wrong field, but I’m not entirely sure how that would have happened.

1 Like

As long as you know that it’s an actual release (and not, say, your own homebrew mixtape/glorified playlist), we’d rather have the information you have on the release than no information at all. :slight_smile: (Heck, it’s even possible to add releases that don’t even have a track list, if you e.g., only know that the release exists, but not anything else about it!)

5 Likes

Same problem. Reading this thread it appears that perhaps the people offering advice haven’t actually tried this with the same sort of data, so here’s a simple example:

Ubuntu 20.04 Version 2.3.1 Python 3.8.5 PyQt 5.14.1 Qt 5.12.8 Mutagen 1.44.0 Discid discid 1.1.0

In Options, File Naming:

  1. Movie files when saving. Destination directory: /media/sophie/videos/Music - Rick Collection
  2. Move additional files
  3. Rename file when saving
  4. Name files like this (the “Default” button was pressed/saved, so the default script is being used:)
    $if2(%albumartist%,%artist%)/
    $if(%albumartist%,%album%/,)
    $if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

The source folder contains a disc that was scanned in by Asunder that wasn’t recognised and has no metadata:
/blah/Unknown Artist/Unknown Album/01 - Track 1.flac
/blah/Unknown Artist/Unknown Album/02 - Track 2.flac
/blah/Unknown Artist/Unknown Album/03 - Track 3.flac
/blah/Unknown Artist/Unknown Album/04 - Track 4.flac
/blah/Unknown Artist/Unknown Album/05 - Track 5.flac
/blah/Unknown Artist/Unknown Album/06 - Track 6.flac

The 'Add Folder" button is pressed and the directory above is chosen. The ‘Cluster’ button is pressed after all files read in, resulting in:

Unclustered Files (0)
Clusters (1)
  Unknown Album (6)    53:27
    Track 1             8:23    Unknown Artist      1
    Track 2             3:43    Unknown Artist      2
    Track 3             5:23    Unknown Artist      3
    Track 4             4:44    Unknown Artist      4
    Track 5             2:31    Unknown Artist      5
    Track 6             2:24    Unknown Artist      6

When Track 1 is selected, the lower half of the screen gets populated with:

Tag             Original Value      New Value
Title           Track 1             Track 1
Artist          Unknown Artist      Unknown Artist
Album           Unknown Album       Unknown Album
Track Number    1                   1
Length          8:23                8:23
Date            1900                1900
Genre           Unknown             Unknown

I then manually update some of the values:

Tag             Original Value      New Value
Title           Track 1             ExampleTitleforTrack1
Artist          Unknown Artist      ArtistExample
Album           Unknown Album       AlbumExample
Track Number    1                   1
Length          8:23                8:23
Date            1900                2020
Genre           Unknown             Rock

I then hit Save, and the following is created in the destination directory:
/media/sophie/videos/Music - Rick Collection/ArtistExample/ExampleTitleforTrack1.flac

There is no track number at the start of the file name and there is no album folder created under the Artist folder.

This same result occurs even with tracks/albums/artists that are recognised.
If my CD ripper found the disc and populated the tracks with correct metadata, for example:

/blah/Emanuel Ax, Chicago Symphony Orchestra, James Levine/Brahms - Piano Concerto No. 1 in D Minor, Op. 15/01 - Brahms Concerto No. 1 in D Minor, Op. 15 - I Maestoso.flac
/blah/Emanuel Ax, Chicago Symphony Orchestra, James Levine/Brahms - Piano Concerto No. 1 in D Minor, Op. 15/02 - Brahms Concerto No. 1 in D Minor, Op. 15 - II Adagio.flac
/blah/Emanuel Ax, Chicago Symphony Orchestra, James Levine/Brahms - Piano Concerto No. 1 in D Minor, Op. 15/03 - Brahms Concerto No. 1 in D Minor, Op. 15 - III Rondo Allegro non troppo.flac

When folder added and clustered, appears as:

Brahms - Piano Concerto No. 1 in D Minor, Op. 15 (3)                      50:06 Emanuel Ax, Chicago Symphony Orchestra, James Levine      3
  Brahms Concerto No. 1 in D Minor, Op. 15 - I Maestoso                   23:14 Emanuel Ax, Chicago Symphony Orchestra, James Levine      1
  Brahms Concerto No. 1 in D Minor, Op. 15 - II Adagio                    14:31 Emanuel Ax, Chicago Symphony Orchestra, James Levine      2
  Brahms Concerto No. 1 in D Minor, Op. 15 - III Rondo Allegro non troppo 12:22 Emanuel Ax, Chicago Symphony Orchestra, James Levine      3

And when the first track is selected, the following details are shown:

Tag             Original Value                                          New Value
Title           Brahms Concerto No. 1 in D Minor, Op. 15 - I Maestoso    Brahms Concerto No. 1 in D Minor, Op. 15 - I Maestoso
Artist          Emanuel Ax, Chicago Symphony Orchestra, James Levine     Emanuel Ax, Chicago Symphony Orchestra, James Levine
Album           Brahms - Piano Concerto No. 1 in D Minor, Op. 15         Brahms - Piano Concerto No. 1 in D Minor, Op. 15
Track Number    1                   1
Length          23:14               23:14
Date            1984                1984
Genre           Symphony            Symphony

Yet when the album folder is selected in the main Clusters listing, and Save is pressed, the following files result:

/media/sophie/videos/Music - Rick Collection/
  Emanuel Ax, Chicago Symphony Orchestra, James Levine
    Brahms Concerto No. 1 in D Minor, Op. 15 - I Maestoso.flac
    Brahms Concerto No. 1 in D Minor, Op. 15 - II Adagio.flac
    Brahms Concerto No. 1 in D Minor, Op. 15 - III Rondo: Allegro non troppo.flac

Again, there are no track numbers displayed in the filenames and no album folder created.

The problem appears to be in the file naming script. It expects/needs %albumartist% in order to create an album folder and any track numbers. The solution would be for MusicBrainzPicard to create a default %albumartist% if all tracks have the same artist. Otherwise, people have to manually create this entry any time they are trying to save an album that wasn’t recognised via the Lookup features.

I’m guessing it’s because the %albumartist% tag is empty. Try changing your naming script to:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%album%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if(%tracknumber%,$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

I suspect that will do what you want.

1 Like

Yes, exactly, as I’ve already said. But I was posting that problem and solution as a change suggestion. The default script simply doesn’t work for my use case, which seems to me to be a normal situation for anyone working on a CD that isn’t recognized. Which is a lot.

I’m ripping about 2000 CDs at the moment and at least 10% of them aren’t recognized, forcing me to save them ‘as is’, and coming up against this problem. Sure, I’d like to take the time to enter them in as new entries in MB but this takes me too long to make it practical.

I see it as a problem with the current default script in that it doesn’t handle this fairly standard use case. A small change would resolve that. I already made the change to my configuration but I think this needs to be rolled out as default, provided it doesn’t break any current functionality.