How to learn Morse code in GNU/Linux

I know what you’re thinking — as if GNU/Linux and ham radio couldn’t possibly be nerdy enough when separate, let’s put them together! But let’s take a step back …

I started getting involved with ham radio just three months ago with VHF/UHF voice FM, and already I’m hungering for more. I don’t have an HF rig yet, and might actually not have one for awhile, but since I know it’s something I’ll want to do eventually, I figure I should just start learning Morse code now. As for why I want to learn Morse code, I couldn’t exactly tell you — there’s just a certain romance to it, and pounding away on a key is such a delightfully different method of communicating than just speaking into a microphone. But ignoring why I want to learn it, here’s how I’m going about doing it, in GNU/Linux no less.

Learning Morse code on the computer is actually harder than it should be. I couldn’t find any Flash or Java applets that do something as simple as generate Morse code. Seriously. I found some really old Java applets that no longer function in current JDKs, but they don’t count. I found lots of DOS programs, many of which are pushing two decades old, but I wasn’t having much luck with them even under Windows. And since I’m running GNU/Linux as my primary desktop now, these programs weren’t helpful at all. Luckily, there’s a simple up-to-date command-line utility for GNU/Linux that does all the basics with a minimum of fuss.

First, you’ll want the morse program. In Ubuntu or Debian GNU/Linux, you can do the following:

sudo apt-get install morse

If you’re not using Ubuntu or Debian, you should be able to find it using the package manager in your distro of choice.

Now, learning Morse is as simple as passing in the right command-line parameters to morse. Here’s what I’ve started with:

morse -rC 'ETAOINSHRDLU' -w 5 -Ts


-r means generate random letters. If you don’t pass it at least one option on how to make letters, you’ll just hear silence. -C 'ETAOINSHRDLU' specifies which characters to use. If you leave it out, you’ll get all the letters, numbers, and punctuation, which is a bet overwhelming. Here, I’m starting with 'ETAOINSHRDLU', which are the ten most common letters in the English language. -w 5 specifies the words per minute. As you get better, increase this number, but 5 is a decent figure to start with. -T effectively sets learning mode, which means you type along as the random characters are generated and are informed of mistakes. -s means the program stops on every character until you get it right. As you get better, turn this option off and you’ll get a continuous uninterrupted stream of characters at the designated rate.

So that’s the way I’m learning Morse code at the moment. I have my hands on the keyboard and shut my eyes to focus completely on the sound, then type along with the Morse (it helps being able to touch type). When I get something wrong, the program lets me know with an error tone, and I either keep guessing or open my eyes if I can’t get it to see the answer.

If morse gives you an error that it is unable to generate audio output, the simple solution is to run it as root using sudo to guarantee it has access to the audio output device. You can also tinker around with permissions and make sure you’re in all the correct user groups, but using sudo is simpler.

Read the morse manual entry for the rest of the command-line parameters. Some of the other useful command-line parameters (and these will not work in conjunction with many of the ones specified above) are:

  • -I plays what you type (use the -w parameter in conjunction to govern how fast the Morse comes out). This would also be useful if your sound card directly outputs to a radio, since the upper limit on typing speed is a lot faster on the upper limit on Morse keying speed.
  • -F [n] adjusts the Farnsworth number of words per minute, if you happen to like that method of teaching (basically, it increases the spaces between words but not within them).
  • -l prints each character before playing it. If you’d rather be told the character and then hear it instead of hear it and then copy it, this is what you want.
  • -d dynamically adjusts the rate depending on how well you are doing.

That’s about it; now go out and enjoy learning Morse code the Free way!

10 Responses to “How to learn Morse code in GNU/Linux”

  1. Kelly Martin Says:

    You really should use a Koch method trainer for this; listening to random character sequences isn’t a good way to learn Morse. I think there’s one somewhere that run in Linux.

    And you really should be beaten about the head and shoulders for suggesting sudo like that.

  2. Kelly Martin Says:

    Here’s a Koch trainer for Linux: http://code.google.com/p/kochmorse/

  3. Cyde Weys Says:

    Try it without sudo then.

  4. T2A` Says:

    Learning Morse can be helpful if you’re ever kidnapped and video taped (provided they don’t kill you on camera). You can blink your location in Morse so someone might save you!

  5. Cyde Weys Says:

    I think the captors might notice you blinking like someone having an epileptic fit, especially since they have it on videotape.

    Funny thing is, I do remember that being used as a plot point in a Tom Swift or Hardy Boys novel (funny how those two blend together in my memory) from waaaaay back when I was still reading those things, and it didn’t make any sense to me then either.

  6. Kelly Martin Says:

    Neal Stephenson fans will recall Randy Waterhouse’s clever use of Morse code as a nonobvious communication channel.

  7. jim smith Says:

    send something back

  8. Calum Says:

    Shame that on my laptop, the bleeping is stupidly loud, and the -v doesn’t seem to work.

    Bah. -.-. –.- -.. -..-

  9. N8SRE Says:

    Bit late on this one, I know, but if the audio is too loud or too soft, play around with alsamixer (or the graphical equivalent) and look for a volume slider with a name like “Beep” or “PC Speaker.” You might have to go into a preferences menu and enable the slider first, on some mixers.

  10. pr3nt1c3 Says:

    I found out about morse from catb.org….. however I can’t get it to integrate with my sound card / alsa. I’ve done everything I can, but no luck. Has anyone had experience getting morse to work with bash, ubuntu and alsa… and if so, what (if any) settings / config files did you change?