From c5ec120031f7c369d2d7631a7b4dcfd6a93fe331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20Podgor=C5=A1ek?= Date: Tue, 7 Mar 2017 22:23:42 +0100 Subject: [PATCH] huekbd apdejt --- huekbd.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/huekbd.sh b/huekbd.sh index f09ad67..58141d6 100755 --- a/huekbd.sh +++ b/huekbd.sh @@ -1,9 +1,21 @@ #!/bin/bash +instrumenti=("sine" "square" "triangle" "sawtooth" "trapezium" "exp" "noise" "tpdfnoise" "pinknoise" "brownnoise" "pluck") + +trenutni_instrument=0 + while [ true ]; do read -n 1 tipka echo "tipka: $tipka" + + # Naslednji instrument ? + if [ $tipka = "1" ]; then + trenutni_instrument=$(perl -e "$trenutni_instrument + 1 % ${#instrumenti[@]}") + fi + + echo "instrument: $trenutni_instrument (${instrumenti[$trenutni_instrument]})" + koda=$(perl -e "print ord(\"$tipka\") * 10") - play -n synth 4 pluck $koda & + play -n synth 1 ${instrumenti[$trenutni_instrument]} $koda & echo "koda: $koda" done