You are not logged in.

#1 2009-07-13 13:11:57

b4283
Member
Registered: 2008-11-26
Posts: 123

fluidsynth init script

Hi,
I've written myself a fluidsynth init script to start it up as a midi server like timidity++.

Anyone has a different soundfont just switch the filenames. smile

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
    start)
        stat_busy "Starting fluidsynth"
        if [ -s /var/run/fluidsynth.pid ]; then
            stat_fail
            stat_busy "fluidsynth is already running."
            stat_die
        fi
        /usr/bin/fluidsynth -s -i -a alsa "/usr/share/soundfonts/Titanic 200 GM-GS SoundFont 1.2.sf2" &>/dev/null&
        echo "$!" > /var/run/fluidsynth.pid
        stat_done
        ;;
    stop)
        stat_busy "Stopping fluidsynth"
        kill `cat /var/run/fluidsynth.pid 2>/dev/null` &>/dev/null
        if [ $? -ne 0 ]; then
            stat_fail
        else
            rm /var/run/fluidsynth.pid
            stat_done
        fi
        ;;
    restart)
        $0 stop
        sleep 1
        $0 start
    ;;
    *)
        echo "usage: $0 {start|stop|restart}"
esac

Last edited by b4283 (2009-07-13 13:12:38)

Offline

Board footer

Powered by FluxBB