I just remembered this noon that I still have CDs that were not opened yet. Two of them was ONE OK ROCK “35xxxv” and Perfume “LEVEL3”. Those CDs had been in my backpack for a long time. Oh, well, time to rip.
There are many ways to rip CD and you can search my blog to have it. Right now I’m using Morituri. Morituri is a command line tool to rip CD using AccurateRip™ technology and CDParanoia. Two of the best tools for accurately ripping CD.
We got two process here: getting pycdio and morituri itself. If you think you won’t need the Paranoia, then you can just jump to getting Morituri.
Morituri needs pycdio for interfacing with CDParanoia. It isn’t packaged yet in Ubuntu. We have to install it manually. This package is optional, but I want CD Paranoia!
Let’s install the alternative Python Package Installer (pip):
sudo apt-get install python-pip
Install pycdio dependencies:
sudo apt-get install python-dev libcdio-dev libiso9660-dev swig pkg-config
Alright! Let’s install pycdio:
sudo pip install pycdio
Next let’s get down with Morituri.
sudo apt-get install morituri
Now, we are ready to get the tracks.
There are three parts of ripping the CD using Morituri. First, deciding the CD offset based on your CD drive. Second, optionally get the right MusicBrainz tags. Lastly, rip it with fire!
Getting The Right Offset
If you have an exotic CD drive, you are not so sure, or you just getting really paranoid, you could check your hardware yourself. Get a relatively well-known CD to test and start analyzing:
rip offset find
This takes a while. It takes two turns to check the drive. I was getting bored and only manage to wait for the first pass before I canceled the execution. Besides, my CD drive is well-known. From dmesg, I got this:
$ dmesg | grep DVD [ 2.400198] ata5.00: ATAPI: HL-DT-ST DVDRAM GH40F, MG01, max UDMA/100 [ 2.510952] scsi 4:0:0:0: CD-ROM HL-DT-ST DVDRAM GH40F MG01 PQ: 0 ANSI: 5
I confirm from the database and from my offset searching, my CD drive has an offset of 667.
Getting The Right Song Title
You can retag it if you want. But, to get the right title, I suggest to browse MusicBrainz database to find out the right title. If your CD is popular enough, it would have many names.
For example, my Perfume CD, LEVEL3, had 17 names. I picked the CD version. I got its ID by getting the serial number in its URL. It was 92d793f1-316a-4d66-ab1e-b9660d2682f7.
Getting It All Together
Alright, all is well. Our preparation is complete. Let’s rip:
rip cd rip --offset 667 -R 92d793f1-316a-4d66-ab1e-b9660d2682f7 --track-template="%A/%d/%t - %a - %n" --disc-template="%A/%d/%A - %d"
I love to get the layout”Album Artist/Album Name/TrackNumber – Artist – Title”. You may have different format. Well, each to one’s own. Here’s the list taken from the man page:
Tracks are named according to the track template, filling in the variables and adding the file extension. Variables exclusive to the track template are:
- %t: track number
- %a: track artist
- %n: track title
- %s: track sort name
Disc files (.cue, .log, .m3u) are named according to the disc template, filling in the variables and adding the file extension. Variables for both disc and track template are:
- %A: album artist
- %S: album sort name
- %d: disc title
- %y: release year
- %r: release type, lowercase
- %R: Release type, normal case
- %x: audio extension, lowercase
- %X: audio extension, uppercase
If you got any error, try to remove the offset parameter. It seems there are many variables to disc perfect. Sometimes hidden track(s) made the offset change. May be, that’s probably just my hunch.
Oh, well, all is good. On to the next original CD.