bsd-family-tree: Small sync with FreeBSD.
[dragonfly.git] / games / morse / morse.6
blob15d0c66bbd494784715a080599e758527a981e0b
1 .\" Copyright (c) 2000 Alexey Zelkin.  All rights reserved.
2 .\" Copyright (c) 1988, 1991, 1993
3 .\"     The Regents of the University of California.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of the University nor the names of its contributors
14 .\"    may be used to endorse or promote products derived from this software
15 .\"    without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\"     @(#)bcd.6       8.1 (Berkeley) 5/31/93
30 .\" $FreeBSD: src/games/morse/morse.6,v 1.4.2.7 2003/01/26 02:57:27 keramida Exp $
31 .\" $OpenBSD: morse.6,v 1.3 2016/01/19 23:21:26 sthen Exp $
32 .\"
33 .Dd December 21, 2017
34 .Dt MORSE 6
35 .Os
36 .Sh NAME
37 .Nm morse
38 .Nd reformat input as morse code
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl r
42 .Op Fl elops
43 .Op Fl P Ar dspdevice
44 .Op Fl d Ar device
45 .Op Fl w Ar speed
46 .Op Fl W Ar speed
47 .Op Fl f Ar frequency
48 .Op Ar string ...
49 .Sh DESCRIPTION
50 The command
51 .Nm
52 read the given input and reformat it in the form of morse code.
53 Acceptable input are command line arguments or the standard input.
54 .Pp
55 Available options:
56 .Bl -tag -width flag
57 .It Fl l
58 The
59 .Fl l
60 option produces output suitable for
61 .Xr led 4
62 devices.
63 .It Fl s
64 The
65 .Fl s
66 option produces dots and dashes rather than words.
67 .It Fl r
68 The
69 .Fl r
70 option reverses the dot-dash morse code
71 .Po
72 as generated by the
73 .Fl s
74 option
75 .Pc
76 back into text.
77 A lowercase
78 .Sq x
79 is printed for undecipherable input; otherwise, text is returned uppercase.
80 Many procedural signs can be decoded (though not encoded).
81 If the morse to be translated is given on the command line, it should be
82 preceded by
83 .Sq --
84 to keep it from being mistaken for options.
85 All other command options are ignored.
86 .It Fl o
87 Write 16bit signed, 44.1kHz native endian sound data
88 to the file specified by
89 .Fl P ,
90 or, if not specified, to standard out.
91 .It Fl p
92 Send morse the real way. This only works if your system has
93 .Xr sound 4
94 support.
95 .It Fl P Ar dspdevice
96 Select a different dsp device from the default
97 .Pa /dev/dsp .
98 .It Fl w Ar speed
99 Set the sending speed in words per minute. If not specified the default
100 speed of 20 WPM is used.
101 .It Fl W Ar speed
102 Enable Farnsworth keying.
103 The argument to
104 .Fl w
105 will set the character keying speed and the argument to
106 .Fl W
107 will set the spacing between character and words.
108 .It Fl f Ar frequency
109 Set the sidetone frequency to something other than the default 600 Hz.
110 .It Fl d Ar device
111 Similar to
112 .Fl p ,
113 but use the RTS line of
114 .Ar device
115 (which must by a tty device)
116 in order to emit the morse code.
117 .It Fl e
118 echo each character before it is sent, used together with either
119 .Fl p
121 .Fl d .
125 .Fl w ,
126 .Fl W ,
128 .Fl f
129 flags only work in conjunction with either the
130 .Fl p
131 or the
132 .Fl d
133 flag.
135 Not all prosigns have corresponding characters. Use
136 angle brackets to create a ligature, like
137 .Ql <KA> .
138 The more common prosigns are
139 .Ql =
141 .Em BT ,
142 .Ql \&(
144 .Em KN
146 .Ql +
148 .Em AR .
150 Using flag
151 .Fl d Ar device
152 it is possible to key an external device, like a sidetone generator with
153 a headset for training purposes, or even your ham radio transceiver.  For
154 the latter, simply connect an NPN transistor to the serial port
155 .Ar device ,
156 emitter connected to ground, base connected through a resistor
157 (few kiloohms) to RTS, collector to the key line of your transceiver
158 (assuming the transceiver has a positive key supply voltage and is keyed
159 by grounding the key input line).  A capacitor (some nanofarads) between
160 base and ground is advisable to keep stray RF away,
161 and to suppress the
162 minor glitch that is generated during program startup.
163 .Sh ENVIRONMENT
164 If your
165 .Ev LC_CTYPE
166 locale codeset is
167 .Ql KOI8-R ,
168 characters with the high-order bit set are interpreted as
169 Cyrillic characters.  If your
170 .Ev LC_CTYPE
171 locale codeset is
172 .Ql ISO8859-1
173 compatible,
174 they are interpreted
175 as belonging to the
176 .Ql ISO-8859-1
177 character set.
178 .Sh SEE ALSO
179 .Xr sound 4
180 .Sh HISTORY
181 Sound support for
183 added by
184 .An Lyndon Nerenberg (VE7TCP/VE6BBM) Aq Mt lyndon@orthanc.com
185 and later converted to use
186 .Xr sound 4
188 .An Simon 'corecode' Schubert Aq Mt corecode@fs.ei.tum.de .
190 Ability to key an external device added by
191 .An J\(:org Wunsch
192 (DL8DTL).
193 .Sh BUGS
194 Only understands a few European characters
195 (German and French),
196 no Asian characters,
197 and no continental landline code.
199 Sends a bit slower than it should due to system overhead. Some people
200 would call this a feature.