hissing fauna, are you the controller?
posted by mike on January 27th, 2009
Here at Unspace, we like music. I mean, who doesn't, but we like to have music playing all day long while we work. We're the sort of people who actively seek out new bands and love sharing our finds with each other. Our office setup isn't anything special; my laptop is connected to a speaker system, I have iTunes open, I add things to a playlist, and that playlist plays all day long.
Ideally, we'd like anyone in the office to be able to add music to the playlist; previously they would just yell at me and I would add their request to the playlist. iTunes Remote for the iPhone works well, but I don't really want to take out my phone to change the song — I'd rather do it on the screen where I'm working. A quick googling reveals a few solutions for Apache+PHP, one for Windows XP, a million ugly scripts, and even an entire Java servlet. Talk about bloat!
So I decided to roll my own. I'd been eager to try out Sinatra for a long time, and this seemed to fit the bill nicely: it's a small web app that does one simple thing and does it fast. As for the design and layout, we decided to yoink it from iTunes rather than reinventing the wheel.
Interested? You can clone it here. All you need is ruby, rubygems, and the sinatra, rb-appscript, and active_support gems.
Stuff I'd like to add on later:
- Search
- Adding tracks from remote libraries
- Realtime updating
- Track seek
It's an open github project, so feel free to fork and contribute! Read the README for instructions on running the server.

January 27th, 2009 at 10:49 PM
Great little project! Love it!
BTW: If anyone has a hard time to make it work, like what I had. :) Please change the top 3 lines of server.rb from
require ‘rubygems’ require ‘activesupport’ require ‘sinatra’
to
require ‘rubygems’ require ‘sinatra’ require ‘activesupport’
January 28th, 2009 at 12:31 PM
Hah! V. nice.
January 28th, 2009 at 05:14 PM
No music in my office unfortunately, but this is off the hizz! Good job Mike.
January 28th, 2009 at 06:23 PM
Ack! Don’t go clicking on “clear playlist” when you’re just listening to tracks from “Music”. It takes a while to add everything back to that master “playlist”.
January 28th, 2009 at 06:27 PM
Oh, and all your other playlists will get blanked, too. So… making a copy of ”~/Music/iTunes/iTunes Library” is a good idea.
Also, what Libin said about the requires.
January 28th, 2009 at 07:42 PM
Hey, I’m currently working on the exact same thing but using Rails and for iTunes, Mplayer, or Winamp. I figured I couldn’t be the only one with the same idea, and it figures that we’d both be using Ruby to implement it!
January 29th, 2009 at 10:37 AM
Hehe, sorry Grant! DESTRUCTIVE CODE!
January 29th, 2009 at 11:58 PM
Wait, I don’t get why you had to reorder the requires. What kind of error are you getting?
January 31st, 2009 at 06:23 PM
This looks killer! We’ll have to get this set up for the Heroku office :)
February 22nd, 2009 at 08:20 AM
I use Theremin and MPD for this. Love it!