Last active
November 8, 2023 14:50
-
-
Save WinterSnowfall/48b0677f4f71b7056e526288bb33db24 to your computer and use it in GitHub Desktop.
Manage the FluidSynth (MIDI synthesizer) service in non-privileged userspace - tested on Ubuntu & derivatives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#install fluidsynth and fluid-soundfont-gm first using: | |
#sudo apt-get install fluidsynth fluid-soundfont-gm | |
#the following line also needs to be added in /etc/default/fluidsynth | |
#OTHER_OPTS='-a pulseaudio -m alsa_seq -r 48000' | |
#bash output styles and colors | |
DEFAULT="\033[0m" | |
BOLD="\033[1m" | |
GREEN="\033[1;32m" | |
case "$1" in | |
start) | |
echo -n "Starting fluidsynth service... " | |
systemctl --user start fluidsynth.service | |
echo -e $GREEN"DONE"$DEFAULT | |
;; | |
stop) | |
echo -n "Stopping fluidsynth service (may take a while)... " | |
systemctl --user stop fluidsynth.service | |
echo -e $GREEN"DONE"$DEFAULT | |
;; | |
*) | |
echo -e "Invalid option! Use either "$BOLD"start"$DEFAULT" or "$BOLD"stop"$DEFAULT"." | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment