As my music collection has grown, I’ve cobbled together a handful of procedures for managing it from my Ubuntu desktop. This post is primarily for my own benefit so I don’t forget parts of it, but I’m publishing it in case it’s useful to anybody else. For background, the collection is currently at 12,320 tracks, and growing. The vast majority is from (in decreasing order) CDs, vinyl records, and digital downloads. My general strategy is to save as much of any originals as possible in a lossless format (currently, FLAC), and generate smaller, lossy copies of the music as needed. I rely heavily on MusicBrainz for all metadata.
Directory layout
archive
: Loosely organized files that are not for listening directly, e.g., un‐split digitized vinyl recordsmaster.rw
: Well organized, master copy of the collectionmaster
: Read-only view ofmaster.rw
profiles
: Various copies of the collection, derived frommaster
Getting data off of the original media
Ripping CDs
- Figure out what sort of disc it is, using
cdrdao disk-info
. Sometimes there are unlisted data tracks that this discovers. - Use Sound Juicer to get the Disc ID to submit to MusicBrainz.
- Use Sound Juicer to extract FLAC files from the audio tracks, into
archive/cd/artist-name/album-name
. I manually changed its dconf setting forparanoia
to['fragment', 'overlap', 'scratch', 'repair']
. - In
archive/cd/artist-name/album-name
, runcdrdao read-toc d01s01.toc
(replacingd01
with the appropriate disc number) to extract the table of contents for the audio session. - If there are any other sessions, extract them by running
cdrdao read-cd --session 2 --datafile d01s02.iso d01s02.toc
, replacing the disc and session numbers as appropriate, and changing the data file’s extension if appropriate. - If any of the extra sessions contain music or music videos, extract those to individual files.
Digitizing and splitting vinyl records
(This procedure can probably easily be adapted for tapes or other analog sources, but my experience so far is primarily with vinyl records.)
- Create a new directory
archive/vinyl/album-name
, and change into it. - If there’s more than one disc, make a text file in the directory with a note about what order the sides will be digitized in. E.g., for an auto‐sequence album, note that the sides will be digitized in order of side number, not one disc at a time.
- If there’s anything else that would affect digitization, note it in a text file. E.g., note if the record is monophonic, or if it will need speed and pitch adjustments.
- Plug in the USB turntable, and run
record-vinyl project.flac
to start recording audio. (Before writingrecord-vinyl
, I had tried Audacity and Ardour for this step. Audacity froze and crashed too often, and Ardour had occasional buffer under‐runs when I did anything else with the computer at the same time. It’s definitely possible that I could have gotten either of them to work better with more effort, but the script wasn’t hard to write.) - For each side, place the side on the turntable, clean it, and play it. If there are any skips, make a text file in the directory with a list of every track that contains a skip.
- Stop
record-vinyl
. - If there were any skips, use Audacity to clean them up, and save the result as a new file. If the pitch and speed need adjustment, do that and save the result as a new file. Do not down‐mix to mono yet, because it’s occasionally easier to split tracks with the fake stereo signal, due to more noise in one channel than the other. (I save the result as a new file instead of going straight to track splitting, to avoid relying on being able to read Audacity project files in the future if I ever want to make any changes.)
- Open the un‐split audio file in Audacity, to split it into individual tracks:
- Switch to spectrogram view. Drag the bottom of the track down to make it as vertically large as possible, while still leaving space for a small label track at the bottom. (I’ve found this makes it much easier to see the boundaries between tracks.)
- For each visible track boundary (which should show up on the spectrogram as background noise with no signal), select from the end of the boundary to the start of that track (which is either the end of the previous label, or the beginning of the disc side). Listen to about a second at a time at each end of the track to make sure the boundaries are at the right place, then create a label in the label track. Within each disc side, there should be no gaps between labels, and no overlapping labels.
- Compare labels against the printed track list, and adjust as needed. If there are multiple tracks listed in a place where there’s only one label, split that label into multiple new labels, using the printed track times, the audio, and the spectrogram as a guide. Merge any labels that are all within the same listed track into a single new label. If the track list doesn’t include times, look at the placement of gaps on the disc itself as a guide for the correct track lengths.
- Export the label track, since it’s a simple text format with all the relevant info for splitting.
- If needed, down‐mix the audio to mono.
- Export the audio from each label to individual files.
Downloading digital media
- Download the files to a subdirectory of
archive
. - Leave the originals in
archive
, and make a copy for tagging and moving tomaster.rw
.
Tagging music files and adding them to the collection
- Get a front cover image, potentially by scanning the cover art. For large cover art, e.g., of 12″ records, use Hugin to stitch together multiple scans.
- Make sure there’s a correct MusicBrainz release, either by adding a new one, or by using an existing one and fixing or completing it if needed. For a CD, attach the extracted Disc ID if needed. I’ve found m17n’s rfc1345 input method very helpful for typing all the punctuation (e.g., curly quotes, various dashes) and scripts (e.g., Cyrillic, Hebrew, Arabic, Greek) in my music collection, without needing to learn a bunch of different keyboard layouts.
- Add the more basic of my custom folksonomy tags to MusicBrainz: tag the release with
added/YYYY/MM/DD
to mark when I added it to my collection, and tag tracks withcontext/hidden-track/pregap
,context/hidden-track/separated-by-silence
, orcontext/hidden-track/unlisted
as appropriate. - Tag the music files with MusicBrainz Picard. When tagging files with no preexisting tags (e.g., from vinyl), be especially careful when matching files against tracks to tag.
- Use Ex Falso to add ReplayGain tags, and then move the files from
archive
tomaster.rw
. The rename pattern I use for moving the files is/home/dseomn/Music/master.rw/<albumartistsort>/<album>/d<discnumber|<discnumber>|XX>t<tracknumber|<tracknumber>|XX>. <artist> - <title>
. - If any of the newly‐moved files have filenames longer than 251 bytes, shorten them to 251 bytes. (251 allows other copies of the collection to add
.mp3
or.ogg
at the end of the filename.) - Move any non‐audio files (e.g., cover art, CD tables of contents, etc.) into the same directory as the music files.
- Run CoHydra with my configuration to generate copies in
profiles
frommaster
. (This does things like ensuring consistent cover image filenames for media players that need that, filtering out files that media players don’t understand, creating a directory with only music videos, and recoding to lossy formats for devices with limited storage.)
After adding music
As soon as possible after adding new music, listen to it once through. For vinyl, pay attention to make sure that the audio corresponds to the track title, and the track boundaries make sense. For CDs, listen for errors that might be correctable by washing and re‐ripping the CD. After getting more acquainted with the music over time, come back to it to add more of my folksonomy tags, then add those tags to the files with Picard.
Every once in a while, run lint-analog-audio-rips
to find vinyls that I started digitizing and forgot to finish. Also, scan the entire collection with Picard to pick up relevant changes in MusicBrainz data.
Leave a Reply