From 6ca9d004183b99a9570c32388ef82ca070846b31 Mon Sep 17 00:00:00 2001 From: iAmInAction <83808704+iAmInActions@users.noreply.github.com> Date: Sat, 8 Jul 2023 15:09:35 +0000 Subject: [PATCH] Add piano This is exactly what the title says, a piano. --- piano.sh | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 piano.sh diff --git a/piano.sh b/piano.sh new file mode 100644 index 0000000..e203678 --- /dev/null +++ b/piano.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +length=100 + +while true +do + read -n1 key + + case $key in + a) + beep -l $length -f 261 + ;; + w) + beep -l $length -f 277 + ;; + s) + beep -l $length -f 293 + ;; + e) + beep -l $length -f 311 + ;; + d) + beep -l $length -f 329 + ;; + f) + beep -l $length -f 349 + ;; + t) + beep -l $length -f 369 + ;; + g) + beep -l $length -f 392 + ;; + z) + beep -l $length -f 415 + ;; + y) + beep -l $length -f 415 + ;; + h) + beep -l $length -f 440 + ;; + u) + beep -l $length -f 466 + ;; + j) + beep -l $length -f 493 + ;; + k) + beep -l $length -f 523 + ;; + o) + beep -l $length -f 554 + ;; + l) + beep -l $length -f 587 + ;; + p) + beep -l $length -f 622 + ;; + *) + sleep 0.$length + ;; +esac +done