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