Subject: Re: spkr beep
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 12/14/2002 11:08:01
> Quick question,
> how to make the speaker beep on ss5?
> I just want to throw it in a script.

I'd be inclined to construct a small soundfile containing the beep and
then send it to /dev/audio when you want.  Or you could construct it on
the fly.  For a 500Hz beep, for example, you might

yes aaaaaaaabbbbbbbb | head -100 | tr -dc ab | tr ab \\0\\200 > /dev/audio

Adjust the 100 on the head command line to control the length of the
beep; that number is the number of milliseconds the beep lasts.  Use
aaaabbbbaaaabbbb for a 1KHz beep.

Playing with the pattern on the yes command line changes the quality of
the tone; you might try bbaaaabbaabbbbaa, perhaps.  (I find
bbaababbaababaab gives one of the most penetrant sounds I've managed.)
If you want something lower than 500Hz as a fundamenal, you might try
using more characters on the yes command line, but then the number on
the head command line will be in units larger than milliseconds.

In passing, it's amazing how sensitive the human ear is to the
lowest-frequency component of a sound.  Listen to the difference
between bbabababbbababab and bbababbbabababab, for example.

Of course, as someone else pointed out, in many environments beeping
from a script is something that sounds good at first but ends up being
rather seriously obnoxious in practice.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B