Jump to Navigation
xrayspx's picture

iTunes Mass Importer

Music: 

Bauhaus - King Volcano

For my own notes, so I don't forget I did this... Big thanks to Doug from Doug's Applescripts for iTunes for convincing me that making iTunes update in this way is possible.

As with all things, I have to make my music library overly complicated. In historical times, I ripped at 128k, then 192k, but even a lot of the 192k mp3s sound like crap, so I've decided that going forward, I'm doing 320k CBR MP3s as well as FLAC.

I'm using Max to do the rip and encode on the Mac. It encodes both sets of files in parallel and saves them in a directory under ~/Music/max-rips/Artist/Title.

Here is a script to sort that and update iTunes. It'll drop the MP3s in my MP3 library directory, then drop the FLACs in a repository for them, finally making iTunes add the new files at the end. If all you want is to make iTunes rescan your library for new files from a script of bash shell, you want the osascript line toward the bottom, just substitute the path to your collection in place of mine.

I'd like to pass $directory and $albumdir to the osascript and have it live inside the inner for loop, but I've not figured out how to use my variables inside the 's that osascript -e requires to run its part. It only takes a few seconds to re-index the whole thing.

This is the utterly fugly 15-minute first draft with crappy variables and whatnot, but it does work.

(Yeah yeah, "find blah blah | while yadda yadda", 15 minutes, works, admittedly fugly, 2000 CDs and nothing has | in the artist or title)
Update #2: Nevermind all that, the script below is a lot clearer and does all that stuff I wanted.

maxmover.sh:


#! /bin/bash

find ./max-rips -depth 1 -type d | awk -F "max-rips/" '{print $2}' | while read artist
  do

    mkdir "/Volumes/Filestore/CDs/$artist"
    mkdir "flac-output/$artist"

    find "./max-rips/$artist" -depth 1 -type d | awk -F "max-rips/$artist/" '{print $2}' | while read album
      do

        mkdir "/Volumes/Filestore/CDs/$artist/$album"
        mv "max-rips/$artist/$album"/*.mp3 "/Volumes/Filestore/CDs/$artist/$album/"
        mv "max-rips/$artist/$album" "flac-output/$artist"

        `/usr/bin/osascript         tell app "iTunes"
        add POSIX file "/Volumes/Filestore/CDs/$artist/$album/"
        end tell
        EOT`

      done

    rm -f "max-rips/$artist"/.DS_Store
    rmdir "max-rips/$artist"

  done

Update:
It looks like there are several ways to skin my osascript cat. These aren't even the most fluid examples I've found.

xrayspx's picture

Winter 2013 Blizzard

Music: 

The over-hyped blizzard of February 2013 has come and gone. 3000cu. ft. shoveled by two of us in 2.5 hours. The lowest point in the driveway measured 22", more drifty parts measured 28", between the cars, 40". But still, who's panicking? It's snow. In February. In New England. Why the travel bans? Why the storm-namery? You suck it up, you shovel, it's clean.

Here are some photos, the Nemo thing might work since everyone's car looked like a nautilus shell under all this snow

Fixed Tags:
xrayspx's picture

Fixing an ugly email situation

Music: 

I've been running IMAP services on my mailserver for many years, previously using Courier. I always had a pretty basic but solid-running system. Postfix, doing a Spam Assassin check, then delivers to the user folders, and Courier running IMAP.

xrayspx's picture

Salman Rushdie at Portsmouth Music Hall

Music: 

A change of pace tonight. A few months ago, we saw Salman Rushdie speak and do an interview as part of the Writers on a New England Stage series presented by NH Public Radio. He gave a brief reading from his recent memoir, Joseph Anton, followed by an interview.

Listen Here

Fixed Tags:
xrayspx's picture

Economics of Home Protection

Music: 

Bertie Wooster (Hugh Laurie) - 47 Ginger Headed Sailors

Or: Why you don't need that AR-15 to save your TV.

I've had some conversation with friends who are very vocally talking about upping their gun count since Sandy Hook, all in the name of "more protection". Discussions of AR-15s and such.

xrayspx's picture

Scurvy Fundamentalists React To Tragedy

Music: 

This week we've had a massive tragedy. Dozens of innocents killed in the most callous way possible. Everyone, everywhere very, very sad.

Except for those devoutly religious enough to bring their unique view to the whole event. I've been reading statements to the effect that God did not intervene because he is polite enough not to go where he isn't welcome. That the answer to this is that our children should pray before every school day, also, More Guns.

Fixed Tags:
xrayspx's picture

The Coup & People Under The Stairs at the Middle East, 12/5/2012

Music: 

DEVO - Smart Patrol/Mr. DNA

Go Here:Read an interview with Boots Riley, by old friend and excellent writer Tom Andes. -- @The Rumpus

A very happy confluence of events led me to lie to Chris Portugal at The Coup / People Under the Stairs show. The first thing that had to happen was that the original venue for People Under the Stairs had to be unprepared to open. That venue is the Sinclair in Cambridge. It's apparently still not open as they're shuffling shows to TT's and the Royale.

xrayspx's picture

Password Policy

Music: 

30 Helens (and two Jesuses) agree, nice password policy.

My wife bought this day calendar to store in her purse and found these two horrifically disturbing pages toward the front. It's extra convenient, because if you get mugged, now the thieves can go home and log into your online banking, and clear the rest of it out too while you're all groggy talking to a policeman after waking up laying next to a brick with no purse. Wonderful.

Fixed Tags:
xrayspx's picture

Mike Watt and The Missing Men @ Brighton Music Hall, 10-17-2012

Music: 

The Pixies - U-Mass

We just walked in from seeing Mike Watt & The Missingmen at the Brighton Music Hall. The latest in our unintentional Punk Rock Legends series, so this is brief.

This blistering set was all of the album Hyphenated-man, which we do not yet own, but will tomorrow. It was pretty much beat poety, jazzy, hardcore rolled up in 2 minute songs.

Watt was looking a little worse for wear from his 2010 knee injury. I'm not surprised, because when we saw him with Iggy Pop (and The Neighborhoods!), just a few weeks after he hurt it, he was in a full immobilizer, and had to get on stage with crutches. Once on stage with a bass in his hands, he proceeded to run around and jump all over the place as if it hadn't happened. He looks like he's feeling it more now, which I know from experience really sucks.

One of the best bits was this cover of Machine Gun by Jimi Hendrix during the encore. This version has better vocal audio than we heard, if I find video of tonight's show, I'll replace this Iowa footage:

Here are the photos, they're not great, because the Brighton Music Hall isn't the brightest lit place in the world, but got some good ones:

xrayspx's picture

Public Image Ltd. @ The Royale, Boston MA, 10-15-2012

Music: 

Big Black - Racer X

Here are some of my favorite photos from Public Image Ltd. PiL played a long set, with no opener, and a good mix of old to new music. John's voice was a bit worse for wear, but he actually became better over the course of the night, I feel, probably due in no small part to generous application of Courvoisier VS.

We spent most of the night being systematically mesmerized by Lu Edmonds and his Buzuq. Natalie was convinced going in that Warren Ellis was touring with them, because she saw multiple sources mis-identifying him from previous shows. That's really a shame. They're similarly masterful, equally anachronistic visions of a late 1940's bearded man thrashing some poor instrument to death, but not the same person. I did get a sense last night for what it would have looked like if Wm. S. Burroughs were a guitar player.

The crowd was strongly in favor of this show, but artists need to keep in mind that Boston Does Not Dance. It just seems to not be what we do. Sorry. We were dancing in spirit, John. We get that a lot here.

A few pictures from the 27 I put to Flickr:

Fixed Tags:

Pages

Subscribe to xrayspx.com RSS


by Dr. Radut