Skip to content

Instantly share code, notes, and snippets.

@henriquegogo
Last active December 9, 2015 17:58
Show Gist options
  • Save henriquegogo/852665 to your computer and use it in GitHub Desktop.
Save henriquegogo/852665 to your computer and use it in GitHub Desktop.
Electronic Drums with Shell Script + SoX
#!/usr/bin/env sh
options='--multi-thread -q'
while read -n 1 -s key
do
case $key in
0) echo "Kick "; play $options kick.wav &;;
4 | 5) play $options hat.wav &;;
1 | 2) echo "Snare "; play $options snare.wav &;;
q | e | x) echo "Exit"; exit;;
*) echo "Unknown key";;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment