This is a nerdy post. I’m telling you that before you get sucked in. In short, I use my computer, which resides in my office, to send a continuous alarm to a set of speakers in my bedroom. I do this with a couple of AppleScripts and a cronjob. If what I said made you wonder if I was speaking a second language, this is not the post for you. However, as some of you have expressed a little bit of wonder at my Rube Goldberg alarm clock, I decided that I’d write it up. Here goes!
Why All the Trouble?
I’m a night owl. My most productive hours are 2200-0200, as shown by the timestamp on this post. I sleep better in the morning after the sun has come up than I do most of the time at night. My best sleep hours start at 0400. I have more than a year’s worth of data to prove this, as I’ve been tracking my sleep with Sleep Cycle alarm clock for more than two years. My ideal work schedule would be 1200-2100, as I could sleep in until 1030 or so.
The world does not live on my schedule.
My mother can tell you that waking me up is not easy. [I told her about this setup and she laughed for like 10 seconds. “Does it work? I bet it doesn’t work.” THANKS, MOM.] When I am at their house, she will stand at the door and repeat my name for a minute or two before I sleepily wonder just what in tarnation is going on. My MSMS roommates will tell you that I can get out of bed, walk across the room, turn the alarm off, get back in bed, and go right back to sleep. I can tell you that I’ve moved my alarm clock any number of times. I used to re-arrange my bedroom furniture every sixth months to fight this.
Yet what I’m doing right now is working. I explained it a couple of weeks ago on Facebook, and they were stunned to see the process. As such, I feel that I owe you an explanation.
What’s Happening Here?
I am piping audio around my house. This is starting to come into vogue with hardware and software solutions that replace things like Sonus systems, setups that run into the high hundreds and low thousands of dollars. This isn’t necessary anymore, especially if you use a Mac.
- Any old Mac
- Airport Express (AE)
- Stereo speakers, self-powered, that accept 1/8″ input.
To make this work, connect the speakers to the AE. The AE serves as an AirPlay point that can be used for all sorts of things, including this alarm system. I pipe all sorts of audio to my bedroom, mainly a Web stream of BBC World Service and radio captured on my radioSHARK. [I’ll talk about these later, especially if there’s interest. The AppleScript that I have for the BBCWS stream is kinda fun.]
- Meridian. [This is shareware/abandonware that is no longer in development.]
Airfoil has a Windows version, too, but it’s still aimed at AirPlay. You’ll have to figure out how to automate Windows on your own, though.
Let’s Go, Baby
Here’s the chain of events:
- The night before, I use Audacity record an M4A of what I want to hear the next morning when I am waking up. I Export this file to ~/Documents/Alarms/. I name the file YYYYMMDD of the date I’ll be waking up. I found out tonight that using the same datestamp twice will cause the next step to fail.
- I fire off meridian-alarms.scpt using Launchbar. [If you’re trying to do this and haven’t been using Launchbar or Quicksilver: WTF, yo.] This 1) quits Meridian then 2) moves the file from ~/Documents/Alarms/ to ~/Library/Sounds/ and 3) re-activates Meridian. The quit/restart option is required for Meridian to know that the new alarm exists. [I’d like to thank the dev for telling me how to do this.] The only hitch is that you do have to click on a dialog box to quit.
- Go into the preferences for the Alarm and set the new wakeup sound to the file that you’ve just made. Failure to do this gets you the previous day’s alarm. Make sure that the Continuous option is checked, or you’ll hear yourself for 12 seconds and nevermore.
- Set up a fire-off time with Cronnix to run meridian-pipe.scpt. This will set you up for piped audio from Meridian to those speakers at alarm time.
- Go the fuck to sleep.
- Come wakey time, your cronjob will fire. Airfoil will be routing sound from Meridian to your bedroom speakers. Once your alarm fires, you’ll be hearing yourself from the night before.
Here are some screenshots that may help you understand what’s happening:
To kill the alarm, you’re going to have to get out of bed, walk out of your bedroom, find the computer in whatever room you keep, sit down, and turn the alarm off. I find that the combination of a) hearing why I need to be awake and b) having to do a lot of work to stay asleep makes things work for me.
How to Make This Work for You
I generalized the scripts, which have things like YOUR_HD, YOUR_USERNAME, and YOUR_AE in them. Please change those values to appropriate ones for you. Spaces are okay: my HDD is “HAL 9000”, which plays a part in the weird world of how I name my computers and attached hardware. [That naming system is now out of date.]
Is this overly nerdy? You bet. If one person uses this craziness, I’ll be happy.