Musical alarm clock script

project , published by Maarten Tromp

Summary

My noisy computer had been my alarm clock for almost a year. But now that my computer was silent enough to just leave on during the night, how about waking up with some nice music instead?

In 2002 you either had an alarm clock or a clock radio. Some mobile phones had an alarm clock built-in that could beep, but it would be years before there were apps or music players on phones. So mainly you had the choice between a device beeping at you or a radio.

If you were creative you could hook your stereo up to a mains timer switch and wake up with music from cd or tape. Or use computer controlled relays to power on some devices (lights, coffee maker). But subtly fading in music was not an option.

Unless, of course, you leave your speakers on and automate the music player and volume control on your computer.

And that is exactly what this script does. It can pause and unpause xmms, my main music player (sort of Winamp), and control the audio mixer master volume.

In the morning it would put the volume all the way down and start playing. The volume is slowly increased to a normal level over the course of about one minute. But the increasing continues some more after that, to give you some incentive for getting out of bed.

In the evening the script would do the reverse. It would slowly decrease the volume over the course of half an hour. Once the volume is all the way down, it pauses the music again.

Fine-tuning the curves was done by trial and error. When you increase the volume to fast, it feels very abrupt. You might as well use an alarm clock then. But when increasing the volume too slow I got very sensitive to sounds in the morning. A bird call would wake me up. The values that worked for me are hard-coded in the script.

To set your alarm clock, the script would call at and schedule itself for the next morning. And once that line is in your bash history you can set your alarm very quickly.

This script instantly became my new alarm clock for the next year. It worked perfectly until the day I moved house and didn't have a computer in my bedroom any more.

For the first half year I had the script wake me up with my then favourite album (Zink by Bloem de Ligny). This was not a very good idea, soon it stopped being my favourite album. So I modified the script to continue whatever was playing in the evening and that worked better.

Some years later I made a system that slowly increases light to wake you up.

The script is available in the downloads directory.