Author Topic: Text and numbers to Morse code, and back again  (Read 4118 times)

0 Members and 1 Guest are viewing this topic.

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Text and numbers to Morse code, and back again
« on: December 08, 2021, 07:37:11 pm »
An ASCII string is split up into individual characters, including spaces, and converted to Morse code. Including audio.

One subroutine converts to Morse, and another one decodes the dots and dashes back to text and numerals.

(Oh shucks. The accented u is meant to be a dot, character 249, in the IBM extended character set. It's a dot at the same elevation as the - sign. I use character 249 as dit, and the - symbol as dah. It shows up fine in QB64.)

Code: QB64: [Select]
  1. Rem  Program converts text to Morse code, including sound, then decodes.
  2. Rem -------
  3. _Title "Morse code encoder/decoder"
  4. Rem Screen _NewImage(120, 43, 0)
  5. Rem Color 1, 7
  6. Dim Shared char(500), MorseChar$(500), Astring$, NumBytes
  7. 1 Input "Continue or exit (x exits) -> ", cont$
  8. If cont$ = "x" Then End
  9. Call InputCharacters
  10. Call MorseEncode
  11. Input "Press <enter> to decode -> ", cont$
  12. Call MorseDecode
  13.  
  14. Sub InputCharacters
  15.     Input "Enter string of letters and numbers to convert to Morse code -> ", Astring$
  16.     Print Astring$
  17.     NumBytes = Len(Astring$)
  18.     For i = 1 To NumBytes
  19.         char(i) = Asc(Astring$, i)
  20.     Next i
  21.     If NumBytes < 1 Then
  22.         Beep
  23.         Print
  24.         Color 4, 7
  25.         Print "There was no input data identified. At least one input byte required."
  26.         Color 1, 7
  27.         End
  28.     End If
  29.     Print "Number of bytes ="; NumBytes
  30.  
  31. Sub MorseEncode
  32.     Print
  33.     For i = 1 To NumBytes
  34.         Rem -------
  35.         Rem  control codes
  36.         Rem -------
  37.         If char(i) < 32 Then
  38.             MorseChar$(i) = "*"
  39.             Print MorseChar$(i), "No Morse equivalent"
  40.             Call NoCode
  41.         End If
  42.         Rem -------
  43.         Rem  parentheses, slash, + and - signs
  44.         Rem -------
  45.         If char(i) > 33 And char(i) < 48 Then
  46.             MorseChar$(i) = "*"
  47.             Print MorseChar$(i), "No Morse equivalent"
  48.             Call NoCode
  49.         End If
  50.         Rem -------
  51.         Rem  colon, semicolon, >, <, ?, etc.
  52.         Rem -------
  53.         If char(i) > 57 And char(i) < 65 Then
  54.             MorseChar$(i) = "*"
  55.             Print MorseChar$(i), "No Morse equivalent"
  56.             Call NoCode
  57.         End If
  58.         Rem -------
  59.         Rem  brackets, backslash, etc.
  60.         Rem -------
  61.         If char(i) > 90 And char(i) < 97 Then
  62.             MorseChar$(i) = "*"
  63.             Print MorseChar$(i), "No Morse equivalent"
  64.             Call NoCode
  65.         End If
  66.         Rem -------
  67.         Rem  more brackets, extended ASCII set
  68.         Rem -------
  69.         If char(i) > 122 Then
  70.             MorseChar$(i) = "*"
  71.             Print MorseChar$(i), "No Morse equivalent"
  72.             Call NoCode
  73.         End If
  74.         Rem -------
  75.         Rem  Space between words
  76.         Rem -------
  77.         If char(i) = 32 Then
  78.             MorseChar$(i) = " "
  79.             Print MorseChar$(i)
  80.             _Delay .8
  81.         End If
  82.         Rem -------
  83.         Rem  Letter A
  84.         Rem -------
  85.         If char(i) = 97 Or char(i) = 65 Then
  86.             MorseChar$(i) = "ù-"
  87.             Print MorseChar$(i), Chr$(65)
  88.             Call dit: Call dah
  89.             _Delay .45
  90.         End If
  91.         Rem -------
  92.         Rem  Letter B
  93.         Rem -------
  94.         If char(i) = 98 Or char(i) = 66 Then
  95.             MorseChar$(i) = "-ùùù"
  96.             Print MorseChar$(i), Chr$(66)
  97.             Call dah: Call dit: Call dit: Call dit
  98.             _Delay .45
  99.         End If
  100.         Rem -------
  101.         Rem  Letter C
  102.         Rem -------
  103.         If char(i) = 99 Or char(i) = 67 Then
  104.             MorseChar$(i) = "-ù-ù"
  105.             Print MorseChar$(i), Chr$(67)
  106.             Call dah: Call dit: Call dah: Call dit
  107.             _Delay .45
  108.         End If
  109.         Rem -------
  110.         Rem  Letter D
  111.         Rem -------
  112.         If char(i) = 100 Or char(i) = 68 Then
  113.             MorseChar$(i) = "-ùù"
  114.             Print MorseChar$(i), Chr$(68)
  115.             Call dah: Call dit: Call dit
  116.             _Delay .45
  117.         End If
  118.         Rem -------
  119.         Rem  Letter E
  120.         Rem -------
  121.         If char(i) = 101 Or char(i) = 69 Then
  122.             MorseChar$(i) = "ù"
  123.             Print MorseChar$(i), Chr$(69)
  124.             Call dit
  125.             _Delay .45
  126.         End If
  127.         Rem -------
  128.         Rem  Letter F
  129.         Rem -------
  130.         If char(i) = 102 Or char(i) = 70 Then
  131.             MorseChar$(i) = "ùù-ù"
  132.             Print MorseChar$(i), Chr$(70)
  133.             Call dit: Call dit: Call dah: Call dit
  134.             _Delay .45
  135.         End If
  136.         Rem -------
  137.         Rem  Letter G
  138.         Rem -------
  139.         If char(i) = 103 Or char(i) = 71 Then
  140.             MorseChar$(i) = "--ù"
  141.             Print MorseChar$(i), Chr$(71)
  142.             Call dah: Call dah: Call dit
  143.             _Delay .45
  144.         End If
  145.         Rem -------
  146.         Rem  Letter H
  147.         Rem -------
  148.         If char(i) = 104 Or char(i) = 72 Then
  149.             MorseChar$(i) = "ùùùù"
  150.             Print MorseChar$(i), Chr$(72)
  151.             Call dit: Call dit: Call dit: Call dit
  152.             _Delay .45
  153.         End If
  154.         Rem -------
  155.         Rem  Letter I
  156.         Rem -------
  157.         If char(i) = 105 Or char(i) = 73 Then
  158.             MorseChar$(i) = "ùù"
  159.             Print MorseChar$(i), Chr$(73)
  160.             Call dit: Call dit
  161.             _Delay .45
  162.         End If
  163.         Rem -------
  164.         Rem  Letter J
  165.         Rem -------
  166.         If char(i) = 106 Or char(i) = 74 Then
  167.             MorseChar$(i) = "ù---"
  168.             Print MorseChar$(i), Chr$(74)
  169.             Call dit: Call dah: Call dah: Call dah
  170.             _Delay .45
  171.         End If
  172.         Rem -------
  173.         Rem  Letter K
  174.         Rem -------
  175.         If char(i) = 107 Or char(i) = 75 Then
  176.             MorseChar$(i) = "-ù-"
  177.             Print MorseChar$(i), Chr$(75)
  178.             Call dah: Call dit: Call dah
  179.             _Delay .45
  180.         End If
  181.         Rem -------
  182.         Rem  Letter L
  183.         Rem -------
  184.         If char(i) = 108 Or char(i) = 76 Then
  185.             MorseChar$(i) = "ù-ùù"
  186.             Print MorseChar$(i), Chr$(76)
  187.             Call dit: Call dah: Call dit: Call dit
  188.             _Delay .45
  189.         End If
  190.         Rem -------
  191.         Rem  Letter M
  192.         Rem -------
  193.         If char(i) = 109 Or char(i) = 77 Then
  194.             MorseChar$(i) = "--"
  195.             Print MorseChar$(i), Chr$(77)
  196.             Call dah: Call dah
  197.             _Delay .45
  198.         End If
  199.         Rem -------
  200.         Rem  Letter N
  201.         Rem -------
  202.         If char(i) = 110 Or char(i) = 78 Then
  203.             MorseChar$(i) = "-ù"
  204.             Print MorseChar$(i), Chr$(78)
  205.             Call dah: Call dit
  206.             _Delay .45
  207.         End If
  208.         Rem -------
  209.         Rem  Letter O
  210.         Rem -------
  211.         If char(i) = 111 Or char(i) = 79 Then
  212.             MorseChar$(i) = "---"
  213.             Print MorseChar$(i), Chr$(79)
  214.             Call dah: Call dah: Call dah
  215.             _Delay .45
  216.         End If
  217.         Rem -------
  218.         Rem  Letter P
  219.         Rem -------
  220.         If char(i) = 112 Or char(i) = 80 Then
  221.             MorseChar$(i) = "ù--ù"
  222.             Print MorseChar$(i), Chr$(80)
  223.             Call dit: Call dah: Call dah: Call dit
  224.             _Delay .45
  225.         End If
  226.         Rem -------
  227.         Rem  Letter Q
  228.         Rem -------
  229.         If char(i) = 113 Or char(i) = 81 Then
  230.             MorseChar$(i) = "--ù-"
  231.             Print MorseChar$(i), Chr$(81)
  232.             Call dah: Call dah: Call dit: Call dah
  233.             _Delay .45
  234.         End If
  235.         Rem -------
  236.         Rem  Letter R
  237.         Rem -------
  238.         If char(i) = 114 Or char(i) = 82 Then
  239.             MorseChar$(i) = "ù-ù"
  240.             Print MorseChar$(i), Chr$(82)
  241.             Call dit: Call dah: Call dit
  242.             _Delay .45
  243.         End If
  244.         Rem -------
  245.         Rem  Letter S
  246.         Rem -------
  247.         If char(i) = 115 Or char(i) = 83 Then
  248.             MorseChar$(i) = "ùùù"
  249.             Print MorseChar$(i), Chr$(83)
  250.             Call dit: Call dit: Call dit
  251.             _Delay .45
  252.         End If
  253.         Rem -------
  254.         Rem  Letter T
  255.         Rem -------
  256.         If char(i) = 116 Or char(i) = 84 Then
  257.             MorseChar$(i) = "-"
  258.             Print MorseChar$(i), Chr$(84)
  259.             Call dah
  260.             _Delay .45
  261.         End If
  262.         Rem -------
  263.         Rem  Letter U
  264.         Rem -------
  265.         If char(i) = 117 Or char(i) = 85 Then
  266.             MorseChar$(i) = "ùù-"
  267.             Print MorseChar$(i), Chr$(85)
  268.             Call dit: Call dit: Call dah
  269.             _Delay .45
  270.         End If
  271.         Rem -------
  272.         Rem  Letter V
  273.         Rem -------
  274.         If char(i) = 118 Or char(i) = 86 Then
  275.             MorseChar$(i) = "ùùù-"
  276.             Print MorseChar$(i), Chr$(86)
  277.             Call dit: Call dit: Call dit: Call dah
  278.             _Delay .45
  279.         End If
  280.         Rem -------
  281.         Rem  Letter W
  282.         Rem -------
  283.         If char(i) = 119 Or char(i) = 87 Then
  284.             MorseChar$(i) = "ù--"
  285.             Print MorseChar$(i), Chr$(87)
  286.             Call dit: Call dah: Call dah
  287.             _Delay .45
  288.         End If
  289.         Rem -------
  290.         Rem  Letter X
  291.         Rem -------
  292.         If char(i) = 120 Or char(i) = 88 Then
  293.             MorseChar$(i) = "-ùù-"
  294.             Print MorseChar$(i), Chr$(88)
  295.             Call dah: Call dit: Call dit: Call dah
  296.             _Delay .45
  297.         End If
  298.         Rem -------
  299.         Rem  Letter Y
  300.         Rem -------
  301.         If char(i) = 121 Or char(i) = 89 Then
  302.             MorseChar$(i) = "-ù--"
  303.             Print MorseChar$(i), Chr$(89)
  304.             Call dah: Call dit: Call dah: Call dah
  305.             _Delay .45
  306.         End If
  307.         Rem -------
  308.         Rem  Letter Z
  309.         Rem -------
  310.         If char(i) = 122 Or char(i) = 90 Then
  311.             MorseChar$(i) = "--ùù"
  312.             Print MorseChar$(i), Chr$(90)
  313.             Call dah: Call dah: Call dit: Call dit
  314.             _Delay .45
  315.         End If
  316.         Rem -------
  317.         Rem  Numeral 0
  318.         Rem -------
  319.         If char(i) = 48 Then
  320.             MorseChar$(i) = "-----"
  321.             Print MorseChar$(i), Chr$(48)
  322.             Call dah: Call dah: Call dah: Call dah: Call dah
  323.             _Delay .6
  324.         End If
  325.         Rem -------
  326.         Rem  Numeral 1
  327.         Rem -------
  328.         If char(i) = 49 Then
  329.             MorseChar$(i) = "ù----"
  330.             Print MorseChar$(i), Chr$(49)
  331.             Call dit: Call dah: Call dah: Call dah: Call dah
  332.             _Delay .6
  333.         End If
  334.         Rem -------
  335.         Rem  Numeral 2
  336.         Rem -------
  337.         If char(i) = 50 Then
  338.             MorseChar$(i) = "ùù---"
  339.             Print MorseChar$(i), Chr$(50)
  340.             Call dit: Call dit: Call dah: Call dah: Call dah
  341.             _Delay .6
  342.         End If
  343.         Rem -------
  344.         Rem  Numeral 3
  345.         Rem -------
  346.         If char(i) = 51 Then
  347.             MorseChar$(i) = "ùùù--"
  348.             Print MorseChar$(i), Chr$(51)
  349.             Call dit: Call dit: Call dit: Call dah: Call dah
  350.             _Delay .6
  351.         End If
  352.         Rem -------
  353.         Rem  Numeral 4
  354.         Rem -------
  355.         If char(i) = 52 Then
  356.             MorseChar$(i) = "ùùùù-"
  357.             Print MorseChar$(i), Chr$(52)
  358.             Call dit: Call dit: Call dit: Call dit: Call dah
  359.             _Delay .6
  360.         End If
  361.         Rem -------
  362.         Rem  Numeral 5
  363.         Rem -------
  364.         If char(i) = 53 Then
  365.             MorseChar$(i) = "ùùùùù"
  366.             Print MorseChar$(i), Chr$(53)
  367.             Call dit: Call dit: Call dit: Call dit: Call dit
  368.             _Delay .6
  369.         End If
  370.         Rem -------
  371.         Rem  Numeral 6
  372.         Rem -------
  373.         If char(i) = 54 Then
  374.             MorseChar$(i) = "-ùùùù"
  375.             Print MorseChar$(i), Chr$(54)
  376.             Call dah: Call dit: Call dit: Call dit: Call dit
  377.             _Delay .6
  378.         End If
  379.         Rem -------
  380.         Rem  Numeral 7
  381.         Rem -------
  382.         If char(i) = 55 Then
  383.             MorseChar$(i) = "--ùùù"
  384.             Print MorseChar$(i), Chr$(55)
  385.             Call dah: Call dah: Call dit: Call dit: Call dit
  386.             _Delay .6
  387.         End If
  388.         Rem -------
  389.         Rem  Numeral 8
  390.         Rem -------
  391.         If char(i) = 56 Then
  392.             MorseChar$(i) = "---ùù"
  393.             Print MorseChar$(i), Chr$(56)
  394.             Call dah: Call dah: Call dah: Call dit: Call dit
  395.             _Delay .6
  396.         End If
  397.         Rem -------
  398.         Rem  Numeral 9
  399.         Rem -------
  400.         If char(i) = 57 Then
  401.             MorseChar$(i) = "----ù"
  402.             Print MorseChar$(i), Chr$(57)
  403.             Call dah: Call dah: Call dah: Call dah: Call dit
  404.             _Delay .6
  405.         End If
  406.     Next i
  407.  
  408. Sub MorseDecode
  409.     Print
  410.     For i = 1 To NumBytes
  411.         Rem -------
  412.         Rem  control codes, punctuation, slashes, extended ASCII
  413.         Rem -------
  414.         If MorseChar$(i) = "*" Then Print MorseChar$(i); " decoded", "InvalidCode"
  415.         Rem -------
  416.         Rem  Space between words
  417.         Rem -------
  418.         If MorseChar$(i) = " " Then Print
  419.         Rem -------
  420.         Rem  Letter A
  421.         Rem -------
  422.         If MorseChar$(i) = "ù-" Then Print MorseChar$(i); " decoded", "A"
  423.         Rem -------
  424.         Rem  Letter B
  425.         Rem -------
  426.         If MorseChar$(i) = "-ùùù" Then Print MorseChar$(i); " decoded", "B"
  427.         Rem -------
  428.         Rem  Letter C
  429.         Rem -------
  430.         If MorseChar$(i) = "-ù-ù" Then Print MorseChar$(i); " decoded", "C"
  431.         Rem -------
  432.         Rem  Letter D
  433.         Rem -------
  434.         If MorseChar$(i) = "-ùù" Then Print MorseChar$(i); " decoded", "D"
  435.         Rem -------
  436.         Rem  Letter E
  437.         Rem -------
  438.         If MorseChar$(i) = "ù" Then Print MorseChar$(i); " decoded", "E"
  439.         Rem -------
  440.         Rem  Letter F
  441.         Rem -------
  442.         If MorseChar$(i) = "ùù-ù" Then Print MorseChar$(i); " decoded", "F"
  443.         Rem -------
  444.         Rem  Letter G
  445.         Rem -------
  446.         If MorseChar$(i) = "--ù" Then Print MorseChar$(i); " decoded", "G"
  447.         Rem -------
  448.         Rem  Letter H
  449.         Rem -------
  450.         If MorseChar$(i) = "ùùùù" Then Print MorseChar$(i); " decoded", "H"
  451.         Rem -------
  452.         Rem  Letter I
  453.         Rem -------
  454.         If MorseChar$(i) = "ùù" Then Print MorseChar$(i); " decoded", "I"
  455.         Rem -------
  456.         Rem  Letter J
  457.         Rem -------
  458.         If MorseChar$(i) = "ù---" Then Print MorseChar$(i); " decoded", "J"
  459.         Rem -------
  460.         Rem  Letter K
  461.         Rem -------
  462.         If MorseChar$(i) = "-ù-" Then Print MorseChar$(i); " decoded", "K"
  463.         Rem -------
  464.         Rem  Letter L
  465.         Rem -------
  466.         If MorseChar$(i) = "ù-ùù" Then Print MorseChar$(i); " decoded", "L"
  467.         Rem -------
  468.         Rem  Letter M
  469.         Rem -------
  470.         If MorseChar$(i) = "--" Then Print MorseChar$(i); " decoded", "M"
  471.         Rem -------
  472.         Rem  Letter N
  473.         Rem -------
  474.         If MorseChar$(i) = "-ù" Then Print MorseChar$(i); " decoded", "N"
  475.         Rem -------
  476.         Rem  Letter O
  477.         Rem -------
  478.         If MorseChar$(i) = "---" Then Print MorseChar$(i); " decoded", "O"
  479.         Rem -------
  480.         Rem  Letter P
  481.         Rem -------
  482.         If MorseChar$(i) = "ù--ù" Then Print MorseChar$(i); " decoded", "P"
  483.         Rem -------
  484.         Rem  Letter Q
  485.         Rem -------
  486.         If MorseChar$(i) = "--ù-" Then Print MorseChar$(i); " decoded", "Q"
  487.         Rem -------
  488.         Rem  Letter R
  489.         Rem -------
  490.         If MorseChar$(i) = "ù-ù" Then Print MorseChar$(i); " decoded", "R"
  491.         Rem -------
  492.         Rem  Letter S
  493.         Rem -------
  494.         If MorseChar$(i) = "ùùù" Then Print MorseChar$(i); " decoded", "S"
  495.         Rem -------
  496.         Rem  Letter T
  497.         Rem -------
  498.         If MorseChar$(i) = "-" Then Print MorseChar$(i); " decoded", "T"
  499.         Rem -------
  500.         Rem  Letter U
  501.         Rem -------
  502.         If MorseChar$(i) = "ùù-" Then Print MorseChar$(i); " decoded", "U"
  503.         Rem -------
  504.         Rem  Letter V
  505.         Rem -------
  506.         If MorseChar$(i) = "ùùù-" Then Print MorseChar$(i); " decoded", "V"
  507.         Rem -------
  508.         Rem  Letter W
  509.         Rem -------
  510.         If MorseChar$(i) = "ù--" Then Print MorseChar$(i); " decoded", "W"
  511.         Rem -------
  512.         Rem  Letter X
  513.         Rem -------
  514.         If MorseChar$(i) = "-ùù-" Then Print MorseChar$(i); " decoded", "X"
  515.         Rem -------
  516.         Rem  Letter Y
  517.         Rem -------
  518.         If MorseChar$(i) = "-ù--" Then Print MorseChar$(i); " decoded", "Y"
  519.         Rem -------
  520.         Rem  Letter Z
  521.         Rem -------
  522.         If MorseChar$(i) = "--ùù" Then Print MorseChar$(i); " decoded", "Z"
  523.         Rem -------
  524.         Rem  Numeral 0
  525.         Rem -------
  526.         If MorseChar$(i) = "-----" Then Print MorseChar$(i); " decoded", "0"
  527.         Rem -------
  528.         Rem  Numeral 1
  529.         Rem -------
  530.         If MorseChar$(i) = "ù----" Then Print MorseChar$(i); " decoded", "1"
  531.         Rem -------
  532.         Rem  Numeral 2
  533.         Rem -------
  534.         If MorseChar$(i) = "ùù---" Then Print MorseChar$(i); " decoded", "2"
  535.         Rem -------
  536.         Rem  Numeral 3
  537.         Rem -------
  538.         If MorseChar$(i) = "ùùù--" Then Print MorseChar$(i); " decoded", "3"
  539.         Rem -------
  540.         Rem  Numeral 4
  541.         Rem -------
  542.         If MorseChar$(i) = "ùùùù-" Then Print MorseChar$(i); " decoded", "4"
  543.         Rem -------
  544.         Rem  Numeral 5
  545.         Rem -------
  546.         If MorseChar$(i) = "ùùùùù" Then Print MorseChar$(i); " decoded", "5"
  547.         Rem -------
  548.         Rem  Numeral 6
  549.         Rem -------
  550.         If MorseChar$(i) = "-ùùùù" Then Print MorseChar$(i); " decoded", "6"
  551.         Rem -------
  552.         Rem  Numeral 7
  553.         Rem -------
  554.         If MorseChar$(i) = "--ùùù" Then Print MorseChar$(i); " decoded", "7"
  555.         Rem -------
  556.         Rem  Numeral 8
  557.         Rem -------
  558.         If MorseChar$(i) = "---ùù" Then Print MorseChar$(i); " decoded", "8"
  559.         Rem -------
  560.         Rem  Numeral 9
  561.         Rem -------
  562.         If MorseChar$(i) = "----ù" Then Print MorseChar$(i); " decoded", "9"
  563.     Next i
  564.  
  565. Sub NoCode
  566.     Sound 400, 2
  567.     _Delay .5
  568.  
  569. Sub dit
  570.     Sound 650, 2
  571.     _Delay .2
  572.  
  573. Sub dah
  574.     Sound 650, 6
  575.     _Delay .2
  576.  
« Last Edit: December 08, 2021, 11:41:48 pm by odin »

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Text and numbers to Morse code, and back again
« Reply #1 on: December 09, 2021, 06:51:26 pm »
An ASCII string is split up into individual characters, including spaces, and converted to Morse code. Including audio.

This is really cool!

Here's an idea for v2, related to @SMcNeill 's suggestion for @SpriggsySpriggs 's API project
https://www.qb64.org/forum/index.php?topic=4468.0, of getting input from a microphone:
have it be able to decode actual Morse audio by listening with the microphone!
Theoretically we could get 2 PCs sitting side by side beeping away and "talking" to each other in Morse. :-D

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: Text and numbers to Morse code, and back again
« Reply #2 on: December 09, 2021, 09:44:42 pm »
Yes, that's exactly what I wanted to do next, but first I need a mic. I'll look to see what Steve and Spriggsy concocted. And to work right, it would have to accommodate a certain amount of slop in length, spacing, and frequencies of the tone.

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Text and numbers to Morse code, and back again
« Reply #3 on: December 10, 2021, 12:50:06 am »
Yes, that's exactly what I wanted to do next, but first I need a mic. I'll look to see what Steve and Spriggsy concocted. And to work right, it would have to accommodate a certain amount of slop in length, spacing, and frequencies of the tone.

Sounds good. Maybe make the program generate Morse code _with_ a certain amount of "slop" to simulate a human sending a message.

Maybe have it display a text window showing a scrolling feed of messages sent & received (in 2 different colors).

Will it know any special codes for protocol, like "over" telling the other system it's done sending and will now listen?

This could be a great learning tool also, you can drill on one letter a day, or review & it will test you on what you've learned.

Back to the demo of 2 PCs beeping back and forth, I'm reminded of stuff like this where 2 chatbots hold a conversation:
https://youtu.be/PTUY16CkS-k

It would be a funny demo for the 2 PCs communicating in Morse code to be chatbots or Eliza programs trying to hold a conversation. You would hear beeping back & forth but could follow the conversation in the text window.

Just some ideas... Just a program that can listen and interpret Morse code from audio would be pretty cool!


Offline DANILIN

  • Forum Regular
  • Posts: 128
    • View Profile
    • Danilin youtube
Re: Text and numbers to Morse code, and back again
« Reply #4 on: December 10, 2021, 06:50:13 am »
word compatible macros is more logical for mass replacement

and macro includes constructions:

dim data read for to next replace
Russia looks world from future. big data is peace data.
https://youtube.com/playlist?list=PLBBTP9oVY7IagpH0g9FNUQ8JqmHwxDDDB
i never recommend anything to anyone and always write only about myself

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Text and numbers to Morse code, and back again
« Reply #5 on: February 01, 2022, 03:15:51 pm »
Yes, that's exactly what I wanted to do next, but first I need a mic. I'll look to see what Steve and Spriggsy concocted. And to work right, it would have to accommodate a certain amount of slop in length, spacing, and frequencies of the tone.

I just thought I would follow up and see if you ever got around to enabling the program to "hear" Morse code through a mic?