Can beets fix tracks which are wrongly named?


I have a few albums where the track titles are randomly swapped around.

Let’s say an album has track 1 (2:56 minutes long) and track 2 (5:12 minutes long), but my tags are messed up, and I have the track 2 tagged with the title “track 1”, and vice versa.

Will the autotagger fix this when importing, based on track lengths? Or will it assume, since the titles are actually correct titles from the album, that track 1 is indeed track 1, and track 2 is indeed track 2?

EDIT: it seems that beets fetches track length information but doesn’t use it to fix the names, e.g.

Correcting tags from:
    Drive: original motion picture soundtrack
    Cliff Martinez - Drive: Original Motion Picture Soundtrack
(Similarity: 21.3%) (missing tracks, artist, tracks) (Digital Media, 2011, MX, Lakeshore Records)
 * tick of the clock (#0) (1:35)  -> Tick of the Clock (#5) (4:48) (length)
 * he had a good time (#0) (4:48) -> He Had a Good Time (#8) (1:37) (length)

At this point I can only apply or skip, when what I would like to do is say “the tracks are swapped, figure this out using the lengths”. Is there a way to accomplish this?



It does actually use the lengths! But it also uses the titles, and it balances the two signals against each other. You might try using the chroma plugin for circumstances like this, where you can get a good signal from the audio itself.



Thanks for replying! Besides using chroma, is there a way I can configure the distance function to prioritize lengths?



There is! It’s actually undocumented for now, but there is a match.distance_weights config mapping that lets you specify how important each factor in a match is. The track length is one such factor:

Increasing that number in your configuration will increase its relative importance for matching.

1 Like

    Cliff Martinez - Drive: Original Motion Picture Soundtrack
(Similarity: 51.0%) (missing tracks, tracks) (Digital Media, 2011, MX, Lakeshore Records)
 * He Had a Good Time (#8) -> Tick of the Clock (#5) (id, index)
 * Tick of the Clock (#5)  -> He Had a Good Time (#8) (id, index)

Thank you!

1 Like


An interesting exchange. I never thought of beets as a tool fore cleaning up messy tags. Mostly because I use it to import proper orderly rips.