Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Using iTunes with more specialized music players Apps
iTunes can play 'bit-perfect' music losslessly, but only if you do several things. The internal volume control must be set to the max, all digital signal processing, including equalizers, must be turned off, and the sample rate of the track you want to play must be set properly in Audio MIDI Setup before you open iTunes, which means if there is a sample mismatch, you either have to close iTunes, reset Audio MIDI Setup to the desired value, and then restart iTunes.

For example, if you have a CD, you can rip it to Apple Lossless files. These have a bit-depth of 16 bits and a sampling frequency of 44.1 kHz. If you purchase and down-load higher-definition music, perhaps 24-bit, 96kHz sampled lossless FLAC files, you can convert them to Apple Lossless without degrading the content (XLD is one such free software option). Now let's say you want to play the two sets of tracks sequentially. If you start iTunes playing the ripped CD and Audio MIDI Setup is set to 44.1 kHz sampling, the ripped CD can be played without degrading the content, but when iTunes reaches the 96kHz music, CoreAudio will down-sample it to 44.1 kHz, thus negating any benefit of having the higher sampling frequency.

Obviously, stopping iTunes, manually changing Audio MIDI Setup, and restarting iTunes quickly becomes a drag, so I came up with a hack that lets you avoid this problem. It involves using iTunes as a music browser that then hands over the task of playing the music to a more specialized player application that deals with the above-mentioned complications seamlessly and automatically. There is commercial software you can pay nearly a thousand dollars for to do this. The following hack enables you to do this at no cost.

The first thing you need to do is obtain and install the open-source, free player Audirvana from GoogleCode. Make sure 'Exclusive Access' mode is set in the Preferences.

You can drag and drop a succession of playlists or albums of different sampling frequencies from iTunes into the Audirvana playlist window and then hit the play button, and Audirvana will play all the music with bit-perfection, changing Audio MIDI Setup to match each track on the fly.

However, the following allows you to completely automate the process, eliminating the need to drag and drop the music from iTunes into the playlist window. It has the added advantage of permitting you to do this using Apple's Remote.app from your iPad, iPod, iPhone, etc., something Audirvana on its own cannot (yet) do.

To automate the handoff process:
  • Download this compressed disk image and open it.
  • You will find three folders. They are called etc, iTunes Plug-ins, and Scripts.
  • Drag and drop the etc folder into your root-level /Library/iTunes directory.
  • If you already have an 'iTunes Plug-ins' folder in /Library/iTunes, then put the plug-in into that folder. If not, drag and drop the folder into /Library/iTunes.
  • If you already have a 'Scripts' folder in /Library/iTunes , then put the AppleScript into that folder. If not, drag and drop the folder into /Library/iTunes.
  • You can use your home directory ~/Library/iTunes for the previous two items if you prefer, but the etc folder must go into /Library/iTunes.
  • You have to enable access for assistive devices in the Universal Access pane of System Preferences. This enables GUI scripting, which is unfortunately necessary as Audirvana is not yet really AppleScript amenable.
What are these components?

In there are a set of shell scripts that have embedded osascript (AppleScript) directives. The one called nyquist_audirvana.zsh is for Audirvana, and the one called nyquist_decibel.zsh is for Decibel. The one called null.zsh doesn't do anything. The distributed AppleScript enables you to select from these three options.

In Itunes Plug-ins, there is a hacked version of the visualizer plug-in example that comes as an optional SDK for Xcode. iTunes runs these things whether or not you display them. Since I can't code my way out of a wet paper bag, it has one line in it that invokes the shell scripts from etc.

The script in allows you to choose to use iTunes with Audirvana, to use iTunes with Decibel, or to use iTunes by itself (or however else you normally happen to use iTunes).

[crarko adds: I haven't tested this one. I looked over the contents of the disk image and have mirrored it here.]
    •    
  • Currently 3.67 / 5
  You rated: 2 / 5 (9 votes cast)
 
[9,457 views]  

Using iTunes with more specialized music players | 4 comments | Create New Account
Click here to return to the 'Using iTunes with more specialized music players' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Using iTunes with more specialized music players
Authored by: ornette1 on Apr 16, '11 07:52:52AM

I use Audirvana so I installed this. Seems to work as advertised. Thanks!



[ Reply to This | # ]
Using iTunes with more specialized music players
Authored by: Cantabridge on Apr 17, '11 10:05:24AM

It is also necessary to turn of "Reload last playlist at start" in the General tab in Audirvana preferences. Otherwise -- if you've used the program before (so it has a playlist to reload) -- the iTunes script hangs at the point of transferring the playlist over to Audirvana. Just figured that one out...

I'm not yet sure my ears can hear the difference, but everything does seem to work as advertised.



[ Reply to This | # ]
Using iTunes with more specialized music players
Authored by: asmeurer on Jul 26, '11 04:20:47PM

How did you verify that with these options all set that iTunes does indeed play the music losslessly?



[ Reply to This | # ]
Using iTunes with more specialized music players
Authored by: GeJe on Aug 08, '11 03:51:29PM

Great tip, any chance to have the plug in recoded in 64 bit so it works with newer iTunes ?



[ Reply to This | # ]