Re: [vox-tech] beeping linux (and star trek)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox-tech] beeping linux (and star trek)
On Mon, Sep 18, 2000 at 10:34:44AM -0700, Peter Jay Salzman wrote:
> a long time ago, someone had asked "how do i turn beeping off on linux".
>
> i answered that you can turn beeping under vi off by set noerrorbells, but
> that it never seemed to work (for me, at least).
>
> now, i have a real answer. one that works! :-)
I also have another way. I believe your way will only work on xterm, etc.
If you are in console mode, you may do this:
echo -e "\e[11;0]"
(if that doesn't work, replace the \e with \033).
Poking around in the virtual terminal soruce recently,
I found a couple commands which alter the console beep.
echo -e "\e[10;<some_freq>]"
to set the frequency at which the beep will play. For
example, to set it to "A" 220, just do:
echo -e "\e[10;440]"
and use
echo -e "\e[11;<duration_in_millisecs>]"
to set the length (must be less than 2000) in
milliseconds.
Try it!
--------------------------------------
In some relation to this, I just wrote a small program
this weekend which uses the built-in speaker to play melodies.
It simply takes the notes you wish to play as arguments,
in the following format:
(note name)(sharp or flat)(octave)(note length)
always lowercase. Octaves are numeric, ranging from 1 to 5 (a3 = a-440).
Note lengths are specified in beats or fractional beats, such as:
w = whole note
h = half note
q = quarter note
e = eighth note
s = sixteenth note
t = thirty-second note
and may be combined to form things such as:
qe = dotted quarter-note
est = doubly-dotted eighth-note
Octaves and durations may be left out, after having been specified
(octaves, actually, never need to be specified).
For example,
ditty c3e d e f g a b c4
plays a C-Major scale. You can also feed pre-typed files to it.
Does this stupid little toy interest anyone? I'll be releasing it soon,
but I need to do a little clean-up, and also plan on adding a /dev/dsp
alternative option. GPL'd - /OF COURSE!/
Pete, I thought maybe it might be useful to you in writing your
ear-training program, either in calling ditty (my program) from a
shell-script, or execve, or "appropriating" the code within.
-Micah
|