But it is designed to study Cyrillic letter codes, which is irrelevant in modern radio communications (everyone uses the Latin alphabet, except our valiant army).

C++ in conjunction with Qt was chosen as the tool for implementing the idea.

The main idea of ​​the program

The atom (unit of time) of Morse code is a point; the duration of all other elements is formed relative to it:
  1. A dash equals three sounding dots;
  2. A pause between elements of one symbol (sign) is one silent point;
  3. There are three dots between the signs;
  4. There are seven dots between the words.
As you can see, any code based on Morse code can be represented as a set of sounding and silent dots: I started from this idea, and this solution seemed quite original to me.

Initial implementation

In the first version of the program, the combination of sounding and silent points was stored as a vector with Boolean elements, where true corresponded to turning on the sound, and false- switching off.

As you already understood, to obtain the final signal, I just “pulled” the sound with some delay (using a timer equal to the duration of the point in milliseconds) with an endlessly playing .wav file with a sine recording. But this approach had a significant disadvantage and it consisted in the fact that each point had to be loaded separately using an overloaded operator or special method. Because of this approach, I had to write a separate macro for each letter (like this - #define I DOT<< false << DOT) и создать огромный жуткий switch to play the passed string. It was terrible, but if you're curious, you can check it out.
with the first version of the program (I was unable to completely upload the local repository to GitHub - only the latest version).

A piece of creepy switch:

bool Morse::StringToMorse (QString &line) ( line += "\0"; for (int i = 0; i< line.size () - 1; ++i) { switch (line.at(i).unicode ()) { case "A": *this << A; if (line.at (i + 1) == " ") continue; else *this << MINI_SPACE; break; case "B": *this << B; if (line.at (i + 1) == " ") continue; else *this << MINI_SPACE; break; // И так далее


And this is how the sound was turned on and off (actually, the sound code was generated):

void Morse::PlayLinePoints () ( QTimer::singleShot (duration_point_, this, SLOT (Mute ())); sound_.play (); ) void Morse::Mute () ( if (line_points_.empty ()) ( / /Stop playback sound_.stop (); return; ) if (line_points_.at (0)) ( //Turn on sound sound_.setMuted (false); line_points_.remove (0); QTimer::singleShot (duration_point_, this, SLOT (Mute ())); return; ) else ( sound_.setMuted (true); //Turn off the sound line_points_.remove (0); QTimer::singleShot (duration_point_, this, SLOT (Mute ())); return; ) )

Final version

These macros turned out to be very cumbersome, and my perfectionism could no longer look at these monstrous designs. After thinking a little, I came to the conclusion that my idea was good, but storing codes in the form of macros is very inconvenient and if this problem is solved, then everything will be fine. As a result, QMap was used to store codes:

//Stores corresponding combinations of dots and dashes of QMap characters codes_;
This approach turned out to be very convenient. Now I just used the current character being played as a key and got the finished
To reproduce the code (a set of Boolean values), however, the reproduction algorithm became a little more complicated: it was necessary to enter the counter of the current element of the symbol and the counter of characters in the line:

New playback implementation:

void Morse::MiniSpace () ( if (stop_) ( this->Stop (); return; ) sound_.setMuted (true); ++id_element_; //Go to another code element if (id_element_ == codes_.value ( string_to_play_.at (id_char_).size ()) ( ++id_char_; id_element_ = 0; QTimer::singleShot (duration_dot_ * 3, this, SLOT (Mute())); //Pause between characters return; ) QTimer: :singleShot (duration_dot_, this, SLOT (Mute())); //Pause between symbol elements ) void Morse::Space () ( if (stop_) ( this->Stop (); return; ) sound_.setMuted (true ); //The pause lasts 7 dots //But since after the symbol there is a pause of three dots, an additional pause must be set to 4 dots long QTimer::singleShot (duration_dot_ * 4, this, SLOT (Mute())); ) void Morse::Mute () ( if (stop_) ( this->Stop (); return; ) if (id_char_ == string_to_play_.size ()) ( // The line has ended this->Stop (); return; ) if (string_to_play_.at (id_char_) == " ") ( Space(); ++id_char_; //Go to another code element return; ) if (codes_.find (string_to_play_.at (id_char_)) == codes_.end ( )) ( qDebug()<< string_to_play_.at (id_char_) << ": No code!"; sound_.stop (); return; } sound_.setMuted (false); //Включаем звук if (codes_.value (string_to_play_.at (id_char_)).at (id_element_)) { QTimer::singleShot (duration_dot_, this, SLOT (MiniSpace())); //Воспроизводим точку } else { QTimer::singleShot (duration_dot_ * 3, this, SLOT (MiniSpace())); //Воспроизводим тире } } bool Morse::Play () { if (!stop_) return false; if (string_to_play_ == "") return false; stop_ = false; id_char_ = 0; id_element_ = 0; sound_.setMuted (true); //Выключаем звук sound_.play (); Mute (); } void Morse::Stop () { if (stop_) return; sound_.stop (); id_char_ = 0; id_element_ = 0; stop_ = true; }


Flag stop_ was introduced to prevent incorrect program operation (two calls in a row to Play() and other bad things).
I don’t see any reason to include the rest of the source code and header files in the body of the article, since everything there is quite obvious and transparent.

You can download the full set of sources for the latest version on GitHub. Writing a GUI is a trivial task, but still, if a GUI is created, then I will add the link. If you have any questions or comments, write in the comments - I will definitely answer.

    There are many options for deciphering the SOS distress signal - “Save Our Souls”, “Save Our Ship”, “Swim Or Sink”, “Stop Other Signals”, “Save From Death”. But all of them are just mnemonics, invented for better memorization, whereas when this signal was adopted as a standard signal at the International Radiotelegraph Conference of 1906, no meaning was put into the abbreviation. Even the letters SOS themselves can be attributed very conditionally to the Morse code sequence (. . . - - - . . .), because there are no inter-letter intervals in it. And they adopted this combination of dots and dashes because it turned out to be more convenient than others for recognizing and highlighting in the general flow of signals due to its sufficient length and symmetry.

    Samuel Morse was an artist until the age of 34 and was not interested in technology. In 1825, a messenger delivered him a letter from his father saying that his wife was dying. Morse immediately left Washington and went to New Haven, where his family lived, but by his arrival his wife had already been buried. This incident forced Morse to give up painting and delve into the study of ways to quickly deliver messages over long distances, which led to the development of Morse code and the electric telegraph in 1838.

    Morse code in its familiar form was not invented by Morse, but by the German engineer Gehrke. The original Morse code was cumbersome, although it was used on some American railroads well into the 1960s.

    On February 6, 1900, a radio station located in the Finnish city of Kotka transmitted a wireless telegram to the icebreaker Ermak with an order to rescue 50 fishermen on a broken ice floe. This was the first radio distress signal in history to be broadcast at sea. The rescue operation was completed successfully.

    Modern submarines are equipped with more efficient means of communication with the “ground world”. Communication is carried out on ultra-long waves, which are capable of penetrating ocean depths of up to 300 meters. This is a very expensive “mobile communication”, which requires the maintenance of powerful ground-based antenna fields that consume power up to 30 MW, and communications aircraft constantly patrolling the sky.

    The SOS signal is transmitted on a frequency of 600 meters only in cases of emergency, when the ship's crew and passengers are in real danger to their lives. In case of violation of this rule, penalties may be imposed on those responsible for unjustified panic. Or moral, which is not an empty phrase in the maritime community. Or material - when the ships that came to help suffer significant material losses. However, there is an exception to this immutable rule. The captain of the ship in some cases can transmit information on a “sonic frequency” during three fixed “minutes of silence” about the emergence of a serious threat to ships in the region. These could be messages about malfunctioning lighthouses, volcanic activity, pirate activity, sunken ships...

    To speed up radio communications, abbreviations, three-letter "Q-codes" and numerous slang expressions were introduced into widespread use. When the Q code is transmitted in the form of a question or statement, its meaning changes. In voice communications, the SOS signal is not used; Mayday is used as a distress signal. It is prohibited to give an SOS signal unless there is a real threat to the life of people or a vessel at sea.

Morse code is a method of encoding characters that allows operators to send messages using a series of long and short electrical signals, or in other words, using dots and dashes.

Who invented Morse code?

Samuel F. B. Morse and his assistant Alfred Vail are considered the inventors of Morse code.

When was Morse code invented?

Morse code was developed in the 1830s and improved in the 1840s.

What was the first message sent using Morse code?

The first official message was: “What hath God wrought” (in Russian: Your deeds are wonderful, Lord!). It was sent by Samuel F. B. Morse on May 24, 1844, at the opening of the Baltimore-Washington telegraph line.

What is Morse code used for?

In the past, Morse code was used very widely, especially in the army. Today, Morse code has limited applications, but it is still used in aviation, among amateur radio operators, and as an assistive technology for people with disabilities.

How to use Morse code?

Morse code can be used in a variety of ways, such as with pen and paper, with light and sound, or even with the eyes or fingers.

How to learn Morse code?

You can learn Morse code by listening to audio recordings of the code, as well as by using word memorization techniques that can be found on various websites. One of the best methods for learning Morse code in 2019 was the Gboard keyboard from Google. You can practice online for free with Morse code exercises provided by the Google Creative Lab.

How to read Morse code?

If you don't have enough experience reading Morse code, you can look up the corresponding characters in a Morse code table, or simply use a Morse code translator.

How to translate Morse code?

If you want to translate or decipher Morse code and do not know how to read it, you can simply use an online Morse code translator. With the help of a Morse code translator, you can easily decipher the code and read the text in Russian.

What is a Morse code translator?

Morse code translator allows anyone to translate Morse code into text and easily decode the message written in the code. With the help of an online Morse code translator, anyone can translate simple text in Russian or another language into Morse code and vice versa. Do you remember the Nokia SMS ringtone? If you want to feel nostalgic, try deciphering the code "... -- ..." and then play the sound. What if you need to decipher a secret message in Morse code or come across an Easter egg with a code in the game? A Morse code translator is at your service 7/24 if you have an Internet connection and a desire to learn Morse code.

We bring to your attention an online Morse code translator.

What does it mean? Let's assume that you need to translate or listen to how your text will sound when translated into Morse code. You enter your text in the left window, indicate the text language below and click the right arrow. In the right window you will receive the Morse code of your text. By clicking on the "play" button below, you can listen to your text in Morse code. This way you will use our online Morse code translator.

Online text translator
to Morse code and back

In the text interpretation of the code, a “section sign” (-···-) is used to indicate a space. This is done solely for ease of copying.

Attention! The built-in player works well in Chrome, normally in Opera (if it gets stuck, you can re-encode the text into Morse code, it helps), very mediocre in Safari. Doesn't work at all in Firefox and Internet Explorer .

In the audio version of the message, all the rules are followed: the duration of one point is taken as a unit of time; the duration of a dash is equal to three dots; the pause between elements of the same character is one dot, between characters in a word - 3 dots, between words - 7 dots.

The sound file for downloading is presented in the formatWAV (you need to download it, not open it in the browser). It's big: for example, Morse code for sending"Greek rode across the river. sees a Greek, a cancer in the river. stuck the Greek’s hand into the river, and the crayfish grabbed the Greek’s hand.” weighs in it 209 KB(although it contains only835 bit information).

Want to test your strength? Nothing could be simpler.

Morse code tunes:

Cyrillic
Latin
Morse code
Chant
A
A
. —
oh yeah
B
IN
— . . .
ba-ki-te-kut
IN
W
. — —
vi-da-la
G
G
— — .
ga-ra-zhi
D
D
— . .
do-mi-ki
E
E
.
There is
AND
V
. . . —
zhe-le-zi-sto
Z
Z
— — . .
for-ka-ti-ki
AND
I
. .
i-di
Y
J
. — — —
and short
TO
TO
— . —
How are you
L
L
. — . .
lu-na-ti-ki
M
M
— —
Mother
N
N
— .
number
ABOUT
ABOUT
— — —
near
P
P
. — — .
pi-la-po-yot
R
R
. — .
re-sha-et
WITH
S
. . .
si-ne-e
T
T

So
U
U
. . —
u-carried
F
F
. . — .
fi-li-mon-chick
X
N
. . . .
hee-mi-chi-te
C
WITH
— . — .
tsap-li-na-shi
H
No
— — — .
cha-sha-to-no
Sh
No
— — — —
sha-ro-va-ra
SCH
Q
— — . —
sha-you-don't-sha
b, b
X
— . . —
that-soft-sign
Y
Y
— . — —
s-not-to-do
E
No
. . — . .
e-le-ron-chi-ki
YU
No
. . — —
Juliana
I
No
. — . —
I'm small I'm small

And here are the tunes of numbers and the most frequently occurring characters. I note that in purely digital texts, zero is often conveyed with one dash, like the letter T - this pleasantly diversifies the transmission and eliminates the need to listen to five dashes in a row;)
Sign
Morse code
Chant
0
— — — — —
zero-to-o-ko-lo
1
. — — — —
and-only-one
2
. . — — —
I-went-to-the-mountain
3
. . . — —
three-you-be-ma-lo, or I-ku-ka-ra-cha
4
. . . . —
che-ve-ri-te-ka
5
. . . . .
five-le-ti-e
6
— . . . .
po-six-ti-be-ri
7
— — . . .
yes-yes-se-me-rik
8
— — — . .
eight-mo-go-i-di
9
— — — — .
but-na-no-na-mi
?
. . — — . .
where should I ask
!
— — . . — —
by-ka-no-pri-ka-za
,
. — . — . —
and-so-and-so-and-so
\ (delimiter)
— . . . —
once-de-li-te-ka

Free service for translating Russian and Latin text into Morse code and vice versa. If the script does not work, try enabling Javascript support in your browser.

The symbols in the table are active. When you left-click on a symbol or Morse code, they will be added to the input window.


Russian
symbol
Latin
symbol
Code
Morse
AA
BB
INW −−
GG−−
DD
E and YoE
ANDV
ZZ−−
ANDI
YJ −−−
TOK− −
LL
MM−−
NN
ABOUTO−−−
PP −−
RR
WITHS
TT
UU
FF
XH
CC− −
HÖ −−−
ShCH−−−−
SCHQ−− −
KommersantÑ −− −−
YY− −−
bX− −
EÉ
YUÜ −−
IÄ − −
Russian
symbol
Latin
symbol
Code
Morse
1 −−−−
2 −−−
3 −−
4
5
6
7 −−
8 −−−
9 −−−−
0 −−−−−
.
, . − − −
! , −− −−
! − − −−
? −−
" −−−−
" − −
; − − −
: −−−
- − −
+ − −
= − −
_ (underscore) −− −
/ − −
(− −−
(or)) − −− −
&
$ − −
@ −− −
ErrorError
End of connectionEnd contact − −

P.S. It should be noted that although the Russian Morse code partially coincides with the Latin one, there are still some differences (I compared it on the Russian and English pages of Wikipedia - you can also see code tables there). For example:

  • the symbol "dot" in the Russian version: · · · · · · , and in Latin: · – · – · –
  • comma in Russian: · − · − · − , and in Latin: – – · · – –
  • exclamation mark in Russian: − − · · − − , and in Latin: – · – · – –
  • the opening bracket in Latin: – · – – ·, and the closing bracket – · – – · –, and in Russian both brackets are the same: – · – – · –
  • some symbols like & + _ $ are only in the Latin version

Therefore, in case of controversial issues, for example, converting the code − − · · − − into an exclamation mark (in the Russian version) or into a comma (in the Latin version), preference is given to the Russian version, since since you are reading this message in Russian, it is assumed that The Russian version is more important for you.

At the same time, since in Russian there is no such necessary sign as + (and for some it may be more necessary $ :), then I added this sign to the Russian encoding as well. If this option does not suit you, if you have minimal knowledge of Javascript and HTML, you can always adjust this script to suit your needs.

By the way, this is my first creation in the Javascript language and there are probably a lot of shortcomings in it. Do not judge strictly:).

P.S. Permission is granted to freely copy and quote this article, provided that an open active link to the source is indicated and the authorship of Ruslan Tertyshny is preserved.

P.P.S. If you want to learn Morse code in an interesting way, we offer you a game "Morse Magic 2", created by Ruslan Bogdanov.