I am starting a Morse code Club at the school where I work, but many of the children only have Apple devices at home. Does anyone have any suggestions for a good Morse code learning app that runs on the Apple ipad and iphone? In particular, I need one that will help a complete beginner to learn the Morse alphabet. Unfortunately, I only have Android and Windows, so my experience with ios is absolutely nil.
Morse Mail is the app I have used more than any other. It allows you to convert text to code easily on your phone. Every morning I create several files from news articles so that wherever I am through the day i can listen, in my car or waiting in a lobby or anywhere. It cost $5 but worth much much more.
Scott kw4jm
Just as a quick follow-up, we are using LCWO in the Morse code Club. In fact, it has a section called Morse Machine, that probably inspired the Android app, that the kids are using to learn the alphabet. Thanks for all the suggestions.
de OE6FEG / M0FEU
Matt
I created a simple text to morse code converter in python, and was wondering if there was an easier/shorter way to do this. Is there a way to generate the dictionary without having to hard-code every single option?
Firstly, I'm not sure you can generate the Morse Code equivalents of a letter in any pattern - to my knowledge there's no algorithm to do that. So you'll have to still statically code in the list. However, you have some unnecessary bits related to that.
While technically this is an optional case, usually functions should be indicative of what they actually do - in this case, they translate something, so let's call main() by the name of what it does - translate().
Let's reduce the translate function specifically to translation and then returning of the morse code string. We'll let getting the information from the end user be part of the next suggestion of improvements I make.
Let's consider that in the future you might want to be able to import translate elsewhere as part of a script. That's why we've written it as we did in the last suggestion. However, you still want to execute this script directly, and get input. So, let's do that!
Instead of just calling translate() at the end of the .py file, let's put that under an if __name__ == "__main__": block at the end. Also, since we reduced the translate function to ONLY do translation, we can do the user input bits here.
This is where we handle direct script execution of your Python code (as in calling python3 morsecode-convert.py or such on the command line). We use the try/except handling like you did before (except we KNOW that an invalid character raises a KeyError in translate, so only catch those exceptions and print a nice error message to the user), but we only do so when the program is executed as a script directly. This also prevents execution of translate without actual useful data passed to the function if you ever import translate or your LETTERS_TO_MC dict into another Python program/script/project later.
Note that I put multiple letter-to-morse-code definitions per line in the dict (three per line), to shrink this to be more readable in scrolling; you can easily expand it as i did earlier in my answer, but you can still easily determine what's in the dict even this way.
As already mentioned in the comments, I don't think there's a strictly better way to create the morse code mapping. There is however a lot we can do to make this code more concise and more pythonic. This looks like Java code that was directly translated into Python and doesn't utilise some of Python's key features.
You perform this check in every loop iteration, although it's not really a special case. This basically only translates " " to "/", the rest of the logic is the same. So you can simply add it to your char to morse mapping:
Addressing only this part of the question: I don't necessarily recommend the following, but mentioning it just for completeness. Morse code was designed such that more frequent letters have shorter codes: for instance, the most frequent letter, E, has code . and the second-most frequent letter, T, has code - and so on. The story (though details are disputed) is that either Samuel Morse or his partner Alfred Vail counted the number of occurrences of each letter on a page of a newspaper, to get a list of letters ordered by frequency. (The ordering in Morse code is ETIANMSURWDKGOHVFLPJBXCYZQ which is not exactly the ETAOINSHRDLCUMWFGYPBVKJXQZ (etc) (see Etaoin shrdlu) that more exhaustive counting would give.)
With this, make_morse_table() gives the same table that is called LETTERS_TO_MC or CHAR_TO_MORSE or MORSE_CODE in the other three answers. You could call this function once, assign the result (dict) to a variable, and then use it the same way as in the other answers.
Is it a good idea to use a function like this? The obvious problem is that this is "tricky" code that is hard to understand or see what it's doing, so it would be best accompanied by copious documentation, maybe even linking to a diagram. The next person (such as yourself, later) to maintain this code (to add more punctuation symbols, say) would have to understand all this, convert the string s into a tree, insert the new symbols into the tree, and update s.
That is why I wouldn't necessarily recommend using something like this. On the other hand, there are some small advantages, like it being harder to accidentally assign two letters to the same code, say.
One of my favourite and often overlooked functions is str.translate(). It is used to translate characters in a string, which is exactly what you are trying to do here. 'S' is translated to '...', and so on.
The exclamation mark at the end is left untranslated. Worse, the periods are left untranslated, making .O into .--- (a J), and .S into .... (an H). The translate function will delete any characters which translate to None, but as the list of invalid characters is huge, adding an entry for every invalid character is not practical.
Two translations are being performed. First the string is being converted into uppercase, and second the new string is converted to Morse code. Ie) "sos" --> "SOS" --> "... --- ..." The two translations can be combined into just one by including both lower and uppercase translations in the MORSE_CODE mapping:
It was obvious that learning Morse code would be a tedious task for each one of us, and hence we needed a machine. So, we decided to write small program that can encode a given string to equivalent Morse code and another decoder that can give the string back for a given Morse code stream.
I've found several of these towers in the Wasteland now; each one transmits its two-letter identifier three times (Radio Signal Alfa Lima transmits AL AL AL) followed by a D (I think), followed by another two-letter code three times followed by a K. The towers I've found all broadcast the same second code after their identifier. I thought it was some kind of all clear signal; it's definitely not OT because there is eight beeps and OT is only four. I can't figure out what the beeps translate to, but I'm no Morse Code expert.
I am trying to write a function that takes English text and produces the corresponding Morse code. I have a function which works fine when the text consists of lower case letters. But I could not write a proper function which produces the corresponding Morse code when the text has capital letters.
This tool converts your typed text into audio Morse code. It will generate a downloadable audio file (in .wav format) to allow you to hear the result, along with displaying the dots and dashes (dits and dahs) as well. To use this tool, type in the text you to like convert to Morse code below and click the Convert to Morse Code button. A link to your downloadable file will then be provided below. With this converter tool, you also have the option to adjust the speed and frequency of how you like to generate the audible Morse code.
You may download and use the audible Morse code files for personal, business, or educational purposes, provided you include a publicly accessible and clickable link to this page with your use. Please read our Terms of Use on warranty information.
Morse code is a method of transmitting text information as a series of on-off audible tones or light pulse. There are two different signal durations called dots and dashes (or dits and dahs). The International Morse Code standardize each number and letters of the alphabet with a unique sequence of dots and dashes.
Morse code was used in the 1890s as a form of radio communication before it was possible to transmit voice. It eventually became a primary means of communication during World War II by various countries for sending messages about enemies activities. Today, most militaries have stopped using Morse code. However, it is still commonly used in aviation as a way to identify navigational stations and among amateur radio operators to identify radio repeaters.
df19127ead