geekiest alarm clock redux.

November 2nd, 2005


As outlined in my other post, I’ve been working on using technology to find an easier way to wake up in the morning. If I had a ton of dough, I might check out this nifty watch (although wearing a watch to bed seems like a bad time, and perhaps even too geeky for me!) and I am sorely tempted to pick up one of these light-based alarm clocks, or one of these incredibly nifty USB X10 home automation systems. However, since right now the emphasis of this project is doing this on the cheap/free, none of those are real options.

This guy seems to posit that the best way to wake up is to be wakened up a little, and then, a lot. This mechanism apparently gently lifts you out of “deep sleep” into “light sleep”, which is (according to him) a more comfortable way to wake up. In that spirit, I’ve added some additional chunks to my Alarm-Clock applescript to wake up the user a little, with the playlist playing very softly at 25% volume, and then play again 15 minutes later, at three times louder or 75% volume. This is also a decent bare-bones example of how to write a subroutine in AppleScript:

***
global sound_volume
global day_of_week

–set user preferences here
set initial_sound_volume to 5
set delay_time_in_minutes to 15
set volume_multiplier to 15
–end user prefs

set day_of_week to (weekday of (current date)) as string
set delay_time_in_seconds to (delay_time_in_minutes * 60)

–with a timeout of one hour
with timeout of 3600 seconds

–first play the playlist softly…
set sound_volume to initial_sound_volume
wake_me_up()

–…wait for a while…
delay delay_time_in_seconds

–…then try again, louder.
tell application “iTunes”
stop
end tell
delay 3
set sound_volume to (sound_volume * volume_multiplier)
wake_me_up()

end timeout

on wake_me_up()
tell application “iTunes”
stop
set sound volume to sound_volume
try
play playlist day_of_week
on error
–do nothing
end try
end tell
return
end wake_me_up
***

~jeff

  • jon joaquin

    After watching Steve Jobs do the Photobooth demo, The idea of using the LCD screen as a flashbulb was brilliant. If you could incorporate an apple script that causes the LCD screen coming awake at different brightness levels, to coincide with your different volume levels, this would mimic also those Fancy alarm clocks that slowly get brighter as the alarm time approaches. Probably more effective in the winter since its darker in the morning.

    What do you think?

  • jimmy

    Jeff,

    http://www.careerbuilder.com

    Love,
    Jimmy

  • http://ldopa.net Jeff

    Jon,

    That’s a really nifty idea. Check back in a couple days and I might have something there.

    Jimmy,

    Yeah, yeah, I know. I’m on it. Now if you’ll excuse me, I’m really into my seventh hour of “Castlevania”.

    ~jeff

  • http://ldopa.net Jeff

    UPDATE: There doesn’t seem to be a way to programmatically adjust the brightness of the screen. Even calling a system event to key 112 (“F1″) returns an error.

    What I did try doing is making a quicktime movie that fades full-screen from pure black to white and run that over the course of 15 minutes v e r y s l o w l y. That was ok, but honestly, not great. The search goes on!