#!/bin/bash # Script to launch fluidsynth server. # Put it in ~/bin/fluid. # To start ‘fluid start’, to stop ‘fluid stop’ case $1 in start ) if ! pgrep fluidsynth then fluidsynth -is -d -r 44100 -c 2 -z 16 --audio-driver=alsa \ --reverb=0 --chorus=0 --gain=5.0 \ /usr/share/sounds/sf2/FluidR3_GM.sf2 \ &>/tmp/fluidsynth.out & sleep 5 echo fluidsynth started. fi if pgrep fluidsynth then echo fluidsynth running. # Use aconnect to get the ports myownport=$(aconnect -i | grep "Teensy MIDI" | cut -d ' ' -f 2)0 synthport=$(aconnect -o | grep "FLUID Synth" | cut -d ' ' -f 2)0 echo Arduino input port: $myownport echo fluidsynth output port: $synthport # Connect the ports aconnect $myownport $synthport else echo fluidsynth probable command line problem. fi ;; stop ) killall fluidsynth echo fluidsynth stopped. ;; * ) echo Please specify start or stop... ;; esac