Computers should beep more
Writing sustains me.
The kettle beeps. Oh yeah!
Ramen sustains me, too.
I’ve been referring my friends to Dan Luu’s 95%-ile isn’t that good. Specifically, how it’s simple to improve your flow by analyzing yourself & getting feedback (emphasis added):
[…] For example, I noticed how I’d get distracted for N minutes if I read something on the internet when I needed to wait for two minutes, so I made sure to keep a queue of useful work to fill dead time (and if I was working on something very latency sensitive where I didn’t want to task switch, I’d do nothing until I was done waiting).
Every time I read his article, I’m inspired to analyze how I work and improve my flow.
This time I’m convinced: computers should beep more.
*Beeps productively*
I don’t mean beeps — or sound in general — as a matter of delight, which is more Josh W. Comeau’s thing (although I do love how he uses sound)—I mean sound as a matter of productivity:
- *beep* when Visual Studio finishes a long build
- *beep* when a slow command line fails
- *beep* when a 5-minute installation completes
In other words, *beep* when I need to return to something I might have forgotten.
This isn’t a new idea: experts call these “eyes-free” or “partial attention” scenarios. I worked at Dr. Bruce Walker’s Sonification Lab at Georgia Tech—which studies sound design for data & interactions—and a chapter he cowrote for The Sonification Handbook includes “status and progress indicators” (that let users “have their eyes free for other tasks") as 1 of 4 broad "functions” of auditory displays. There’s plenty more history:
- The BEL character, in ASCII (~1960s) and even earlier codes (1870s/1900s), rings a physical bell on old teletypes (and plays a sound in modern terminals).
- PC startup noises, from early OS’s until now, signal the end of long boot processes.
- The popular screen reader NVDA (and some internal versions of macOS Finder!) beeps as progress bars fill up.
But most of the tools I use don’t have sounds for notifications like this, not by default.
How useful is a beep?
I know I get sidetracked waiting for slow things, but I wanted to quantify it.
Immediately after reading Luu’s article, I altered my terminal to beep after long-running commands, but I was unable to do this for Visual Studio builds — a great opportunity to experiment.
So for 3 days at work, I measured how much time I lost to distraction waiting for builds in Visual Studio. How much time would I lose when I’d get distracted and not realize a build finished?
Over 3 days (full data in appendix):
- I wasted nearly 20 minutes total getting sidetracked while waiting for builds to complete.
- I wasted an average of about 1min 15s per build.
- Extrapolating, I waste about 30 minutes per week—6% of an 8-hour day, every week (assuming 7 builds/day).
Not a huge amount of waste, but it’s all preventable.
(Plus, over the next few days I wasted 7min, 8min, and even 24min on some builds. But I didn’t include them in my analysis since I wasn’t as rigorous about measuring).
Is the problem beeper deeper?
Looking deeper at the data tells an interesting story — only 16 builds over 3 days means I’m not building very often. Namely, a couple of things help me:
- REPLs & interpreters: I often work in PowerShell, which is interpreted & does not need to compile.
- Hot reload: Visual Studio will instantly update my UI when I make changes, so I don’t need to do a full build frequently (indeed, most of my builds were to get to an initial state that I could then update "live").
Also, I have a lot of meetings, so I build code less often than some folks.
If you’re trying to diagnose poor productivity, there are plenty more levels to go beyond "because my computer didn’t beep":
- "Our project doesn’t support enough hot reloading"
- “Our project shouldn’t require compilation”
- “Our project should compile faster”
- “Our project should catch more errors before build”
- etc.
If you can fix these problems, do so! You’ll save more time for your team than beeps will. But those problems can be expensive to fix. While you fix them, beeps might help.
Don’t choose the first beep you see
Now, not all beeps are good beeps. In fact, your typical square-wave “beep” is a very bad beep to use for notifications.
In the podcast linked above, Matthew Bennett (who designed the Windows 11 sounds) describes sound fatigue:
Matthew: There’s noise pollution in the digital world, the same way there’s noise pollution in the physical world. And just because the sound is not 110 decibels, doesn’t mean that it can’t create anxiety and annoyance.
We’re evolutionarily wired to respond with fight or flight to sounds that are unexpected. And especially to sounds that have certain kinds of characteristics.
Narrator: Notification sounds are usually sudden and surprising. They also tend to be high-pitched and dissonant. These types of sounds trigger an immediate physiological response.Matthew: A cortisol rush, increased blood pressure, heart rate, things like that. And you only need one or two of those sounds to really throw off your work session or your Zoom call.
A simple sine or square wave beep is a terrible sound for those reasons: sudden & surprising, high-pitched & dissonant. I don’t want sine wave beeps.
I also don’t want long beeps—like the 4-second Windows 10 notification sound. When you’re having a bad day and your builds are failing again & again, hearing a drawn-out 4-second beep every time feels like extra punishment for messing up. I remember drafting a pitch at work where we considered playing that sound, just in the background, to demonstrate how fatiguing it could be; and I remember people visibly flinched. I bet we could have shortened the pitch to that :).
Finally, I want my beeps to be useful. If I’m still paying attention to a process, beeping when it finishes might be annoying. Don’t tell me what I already know, unless it’s delightful.
In an email with me, Matthew summarizes the goal as “calm but audible,” specifically designed with things like attenuated attack to avoid provoking a stress response. Short, but not so short that it’s “easy to miss from the other room.”
Give me something short & soft, like macOS’s Pop or Windows Ding.wav.
How do I beeping do it?
So I want short, delightful beeps that play at useful points as I work. Here’s how I did it:
PowerShell
On Windows, I have PowerShell play a short sound (no [Console]::Beep()
sine waves, please) if commands take a few seconds, using the SoundPlayer
API:
(New-Object System.Media.SoundPlayer "$env:windir\Media\Windows Ding.wav").Play()
Full PowerShell example
# In user_profile.ps1 (e.g. $PROFILE)
$Prompt = {
# Somewhere in my prompt...
$previousCommand = Get-History -Count 1
if ($previousCommand.Id -ne $env:_BESTO_LAST_COMMAND_ID) {
$env:_BESTO_LAST_COMMAND_ID = $previousCommand.Id
$elapsedTime = $previousCommand.EndExecutionTime - $previousCommand.StartExecutionTime
# This is the trick---only play the sound if the command took a while!
if ($elapsedTime.TotalSeconds -ge 3) {
(New-Object System.Media.SoundPlayer "$env:windir\Media\Windows Ding.wav").Play()
}
}
}
ZSH
On my Mac, I use afplay
to play a sound if a command takes a few seconds (eventually I’d like to make this an OhMyZsh plugin):
# afplay hangs a bit, so run on a background thread
(afplay /System/Library/Sounds/Frog.aiff -q 1 &) > /dev/null
Full ZSH example
function beep_if_last_command_slow {
# https://askubuntu.com/a/407761
local lastCommand=$(fc -l -D | tail -n1)
local lastCommandId=$(echo $lastCommand | awk '{print $1}')
local seconds=$(echo $lastCommand | awk '{print $2}' | awk -F: '{ print ($1 * 60) + $2 }')
if [[ $seconds -gt 1 && $lastCommandId -ne $BESTO_LAST_COMMAND_ID ]]; then
# Play a nice sound! & remember that we did so for this command.
(afplay /System/Library/Sounds/Frog.aiff -q 1 &) > /dev/null
export BESTO_LAST_COMMAND_ID="$lastCommandId"
fi
}
# Run this in your precmd, not in your prompt, so you don't spawn a subshell.
precmd() {
beep_if_last_command_slow
}
See also: OhMyZsh bgnotify
XCode
Use the Behaviors page in Settings:
- XCode > Settings > Behaviors
- Under Succeeds and Fails, check Play sound.
- Choose a cool sound!
Done!
Visual Studio
Still working on it 😀. Control Panel used to work, but it’s not been working for me recently.
Final thoughts
Sound — and beeps — can make computers more delightful. Sound can make our computers more joyous to use, and it can help us focus on the work we care about.
Computers should beep more, in ways that help us & bring us joy. The beeps I’ve added will save me over 30min a week, and they’ll bring me a little delight whenever they do.
I’ve added some beeps to my life. I hope you do, too.
Thanks to Matthew Bennett for consulting on this article. Thanks to Atherai Maran for editing.
Appendix: bad beeps
For what it’s worth, the world is full of bad beeps, just as it’s full of way-too-bright blue LEDs that HackerNews users complain about. I think that may be one reason modern UI has few beeps at all: we’re so tired of those cheap, loud mechanical beepers in old computers that no one wants to propose new beeps.
Interestingly, the beeping seems to be getting worse outside of computing. Here are some bad beeps without thinking too hard:
- My microwave’s beep
- My kettle’s beep (yes, the one I mentioned in the lede… I’d prefer a subtler beep, or the *click* of my old kettle’s switch)
- My air conditioner beep
- My apartment callbox buzzer (a buzz, not a beep, but it scares me enough every time that I’m shaming it here)
- My apartment elevator buzzer (scares me, too)
- My parents’ oven beep, fridge beep, and dishwasher beep
- My parents’ alarm system beep (on every tap!)
I bet it’s because beepers are like $0.005 cheaper than speakers, and they don’t require contracting a sound designer.
Appendix: further reading
If you’re interested in designing better beeps, there’s plenty of great literature:
- The Sonification Handbook mentioned earlier has plenty of info about psychoacoustics & designing effective sounds. Specifically, the chapters on Psychoacoustics, Earcons, and Intelligent auditory alarms. A thesis cited therein makes it clear: “[Multiple studies] have shown that the perceived urgency of sounds can be predictably controlled.”
- A 1999 experiment found a 5% (40s) time improvement when sound was added to a progress bar in a simple task
- As mentioned at the beginning, NVDA and some internal versions of macOS Finder play sounds as progress bars fill up.
Since hospital ICUs & plane cockpits are full of alarms in life-or-death situations, there’s a lot of good fundamental research out there. It’s a matter of harnessing it in real products. My friends at the GT Sonification Lab would lament: we know how to put useful sounds in our UIs, so why don’t we?
Appendix: data
From the week of Jan 15, 2024. Transcribed from my hand-written notebook & lightly edited. I made data-collection as lightweight as possible, focused only on recording how much time I wasted. "-
" indicates no data.
Started | Finished | Noticed | Wasted | Note | |
---|---|---|---|---|---|
Day 1 | 1:00PM | 1:05PM | 1:06PM | 1min | |
- | - | - | 5s | NuGet auth | |
- | - | - | 20s | writing previous :) | |
1:24PM | 1:26PM | 1:27PM | 1min | ||
1:31PM | 1:31PM | 1:33PM | 2min | Trying to make lunch | |
- | - | - | 4min | More lunch | |
Day 2 | - | 10:26AM | 10:27AM | 1min | |
- | 10:29AM | 10:30AM | 1min | ||
- | - | - | 10s | ||
11:30AM | 11:35AM | 11:37AM | 2min | ||
- | - | - | 1–2min? | ||
- | 3:56PM | 3:58PM | 2min | ||
- | - | - | 0min | ||
- | 4:28PM | 4:31PM | 3min | ||
Day 3 (Jan 18) | 3:02PM | 3:06PM | 3:06PM | 0s | Glanced at build as soon as it finished |
- | 3:09PM | 3:10PM | 1min |
Plus 20+ builds the next week (including ones where I lost 7min, 8min, and even 24min), not included in the analysis above because I wasn’t as rigorous about keeping time.