Improve 2018/algmyr/try.sh + update FAQ

The script now does more (another feature of the program).

The FAQ now has a name of 'sox' for FAQ 3.10 which the script refers to
and the README.md file now refers it too (instead of 3.10).

Fix make clobber: rm *.wav.

Update .gitignore.
This commit is contained in:
Cody Boone Ferguson committed 2024-01-31 09:12:10 -08:00
1 parent 485b24beab
commit a4a153cd74
5 files changed
+35 -20

No files matched your search

+29 -15
View File
@@ -15,46 +15,60 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "$ ./prog -h | ./prog -d 1 0" 1>&2
read -r -n 1 -p "Press any key to run: ./prog -h | ./prog -d 1 0: "
echo 1>&2
./prog -h | ./prog -d 1 0
echo 1>&2
# Who needs cat? Answer: more people than you think.
read -r -n 1 -p "Press any key to run: ./prog prog.c | ./prog -d 1 0 (space = next page, q = quit): "
echo 1>&2
./prog prog.c | ./prog -d 1 0 | less -EXF
./prog prog.c | ./prog -d 1 0 | less -rEXFK
echo 1>&2
APLAY="$(type -P aplay)"
SOX="$(type -P sox)"
if [[ -z "$SOX" && -z "$APLAY" ]]; then
echo "Missing both sox and aplay, cannot do this step."
echo "Missing both sox and aplay, cannot do this step." 1>&2
echo "NOTE: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
elif [[ -n "$SOX" ]]; then
echo "$ echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog | \
sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 \
echo "$ echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog | \
$SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 \
- -n spectrogram -d 10 -X 300" 1>&2
echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog |\
sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - -n spectrogram -d 10 -X 300
$SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 - -n spectrogram -d 10 -X 300
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "$ echo "IOCCC 2018" | ./prog | sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav"
echo "IOCCC 2018" | ./prog | sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav
echo "$ echo \"IOCCC 2018\" | ./prog | $SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav"
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "IOCCC 2018" | ./prog | "$SOX" -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav
echo "Now listen to ioccc.wav." 1>&2
else
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
./prog | aplay -c1 -fFLOAT_LE -r44100
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
./prog | aplay -c1 -fFLOAT_LE -r44100
echo "$ echo \"<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~\" |
./prog | $APLAY -c1 -fFLOAT_LE -r44100" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~" | ./prog | "$APLAY" -c1 -fFLOAT_LE -r44100
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
fi
echo 1>&2
echo "$ echo "IOCCC 2018!" | ./prog | ./prog -d 1 0" 1>&2
read -r -n 1 -p "Press any key to run: echo \"IOCCC 2018!\" | ./prog | ./prog -d 1 0: "
echo 1>&2
echo "IOCCC 2018!" | ./prog | ./prog -d 1 0
read -r -n 1 -p "Press any key to run: ./prog README.md prog.c > out.raw: "
echo 1>&2
./prog README.md prog.c > out.raw
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog -d 2 0 out.raw (space = next page, q = quit): "
echo 1>&2
./prog -d 2 0 out.raw | less -rEXFK
echo 1>&2