Skip to content

Instantly share code, notes, and snippets.

@mzero
Created August 18, 2018 15:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzero/dc8cc06dbe5867ade34f18e819491032 to your computer and use it in GitHub Desktop.
Save mzero/dc8cc06dbe5867ade34f18e819491032 to your computer and use it in GitHub Desktop.
Start SuperCollider script from the Pisound button
#!/bin/sh
. /usr/local/pisound/scripts/common/common.sh
log "starting pbj"
flash_leds 1
killall scsynth
killall sclang
rm -f /tmp/sclang-*.log 2>/dev/null || true
aconnect -x
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
export JACK_NO_AUDIO_RESERVATION=1
NOW="$(date -Iseconds)"
if true
then
killall jackd
rm -f /tmp/jackd-*.log 2>/dev/null || true
log "Launching jackd"
JACKD_LOG="/tmp/jackd-$NOW.log"
nohup /usr/bin/jackd \
-T -R -P 75 \
-d alsa -d hw:pisound -r 48000 \
-p 64 -n 2 -s \
> "$JACKD_LOG" &
sleep 2
fi
log "Launching sclang"
SCLANG_LOG="/tmp/sclang-$NOW.log"
cd /home/pi/sc/Projects
echo | HOME=/home/pi nohup sclang boot.scd > "$SCLANG_LOG" &
flash_leds 1
sleep 0.3
flash_leds 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment