-
Notifications
You must be signed in to change notification settings - Fork 0
/
server
executable file
·39 lines (31 loc) · 1.03 KB
/
server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/tcsh
set soundfont = "$HOME/churchplayer/churchplayer.sf2"
set PIPE = "/tmp/fluidsynthfifo"
# Kill any processes that are using the audio device (hw:0)
killall -r -s KILL fluidsynth
if( -e /usr/bin/fuser ) then
alias fuser /usr/bin/fuser
else if( -e /bin/fuser ) then
alias fuser /bin/fuser
else if( -e /sbin/fuser ) then
alias fuser /sbin/fuser
else if( -e /usr/sbin/fuser ) then
alias fuser /usr/sbin/fuser
else
echo "Cannot find fuser command"
exit
endif
set pid = `fuser -v /dev/snd/pcmC0D0p`
while( $status == 0 && "$pid" != "" )
kill $pid
set pid = `fuser -v /dev/snd/pcmC0D0p`
end
# Create a named pipe from which the fluidsynth server process can read
# commands.
rm -f $PIPE >& /dev/null
mkfifo $PIPE
# Start up the server process that creates the sound from the ALSA sequencer
# data. Read stdin commands from the above fifo.
echo "Starting fluidsynth"
/usr/bin/fluidsynth -f fluid.conf --server --audio-driver=alsa -o audio.alsa.device=hw:0 $soundfont $1 < $PIPE
echo "Exiting server script..."