Menu

hyphens are causing me problems

2015-12-13
2015-12-20
  • decaf green tea

    decaf green tea - 2015-12-13

    I have multiple directories and the format is always 01 Track Title, 02 Another Title and I use the simple %{track} %{title} so every track title and track number is updated, except for .... Rare tracks with only one letter titles and any song containing a hyphen which are plentiful.
    If I load the individual directories and use %{track} %{title} it works perfectly for the hyphenated tracks.

    Any ideas?

     
  • Urs Fleisch

    Urs Fleisch - 2015-12-14

    I am not sure if I completely understand the problem, so I am describing an example how to reproduce it.

    I have a directory "An Artist - An Album" containing three files:

    01 Title - with Hyphen.mp3
    02 A.mp3
    03 Ab.mp3
    

    The filename - tag formats are selected as

    Format <Arrow Up> "%{track} %{title}"
    Format <Arrow Down> "%{artist} - %{album}/%{track} %{title}"
    

    I now click "To Tag 1", which will correctly set the tags for the first and the third file, but it will not set the tags for the file with a single character title. So I can confirm the problem for the one letter case. The reason are regular expressions, which are used to extract the tags and which require at least two characters. I will check if this can be improved. As a quick workaround, you could use the function "File/Import.../From Tags" with Source="%{file}" and Extraction="%{track}(\d+) %{title}(.*).mp3".

    The case containing a hyphen works for me. Could you check if the selected "Format Arrow Down" exactly matches the format of your file names, also the artist/album part? If the format does not match, Kid3 tries a series of other formats, which might give correct results for some files, but not for those containing hyphens. With a correct format, everything following the space after the track number should be used for the title.

     
  • decaf green tea

    decaf green tea - 2015-12-14

    Sorry, I wasn't clear enough.
    I had cleaned up some tracks in my collection with a renamer so I wanted to propagate those changes through kid3. This could be done using the track number & track title "%{track} %{title}"

    The problem was that anything with a hyphenated track title failed to fill in the track number tag when I selected multiple directories.

    01 Ya Ya's.flac
    02 Ya-Ya's.flac
    03 Ya Ya's - Ya Ya's.flac

    So in this circumstance, track one and three had the track number tag and number two didn't have a track number tag.

    When I selected the singular directory and used "%{track} %{title}" it filled in the missing tag correctly.

     
  • Urs Fleisch

    Urs Fleisch - 2015-12-14

    Strange, I cannot reproduce it. I have now created a second directory besides the one described in my prior post and it will always set the track numbers, no matter whether I select tracks from one or two directories.

    By the way, in your example both tracks two and three have a hyphen, but track three works whereas track two does not?

    You have the tracks from multiple directories expanded and selected in the file list? Which version on which OS are you using? What is the filesystem?

     
  • decaf green tea

    decaf green tea - 2015-12-14

    I used the example to illustrate the difference. Every track that contained a hyphenated word or tracks that used hyphens to delineate between two tracks in the same flac left the number field empty ... but it was fine with tracks that had "space, hyphen, space" in the title.
    The directories were always expanded to select multiple directories.

    I'm using he same Kid3 3.3 El Capitan/Journaled to edit my collection.
    I sparked up an old MacPro running Lion/Journaled and there was no problem with the hyphenated tracks.
    I was editing several genre directories with many albums in each section and the problem reproduced every time - To fix all the previous anomalies, I isolated all the unnumbered tracks in the player, revealed them in the finder, then loaded each album directory just to add the tag for the one song in every folder with a hyphen in the title.
    Now that I've fixed all the tag anomalies I can't revert to the original files so reproducing the same problems isn't an easy prospect.

    I've just tried to reproduce the problem for the last few hours. I'm not getting the same results today.

    I expanded and selected 92 album directories that were already fixed. Deleted the "Total Tracks" tag and "Track Number" tag. I then saved all the files with those tags unwritten.
    I used Tools>Number Tracks ... all checkboxes on, with multiple directories selected. This time the Total Tracks was filled as well as the Track Number tag on all tracks.
    The anomalies were:
    In the player one whole Album's Track Total and Track Number could no longer be read.
    The numbering couldn't be fixed with "%{track} %{title}", it took Tools>Number Tracks ... to fill in the tags on the single directory.

    I decided to go back and try from the beginning. I copied 90 album directories across from an untouched back-up to test the original problem.
    I used Tools>Number Tracks ... with all checkboxes ticked and multiple directories selected. The Total Tracks and Track Number tags were filled including the tracks with hyphens.
    I saved them and opened them all in the player.

    The anomalies were:

    Two whole albums not showing the Track Number correctly - All these tracks had an inexpliquable leading space in the track name and they were easily fixed ... and a single track called "Z" which we already covered.

    There are two albums that are not showing the Track Number/Total Tracks fields correctly in the player. Through trial and error I've discovered that if I only use the Track Number tag, the player reads all the tags, but not the total tracks field, but if I add the Total Tracks tag as well, all the fields are marked as "unknown".
    Just removing all the tags and running Kid3 again doesn't fix it. The only way I found to clear the problem was to convert all the tracks to wav, and back to flac and all is fine - Then Kid3 fills the tags as intended.

    Using "%{track} %{title}" always returns the last number as the Track Number tag rather than the first number as in this example: Cafe 1930.flac will appear as Cafe 1930 / 1930 of 10 in the player before I fixed it manually.

    01 Oblivion.flac
    02 Café 1930.flac
    03 Tango Suite Part I.flac
    04 Tango Suite Part III.flac
    05 Verano Reflections.flac
    06 Night Club 1960.flac
    07 Tango Part II.flac
    08 Bordel 1900.flac
    09 Milonga Del Angel.flac
    10 Last Tango For Astor.flac

    I think we can safely say that whatever was happening yesterday, I can't reproduce it today and most of the anomalies today are superficial and easily fixed.

    I do have a question though, most taggers will put a trailing zero in front of 1-9, but I can't get Kid3 to do that ... 04 of 30 looks so much better than 4 of 30 in a column format. Is there an easy answer?

    Thanks for the program and thanks for the support :)

     
  • Urs Fleisch

    Urs Fleisch - 2015-12-15

    Thanks for this thorough examination. The only thing which seems to be reproducable is the case with one letter titles. This will be fixed in the bug fix release 3.3.1 which is soon to come.

    The things with hyphens and track numbers are strange and I could not reproduce such a case. The code to generate tags from file names is quite generic, not platform dependent and free from non-deterministic stuff. So it could be that the tags can be set but not written to the files because of anomalies in the FLAC files or the code handling FLAC metadata. I have seen FLAC and Ogg files which could not be written, sometimes it helps to remove the tag. Two implementations for handling such tags are available for Kid3: the plugins OggFlacMetadata and TaglibMetadata, maybe changing the order or deselecting one of them could help.

    Concerning the leading zero in front of 1-9: Unfortunately, there is no way (besides changing the code) to prevent Kid3 from stripping such leading zeros when To: Tag 1 or Tag 2 is clicked in the main window. However, it is possible using the "Import from Tags" function which I mentioned in my first comment. Go to "File/Import.../From Tags", click "Add" to add a new format with

    Format="Filename to tag"
    Source="%{file}"
    Extraction="%{track.2}(\d+) %{title}(.*)\..{2,4}"
    

    Then click "Save Settings" to store it for future use. You can henceforth click "Apply" to use the format. It will set the track numbers with 2 digits, but it is a few clicks away. This example only uses the filename, not the full path. You could use %{filepath} for the Source and extend the Extraction accordingly.

    Wait, I just found out that it can be done much easier (I'm getting old enough to forget my own code, but I leave my sermon about "Import From Tags", maybe you can use it in another situation). Here is the easy way: Settings/Configure Kid3.../Tags/Tag 2, set "Track number digits" to "2".

     
  • decaf green tea

    decaf green tea - 2015-12-16

    Oh superb answer on the 2 digit front ... "%{track}" click Tag 2 does add the leading zero, but only if I remove the existing Track Number tag first ... This'll take some time to go through :)

    I agree that the code handling metadata is not perfect. - I tend to decode and re-encode anything that develops a tag problem and that only fails if the file itself is corrupted.

    I've used Kid3 several times to tidy up previous tags but only ever using the GUI, I thought it was worth spending some of my time discussing possible bugs and other weird patterns of behaviour.

    The only remaining anomaly that I can reproduce is with file names with a numeric at the end using "%{track}" This happens in single track selection, directory selection and multiple directory selections. There's no problem with numerics elsewhere such as 03 Red 88 Shoes.flac

    23 Sofa #1.flac will still fill the Track Number tag as 01
    11 Exercise 17.flac will still fill the Track Number tag as 17
    02 Café 1930.flac will still fill the Track Number tag as 1930
    09 Film Excerpt, Pt. 2.flac will still fill the Track Number tag as 02

    Using the Number Tracks ... tool the tracks number correctly, except the Track Number tag format is 01/31, 02/31, 03/31 which I don't like. One weirdness here is that if I select multiple directories, the first directory's Track Number tag always remained empty. After several tries I realised it only works if I select from the directory title, not the first track in the directory ... Of course, the "%{track}" click Tag 2 works on anything selected.

     
  • Urs Fleisch

    Urs Fleisch - 2015-12-16

    To reformat the track numbers to two digits you do not necessarily need to remove the existing numbers. Just go to "Tools/Number Tracks" and uncheck the check box before "Start number", then click "OK". This will format the track according to the current format (make sure to uncheck "Total number of tracks" if you do not want to add totals).

    Unfortunately, I can still not reproduce the problem with the numeric at the end. Could you tell me your "Format <Arrow Down="">" setting and a complete absolute path of such an example file?

     
    • decaf green tea

      decaf green tea - 2015-12-17

      Re unchecking 'total number of tracks', I missed how that option functioned - Works as you say :)

       
  • decaf green tea

    decaf green tea - 2015-12-17

    Sorry for the delay .. other things to do!

    Format Down arrow: "%{track}"

    Absolute paths:
    /Volumes/The\ Music\ Machine/Jazz\ Music\ Tagged/Al\ Di\ Meola\ -\ Di\ Meola\ plays\ Piazzolla\ (1996)/08\ Bordel\ 1900.flac

    /Volumes/The\ Music\ Machine/Jazz\ Music\ Tagged/Tom\ Waits\ -\ Nighthawks\ at\ the\ Diner\ (1975)/17\ Big\ Joe\ and\ Phantom\ 309.flac

    /Volumes/The\ Music\ Machine/R\&B\,\ Blues\ \&\ Blues\ Rock\ Tagged/B.B.\ Chung\ King\ \&\ The\ Buddaheads\ -\ Real\ (2002)/02\ 911.flac

    /Volumes/The\ Music\ Machine/R\&B\,\ Blues\ \&\ Blues\ Rock\ Tagged/Coen\ Wolters\ Band\ -\ Broken\ Glass\ (2004)/12\ Suite\ 1210.flac

    /Volumes/The\ Music\ Machine/Reggae/Inner\ Circle\ -\ Reggae\ Dancer\ (1994)/12\ 24-7-365.flac

    /Volumes/The\ Music\ Machine/Southern\ Rock\ Tagged/Husky\ Burnette\ -\ Tales\ From\ East\ End\ Blvd.\ (2013)/02\ Highway\ 41.flac

    /Volumes/The\ Music\ Machine/Southern\ Rock\ Tagged/Thunder\ -\ Their\ Finest\ Hour\ (and\ a\ bit)\ (1995)/06\ Higher\ Ground\ \'95.flac

     
  • Urs Fleisch

    Urs Fleisch - 2015-12-17

    The Format Down arrow: "%{track}" is not correct, for the format of your directories and files, you should try "%{artist} - %{album} (%{year})/%{track} %{title}".

     
    • decaf green tea

      decaf green tea - 2015-12-18

      That's an entirely counter intutiive solution, but it does work :)
      Too late for me as I corrected everything manually.

      Maybe it's because I don't know how your code operates, but intuitively, if all the other tags are written and I want to target a specific tag I should be able to target it individually.
      Using "%{track}" numbers everything correctly EXCEPT those with a numeric ending. So, it looks like Kid3 has a specific bug that reads the last number in the filename rather than the first.

      When I first used Kid3 on the collection I used a longer format, but I then dealt with all the anomalies manually. Surely, if I use the "%{artist} - %{album} (%{year})/%{track} %{title}" format it'll reintroduce all the anomalies I've already fixed?

       
  • Urs Fleisch

    Urs Fleisch - 2015-12-18

    A simple explanation can be found in http://kid3.sourceforge.net/kid3_en.html#file. It ends with " First, the format specified in Format is used. If the existing filename does not match this format, the following formats are tried: ...". This is the case with your "%{track}" format. It will not match for most cases, and Kid3 will then try the formats listed in the handbook, in this case, "Artist - Album/Track Song" will match (taking the year as part of the album). That's why it works with most of your tracks. However, in the numeric at the end case, "%{track}" will match (because Kid3 transforms the format into a regular expression with captures for numeric strings for the known numeric tags and some general captures for the remaining tags and adds "..{2,4}" to match the extension, thus only a sequence of digits followed by a dot and the extension will match the resulting regular expression) and Kid3 will not try the other formats and the result is wrong.

    If you want to target the specific tags individually, there are two possibilities:

    • Before clicking "To: Tag 2", you can only set the checkboxes for those frames which you want to be set from the filename (there is a context menu in the frame name column, which makes it easier to select all frames).
    • You can replace the names of the frames in the format which you do not want to be touched by "ignore", so for instance, to only set the track numbers you could use "%{ignore} - %{ignore} (%{ignore})/%{track} %{ignore}" instead of "%{artist} - %{album} (%{year})/%{track} %{title}", or you could leave the directory part empty and just use "%{track} %{ignore}".
     
    • decaf green tea

      decaf green tea - 2015-12-20

      I gotta say that when I first looked at the interface last year I was a little daunted by it, but I stuck with it because it got the job done better than any other tagger more or less out of the box - Beyond that point, in some ways it reminded me of ffmpegX (back when the options for transcoding and editing video formats were limited on a mac) the interface was a multitude of options that only work if you understood what everything meant.

      That said, your explanations and solutions have been as excellent as your software.
      Many thanks