I was looking for an old CD in the cellar. Something about Persian classical music. My wife tells me that I shouldn’t look in the regular shelves but back there in that bag. And I found it. And another one I hadn’t heard in a long time. And another one. Uhm... Let’s take the entire bag back upstairs, right?
I discovered some CDs in the cellar that I hadn’t ripped. Some classics from Omme Kolsoum/Oum Kalthoum, Fairuz, Music from China & Taiwan, and more. That last one reminds me of the fantastic ARC Music label. I love it. And I’ve only looked at 15 CDs from an estimated 90 in this bag.
Time passes and now I’m trying to wrap my brain around Musicbrainz Picard to tag my music.
All of this because some time ago I decided to get rid of iTunes, and that in turn was made possible because I switched my iPod Classic to Rockbox. The entire music setup here at home is that I have two *Libratone Loop* speakers and a *Tivoli Audio Model One*. I connect my portable audio players to these speakers using 3.5 mm headphone jacks (phone connector). The ancient iPod Classic with its 80GB of music is the most important of these. And ever since I switched the iPod to Rockbox at the end of last year, I wanted to reorganize my music collection, but using the file system, not some error prone, invisible, hard to investigate database which is part of a proprietary application with a terrible user interface. And that’s what I’m doing right now.
I switched the iPod to Rockbox
This involved finding a new application to tag my music because I don’t feel like typing it all up. *Musicbrainz* to the rescue. Apparently there is also command line app that accesses it. But sadly it is organized as a library, which means it wants to move files around, it wants to keep metadata in a database, and where as the user interface might be better than iTunes, I fear it’s once again a brittle, over-engineered solution. Nope! *Picard* allows me to pick a folder, work on those files, rename those files, and close it again and it’s gone. That’s how I like it.
As for importing the music, macOS shows the audio tracks of a mounted CD as `aiff` files (the equivalent of `wav` files). I just need to call `lame` on all of the files, and make sure the destination directory is set, and all of that. Time for a bit of Perl scripting!
#!/usr/bin/env perl use Modern::Perl; use File::Basename; use File::Path qw(make_path); my $path = shift; if (! $path) { die "Usage: import-cd DIR [NAME]\n"; } if (!-d $path) { die "$path is not a directory to a CD\n"; } $path =~ s/\/$//; print "Importing $path\n"; my ($filename, $dirs, $suffix) = fileparse($path); my $target = shift; $target ||= "/Volumes/Data/Audio/$filename"; if (!-d "/Volumes/Data") { die "You need to mount the Data drive\n"; } if (-d $target) { die "$target already exists\n"; } print "Saving to $target\n"; make_path($target) or die "Cannot create $target\n"; opendir(my $dh, $path) or die "Cannot open $path: $!\n"; my @files = grep { $_ !~ /^\./ && -f "$path/$_" } readdir($dh); closedir($dh); for my $old_name (@files) { my $new_name = $old_name; $new_name =~ s/\.aiff$/.mp3/ or $new_name .= '.mp3'; print "Converting $old_name .. $new_name\n"; system("/usr/local/bin/lame", "--preset", "standard", "$path/$old_name", "$target/$new_name"); }
Only 17 more CDs to check. But I think I’ll do that tomorrow.
#Music
(Please contact me if you want to remove your comment.)
⁂
Getting those tags right, and doing the thing with MusicBrainz really is taking a long time!
– Alex 2018-02-04 20:11 UTC