xref: /dragonfly/games/morse/morse.6 (revision 092c2dd1)
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
50The command
51.Nm
52read the given input and reformat it in the form of morse code.
53Acceptable input are command line arguments or the standard input.
54.Pp
55Available options:
56.Bl -tag -width flag
57.It Fl l
58The
59.Fl l
60option produces output suitable for
61.Xr led 4
62devices.
63.It Fl s
64The
65.Fl s
66option produces dots and dashes rather than words.
67.It Fl r
68The
69.Fl r
70option reverses the dot-dash morse code
71.Po
72as generated by the
73.Fl s
74option
75.Pc
76back into text.
77A lowercase
78.Sq x
79is printed for undecipherable input; otherwise, text is returned uppercase.
80Many procedural signs can be decoded (though not encoded).
81If the morse to be translated is given on the command line, it should be
82preceded by
83.Sq --
84to keep it from being mistaken for options.
85All other command options are ignored.
86.It Fl o
87Write 16bit signed, 44.1kHz native endian sound data
88to the file specified by
89.Fl P ,
90or, if not specified, to standard out.
91.It Fl p
92Send morse the real way. This only works if your system has
93.Xr sound 4
94support.
95.It Fl P Ar dspdevice
96Select a different dsp device from the default
97.Pa /dev/dsp .
98.It Fl w Ar speed
99Set the sending speed in words per minute. If not specified the default
100speed of 20 WPM is used.
101.It Fl W Ar speed
102Enable Farnsworth keying.
103The argument to
104.Fl w
105will set the character keying speed and the argument to
106.Fl W
107will set the spacing between character and words.
108.It Fl f Ar frequency
109Set the sidetone frequency to something other than the default 600 Hz.
110.It Fl d Ar device
111Similar to
112.Fl p ,
113but use the RTS line of
114.Ar device
115(which must by a tty device)
116in order to emit the morse code.
117.It Fl e
118echo each character before it is sent, used together with either
119.Fl p
120or
121.Fl d .
122.El
123.Pp
124The
125.Fl w ,
126.Fl W ,
127and
128.Fl f
129flags only work in conjunction with either the
130.Fl p
131or the
132.Fl d
133flag.
134.Pp
135Not all prosigns have corresponding characters. Use
136angle brackets to create a ligature, like
137.Ql <KA> .
138The more common prosigns are
139.Ql =
140for
141.Em BT ,
142.Ql \&(
143for
144.Em KN
145and
146.Ql +
147for
148.Em AR .
149.Pp
150Using flag
151.Fl d Ar device
152it is possible to key an external device, like a sidetone generator with
153a headset for training purposes, or even your ham radio transceiver.  For
154the latter, simply connect an NPN transistor to the serial port
155.Ar device ,
156emitter 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
159by grounding the key input line).  A capacitor (some nanofarads) between
160base and ground is advisable to keep stray RF away,
161and to suppress the
162minor glitch that is generated during program startup.
163.Sh ENVIRONMENT
164If your
165.Ev LC_CTYPE
166locale codeset is
167.Ql KOI8-R ,
168characters with the high-order bit set are interpreted as
169Cyrillic characters.  If your
170.Ev LC_CTYPE
171locale codeset is
172.Ql ISO8859-1
173compatible,
174they are interpreted
175as belonging to the
176.Ql ISO-8859-1
177character set.
178.Sh SEE ALSO
179.Xr sound 4
180.Sh HISTORY
181Sound support for
182.Nm
183added by
184.An Lyndon Nerenberg (VE7TCP/VE6BBM) Aq Mt lyndon@orthanc.com
185and later converted to use
186.Xr sound 4
187by
188.An Simon 'corecode' Schubert Aq Mt corecode@fs.ei.tum.de .
189.Pp
190Ability to key an external device added by
191.An J\(:org Wunsch
192(DL8DTL).
193.Sh BUGS
194Only understands a few European characters
195(German and French),
196no Asian characters,
197and no continental landline code.
198.Pp
199Sends a bit slower than it should due to system overhead. Some people
200would call this a feature.
201