Skip to content

jlondonobo/morse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Untitled

Features

  • Output string representation to stdout.
  • Output sound representation to a .wav file via the --output flag.
  • Supports short flags like -s (sound) and -o (output).
  • Configure sound pitch, speed, and tone.

Installation

Installing morse requires that you have Go installed in your system. Then run:

go install github.com/jlondonobo/morse@latest

Quickstart

To translate text to Morse code, run:

morse 'Vamos' -s

This command will write the string representation to standard output and play it on your speakers.

To name the ouput file something different, use the --file-name (-f) flag. For example:

morse 'Lets go, Carlos, lets go' -sf 'carlitos.wav'

Configuration

By default, morse plays a 700Hz sine wave at 20 words per minute. But you can change its pitch, speed, and tone.

Morse supports configuring the ouptut sound using the --pitch, --speed, and --tone flags.

Pitch

You can set the pitch anywhere from 300Hz to 1000Hz via the --pitch flag.

morse 'Ace' -s --pitch 500

Speed

Morse code speed is measured in words per minute (wpm). Because characters might have different lengths, the convention is to meausre words per minute using the word "PARIS " with a space at the end.

morse produces sound outputs at 20wpm, try adjusting it to anything between 5-40 wpm.

morse 'What a magnificent shot' -s --speed 35

Tone

Set the output tone to one of sine, triangle, sawtooth and square. Via the --tone flag.

morse 'And the champion of the 2025 Nitto ATP finals is Jannik Sinner' -s --tone triangle
  • sine: The base, smooth. Makes up all other waves.
  • square: Richer and buzzier.
  • triangle: Between sine and square.
  • sawtooth: More friction and the buzziest of all.

Roadmap

  • Enable saving sound to file

  • Make functions run in parallel

  • Set up short-version flags

  • Extend punctuation

  • Add a default file name for better ergonomics

  • Enable editing sound qualities

    • Speed
    • Pitch
    • Tone
  • Improve efficiency of steream construction / duplication.

  • Improve error handling in goroutine

About

A simple CLI tool for translating text to Morse code

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages