Sonic Pi rescue sheet

Sonic Pi is fun, when it runs.
But sometimes it is not.

In my case on Mac OS with Sonic Pi v3.0.1 it hang in two cases:

  1. It cannot connect to a sound card I want to be connected
  2. or it hang on unavailable ports with something like this in log “Port unavailable: 4560

1. Set your card hard

#list sound cards and..

terminal$: system_profiler SPAudioDataType -xml
That lists lot a stuff, but if you focus a bit you find the name of your sound card/s

#edit boot script & set you card in /Applications/Sonic\ Pi.app/app/server/ruby/lib/sonicpi/scsynthexternal.rb

Find part where it says something like this and add your soundcard name, the -H attribute, no worries it won’t be there add it yourself.

boot_and_wait(scsynth_path,
                    “-u”, @port.to_s,
                    “-a”, num_audio_busses_for_current_os.to_s,
                    “-m”, “131072”,
                    “-D”, “0”,
                    “-R”, “0”,
                    “-l”, “1”,
                    “-i”, num_inputs,
                    “-o”, “16”,
                    “-U”, “#{native_path}/supercollider/plugins/”,
                    “-b”, num_buffers_for_current_os.to_s,
                    “-B”, “127.0.0.1”,
                    “-H”, “Steinberg UR22”
                    )

2. Kill

Hangs on Port unavailability, or something like that

#find running processes named ..Sonic..

terminal$:ps aux | grep Sonic

#and kill them by their ID (the second parameter after the user name like 204601)

terminal$:kill 204601