#!/bin/bash
#
# Date    2020-11-25
# Updated 2022-09-26 (Pi day! No more.)
#
# YOSHPATH="/usr/bin"
#
# Starts Yoshimi with our oft-used GM patch setup for Yoshimi.
# Adjust the variables below for your setup.

YOSHPATH="/usr/bin"
YOSHIMI="yoshimi"
OPTIONS=""
REPOPATH="Home/ca/mls/git"
CFGPATH="$HOME/$REPOPATH/yoshimi-cookbook/sequencer64/b4uacuse"
DOHELP="no"

if [ "$1" == "latest" ] ; then
    YOSHPATH="/usr/local/bin"
    YOSHIMI="yoshimi-1.7.2rc1"
    shift
fi

if [ "$1" == "jack" ] ; then
    OPTIONS="-j -J"
elif [ "$1" == "alsa" ] ; then
    OPTIONS="-a -A"
elif [ "$1" == "A" ] ; then
    OPTIONS="--alsa-midi --alsa-audio=CODEC"
elif [ "$1" == "jA" ] ; then
    OPTIONS="-j -A"
elif [ "$1" == "help" ] ; then
    echo "Options: jack alsa A jA"
    DOHELP="yes"
fi

if [ "$DOHELP" == "no" ] ; then
echo "Running $YOSHPATH/$YOSHIMI $OPTIONS --state=$CFGPATH/yoshimi-b4uacuse-gm.state"
$YOSHPATH/$YOSHIMI $OPTIONS --state=$CFGPATH/yoshimi-b4uacuse-gm.state &
fi

