Cultured Perl: Fun with MP3 and Perl, Part 2 55
Ted writes "I continues to look at manipulating and guessing MP3 tags with Perl, FreeDB, and various CPAN models via my autotag.pl application. Writing autotag.pl was grueling but fun. I used fuzzy string matching, FreeDB searches, ID3 versions 1 and 2, and lots of text-mode user interactions. It all came together in an application that I tested thoroughly over the course of a month. Info and Slashdot comments about Part One can be seen here, which was posted in December."
Mmm Perl (Score:5, Informative)
As long as we're on the topic of useful perl scripts for manipulating metadata, let me offer some other scripts as well.
Michael. [michael-forman.com]
Re:Mmm Perl (Score:2)
Re:Mmm Perl (Score:5, Informative)
Re:Mmm Perl (Score:5, Insightful)
Filenames are for humans, fix the broken software that doesn't allow filenames with spaces in.
Re:Mmm Perl (Score:2)
Re:Mmm Perl (Score:3, Funny)
it actually looks a lot like Perl:
sample [ancientscripts.com]
- !//!!1\\\!!!
Re:Mmm Perl (Score:2)
Re:Mmm Perl (Score:1)
It is useful for the user to keep a clear mental division between the name of a file and its contents, since there is no intrinsic link between the two. More association simply leads to more "metaphor shear", as Neal Stephenson puts it.
Spaces separate words. Filenames are words. (Score:2)
Correct.
fix the broken software that doesn't allow filenames with spaces in.
Utterly wrong. According to the philosophy that software should help humans, and bend over backwards if necessary to do so, it should only present humans with filenames that are easy to parse at a glance. That means sticking to the "filenames are separated by spaces" system:
Is that "a", "b.mp3", and "c", or "a b.mp3" and "c", or "a" and "b.mp3 c"(, etc.)? It's only obvious if
Re:Spaces separate words. Filenames are words. (Score:2)
Just a note: that still works if you type " first.
Re:Mmm Perl (Score:3, Interesting)
I'm the original poster and I agree with you totally! I do not tollerate spaces in my Unix filenames with the sole exception of mp3 files.
As a matter of fact, that's one of the main reasons I wrote my ren-regexp [michael-forman.com] perl script. For files with unsightly spaces I simply type:
ren-regexp "s/
and my files are sane again.
Isn't that strange that I prefer my mp3 file names with spaces? I never really thought about it until now.
Michael. [michael-forman.com]
Re:Mmm Perl (Score:5, Interesting)
Re:Mmm Perl (Score:2)
And what the heck does XDnD have to do with anything? What made you think I'm using X?
Re:Mmm Perl (Score:5, Funny)
In other words, you wish that all combinations of X apps and terminal programs worked like kwin plus konsole? Whenever I drag an icon into a konsole window, I get a context menu to paste, cd, cp, ln, or mv the specified path into my current shell directory.
In fact, the quickest way I know of to copy a single MP3 from home to the office (assuming I'm currently using X) is to:
Within a couple of minutes, I have the file in my local /tmp directory. Now that is how GUIs and CLIs are supposed to work together.
Oh, if you're my boss: just kidding ha! ha!
Re:Mmm Perl (Score:2)
in plan9 I would just do this
to play it
mpg123
to copy
cp
all this opening applications and dragging, jeesh
if I didn't know the filename I could do
ls
then when the text was on screen click to the left of it type 'cp ' click to the right of it type '
until you've used plan9, yo
Re:Mmm Perl (Score:2)
KDE does that too, silly goose.
Drag and drop a Desktop icon or Konqueror file into a Konsole and it is quoted and the tcsh shell supports case-insensitive file name completion as well if "set complete = enhance" is set.
*Lick lick* Your tears of sorrow taste so sweet.
Michael. [michael-forman.com]
Re:Mmm Perl (Score:2)
Actually I don't use spaces in my ogg filenames but I am quite happy to have spaces in the directory names. I never experience problems. And where I do, I 'quote' the filename.
Someone complained about for mp3 in *mp3... find . -name '*mp3' -exec.... should do it.
Re:Mmm Perl (Score:1)
that's an extra fork, what about symlinks (ugh) and it's dirty
Re:Mmm Perl (Score:2)
Re:Mmm Perl (Score:2)
it's about elegance
Re:Mmm Perl (Score:2)
I was shocked to see there was a release last year and that it's still in active use. Thanks for kindling a flame of curiousity.
It's just a shame there is no release for Sparc, I have a load of IPX's that would benefit from an interesting operating system.
Re:Mmm Perl (Score:1)
We're getting more and more users all the time tbh.
Even Linus pops by to the 9fans mailing list now and again.
Re:Mmm Perl (Score:2)
<add a quote>"<copy My File Name.ogg to terminal>My File Name.ogg<add a quote>"
Re:Mmm Perl (Score:2)
-Q By default, printed file names are quoted if they contain characters special to rc(1). The -Q flag disables this behavior.
Re:Mmm Perl (Score:1)
Re:Mmm Perl (Score:3, Insightful)
for (mp3 in *.mp3) mpg123 $mp3
fails if the filename contains a space
ls -l *.mp3 | awk ' { print "%s is %d bytes\n", $9, $5 } '
fails if the filename contains a space
etc.
spaces in filenames should be illegal
Re:Mmm Perl (Score:2, Insightful)
Re:Mmm Perl (Score:1)
Re:Mmm Perl (Score:2)
Re:Mmm Perl (Score:2)
Musicbrainz? (Score:5, Informative)
Re:Musicbrainz? (Score:2, Informative)
Latest Version
The MusicBrainz tagger is currently only available for Windows.
Re:Musicbrainz? (Score:2)
Re:Musicbrainz? (Score:1)
Re:Musicbrainz? (Score:3, Informative)
oh well.
http://cvs.musicbrainz.org/cvs/mb_tagger/ [musicbrainz.org]
Re:Musicbrainz? (Score:1)
This looks like a good solution to my renaming problems, if it wasnt for the damn developers not taking into account people who have WHITE ON BLACK settings. Why do people constantly hard code the text (white) but leave the background colour as a system colour. (In my case also white!)
ARG!
Re:Musicbrainz? (Score:2, Informative)
I tried MusicBrainz and didn't like the interface to it, or its capabilities. FreeDB was much better for my purpose.
Ted (article author)
Re:Musicbrainz? (Score:2, Insightful)
I just wish there was a way to tell them all that just because a song is a parody, doesn't necesarrily mean it was written and performend by Weird Al [weirdal.com].
This is exactly what I need. (Score:4, Informative)
Lucky, what I did do, is named them all with tracknumber-band-song.mp3 in each subdirectory.
Now that I have like 200 some directories, I don't want to go in with id3master on windows and make a id3 version1/2 tags on every file.
This is exactly what I need! I use cygwin to write small perl scripts to generate reports, so this should be a snap. He even has examples on how to use his perl modules.
Wow, nice for IBM to have a linux developers forum.
another rite of passage in perl. (Score:2, Funny)
Re:another rite of passage in perl. (Score:2)
Don't feel bad, it's the same way for Ruby folks [rubyforge.org].
Maybe it's a scripting language thing in general.
Re:another rite of passage in perl. (Score:1)
Re:another rite of passage in perl. (Score:2, Insightful)
Re:another rite of passage in perl. (Score:2)
Re:another rite of passage in perl. (Score:2)
And editor and/or compilers could raise an error if the code doesn't have enough use/#includes near the start ;->
Re:another rite of passage in perl. (Score:1)
CPAN modules are sometimes written badly.
CPAN modules are "one size fits all" which can be slow or even unusable for specific purposes.
CPAN modules don't teach.
Installing CPAN modules requires at least a little understanding of Perl. Otherwise you get cargo cult programmers who only know "perl -MCPAN -eshell" and can't think for themselves.
Ted
p.s. this applies to every other language with a
Re:another rite of passage in perl. (Score:2)
The 1st chapter would have to quickly segue into writing wrapper code to adapt CPAN packages to your needs, and take a more traditional approach from there.
CPAN modules are "one size fits all" which can be slow
Slower than DIY? Even if you're a newbie?
CPAN modules don't teach.
Reinventing the wheel can be educational, but you could also learn by tinkering with a car. (Maybe not the safes
Wow... (Score:1)
cool.
Bill