summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/speaker.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/netbsd/man4/speaker.4 3.html')
-rw-r--r--static/netbsd/man4/speaker.4 3.html306
1 files changed, 0 insertions, 306 deletions
diff --git a/static/netbsd/man4/speaker.4 3.html b/static/netbsd/man4/speaker.4 3.html
deleted file mode 100644
index a6560174..00000000
--- a/static/netbsd/man4/speaker.4 3.html
+++ /dev/null
@@ -1,306 +0,0 @@
-<table class="head">
- <tr>
- <td class="head-ltitle">SPEAKER(4)</td>
- <td class="head-vol">Device Drivers Manual</td>
- <td class="head-rtitle">SPEAKER(4)</td>
- </tr>
-</table>
-<div class="manual-text">
-<section class="Sh">
-<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
-<p class="Pp"><code class="Nm">speaker</code> &#x2014; <span class="Nd">console
- speaker audio device driver</span></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
-<p class="Pp"><code class="Cd">spkr* at pcppi?</code>
- <br/>
- <code class="Cd">spkr* at audio?</code></p>
-<p class="Pp">
- <br/>
- <code class="In">#include &lt;<a class="In">dev/spkrio.h</a>&gt;</code></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
-<p class="Pp">The speaker device driver allows applications to control the
- console speaker on machines with a PC-like 8253 timer implementation or a
- synthesized speaker from an audio device/soundcard.</p>
-<p class="Pp" id="ioctl">Only one process may have this device open at any given
- time; <a class="Xr">open(2)</a> and <a class="Xr">close(2)</a> are used to
- lock and relinquish it. An attempt to <a class="Xr">open(2)</a> when another
- process has the device locked will return -1 with an
- <code class="Er">EBUSY</code> error indication. Writes to the device are
- interpreted as &#x201C;play strings&#x201D; in a simple ASCII melody
- notation. An
- <a class="permalink" href="#ioctl"><code class="Fn">ioctl</code></a>() for
- tone generation at arbitrary frequencies is also supported.</p>
-<p class="Pp" id="not">For the <a class="Xr">pcppi(4)</a> device
- sound-generation does
- <a class="permalink" href="#not"><i class="Em">not</i></a> 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.</p>
-<p class="Pp">For the audio device speaker, the speaker uses one of the virtual
- audio channels. Enabling this device will also provide a
- <a class="Xr">wsbell(4)</a> keyboard bell.</p>
-<p class="Pp" id="ioctl~2">Applications may call
- <a class="permalink" href="#ioctl~2"><code class="Fn">ioctl</code></a>() on
- a speaker file descriptor to control the speaker driver directly;
- definitions for the <code class="Fn">ioctl</code>() interface are in
- <code class="In">&lt;<a class="In">dev/spkrio.h</a>&gt;</code>.</p>
-<p class="Pp">The <var class="Vt">tone_t</var> structure is as follows:</p>
-<div class="Bd Pp Bd-indent Li">
-<pre>typedef struct {
- int frequency; /* in hertz */
- int duration; /* in 1/100ths of a second */
-} tone_t;</pre>
-</div>
-<p class="Pp">A frequency of zero is interpreted as a rest.</p>
-<p class="Pp">At present there are four ioctls:</p>
-<dl class="Bl-tag">
- <dt id="SPKRGETVOL"><a class="permalink" href="#SPKRGETVOL"><code class="Dv">SPKRGETVOL</code></a></dt>
- <dd>Returns an integer, which is the current bell volume as a percentage
- (0&#x2013;100).</dd>
- <dt id="SPKRSETVOL"><a class="permalink" href="#SPKRSETVOL"><code class="Dv">SPKRSETVOL</code></a></dt>
- <dd>Accepts an integer, which is the desired volume as a percentage.</dd>
- <dt id="SPKRTONE"><a class="permalink" href="#SPKRTONE"><code class="Dv">SPKRTONE</code></a></dt>
- <dd>Accepts a pointer to a single tone structure as third argument and plays
- it.</dd>
- <dt id="SPKRTUNE"><a class="permalink" href="#SPKRTUNE"><code class="Dv">SPKRTUNE</code></a></dt>
- <dd>Accepts a pointer to the first of an array of tone structures and plays
- them in continuous sequence; this array must be terminated by a final
- member with a zero duration.</dd>
-</dl>
-<section class="Ss">
-<h2 class="Ss" id="Play_string_language"><a class="permalink" href="#Play_string_language">Play
- string language</a></h2>
-<p class="Pp">The play string language is modelled on the
- <code class="Ic">PLAY</code> statement conventions of IBM BASIC
- <span class="No">2.0</span>. The <code class="Ic">MB</code>,
- <code class="Ic">MF</code> and <code class="Ic">X</code> commands of
- <code class="Ic">PLAY</code> are not useful in a UNIX environment and are
- not implemented. The &#x201C;octave-tracking&#x201D; feature is also
- new.</p>
-<p class="Pp">There are 84 accessible notes numbered 1&#x2013;84 in 7 octaves
- numbered 0&#x2013;6; octave&#x00A0;2 starts with middle C. The tuning is
- equal-tempered A440.</p>
-<p class="Pp">In the initial state the current octave is 4, the default note
- duration is quarter notes, the tempo is 120 bpm, and the articulation is
- non-legato or normal, i.e. half-second notes with the last 1/16th second
- being &#x201C;rest time&#x201D;.</p>
-<p class="Pp">Play strings are interpreted left to right as a series of play
- command groups. Letter case is ignored. Whitespace between groups is ignored
- and may be used to separate melody sections. Play command groups are as
- follows:</p>
-<dl class="Bl-tag">
- <dt id="C"><a class="permalink" href="#C"><code class="Ic">C</code></a>,
- <code class="Ic">D</code>, <code class="Ic">E</code>,
- <code class="Ic">F</code>, <code class="Ic">G</code>,
- <code class="Ic">A</code>, <code class="Ic">B</code></dt>
- <dd>Letters &#x2018;<code class="Ic">A</code>&#x2019; through
- &#x2018;<code class="Ic">G</code>&#x2019; cause the corresponding note to
- be played in the current octave. A note letter may optionally be followed
- by an
- <a class="permalink" href="#accidental"><i class="Em" id="accidental">accidental
- sign</i></a>, one of &#x2018;<code class="Ic">#</code>&#x2019;,
- &#x2018;<code class="Ic">+</code>&#x2019;, or
- &#x2018;<code class="Ic">-</code>&#x2019;; the first two of these cause it
- to be sharped one half-tone, the last causes it to be flatted one
- half-tone. It may also be followed by a time value number and by sustain
- dots (see below). Time values are interpreted as for the
- &#x2018;<code class="Ic">L</code>&#x2019; command below;.</dd>
- <dt id="O"><a class="permalink" href="#O"><code class="Ic">O</code></a><var class="Ar">n</var>,
- <code class="Ic">OL</code>, <code class="Ic">ON</code></dt>
- <dd>If <var class="Ar">n</var> is numeric, this sets the current octave.
- &#x2018;<code class="Ic">OL</code>&#x2019; enables, and
- &#x2018;<code class="Ic">ON</code>&#x2019; disables
- <a class="permalink" href="#octave-tracking"><i class="Em" id="octave-tracking">octave-tracking</i></a>
- (it is disabled by default). When octave-tracking is on, interpretation of
- a pair of letter notes will change octaves if necessary in order to make
- the smallest possible jump between notes. Thus
- &#x201C;<code class="Li">olbc</code>&#x201D; will be played as
- &#x201C;<code class="Li">olb&gt;c</code>&#x201D;, and
- &#x201C;<code class="Li">olcb</code>&#x201D; as
- &#x201C;<code class="Li">olc&lt;b</code>&#x201D;. Octave tracking is
- temporarily disabled for one letter note that follows
- &#x2018;<code class="Ic">&gt;</code>&#x2019;,
- &#x2018;<code class="Ic">&lt;</code>&#x2019; or
- &#x2018;<code class="Ic">O</code><var class="Ar">n</var>&#x2019;.</dd>
- <dt id="_"><a class="permalink" href="#_"><code class="Ic">&gt;</code></a></dt>
- <dd>Bump the current octave up one.</dd>
- <dt id="_~2"><a class="permalink" href="#_~2"><code class="Ic">&lt;</code></a></dt>
- <dd>Drop the current octave down one.</dd>
- <dt id="N"><a class="permalink" href="#N"><code class="Ic">N</code></a><var class="Ar">n</var></dt>
- <dd>Play note <var class="Ar">n</var>, <var class="Ar">n</var> being 1 to 84
- or 0 for a rest of current time value. May be followed by sustain
- dots.</dd>
- <dt id="L"><a class="permalink" href="#L"><code class="Ic">L</code></a><var class="Ar">n</var></dt>
- <dd>Sets the current time value for notes. The default is
- &#x201C;<code class="Li">L4</code>&#x201D;, quarter notes. The lowest
- possible value is 1; values up to 64 are accepted.
- &#x201C;<code class="Li">L1</code>&#x201D; sets whole notes,
- &#x201C;<code class="Li">L2</code>&#x201D; sets half notes,
- &#x201C;<code class="Li">L4</code>&#x201D; sets quarter notes, etc...</dd>
- <dt id="P"><a class="permalink" href="#P"><code class="Ic">P</code></a><var class="Ar">n</var>,
- <code class="Ic">~</code><var class="Ar">n</var></dt>
- <dd>Pause (rest), with <var class="Ar">n</var> interpreted as for
- &#x2018;<code class="Ic">L</code>&#x2019;. May be followed by sustain
- dots.</dd>
- <dt id="T"><a class="permalink" href="#T"><code class="Ic">T</code></a><var class="Ar">n</var></dt>
- <dd>Sets the number of quarter notes per minute; default is 120. Musical names
- for common tempi are:
- <table class="Bl-column Bd-indent">
- <tr id="Tempo">
- <td></td>
- <td><a class="permalink" href="#Tempo"><b class="Sy">Tempo</b></a></td>
- <td><a class="permalink" href="#BPM"><b class="Sy" id="BPM">BPM</b></a></td>
- </tr>
- <tr>
- <td>very slow</td>
- <td>Larghissimo</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Largo</td>
- <td>40&#x2013;60</td>
- </tr>
- <tr>
- <td></td>
- <td>Larghetto</td>
- <td>60&#x2013;66</td>
- </tr>
- <tr>
- <td></td>
- <td>Grave</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Lento</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Adagio</td>
- <td>66&#x2013;76</td>
- </tr>
- <tr>
- <td>slow</td>
- <td>Adagietto</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Andante</td>
- <td>76&#x2013;108</td>
- </tr>
- <tr>
- <td>medium</td>
- <td>Andantino</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Moderato</td>
- <td>108&#x2013;120</td>
- </tr>
- <tr>
- <td>fast</td>
- <td>Allegretto</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Allegro</td>
- <td>120&#x2013;168</td>
- </tr>
- <tr>
- <td></td>
- <td>Vivace</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Veloce</td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td>Presto</td>
- <td>168&#x2013;208</td>
- </tr>
- <tr>
- <td>very fast</td>
- <td>Prestissimo</td>
- <td></td>
- </tr>
- </table>
- </dd>
- <dt id="ML"><a class="permalink" href="#ML"><code class="Ic">ML</code></a>,
- <code class="Ic">MN</code>, <code class="Ic">MS</code></dt>
- <dd>Set articulation. &#x2018;<code class="Ic">MN</code>&#x2019; (for normal)
- is the default; the last 1/8th of the note's value is rest time. You can
- set &#x2018;<code class="Ic">ML</code>&#x2019; for legato (no rest time)
- or &#x2018;<code class="Ic">MS</code>&#x2019; for staccato (1/4 rest
- time).</dd>
-</dl>
-<p class="Pp">Notes, that is, <code class="Ic">C</code>,
- <code class="Ic">D</code>, <code class="Ic">E</code>,
- <code class="Ic">F</code>, <code class="Ic">G</code>,
- <code class="Ic">A</code>, <code class="Ic">B</code>, or
- <code class="Ic">N</code> command character groups, may be followed by
- sustain dots. Each dot causes the note's value to be lengthened by one-half
- for each one. Thus, a note dotted once is held for 3/2 of its undotted
- value; dotted twice, it is held 9/4, and three times would give 27/8.</p>
-</section>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
-<dl class="Bl-tag Bl-compact">
- <dt><span class="Pa">/dev/speaker</span></dt>
- <dd style="width: auto;">&#x00A0;</dd>
-</dl>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
- ALSO</a></h1>
-<p class="Pp"><a class="Xr">audio(4)</a>, <a class="Xr">pcppi(4)</a>,
- <a class="Xr">wsbell(4)</a>, <a class="Xr">sysctl(8)</a></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
-<p class="Pp">This <code class="Nm">speaker</code> device was originally for the
- pcppi PC timer interface. Support was added for a synthesized device by
- Nathanial Sloss, first appearing in <span class="Ux">NetBSD 8.0</span>.</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
-<p class="Pp"><span class="An">Eric S. Raymond</span>
- &lt;<a class="Mt" href="mailto:esr@snark.thyrsus.com">esr@snark.thyrsus.com</a>&gt;</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
-<p class="Pp">Due 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.</p>
-<p class="Pp">There is no volume control.</p>
-<p class="Pp">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.</p>
-<p class="Pp">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.</p>
-</section>
-</div>
-<table class="foot">
- <tr>
- <td class="foot-date">June 13, 2017</td>
- <td class="foot-os">NetBSD 10.1</td>
- </tr>
-</table>