Skip to content

Commit

Permalink
Added starter script
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Feb 27, 2021
1 parent 8239c40 commit f79bae6
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/Mplay.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

function realpath {
local r=$1; local t=$(readlink $r)
while [ $t ]; do
r=$(cd $(dirname $r) && cd $(dirname $t) && pwd -P)/$(basename $t)
t=$(readlink $r)
done
echo $r
}

MPLAY_HOME=$(dirname $(realpath "$0"))

function usage()
{
echo "Mplay [-h|--help] [--device=midi-device] [--gui] midi-file"
}

device="scva"
interface="tui"
file=""

while :; do
case $1 in
-h | -\? | --help)
usage
exit
;;
--device=?*)
device=${1#*=}
;;
--gui)
interface="Mplay"
;;
-*)
usage
exit 1
;;
*)
file="$@"
break
;;
esac
shift
done

if [ "$file" == "" ]; then
usage
exit 1
fi

env MIDI_DEVICE=${device} julia ${MPLAY_HOME}/${interface}.jl "${file}"

0 comments on commit f79bae6

Please sign in to comment.