#!/usr/bin/env bash

DURATION=0.1
FREQ=880

while getopts d:f: opt
do
    case "$opt" in
        d)
            DURATION=$(( OPTARG * DURATION ))
            ;;
        f)
            FREQ=$(( FREQ * OPTARG ))
            ;;
        *)
            echo "Unknown argument ${opt}" >&2
            exit 1
            ;;
    esac
done

play -q -n synth $DURATION sin $FREQ
