|
NAMEspeaker , spkr —
console speaker device driver
SYNOPSISdevice speaker
#include <dev/speaker/speaker.h>
DESCRIPTIONThe speaker device driver allows applications to control the PC console speaker on an IBM-PC--compatible machine running FreeBSD.Only one process may have this device open at any given time;
open(2)
and
close(2)
are used to lock and relinquish it. An attempt to open when another process
has the device locked will return -1 with an Sound-generation does not monopolize the processor; in fact, the driver spends most of its time sleeping while the PC hardware is emitting tones. Other processes may emit beeps while the driver is running. Applications may call
ioctl(2)
on a speaker file descriptor to control the speaker driver directly;
definitions for the
ioctl(2)
interface are in
At present there are two such
ioctl(2)
calls. The play-string language is modeled on the PLAY statement
conventions of IBM Advanced BASIC 2.0. The There are 84 accessible notes numbered 1-84 in 7 octaves, each running from C to B, numbered 0-6; the scale is equal-tempered A440 and octave 3 starts with middle C. By default, the play function emits half-second notes with the last 1/16th second being `rest time'. Play strings are interpreted left to right as a series of play command groups; letter case is ignored. Play command groups are as follows:
Notes (that is, A note and its sustain dots may also be followed by a slur mark (underscore). This causes the normal micro-rest after the note to be filled in, slurring it to the next one. (The slur feature is not supported in IBM BASIC.) Whitespace in play strings is simply skipped and may be used to separate melody sections. FILES
SEE ALSOspkrtest(8)HISTORYThespeaker device appeared in FreeBSD
1.0.
AUTHORSEric S. Raymond <esr@snark.thyrsus.com>, June 1990PORTED BYAndrew A. Chernov <ache@astral.msk.su> BUGSDue to roundoff in the pitch tables and slop in the tone-generation and timer hardware (neither of which was designed for precision), neither pitch accuracy nor timings will be mathematically exact. There is no volume control.The action of two or more sustain dots does not reflect standard musical notation, in which each dot adds half the value of the previous dot modifier, not half the value of the note as modified. Thus, a note dotted once is held for 3/2 of its undotted value; dotted twice, it is held 7/4, and three times would give 15/8. The multiply-by-3/2 interpretation, however, is specified in the IBM BASIC manual and has been retained for compatibility. In play strings which are very long (longer than your system's physical I/O blocks) note suffixes or numbers may occasionally be parsed incorrectly due to crossing a block boundary.
Visit the GSP FreeBSD Man Page Interface. |