huemix/huekbd.sh

22 lines
583 B
Bash
Raw Normal View History

2017-03-07 17:53:19 +01:00
#!/bin/bash
2017-03-07 22:23:42 +01:00
instrumenti=("sine" "square" "triangle" "sawtooth" "trapezium" "exp" "noise" "tpdfnoise" "pinknoise" "brownnoise" "pluck")
trenutni_instrument=0
2017-03-07 17:53:19 +01:00
while [ true ]; do
read -n 1 tipka
echo "tipka: $tipka"
2017-03-07 22:23:42 +01:00
# Naslednji instrument ?
if [ $tipka = "1" ]; then
trenutni_instrument=$(perl -e "$trenutni_instrument + 1 % ${#instrumenti[@]}")
fi
echo "instrument: $trenutni_instrument (${instrumenti[$trenutni_instrument]})"
2017-03-07 17:53:19 +01:00
koda=$(perl -e "print ord(\"$tipka\") * 10")
2017-03-07 22:23:42 +01:00
play -n synth 1 ${instrumenti[$trenutni_instrument]} $koda &
2017-03-07 17:53:19 +01:00
echo "koda: $koda"
done