alpha2morse() {
  local -A alpha_assoc=(    [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]='----.' )

  if [[ "${
     echo -ne "Usage: ${FUNCNAME[0]} arguments...\n \
        ${FUNCNAME[0]} is an IMC transmitter. \n \
        It'll transmit your messages to International Morse Code.\n" >&2
     return 1
  fi

  while [[ -n "${1}" ]]; do
        for (( i = 0; i < ${
            local letter="${1:${i}:1}"
            for (( y = 0; y < ${
                case "${alpha_assoc[${letter^^}]:${y}:1}" in
                     ".") echo -n "dot "; play -q -n -c2 synth .1 2> /dev/null || sleep .1 ;;
                     "-") echo -n "dash "; play -q -n -c2 synth .3 2> /dev/null || sleep .3 ;;
                esac
                sleep .1
            done
            echo
            sleep .3
        done
        echo
        sleep .7
        shift
  done
}

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
   alpha2morse "${@}"
fi