Reapin’ time and sheepin’ time.

Dear reader, I apologise for the lack of blogging recently. Here is a double helping.

First of all, I’ve been having great fun with Reaper. Digital audio workstation software written by the charmingly named Cockos Inc. I remember trying an early version years ago and hating it, but it has come a long way. I’ve tried most of the DAWs, and I think Reaper is now my favourite, especially when you can buy a personal-use license for 60 bucks! (I bought it.) It is available for Mac and Windows, and the bundled collection of plugins isn’t half bad.

My Reaper recording setup.

To all electronics experts reading, I apologise for placing the setup so near a radiator! 🙂

So that’s reaping time, but what about the sheeping time? My dad was looking for some way to run GeneJockey 2. This is a program for editing DNA sequences, and it only ran on Classic Mac OS. He kept an old PowerBook 1300 around to run it, but this was starting to get unreliable.

I obtained a copy of the SheepShaver Mac emulator for Windows, and a ROM file and ready-to-use Mac OS 9 disk image from I put it all on my old Windows laptop for a test. And, it werked!

GeneJockey 2 running in Mac OS 9 on the SheepShaver emulator.

Until next time, don’t fear the reaper!

Resampling in Mac OS part 2 :)

After a few snarky messages from Mac owners, I thought I had better post a follow-up. I experimented a little at the weekend and found the following:

If I leave my soundcard (Audiophile Firewire) permanently on 96kHz, then:

iTunes will resample to 96kHz internally, with quality that sounds just fine.

VLC will output at whatever the sample rate of the media is, and get resampled to 96k by AUHAL on its default quality setting, which sounds a bit sketchy.

But, VLC can be set to always output at a particular rate, resampling internally. There’s an option called “Frequency” in the advanced audio preferences. According to VLC’s debug stream, it uses a module called “bandlimited_resampler”, and that’s encouraging, because it suggests that the guy who coded it knows the word “bandlimited”. It uses about 6% CPU time, and again, sounds fine. Thanks to the wonders of open source, we can see bandlimited.h here! Ooo, a 1536 point sinc kernel with linear interpolation and single-precision floating point arithmetic.

I got VLC’s “Media Library” to work too, so it can store a playlist, remembering what FLAC stuff I have and the track order of it.

I’ve not tried to play DVDs yet, but hopefully the computer won’t catch fire.

So in conclusion, I’m upgrading this from “:(” to “:)”

Resampling in Mac OS :(

Recently I’ve been experimenting with higher definition music downloads. For example, the Studio Masters recordings from Linn Records, or the material from B&W Society Of Sound. Everything went nicely until I got my new Mac.

First of all, the only lossless format supported by iTunes is Apple Lossless. It won’t play FLAC (the open source Free Lossless Audio Codec) properly, even with the extensions, Fluke, or whatever. A bummer, as I already had a fair amount of music in FLAC format. Sure, VLC will play it, but VLC can’t understand iTunes playlists.

Second, Linn don’t support Apple Lossless. They supply their music in FLAC and WMA formats only. I guess they’d rather you bought their own stupid, overpriced DS network media players, even if you have a Mac already.

Third, Mac OS resamples! Windows was smart enough (or dumb enough?) to set your audio hardware to the actual sample rate and bit depth of the track that was currently playing. Or at least the setup I used, Winamp Classic with the ASIO driver, would do that, guaranteeing bit-accurate output under all conditions.

The Mac doesn’t. You set the sample rate and bit depth once and for all in the audio control panel, and all the sound gets resampled to that. You can play 96kHz material till you’re blue in the face, using any player application you like, but if the system sample rate is set to 44.1, it’ll get downsampled. Watch a DVD, and the sound is getting resampled from 48 to 44.1.

I don’t know about you, but I wouldn’t trust any resampling algorithm I hadn’t written or at least tested myself. They’re notoriously hard to get right. And a “right” one consumes so much CPU power that there’s a real incentive to downgrade the performance deliberately.

Here’s the official line from the Coreaudio mailing list, found here

This was a comment posed to the list (which was replayed verbatim from Benchmark’s Elias Gwinn)
> […] If the user changes CoreAudio’s sample-rate in AudioMIDI Setup to something different than what iTunes is locked to, CoreAudio will convert the sample rate of the audio that it is receiving from iTunes. In this case, the audio may be undergoing two levels of sample-rate conversion (once by iTunes and once by CoreAudio). (The SRC in iTunes is of very high quality (virtually inaudible), but the SRC in CoreAudio is horrible and will cause significant distortion.) If the user wants to change the sample rate of CoreAudio, iTunes should be restarted so that it can lock to the correct sample rate.

This is the response from an Apple employee:
iTunes uses the AudioConverter API internally but we set the quality to “max” and AUHAL probably uses the default (I don’t know). One SRC at max quality followed by one at the default quality is not so great when analyzing sine tone playback.

So the bottom line seems to be, that if you have material recorded at a higher sample rate than 44.1, then you need to turn your system’s sample rate up to appreciate it. And if you do that, then all of your other stuff will get upsampled, though at least it uses Coreaudio’s best quality algorithm. Or does it? Leopard introduced a new “Mastering grade” algorithm, and it’s not obvious whether that one is used.

One step forward, two back. Come on Apple, twiddle those nose rings and come up with a sexy solution.