#!/usr/bin/env bash
#
# Whether a singer on a telephone is scored more kindly than one on a wired
# microphone. The gap this closes was measured on the machine: the same person
# singing the same song twice scored 3900 from a telephone and 5200 from a
# SingStar microphone. Nothing about the singing was different - a telephone's
# voice arrives later, through the phone's own processing, and the game marks
# it against notes it has already drawn as missed. Watching a screen full of
# missed notes you did not miss is the opposite of a party.
#
# Nothing restarts: the microphone bridge reads this within a second and the
# game reads what the bridge writes, so a switch flipped between two songs is
# in force for the next one.

set -euo pipefail
ARCHSTAR_ACTIONS_LIB="${ARCHSTAR_ACTIONS_LIB:-/usr/lib/archstar-actions/lib/common.sh}"
# shellcheck source=/dev/null
source "${ARCHSTAR_ACTIONS_LIB}"

value="${1:-}"
require_one_of "${value}" on off

remember_setting phone-scoring "${value}"

if [[ "${value}" == 'on' ]]; then
    printf 'a telephone is scored as kindly as the tolerance setting says\n'
else
    printf 'every microphone is scored by the game own rules\n'
fi
