morse_code Module

Basic Morse code support. https://en.wikipedia.org/wiki/Morse_code


Uses

  • module~~morse_code~~UsesGraph module~morse_code morse_code module~signals signals module~morse_code->module~signals module~tape_recorder_class tape_recorder_class module~morse_code->module~tape_recorder_class module~signals->module~tape_recorder_class module~envelopes envelopes module~signals->module~envelopes module~forsynth forsynth module~signals->module~forsynth module~tape_recorder_class->module~forsynth module~envelopes->module~tape_recorder_class module~envelopes->module~forsynth iso_fortran_env iso_fortran_env module~forsynth->iso_fortran_env

Used by

  • module~~morse_code~~UsedByGraph module~morse_code morse_code program~radioactivity radioactivity program~radioactivity->module~morse_code

Variables

Type Visibility Attributes Name Initial
character(len=5), private, parameter :: morse_table(36) = ['.-   ', '-... ', '-.-. ', '-..  ', '.    ', '..-. ', '--.  ', '.... ', '..   ', '.--- ', '-.-  ', '.-.. ', '--   ', '-.   ', '---  ', '.--. ', '--.- ', '.-.  ', '...  ', '-    ', '..-  ', '...- ', '.--  ', '-..- ', '-.-- ', '--.. ', '-----', '.----', '..---', '...--', '....-', '.....', '-....', '--...', '---..', '----.']

Functions

public function string_to_morse(string) result(morse)

This function receives a string and returns its Morse code translation. The input string can contain only alphabetic characters in upper or lower case, digits 0..9 and spaces. All other characters will be considered as spaces. Characters inside words are separated by one space, and words by two spaces.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: string

Return Value character(len=:), allocatable


Subroutines

public subroutine add_morse_code(tape, track, t1, f, Amp, string)

Adds on the specified track a Morse code translation of the string, starting at time t1. The frequency f must correspond to a high tone, for example 880 Hz.

Arguments

Type IntentOptional Attributes Name
type(tape_recorder), intent(inout) :: tape
integer, intent(in) :: track
real(kind=wp), intent(in) :: t1
real(kind=wp), intent(in) :: f
real(kind=wp), intent(in) :: Amp
character(len=*), intent(in) :: string