Skip to content

⚫➖ R package: text to Morse Code to audio

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

matt-dray/remorse

Repository files navigation

{remorse}

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. R-CMD-check Codecov test coverage Blog posts

Use R to convert text to Morse Code to audio.

Read more in the blog post.

Installation

You can install {remorse} from GitHub, which also installs {sonify}.

if (!require(remotes)) install.packages("remotes")
remotes::install_github("matt-dray/remorse")
library(remorse)

Examples

Text to Morse Code:

text_in <- "hello there!"
morse <- txt2morse(text_in)
morse
#> [1] "...././.-../.-../--- -/...././.-././-.-.--"

And back again:

text_out <- morse2txt(morse)
text_out
#> [1] "HELLO THERE!"

And from Morse to audio (will play audio on your speakers):

morse2sfx(morse)

Check the full list of supported Morse Code:

morse_lookup
#>        A        B        C        D        E        F        G        H 
#>     ".-"   "-..."   "-.-."    "-.."      "."   "..-."    "--."   "...." 
#>        I        J        K        L        M        N        O        P 
#>     ".."   ".---"    "-.-"   ".-.."     "--"     "-."    "---"   ".--." 
#>        Q        R        S        T        U        V        W        X 
#>   "--.-"    ".-."    "..."      "-"    "..-"   "...-"    ".--"   "-..-" 
#>        Y        Z        0        1        2        3        4        5 
#>   "-.--"   "--.."  "-----"  ".----"  "..---"  "...--"  "....-"  "....." 
#>        6        7        8        9        &        '        @        ) 
#>  "-...."  "--..."  "---.."  "----."  ".-..." ".----." ".--.-." "-.--.-" 
#>        (        :        ,        =        !        .        -        * 
#>  "-.--." "---..." "--..--"  "-...-" "-.-.--" ".-.-.-" "-....-"   "-..-" 
#>        +        "        ?        /          
#>  ".-.-." ".-..-." "..--.."  "-..-."      " "