Created by: WA7SPY
This program helps you learn Morse code interactively!
You can:
- Practice letters in weekly groups
- Send random words and sentences built from each week's letters
- Send random call signs, numbers, and punctuation
- Enter your own text to send in Morse code
- Send the contents of a text file as Morse code (menu option 9)
- Adjust tone frequency and speed (WPM)
- Use Farnsworth timing to slow spacing between letters/words while keeping character speed high (e.g., 25 WPM characters at 5 WPM effective)
- Stretch spacing further with a Farnsworth gap multiplier
- Use Flash Card Mode to display large letters as they are sent
- Toggle dot-dash display for reference
- Toggle voice mode to speak letters aloud
Morse code is an audible language—turn off the visual dot-dash display as soon as you can.
Practice at least 15 minutes per day. Do not move to the next week until you can copy the current week confidently.
GOOD LUCK—ENJOY LEARNING!
v2.2 – September 2025
- Added menu option 9: Send from a text file
- Added Farnsworth timing controls:
- Set Farnsworth effective WPM
- Adjust Farnsworth gap multiplier
- Fixed intra-character spacing (correctly plays “M=--”, “I=..”, etc.)
- Improved macOS audio initialization (CoreAudio)
v2.1 – July 7, 2025
- Enter = pause/resume;
q+ Enter = stop and return to menu - Minor on-screen instruction improvements
- Python 3
- pygame
- numpy
Follow the steps below for your platform.
-
Install Python 3 from python.org.
-
Open Command Prompt.
-
Install dependencies:
pip install pygame numpy
-
(Optional) Create a virtual environment:
python -m venv pyEnv pyEnv\Scripts\activate
-
Make sure Python 3 is installed:
python3 --version
-
Install dependencies:
pip3 install pygame numpy
-
(Optional) Create a virtual environment:
python3 -m venv pyEnv source pyEnv/bin/activate
Make sure the following files are located in the same folder before running the program:
morsecode.py– the main program.ascii_letters.py– provides the large letter display for Flash Card Mode.
If ascii_letters.py is missing or not in the same directory as morsecode.py, the program will not start and you will see an error similar to:
ModuleNotFoundError: No module named 'ascii_letters'
Navigate to the folder containing morsecode.py.
Windows:
python morsecode.pymacOS and Linux:
python3 morsecode.pyMorse Code Trainer - Main Menu
1. Practice Week Letters
2. Random Word
3. Random Sentence
4. Random Call Sign
5. Random Numbers (0123456789)
6. Random Punctuation (.,?/)
7. Enter Custom Text
8. Settings
9. Send from a text file
Press [Enter] to Pause. Press [q] then [Enter] to Stop.
Display: ON | Flash: OFF | Voice: OFF | WPM: 25 | Farnsworth: 5 | GapMult: 2.0 | Frequency: 500Hz
Choice:
While sending, the program may show:
Sending: E (.)
Main Menu Options
- Practice Week Letters – Sends letters from a specific week's group randomly.
- Random Word – Sends 3 randomly selected words.
- Random Sentence – Sends a randomly selected sentence.
- Random Call Sign – Sends a randomly selected ham call sign.
- Random Numbers – Sends numbers randomly.
- Random Punctuation – Sends punctuation marks randomly.
- Enter Custom Text – You type anything; it sends it back in Morse code.
- Settings – Adjust frequency, Character WPM (dot speed), Farnsworth WPM (effective), Farnsworth gap multiplier, display options, flash card mode, and voice mode.
- Send from a text file – Enter a path like
~/Desktop/qso.txt; the file’s text is normalized and sent in Morse.
Pausing and Stopping
- Pause/Resume: Press Enter during playback
- Stop and return to menu: Press q then Enter
- Character WPM sets the actual dit length (tone speed while characters play).
- Farnsworth WPM slows down spacing (between letters/words) to create a lower effective speed.
- Gap Multiplier adds extra stretch on inter-character/word gaps (on top of Farnsworth), useful at very low effective speeds.
Common setup for learners: Characters at 25 WPM, Farnsworth 5 WPM, Gap Multiplier ~1.8–2.2.
v2.2 – September 2025
- Added menu option 9: Send from a text file
- Added Farnsworth timing controls:
- Set Farnsworth effective WPM
- Adjust Farnsworth gap multiplier
- Fixed intra-character spacing (correctly plays “M=--”, “I=..”, etc.)
- Improved macOS audio initialization (CoreAudio)
v2.1 – July 7, 2025
- Enter = pause/resume;
q+ Enter = stop and return to menu - Minor on-screen instruction improvements
- Python 3
- pygame
- numpy
- Install Python 3 from https://www.python.org/
- Install dependencies:
pip install pygame numpy pyttsx3
- Run:
python morsecode.py
- Install Python 3 (Homebrew, apt, etc.)
- Install dependencies:
pip install pygame numpy
- Run:
python3 morsecode.py
morsecode.py– main programascii_letters.py– large-letter display for Flash Card Mode Ifascii_letters.pyis missing or in another folder, Python will raise:
ModuleNotFoundError: No module named 'ascii_letters'
This project’s learning sequence and approach are inspired by the work of Mike Aretsky, N6MQL (SK). Mike was a beloved ham radio leader, Morse code advocate, accomplished engineer, and community pillar whose legacy continues to help new operators learn CW.
(Choose a license if you want one—e.g., MIT—or remove this section.)