NAME

Morse Code Text-to-Audio Converter

SYNOPSIS

perl gus_morse.pl --path /media/ramdisk/morse.txt --wpm 26 -incr 0.1 --farn 13 --decr 0.2 --tone 750 --samp 11025 --codec mp3 --rand

DESCRIPTION

Reads in text file, writes out Morse code as audio file. Writes initially to *.wav then converts.

MODULES USED

Getopt::Long

Audio::Wav

Time::HiRes qw( gettimeofday )

File::Path qw( rmtree )

File::Copy

Config

COMMAND LINE OPTIONS

Control behavior of text-to-audio conversion using these options.

--p[ath]

Valid system file path to input text file. Audio output file(s) will be written to same directory, with extensions for inumeration and codec. Default = './morse.txt'

--w[pm]

Character speed as words-per-minute...independent of character spacing. Default = 26.0.

--i[ncr]

For each new file generated in series, increase the --wpm by this value in wpm. Default = 0;

--f[arn]

Farnsworth spacing. Spreads out inter-character & inter-word spacing by stretching the gaps to this value in WPM.

--e[xtra]

Inter-word spacing. Spreads out inter-word spacing by adding N to the 7 PARIS elements for a space. Default = 0;

--d[ecr]

For each new file generated in series, incease the --farn by this value in wpm. Default = 0;

--t[one]

Tone of CW characters in Hz. Default = 700

--m[ins]

Once output file exceeds this limit in minutes, a new file will split off at next major punctuation.

--n[opunct]

Arg is a string of characters which are to be passed over or substituted when encountered in a text file.

--s[amp]

Sampling rate of the *.wav file in Hz. Default = 11025.

--c[odec]

Which audio codec (format) as final output? Default = wav On Linux you may also choose *.ogg if you have the oggenc package installed or mp3 should you have the lame package installed.

--g[raphic]

Path to *.png or *.jpg file, if any, for cover-art tag. Used only with --codec mp3 on Linux.

--l[ang]

Language of input *.txt file and subsequent Morse code charset.

en

English via US ASCII (Default)

eo

Esperanto: prefere laŭ Unikodo, anstataŭ la iksa sistemo.

es

Spanish, includes N-tilde char.

others?

Possibly to be supported later. Only just maybe...

--r[and]

Randomly shuffle all characters in each line. This will convert any text to random practice.

--k[och]

Like --r[and] except that the character count for each line will be expanded by adding tupples of all those provided. This is to facilitate the Koch method of teaching Morse code where only one each from a very small subset of characters are provided on a given line. You must provide an input text file containing lines of those characters to be tuppled and suffled.

--v[erbose]

Verbosity flag provides verbose feedback.

--g[raphic]

Specify a file by name as album art. Must conform to player requirements. Note, that if rather than a command-line arg, this instruction is embedded (see below) then the file name must be all upper-case: COVER.JPG

--h[elp] Help

Display basic help/usage message.

--test Test

Perform dry run as predictive test, generating no *.wav files. Use this mode to try out various combinations of --wpm, --decr, --incr and view the results in quick order.

SPECIAL CHARACTERS

Converter will parse input text for *-delimited special characters. Examples: *AR* *SK* *KN* *BT* *SOS* *ERROR*

EMBEDED OPERATORS

Converter will parse input text for *-delimited special operators. These have the same effect as their CLI arg equivalents, but may be embeded mid-stream in the text file so as to take effect mid-stream during the playout. Use them to simulate QSO between multiple stations.

Regular Ops

These have same effect as their CLI-arg equivalents. Examples: *TONE=775* *WPM=20.6* *DIFF=8.5* *LANG=EN* *LANG=EO* *QUIT=99* *GRAPIC=COVER.JPG*

head2 *RAND=1* and *KOCH=1*

These differ from their CLI-arg equivalents in requiring either a 0 or a 1 as integer arguments. On the CLI they are flags, always equal to 1. As embedded operators they may be toggled on and off.

*NEXT*

This op has no CLI-arg equivalent. Its function is to trigger a break between consecutive output files.

BUILT-IN REGEX

Roman Numerals

Chapter titles enumerated as Roman will all become Arabic up to a limit of 100.

Excess Whitespace

Plural spaces will be reduced to single, leading and trailing spaces on lines removed.

Full Stop

Sentence final punctuation is followed by a short pause, as would be heard if read by a human narrator.

AUTHOR

Gan Uesli Starling <gan@starling.us>

LICENSE

Authored 2006-2023, Gan Uesli Starling, KY8D, VA7KYD, T000000139. No rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SCRIPT CATEGORIES

Convert