AutoRater

Done! iTunes AutoRater runs in the background, monitoring the currently playing song in iTunes. When the song changes, it up- or down-rates it according to how long the song played for. What I will(may?) do is merge this code with that for iTunesRater, so that you can rate songs, and it will also Auto-Rate them. Maybe I won’t do this, since these two are separate tasks. I wonder if the current ratings are a little aggressive: -5/+10 seems like a big change. I’ll take feedback, and in a future version (perhaps I’ll make this a preferences panel, where you can choose the maximum rating changes. Anyway, version 0.1 is available. Caveat User! (Back up your iTunes Library regularly!)

SMB devices disconnect on sleep.

That title pretty much sums it up. If you have an SMB server mounted, and you put the Mac to sleep, then the server is no longer mounted when you wake it up. Windows XP does not have this problem. Windows XP also mounts all servers it can find, removing the need for hacks like creating a mount script and putting it into your LoginItems.

iTunes Auto-Rater

One of the comments to my MacOSXHints.com hint about rating iTunes songs with ratings other than the simple 0-5 stars gave me an idea for a program. Basically, it’s a daemon/controller for iTunes, that sits there and monitors the currently playing track. The rationale is that if you listen to the whole track, you like the song and want to increase the rating, and if you skip it, you are getting a bit sick of it, so you want to reduce the rating. Since there is no way to determine when a track changes, you have to continually poll iTunes for the track info. What you could do is when a new song is discovered, store the track length in a variable. Then, keep track of the amount of time that that track remains playing, and if it is close to the full track length (say, 95%?) then increase the rating. If you only listened to a small part of it, then reduce the rating. You could even have it so the rating is increased/reduced by 1 for every 5% of the song either side of 50% that you listen to. Or, you could just have it so it either increases (by 10?) or reduces (by 5) at a certain threshold. Writing this program as an AppleScript Studio program should be quite simple. UPDATE: Visit AutoRater for details on the first working version.

iTunes Consolidate Library

The iTunes menu item ‘Consolidate Library’ gathers all music & files in the library, and copies them to the library folder if they aren’t already. However, if you have multiple users with a shared library folder, to reduce space usage, and both users consolidate to a new location, iTunes will create 2 copies of each track. What I’ll need to do now is delete the second copy of each track (seems simple, since all 2nd copies end in 1, but some songs also end in a 1!), and then find a way to ‘re-attach’ the missing tracks to the file they should correspond to. To delete files:

$ cd <Music Folder>
$ find . -name "* 1.m??" -newer <file of correct age> -exec rm {} \;

To reattach:

tell application "iTunes"
    --if song location is unknown then 
    --attach file according to 
    --it's track_number, title, 
    --artist and album details
end tell

Coding on Palm

I don’t write too many blog entries on my Zire (thanks to Jason, I’m not game to call it my Palm), and I just remembered why. It takes ages to enter data, and the error rate is too high. I was just trying to write a program in python (to run at home - I need to reinstall it on my Zire) and writing commas in particular is quite difficult. I might get around to buying a keyboard, or maybe just a laptop! I kind of like graffiti, but I wonder what the Palms with a keyboard are like. Using a retractable pen with the tip up is more comfy than the stylus.

Transferrence (iTunes Library Migration)

I’m putting my whole iTunes Library, and all of my iPhoto pictures, and the various movies I’ve collected onto my NSLU2. To shift the iTunes library, I just changed the library location in the Advanced Preferences, and then Consolidated the Library. I’m hoping I’ll be able to do exactly the same with Jaq’s and it won’t actually have to copy the files across, as they will already be there. It will be interesting to see how clever it is. It takes a couple of hours to transfer the many gigabytes of music I’ve encoded, so hopefully it won’t have to be completely redone. Either way, it will keep all of my ratings, and so forth. My tip for sharing songs from a library between multiple users - just point all of the iTuneses at the same location for storing the files, and make sure all of them are set up the same in terms of organising. When one person adds songs, the others just need to drag the folder/disk onto the iTunes Library icon in iTunes, and only the new files will be added. There are occasionally issues when someone changes an album or track name, but iTunes seems to cope pretty well most of the time.

NSLU2 on MacOS X

The instructions for installing an NSLU2 are designed for using a Windows box - but it’s easy enough to set it up using any OS. Just use the web server built in, and use an address of 192.168.1.77 and username/password of admin/admin. Following the NSLU2-Linux instructions on unslinging is easy too, except I didn’t know what to do after unslinging and rebooting - ie I cannot telnet back into the box! What you need to do is change the password after connecting the disk but before rebooting: # passwd [enter new password twice] # cp /etc/passwd /share/hdd/conf/passwd # ln -sf /share/hdd/conf/passwd /etc/passwd Then you need to reboot (or maybe you don’t, I did just to test the password stuck!), re-enable telnet login, and you can begin to install packages.

iTunesRater 0.1

As much as I like to bitch and moan about AppleScript, AppleScriptStudio isn’t too bad for creating simple applications. In a couple of hours, I just wrote a simple stand-alone application that monitors the current song playing in iTunes, and allows rating to occur, independent of the iTunes window. It also allows for a larger range of values as the rating, rather than the iTunes 0-5 stars. The tick marks are on the slider so you can see what the current rating will be in terms of the iTunes display. Features:

  • Automatically updates display from iTunes when song changes
  • Automatically updates iTunes rating whenever it’s changed
  • Allows for more flexible rating than basic iTunes, and most other programs capable of changing ratings.
  • Unobtrusive, can sit in the corner of the screen while working.

Limitations:

  • Ugly icon

I take no responsibility if this toasts your iTunes library - I use it with mine, but your mileage may vary. Here’s a little screenshot, and the archive is iTunes Rater. (Only Version 0.2 is still available!) Itunesrater The AppleScript code is IMHO interesting:

Gott wüfelt nicht

This March is the 100 year anniversary of Einstein’s Special Theory of Relativity.

The Science of Eternal Sunshine

I just started reading “Mind Wide Open: Your Brain and the Neuroscience of Everyday Life” (Steven Johnson) today, and then find a link to his blog tonight. Synchronicity! After reading through most of the stuff there, and subscribing to his RSS feed so I don’t miss anything, I finally found a link to a review he wrote of the Jim Carrey movie Eternal Sunshine of the Spotless Mind. I’ve just read, in creating the links that it was a Kaufman film (ie. Being John Malkovitch / Adaptation). I may have to rent it and have a watch. So, here’s SBJ’s article: The Science of Eternal Sunshine - You can’t erase your boyfriend from your brain, but the movie gets the rest of it right. By Steven Johnson: http://slate.msn.com/id/2097502/ iTunes: Your Disco Needs You from the album “Light Years” by Kylie Minogue