xref: /freebsd/usr.bin/morse/morse.6 (revision 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3)
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.Dd April 16, 2023
30.Dt MORSE 6
31.Os
32.Sh NAME
33.Nm morse
34.Nd reformat input as morse code
35.Sh SYNOPSIS
36.Nm
37.Op Fl elrps
38.Op Fl d Ar device
39.Op Fl w Ar speed
40.Op Fl c Ar speed
41.Op Fl f Ar frequency
42.Op Ar string ...
43.Sh DESCRIPTION
44The
45.Nm
46command reads the given input and reformats it in the form of morse code.
47Acceptable input are command line arguments or the standard input.
48.Pp
49Available options:
50.Bl -tag -width indent
51.It Fl l
52The
53.Fl l
54option produces output suitable for
55.Xr led 4
56devices.
57.It Fl s
58The
59.Fl s
60option produces dots and dashes rather than words.
61.It Fl p
62Send morse the real way.
63This only works if your system has
64.Xr speaker 4
65support.
66.It Fl w Ar speed
67Set the sending speed in words per minute.
68If not specified, the default
69speed of 20 WPM is used.
70.It Fl c Ar speed
71Farnsworth support.
72Set the spacing between characters in words per minute.
73This is independent of the speed
74that the individual characters are sent.
75If not specified, defaults to the effective value of the
76.Fl w
77option.
78.It Fl f Ar frequency
79Set the sidetone frequency to something other than the default 600 Hz.
80.It Fl d Ar device
81Similar to
82.Fl p ,
83but use the RTS line of
84.Ar device
85(which must be a TTY device)
86in order to emit the morse code.
87.It Fl e
88Echo each character before it is sent, used together with either
89.Fl p
90or
91.Fl d .
92.It Fl r
93Decode morse output consisting of dots and dashes (as generated by using
94the
95.Fl s
96option).
97.El
98.Pp
99The
100.Fl w , c
101and
102.Fl f
103flags only work in conjunction with either the
104.Fl p
105or the
106.Fl d
107flag.
108.Pp
109Not all prosigns have corresponding characters.
110Use
111.Ql #
112for
113.Em AS ,
114.Ql &
115for
116.Em SK ,
117.Ql *
118for
119.Em VE
120and
121.Ql %
122for
123.Em BK .
124The more common prosigns are
125.Ql =
126for
127.Em BT ,
128.Ql \&(
129for
130.Em KN
131and
132.Ql +
133for
134.Em AR .
135.Pp
136Using the
137.Fl d
138flag,
139it is possible to key an external device, like a sidetone generator with
140a headset for training purposes, or even your ham radio transceiver.
141For
142the latter, simply connect an NPN transistor to the serial port
143.Ar device ,
144emitter connected to ground, base connected through a resistor
145(few kiloohms) to RTS, collector to the key line of your transceiver
146(assuming the transceiver has a positive key supply voltage and is keyed
147by grounding the key input line).
148A capacitor (some nanofarads) between
149base and ground is advisable to keep stray RF away,
150and to suppress the
151minor glitch that is generated during program startup.
152.Sh ENVIRONMENT
153Your
154.Ev LC_CTYPE
155locale codeset determines how
156characters with the high-order bit set
157are interpreted.
158.Pp
159.Bl -tag -width ".Li ISO8859-15" -compact
160.It Li ISO8859-1
161.It Li ISO8859-15
162Interpret characters with the high-order bit set as Western European characters.
163.Pp
164.It Li KOI8-R
165Interpret characters with the high-order bit set as Cyrillic characters.
166.Pp
167.It Li ISO8859-7
168Interpret characters with the high-order bit set as Greek characters.
169.El
170.Sh FILES
171.Bl -tag -width ".Pa /dev/speaker" -compact
172.It Pa /dev/speaker
173.Xr speaker 4
174device file
175.El
176.Sh SEE ALSO
177.Xr speaker 4
178.Rs
179.%I ITU-T Recommendation F.1
180.%R "Operational provisions for the international public telegram service"
181.%O Division B, I. Morse code
182.Re
183.Rs
184.%I ITU-R M.1677-1
185.%R International Morse code
186.%D 2009
187.%U https://www.itu.int/rec/R-REC-M.1677-1-200910-I/
188.Re
189.Sh HISTORY
190Sound support for
191.Nm
192added by
193.An Lyndon Nerenberg (VE6BBM) Aq Mt lyndon@orthanc.ca .
194.Pp
195Ability to key an external device added by
196.An J\(:org Wunsch
197(DL8DTL).
198.Pp
199Farnsworth support for
200.Nm
201added by
202.An Stephen Cravey (N5UUU) .
203.Sh BUGS
204Only understands a few European characters
205(German and French),
206no Asian characters,
207and no continental landline code.
208.Pp
209Sends a bit slower than it should due to system overhead.
210Some people would call this a feature.
211