Skip to main content

Koch method Morse code trainer

Command line Koch method Morse code audio generation and training program.

Implements:

  • Morse code audio playback and file generation

  • with configurable Farnsworth timing [PDF] (defaults to a minimum of 20 WPM characters at any WPM less than 20 WPM)

  • and filters to limit the code’s audio bandwith

  • supporting a Koch method CLI training program

Installation

$ pip install koch

Requires:

Tested with Python 3.9 on Mac OS X.

Note that to install the PyAudio dependency on Mac OS X, you’ll need to first install portaudio with Homebrew:

$ brew install portaudio
$ pip install PyAudio

Examples

Play back strings in Morse by passing them as command line arguments:

$ koch hello world

Save the generated code to a WAV file:

$ koch -f hello.wav hello world

Change the code speed from the default 20 WPM to 30 WPM:

$ koch -w 30 hello world

And the tone frequency from the default 770 Hz to 440 Hz:

$ koch -H 440 hello world

Try a slower speed, which will default to Farnsworth timing with each character played at 20 WPM (default) but the inter-character spacings slowed to 10 WPM:

$ koch -w 10 hello world

Keep the inter-character speed at 10 WPM, but increase the Farnsworth character speed to 30 WPM:

$ koch -w 10 --cwpm 30 hello world

Start a Koch method training sequence, which begins by teaching only the letter ‘K’ (default 20 WPM, 10 characters generated per training run, random word lengths):

$ koch

Move up to learning the first two characters in the Koch method (i.e. ‘K’ and ‘M’):

$ koch -c 2

This will randomly play 10 ‘K’ or ‘M’ characters in words of random lengths, then pause and wait for the user to hit the <Enter> key before printing the actual test sequence played.

You can also try a custom Koch alphabet, e.g. to learn in a different character order:

$ koch -a ABCDE -c 3

Several options together to generate a WAV file with a 30 WPM, 440 Hz Koch training session that’s 20 characters long teaching three letters, ‘K,’, ‘M,’ and ‘R’:

$ koch -w 30 -H 440 -l 20 -c 3 -f koch.wav

Get help with CLI options:

$ koch -h

See also

Contributing

Get the source and report any bugs on Github:

https://github.com/casebeer/koch

Version history

  • 0.1.0 - Python 3. Several new features including stdin input.

  • 0.0.3 - Band pass filter bug fix. Add CLI option to override default 200 Hz band pass filter bandwidth.

  • 0.0.2 - Limit code audio bandwidth to 200 Hz using bandpass filters. Improved file output behavior for easier scripting.

Metadata

Release files for koch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for koch 0.1.0
File Size Uploaded Provenance Actions
koch-0.1.0.tar.gz 9.5 kB Without provenance Details for koch-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for koch 0.1.0
File Interpreter ABI Platform Actions
koch-0.1.0-py3-none-any.whl Python 3 none any Details for koch-0.1.0-py3-none-any.whl

Total release size: 19.6 kB

Release files / koch-0.1.0.tar.gz

Download URL koch-0.1.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dba325debe3407d4767b062b9ba7bf9d43433ba0fc84db591d737c719e24357a
BLAKE2b-256 checksum
How to use checksums
589b26f34b28f332e939fd4e9cf4c6a45db7fc8f8488441646840ba98f4b77e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / koch-0.1.0-py3-none-any.whl

Download URL koch-0.1.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52afad9b56ba939c58c4a227f559ea1a6de16c622f52bcda72edc0dfa3dcf12c
BLAKE2b-256 checksum
How to use checksums
3549bce5f217ca9f64c4a203986b20abf9fa59d1c8b6bba5ed65b6a3d39f02bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for koch 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page