iTunes Ratings

From OmniNerd: Playing Favourites, I decided to run my own version of the experiment that compares how often songs with different ratings get played by iTunes. The difference with my experiment is that it has 101 tracks, each with a different rating (0, 1, …, 99, 100). To start with, I created a new user, so I wouldn’t have to muck around with my own iTunes library. I recorded a short empty track with Sound Studio. That is, I started the application, pressed Record, then Stop, and saved this. Then, I imported this track into iTunes, and made it so it was only 0.01 seconds in length (use Info, Options, Stop Time). This will make the experiment much faster than the previous one, which had 1 second tracks. I’m not that concerned it’s an AIFF, as I made this script to create the 101 empty tracks, as AAC or MP3:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    tell application "iTunes"
    	set i to 0
    	set base to first item of selection
    	repeat 101 times
    		set trk to first item of (convert base)
    		set name of trk to i
    		set rating of trk to i
    		set i to i + 1
    	end repeat
    end tell

This will duplicate the selected track (or the first track of the selection, if you have more than one) 101 times. It will then give a name to each of these, 0-100, and assign the same rating as the name. Since doing this also seemed to play the tracks once, I used the following script to reset the play count. The bonus is that it can be used to reset the play counts and run the experiment again, with different parameters.

1
2
3
4
5
    tell application "iTunes"
    	repeat with trk in selection
    		set played count of trk to 0
    	end repeat
    end tell

It’s now time to run the experiment. I set the Party Shuffle to use the Library, and to play higher rated songs more often. Then I clicked play, and went away for about 12 hours. • When I came back, I could see what the data was starting to look like, but I grabbed the data using this script anyway:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
    tell application "iTunes"
    	set theData to {}
    	repeat with trk in selection
    		set theRating to name of trk
    		set theCount to played count of trk
    		set thisData to {theRating, theCount}
    		copy thisData to the end of theData
    	end repeat
    end tell
    
    get theData
    
    tell application "TextEdit"
    	set theDoc to make new document
    	repeat with thisData in theData
    		set text of theDoc to text of theDoc & (first item of thisData) & "," & (second item of thisData) & return
    	end repeat
    end tell

Then, I saved this file as a CSV file, and imported it into Excel, which when plotted, gives the following graph: To me, the results look pretty clear. iTunes does not take into account the actual rating, only the star value. Even the new half-stars aren’t notably different. I’ll continue to run the experiment, and put up another post later. I may change some things, and rerun the original experiment, just to confirm it, although my results seem to do this already.

Dymocks and Non-Fiction

I love to browse bookshops. Back in the day, when I had money, I always bought at least one book. Now, I spend more time at libraries and second-hand bookshops. On Saturday, as we tried to avoid the heat, we went to the movies at Marion Shopping Centre. We saw Mrs. Henderson Presents…, but more on that later. We ate at Shenannigans, but more on that later. We had a coffee at Coffee Club, and I won’t elaborate on that.

However, after all of this, we still had a little time free, so we went into Dymocks. I tend to looks briefly at the specials, and then head over to the Popular Science and Non-Fiction sections. After browsing for a little while, I came across a collection of the Onion. I read a bit of it, and took it over to show Jaq, as there was something funny on the front cover. I think it was:

US Military clears A-Team of all charges

I used to love that show. Anyway, back onto the story. After flicking through it for a few minutes, I returned to the shelf I grabbed it from. And imagine my surprise in what section that was: Now seriously, Dymocks. It doesn’t take a very long read of the Onion to realise that it’s not Non-Fiction.

iTunes Ratings now support half-stars

I updated to iTunes 6.0.2, and looky what I found: Now, the trick is that it needs to be exactly 10, 30, 50, 70 or 90 in order to be a half-star. A rating of 75 will still appear to be three stars. I think this is a bug. I’ve written some code that does it better:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
    property star : «data utxt2605» as Unicode text
    property half : «data utxt00BD» as Unicode text
    property quarter : «data utxt00BC» as Unicode text
    property threeq : «data utxt00BE» as Unicode text
    
    on myRating(theRating)
    	set theResult to ""
    	repeat 5 times
    		if theRating > 20 then
    			set theResult to theResult & star
    		else if theRating > 15 then
    			set theResult to theResult & threeq
    		else if theRating > 10 then
    			set theResult to theResult & half
    		else if theRating > 5 then
    			set theResult to theResult & quarter
    		end if
    		set theRating to theRating - 20
    	end repeat
    	return theResult
    end myRating

I’m currently using this to get the ratings data to add to my blog posts: at the moment it’s a FastScript that just inserts the data via the clipboard, but when Blogsome gets XMLRPC working again, it will be an ecto script.

It’s Still Rock And Roll To Me • [Billy Joel][2] • [Greatest Hits][3] ★★¼

[2]: http://www.google.com/search?q=%22Billy Joel%22 [3]: http://www.google.com/search?q=%22Greatest Hits%22

Invisibilia

Invisibilia Invisible Sleep I’m going to do one of these!

Alas, poor PacMan. I knew him, Ghosts.

I Guess We’ll Just Have To Adjust: The Creatures In His Head Whether ’tis nobler in the mind to suffer the slings and arrows of outrageous video games…

Fall On Me • R.E.M. • [The Best Of R.E.M.][4] ★★

[4]: http://www.google.com/search?q=%22The Best Of R.E.M.%22

WYSIWYG editing for Blogsome

I’ve spent a bit of time working on getting some plugins working under Blogsome. In particular, TineMCE-Wordpress and WYSI-Wordpress. Neither of them worked too well, and they both just removed the Quicktags. I’ve also downloaded the TinyMCE source: I may implement a subset of that in a single file, and get that working with Blogsome. I also tried getting the Gravatar plugin to work, but this fails, as the Post Editor seems to screw up the tags, putting in a close tag. And self-closing the tag fails. <gravatar matt@schinckel.net> becomes <gravatar matt@schinckel.net></gravatar> And <gravatar matt@schinckel.net /> gets changed into <img class=“postgrav” src=“wp-content/gravatars/blank_gravatar.png” alt=“a gravatar image”> by the plugin, not what it should look like. Which, by the way, isn’t Valid XHTML! Note: these are not installed on the actual Blogsome server, but a Test one.

The More I See You • [Chris Montez][4] • [Room Service][5] ★★

[4]: http://www.google.com/search?q=%22Chris Montez%22 [5]: http://www.google.com/search?q=%22Room Service%22

Hot Weather and Renovations

The last few days has seen extreme weather in Adelaide. 42°C for 4 days in a row. And this at the time we decided to:

  • Chop down the 13 Cypress Pines along the side fence.
  • Remove the old air-conditioner and brick up the cavity.
  • Knock down the old greenhouse.

Mum and Dad were up from Naracoorte to help us - Dad manned the chainsaw and they brought with them a 14" × 6" trailer, which we loaded up with Cypress offcuts. We kept the trunks, as they are pretty straight, and we’ll use them for garden beds. Anyway, we got all of that done - and a lot of it in shorter time than anticipated. The cutting down of the trees only took about 4 hours, which is lucky, as we may not have completed it otherwise. It was so damn hot. I took a heap of pictures. One day I’ll get around to posting some more.

Telling iTunes Audiobooks are not Music

I’ve just converted an Audio Book to AAC - I’m ashamed to say it’s The Da Vinci Code, but, well… Anyway, I was a bit peeved that it doesn’t show up as an Audiobook when you use the search feature of iTunes. And none of the tips I came across seemed to fix it:

  • Rename the file so it’s *.m4b instead of *.m4a
  • Use the Make Bookmarkable script from Doug’s AppleScripts
  • Set the Type Code to “M4B "

Then I read this, at macintouch (iPod: File Management):

If I remember correctly, an iTunes audio book is little more than a renamed AAC file. The steps necessary for making your own are pretty simple:

  1. Convert the file to AAC format (if it isn’t already)
  2. Make sure it’s not in the iTunes library. (Otherwise iTunes may not recognize the change.)
  3. Set the file type to “M4B " if you’re on a Mac (only necessary if you’re using a Mac)
  4. Rename the file to have an “.m4b” extension
  5. Add it back to the iTunes library

Look at #2. That does the trick. Now, I just need to see if the Join Together and Chapterize script will ever finish…

How not to prevent someone installing your software.

I have data in my Apple Address Book, that I’d like to merge into a Word Document (or even an AppleWorks one, if it comes to that). However, there only seems to be one way to do that - using a commercial piece of software called Office Power Pack. Which doesn’t seem to be available anymore, other than through a couple of download mirrors. So I downloaded it, just to see what it’s like. And when you go to install it, it asks for a license key. But, if you look inside the Installer.app package, you’ll find the applications that it installs. Double-clicking on one kindly informs you of where it needs to be installed to work. Dragging it there makes it work - although it doesn’t seem to be accesible from a menu within Word. • Having done this, I’m glad I didn’t pay money for this. It is limited to a subset of the Address Book data (no mobile phone, no Related Names fields, which I need), and doesn’t even keep a live query, but exports the data to a text file. Hell, I could have done this with a shell script and contacts. Or some fancy AppleScripting, almost. What I’d like to see is an ODBC connection to the Address Book. Or even better a proper link between Word and the Address Book. Perhaps Pages can do this. I might have to investigate.

State League

I played my first game of representative Touch in about a year yesterday. And I loved it. My team, the Central Scorpions, won by 11-4 over the Wolves. And I scored either 4 or 5 Touchdowns. I think having not played for so long just made me so hungry. And I feasted.