Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    430

    mp3tag automation?

    hi,

    I'm using mp3tag to tag all my tracks. I'm particularly meticulous with the classical ones. Among other things, they get artist, composer, albumartist and genre.

    Every artist, composer, albumartist ... is named in format of <last name>, <first name> <title>.

    For every composer, there are two tags that always come, 'Classical' and 'Classical::<period>' i.e. 'Classical::Romantic'.

    Here are the issues:

    - original rips usualy come with inconsistent names. So, I have to manually correct them. For example, rip would show Donizetti, and I change it to Donizetti, Gaetano. In order to do that, I need to know how exactly is somebody already named in my library, beacuse he can also come in flavor of 'Domenico Gaetano Maria Donizetti' and I need to know what I accepted last time. Things get even more complicated if name conatins special characters (special for English, native for the language of the original name)

    - once proper name is established, I need period part in genre tag. i.e. Donizetti need his Classical::ClassicalPeriod tag.


    So, is there any way to set up some kind of script with mp3tag to achieve this? I know that I could kind of get it with actions, but I'd prefer something more elegant, even better if it could loook into the SC database for already existing entries (especially for genres)

    thks,

    K

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    Colorado
    Posts
    10,072
    Not with Mp3tag. The best you could do would be to set up a couple of very long, very tedious Mp3tag actions. One to correct all the different name spellings and then one to set the genres that you want associated with each ocmposer.

    You could do something like this with a custom script or application that would read and rewrite your file tags, but it would be a lot of work. You'd still need to set up some kind of database with those composer to genre associations. You'd also need a database of name 'fixes' to get from all the variations on each composer name (and probably orchestra and conductor and soloist names as well) to the 'correct' name. That data couldn't really be found in the SC database.

  3. #3
    Senior Member MuckleEck's Avatar
    Join Date
    Apr 2007
    Location
    Finchampstead, Berks, UK
    Posts
    272
    Quote Originally Posted by slimkid View Post
    So, is there any way to set up some kind of script with mp3tag to achieve this? I know that I could kind of get it with actions, but I'd prefer something more elegant, even better if it could loook into the SC database for already existing entries (especially for genres)
    You can look into the database by using Excel or Access and "get data from Other sources" then using microsoft query to query the Squeezecenter database.

    You may need to install the ODBC drivers and give access to the database.

    I have used this to look at the paths that squeezecenter uses.
    Alasdair

    SBR -> Linn Majik -> Acoustic Energy Extreme 5 (garden) | SBR -> Cambridge Audio 640R -> Morduant Short (TV room) | SB3 -> AudioEngine 2 (bedroom-2) | SB3 -> AudioEngine 2 (kitchen) | SBR -> Musical Fidelity A1008 -> JR149 (office)| Squeezebox Radio (bedroom) | SB3 -> AudioEngine 2 (Bedroom -3) | Boom (bedroom-4) | Two Controllers

    Last Fm http://www.last.fm/user/MuckleEck/

  4. #4
    Senior Member vrobin's Avatar
    Join Date
    May 2007
    Posts
    460
    You can also create a search and replace regexp to handle aliases. Knowing the problem, you can create an action "normalize composer name" and modify this action for each new badly spelled composer name you meet.

    I used such scripts to transform all Bach, JS. Bach, JS Bach, J.S. Bach, Jean-Sebastien Bach to => Joan Sebastian Bach. I add another script that guess and create the COMPOSERSORT tag automatically, and another one that tries to extract Opus or Composer catalog number from the track title (I had posted this last one).

    With mp3tag automation, you can make a lot of things!

  5. #5
    Senior Member
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    430
    Quote Originally Posted by vrobin View Post
    You can also create a search and replace regexp to handle aliases. Knowing the problem, you can create an action "normalize composer name" and modify this action for each new badly spelled composer name you meet.

    I used such scripts to transform all Bach, JS. Bach, JS Bach, J.S. Bach, Jean-Sebastien Bach to => Joan Sebastian Bach. I add another script that guess and create the COMPOSERSORT tag automatically, and another one that tries to extract Opus or Composer catalog number from the track title (I had posted this last one).

    With mp3tag automation, you can make a lot of things!
    Thks for the ideas so far. What I use right now is mysql query into SC database that lists existing composers and their period genres. Then, when in doubt, I have to list through the existing entries. It's just tedious having to fire it and list through rows and manually. I was thinking along the lines of combining mp3tag actions and some kind of script that would involve mysql driver, either with perl or excel or something. Of course, there's always option of running a script over SC database, but I'm hoping I wouldn't have to do that.


    K

  6. #6
    Senior Member
    Join Date
    Feb 2007
    Location
    Olde London Town
    Posts
    1,099
    YOu could try a user-defined Tag Source, such as currently used to query Amazon.com etc.

    As I understand it, a tag source can take an initial search value from current tags. The result set value(s) can be then be loaded into a number of tags, you write a parser script to iterate over the returned value(s).

    My idea would be to query a Tag Source with current COMPOSER value, i.e. JSBach.

    The data server would then fuzzy match against a list of composers and return Bach, Johann Sebastian|Classical:Baroque.

    Your script would then replace all COMPOSER and GENRE tags with the returned values.

    Easy! Just need to write the data server and the handler scripts Of course, slimdevices could host this web service. Oh, wait! No-one can agree on the correct way of tagging classical music genres!
    Last edited by amcluesent; 2008-04-16 at 10:31.

  7. #7
    Senior Member vrobin's Avatar
    Join Date
    May 2007
    Posts
    460
    Here's an extract of one of my .mta file with composer normalization and sort tag generation:

    [#16]
    T=5
    F=MY-COMPOSER
    1=$regexp(%MY-COMPOSER%,'Anton.n Dvo..k','Anton\u00edn Dvo\u0159\u00e1k')

    [#17]
    T=5
    F=MY-COMPOSER
    1=$regexp(%MY-COMPOSER%,'George Frideric Handel','Georg Friederich H\u00e4ndel')

    [#18]
    T=5
    F=MY-COMPOSER-SORT
    1=$trim($regexp(%MY-COMPOSER%,'^(.*)\\s+([^\\s]*)$','$2, $1'))

  8. #8
    Senior Member
    Join Date
    Dec 2007
    Location
    Boston area (NE USA)
    Posts
    647
    MP3Tag can write all tags to a text file, and can do that on a "per folder" basis (so one file per folder).
    It can also read a text file and write tags from that.

    Once you have that, you can write processing in whatever language you like (python, perl, vbs, rexx, or even C/C++ if you're feeling masochistic) without having to mess about with tag reading libraries.
    Or, if your language of choice is C/C++ or Python, and your files are all MP3, Ogg, or flac, you could use the libtagedit library http://sourceforge.net/projects/libtagedit/
    There's also a really complete Python/MP3 (does all music formats, basically) set of libraries out on the web - but I've lost it. Maybe it was called Pymp3? Mp3py?

  9. #9
    Senior Member
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    430
    Sorry,
    should have already made a conclusion to this thread with the solution I found the most acceptable:

    I ended up making Perl script to retrieve the information about full names and corresponding periods from slim database and creating .mta file with two actions (per artist); one to correct artist's name to full name that already exists in the database, and the other one to update genre to the period that already exists there too.

    K

  10. #10
    Member
    Join Date
    May 2006
    Location
    Germany
    Posts
    53
    @bobkoure,

    I think you mean Mutagen.

    Really complete.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •