I use Perl to manipulate my music collection. I have scripts that validate MP3 tags, convert between formats, re-tag mp3 files as they copy them to diferent players etc.

My reasons for using Perl in this case are that there are lots of things I want to do, my processing time is close to infinite but my development time is very limited.

I have long suspected that these type of issues would be a good way to discuss many of the key Perl skills (data manipulation, controlling other programs etc) in a context that is both interesting to most people and slightly away from "work".

Validate MP3 Tags

When I get a new CD I rip it in FLAC and save the data. Once I have more than 4Gb I create an index file (with a Perl script) and write it to a DVD. In the meantime I create a 128kB MP3 and tag it using public tools. The issue is that the artist names are not consistent and the year field is almost never set, so I have a Perl script that checks the tags for consistency and works out the year.

I then have a Perl script that places the new tracks in my "on-line" set (on the house DAAP server), it takes care of transferring to the dedicated machine and making sure the server can see it.

These tasks are all implemented by combinations of CPAN modules and system() calls to existing programs (for example I use lame to encode mp3s).

Different Portable Players

The family have a number of different MP3 players, each of which has its own strange behaviour. I have a Perl script that, once you have selected which player you have, may convert the format (for example to 64kB MP3 for the older players with limited capacity) and retag.

I have one player in particular that either plays the tracks in order of creation, or in alphabetical order of track name. If the album needs to be played in the right order the transfer program prepends the track number to the trackname tag (so it becomes, for example "a01 - Grace Kelly") and playing the tracks in alphabetical order works.

Finally

I also have a collection of music charts which are consolidated in Perl to create the web site http://www.tsort.info/music/ (that is how I can assign the years to mp3 tracks).


In reply to Re: Plenty of Practical Perl Problems? by hawtin
in thread Plenty of Practical Perl Problems? by loris

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.