The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Tool to do search and replace of tags in music files?

BlindZenDriverBlindZenDriver Registered User regular
I'm sort of old school so I buy my music on CD's which I then rip and put on a server I run. It serves me well, however the ripping process can be a chore and I would like a tool that allows me do search&replace of song titles and more.

An example to illustrate what I like to have a tool help me, say I rip a CD with a concert on. The ripping program will ID the CD and fetch the album and song titles from an on-line database, after which the individual songs are then ripped and the resulting files gets named and tagged with data found on the net. All good except who ever put in the song titles in the on-line database included '(Live)' in every song title, something which to me is just unneeded and annoying information - especially as many live albums included the words "concert" or "live" in the album title.

Currently I am using a tool named Tag&Rename to edit tags in music files and it works really well for most tasks, except it can't do search&replace operation on multiple song so I can't like do a search for ' (Live)' in song titles and replace that part of song titles with noting. Any recommendation for a tool which will let me do tasks like that?

Bones heal, glory is forever.

Posts

  • Inquisitor77Inquisitor77 2 x Penny Arcade Fight Club Champion A fixed point in space and timeRegistered User regular
    I've used Mp3tag in the past but no guarantees it will solve your problem...

  • mRahmanimRahmani DetroitRegistered User regular
    I feel like you would almost need a custom batch tool to do something like that. I’m also a fan of mp3tag, but it’s best suited to attacking this one album at a time I think. Not sure how many albums you need to fix, that might or might not be viable.

  • BlindZenDriverBlindZenDriver Registered User regular
    mRahmani wrote: »
    I feel like you would almost need a custom batch tool to do something like that. I’m also a fan of mp3tag, but it’s best suited to attacking this one album at a time I think. Not sure how many albums you need to fix, that might or might not be viable.

    Thank you and also to @Inquisitor for the suggestion. I shall see what Mp3tag can do, from the description on the web site it sounds promising.

    I have actually been thinking about making my own tool, it could be a fun little project. I was once a programmer, but over time I have been converted into be more on the analyzing and organizing side of things. But time...

    Bones heal, glory is forever.
  • CaedwyrCaedwyr Registered User regular
    I used Picard to do something similar. I'm not sure if it can do exactly what you are looking to do, but it was helpful when I had to batch rename/re-meta data a large group of music files that had incorrect information.

    https://picard.musicbrainz.org/

  • LuianeLuiane Registered User regular
    If it's just file names and not tags that need to be updated, I think a Python script should be able to accomplish what you want fairly quickly if you have any experience with it.

    I think something like this should work, but has some basic assumptions made - like that the (Live) will be always capitalised the same way etc, and that there was an extra white space after (Live). Maybe copy a few files and try it on them first to see if it seems good.
    This is going to work recursively, so any and all files in subfolders will be included.
    import os
    
    targetFolder = "targetFolder"
    toRemove = "(Live) "
    os.chdir(targetFolder)
    
    filePaths = [os.path.join(root, filename)
    			for root, _, filenames in os.walk(targetFolder)
    			for filename in filenames]
    			
    for filePath in filePaths:
        if toRemove in filePath:
            newName = filePath.replace(toRemove, "")
            os.rename(filePath, newName)
    

    Steam id: Varys
    LoL EU West nickname: Irridan
  • BlindZenDriverBlindZenDriver Registered User regular
    Caedwyr wrote: »
    I used Picard to do something similar. I'm not sure if it can do exactly what you are looking to do, but it was helpful when I had to batch rename/re-meta data a large group of music files that had incorrect information.

    https://picard.musicbrainz.org/

    Thank you - I will be looking into this as well. My plan is to give it a go in the weekend and I'll make sure to report back after.

    Luiane wrote: »
    If it's just file names and not tags that need to be updated, I think a Python script should be able to accomplish what you want fairly quickly if you have any experience with it.

    I think something like this should work, but has some basic assumptions made - like that the (Live) will be always capitalised the same way etc, and that there was an extra white space after (Live). Maybe copy a few files and try it on them first to see if it seems good.
    This is going to work recursively, so any and all files in subfolders will be included.
    <SNIP>

    Thank you for the effort, code looks neat but no it is not about the file names. The tags are part of the file according to some standard I think it called ID3, however as there are tools to take the file names and set the tags to match I suppose one can perhaps do a two step process ie. put the file names right and then set the tags to match afterwards. I shall experiment.

    Bones heal, glory is forever.
  • BurtletoyBurtletoy Registered User regular
    I'm pretty sure all the music playing apps can do this. Not sure about iTunes. Music bee can, I think media monkey and foobar2000 also do.

    I was gonna recommend musicbrainz, but I see its already there as well.

  • LuianeLuiane Registered User regular
    Caedwyr wrote: »
    I used Picard to do something similar. I'm not sure if it can do exactly what you are looking to do, but it was helpful when I had to batch rename/re-meta data a large group of music files that had incorrect information.

    https://picard.musicbrainz.org/

    Thank you - I will be looking into this as well. My plan is to give it a go in the weekend and I'll make sure to report back after.

    Luiane wrote: »
    If it's just file names and not tags that need to be updated, I think a Python script should be able to accomplish what you want fairly quickly if you have any experience with it.

    I think something like this should work, but has some basic assumptions made - like that the (Live) will be always capitalised the same way etc, and that there was an extra white space after (Live). Maybe copy a few files and try it on them first to see if it seems good.
    This is going to work recursively, so any and all files in subfolders will be included.
    <SNIP>

    Thank you for the effort, code looks neat but no it is not about the file names. The tags are part of the file according to some standard I think it called ID3, however as there are tools to take the file names and set the tags to match I suppose one can perhaps do a two step process ie. put the file names right and then set the tags to match afterwards. I shall experiment.

    Oh yeah that was right in the thread name wasn't it.

    Did a quick Google and found a Python package created for modifying music tags that should be possible to use if you want to modify the script: https://pypi.org/project/music-tag/

    Seems fairly well documented - keeping the same loop and also modifying the name tag seems like it should be doable.

    Steam id: Varys
    LoL EU West nickname: Irridan
  • BlindZenDriverBlindZenDriver Registered User regular
    Luiane wrote: »
    <SNIP>

    Did a quick Google and found a Python package created for modifying music tags that should be possible to use if you want to modify the script: https://pypi.org/project/music-tag/

    Seems fairly well documented - keeping the same loop and also modifying the name tag seems like it should be doable.
    Thank you - as you say documentation seems good, so it certainly should be doable. Great find.

    Now I'm torn - using someone else's code feels almost like cheating, but on the other hand I've never coded Python so this might be a good way to start.
    I've always been a fan of the right tool for the job, but I do at times also just go for Delphi as I like that world. I understand there is even a Python IDE made by the people that do Delphi, which makes even more tempting to try Python.


    Bones heal, glory is forever.
  • LuianeLuiane Registered User regular
    Luiane wrote: »
    <SNIP>

    Did a quick Google and found a Python package created for modifying music tags that should be possible to use if you want to modify the script: https://pypi.org/project/music-tag/

    Seems fairly well documented - keeping the same loop and also modifying the name tag seems like it should be doable.
    Thank you - as you say documentation seems good, so it certainly should be doable. Great find.

    Now I'm torn - using someone else's code feels almost like cheating, but on the other hand I've never coded Python so this might be a good way to start.
    I've always been a fan of the right tool for the job, but I do at times also just go for Delphi as I like that world. I understand there is even a Python IDE made by the people that do Delphi, which makes even more tempting to try Python.


    Using different packages in python is a nice way to get going faster with some things. The plugins Numpy (math), Scipy(signal processing and more), matplotlib(plotting) and pandas (parsing large data sets, csvs and Excel files) are all great for example.

    I'd recommend PyCharm as an IDE, I like the debugging features of it a lot (and it's free :) ). Of course, if there is another that you are already familiar with that might be better.

    Steam id: Varys
    LoL EU West nickname: Irridan
  • dispatch.odispatch.o Registered User regular
    I'm pretty sure Foobar could do this without plug-ins and plug-ins added even more options.

  • BlindZenDriverBlindZenDriver Registered User regular
    UPDATE

    Busy times, but finally I got the chance to put some time in to test some search&replace.

    I've only gotten as far as MP3TAG and I am liking it.

    As a test I grabbed a bunch of songs, around 3,924 to be exact and made MP3TAG search for songs with the word "Order" in the tags and replace those with the intentionally wrongly spelled word "Orden" and it just worked. Of the 3,924 files in my test there was just two New Order albums and this just 18 songs to be selected.

    I used a file comparison tool, Beyond Compare, to ensure only the files I expected to have edited was touched and only in a way I expected ie. only the desired tags was changed and nothing else. All good.

    The interface lets you limit your search in a number of ways, so you can:
    • Work on only selected files
    • Chose to work on only one type of tags like for example Album name or all tags
    • Search only for separate words or with no constrains
    • Search case-sensitive or case-insensitive
    • Or if more advanced one can use regular expressions

    And the interface will remember past search and replaces, which makes things convenient. If I was to wish for something more it would be that the search&replace function was located in the Edit menu of the user interface, instead it is something to find under Actions in the

    The search&replace worked fast, doing the described test took like 1-2 seconds (note - I did the test on a NVMe SSD).

    Also I like you can do a portable install, doing so keeps clutter out of Windows and I like to run programs like that when they are some I only use once in a while.


    I still plan to check out the other suggestions + of course trying to program a tool my self. If I learn something Interesting I shall report back.

    Thank you all for all your input.

    Bones heal, glory is forever.
Sign In or Register to comment.