Skip to content

Instantly share code, notes, and snippets.

@willbchang
Created September 23, 2019 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willbchang/19876c0ef54cabde2a1959e7aec1dd67 to your computer and use it in GitHub Desktop.
Save willbchang/19876c0ef54cabde2a1959e7aec1dd67 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# AegeanSymphonicOrchestra-v2_2.sf2
# GeneralUser-v1.471.sf2
# SGM-V2.01.sf2
SOUNDFONT='/Users/Will/.config/.soundfont/SGM-V2.01.sf2'
if [ -e "$SOUNDFONT" ]
then
for i in "$@"
do
if [ -e "$i" ]
then
(fluidsynth -i "$SOUNDFONT" "$i" 2>&1) >/dev/null
else
echo "[playmidi]: cannot find file at $i"
return 1
fi
done
else
echo "[playmidi]: SOUNDFONT file not found at $SOUNDFONT"
return 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment