Skip to content

Instantly share code, notes, and snippets.

@atirut-w
Created September 20, 2018 13:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atirut-w/095bdda3456192c9c3a81d0da8cb902a to your computer and use it in GitHub Desktop.
Save atirut-w/095bdda3456192c9c3a81d0da8cb902a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [[ -z "$1" && -z "$2" ]]; then
echo "PlayMIDI version 1.0
Use fluidsynth to play MIDI musics easily in one command
Usage:
playmidi soundfont.sf2 midifile.mid"
exit 1
elif [[ $1==*".mid" && -z "$2" ]]; then
fluidsynth -g 0.8 -a alsa -m alsa_seq -l -i "$1"
elif [[ $1==*".sf2" && $2==*".mid" ]]; then
fluidsynth -g 0.8 -a alsa -m alsa_seq -l -i "$1" "$2"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment