{"id":20400067,"url":"https://github.com/codebrainz/morse","last_synced_at":"2025-04-12T13:50:48.191Z","repository":{"id":4116066,"uuid":"5226516","full_name":"codebrainz/morse","owner":"codebrainz","description":"Simple command line morse code keyer","archived":false,"fork":false,"pushed_at":"2018-10-12T07:10:39.000Z","size":148,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T08:23:21.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codebrainz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-29T23:12:02.000Z","updated_at":"2019-07-28T01:18:26.000Z","dependencies_parsed_at":"2022-08-26T06:42:16.921Z","dependency_job_id":null,"html_url":"https://github.com/codebrainz/morse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fmorse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fmorse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fmorse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebrainz%2Fmorse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebrainz","download_url":"https://codeload.github.com/codebrainz/morse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248575559,"owners_count":21127205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T04:38:17.252Z","updated_at":"2025-04-12T13:50:48.172Z","avatar_url":"https://github.com/codebrainz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Morse\n=====\n\nMorse is a very basic and probably inaccurate text to Morse code converter.\nIt takes ASCII text read from standard input and plays the Morse codes\naudibly (as well as printing each character as it's played).\n\n### Disclaimer\n\nI'm not a Morse code enthusiast or expert and this program just works\naccording to some information I read on Wikipedia. If you find a problem or\nbug with the software let me know and I'll fix it.\n\nDependencies\n------------\n\nThere's a choice of two audio backends and at least one is required:\n\n* libao - http://xiph.org/ao (default)\n* PortAudio - http://www.portaudio.com\n\nAlso, in order to generate the Morse code/character table in `morse.c`,\nPython 2.6 or greater is required. Normally you will not need Python unless\nyou update the `morse.json` file and want to re-generate the `morse.c` file.\n\nInstallation\n------------\n\nThe usual:\n\n    $ ./configure\n    $ make\n    $ make install\n\n### Interesting Configuration Options\n\nThe `--with-portaudio` argument to `./configure` enables the PortAudio\nbackend and disables the libao backend. The default is to use libao.\n\n### Regenerating the morse.c file\n\nThe `morse.c` file is generated using the `gencodes.py` Python script in\nthe `src` directory. It reads the data in `morse.json` and generates some C\ncode which is put into the contents of `morse.c.in` by replacing a special\ntoken and the replaced contents are written to `morse.c`.\n\nIf you want to regerenate `morse.c`, do the following:\n\n    $ cd src\n    $ python gencodes.py -t morse.c.in -j morse.json \u003e morse.c\n\nAnd then perform a rebuild/re-install according to the instructions above.\n\nUsage\n-----\n\nThe most basic usage is:\n\n    $ echo \"foo\" | morse\n\nAlternatively, you can run it in interactive mode:\n\n    $ morse\n    Whatever you type will get played as morse code when you hit enter.\n    What\n        ^ What's playing get's echoed back as it's playing\n\n### Options\n\nThere are only two options. `-f` specifies the frequency of the tones in\nHertz (default is 1000). `-d` specifies the duration of one unit (ie. one\ndot length) in seconds. The duration of all tones is based on this value\n(default is 0.1 seconds).\n\nThere's also a not very helpful `-h` option that will just print a usage\nmessage.\n\nUsing the Library\n-----------------\n\nThe best example to see how to use the library is the `main.c` file. Here's\na little (untested) snippet that shows how to use some parts of the library:\n\n```c\n#include \u003cmorse/keyer.h\u003e\n\nint main(int argc, char *argv[])\n{\n  Keyer *k;\n  const char *TEST_STRING = \"Hello World\";\n\n  /* Allocates a new keyer and implicitely calls `keyer_init()` if\n   * it hasn't been called yet. */\n  k = keyer_new();\n\n  if (k) {\n    keyer_set_freq(k, 2000.0 /* Hz */);\n    keyer_set_unit_duration(k, 0.08 /* Seconds */);\n    keyer_key_string(k, TEST_STRING);\n    keyer_free(k);\n  }\n\n  /* Optionally clean up some allocated resources, otherwise the OS\n   * will clean it up when the program exits. */\n  keyer_shutdown();\n\n  return 0;\n}\n```\n\nIf you just want to use the \"beep\" code:\n\n```c\n#include \u003cmorse/beep.h\u003e\n\nint main(int argc, char *argv[])\n{\n\n  beep(440.0, 2.0); /* Play a 440 Hz sine wave for 2 seconds. */\n  beep(1000.0, 0.5); /* Play a 1000 Hz sine wave for 0.5 seconds. */\n\n  /* Optional, use to free resources instead of letting the OS clean\n   * it up when the program exits */\n  beep_shutdown();\n}\n```\n\nTo get the Morse code as a string of encoded `-` and `.` characters, use:\n\n```c\n#include \u003cmorse/morse.h\u003e\n\nint main(int argc, char *argv[])\n{\n  char test_char = 'a';\n  const char *morse_code = morse_code_from_asc(test_char);\n\n  printf(\"The character '%c' encoded into a Morse string is: %s\\n\",\n    test_char, morse_code);\n\n  /* To test to see if a char is a supported Morse character */\n  if (morse_code_is_char('\u003c')) {\n    printf(\"The Morse code for '\u003c' is: %s\\n\", morse_code_from_asc('\u003c'));\n  }\n}\n```\n\nNone of the functions in the library claim to be thread-safe.\n\nCredits and License\n-------------------\n\nThis program is written and maintained by:\n\n    Matthew Brush \u003cmbrush@codebrainz.ca\u003e\n\nIt is license under the MIT license, see COPYING file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fmorse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrainz%2Fmorse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrainz%2Fmorse/lists"}