#!/bin/bash

pid=$(ps ax|grep "grmain"|head -1|cut -c1-6)
echo PID [$pid]
#sleep 1

# notify sampler and midi services

#[ -e /dev/midi? ] || [ -e /dev/snd/pcmC*c ] && kill -SIGUSR1 $pid
[ -e /dev/midi? ] || [ -e /dev/snd/pcmC*c ] || [ -e /dev/snd/midi* ] && kill -SIGUSR1 $pid

# notify computer keyboard services
[ -e /dev/input/event0 ] && kill -SIGUSR2 $pid
