Arduino interface to sonic pi

Hi and thanks for the quick response Sam, its a great application, so what your saying basically at this stage I cant use it with arduino midi.

There’s no issue with using any MIDI device - including the arduino MIDI.

The issue is specifically with Sonic Pi’s MIDI support on Raspberry Pi. The last official release for that platform was v3.0.1. MIDI works just fine on that. Unfortunately no subsequent release supports MIDI at this stage and if you have a Pi4 there appears to be no option to run older versions of Sonic Pi other than their own broken release.

You can of course use a PC, Mac or compile Sonic Pi yourself on a Pi if you’re feeling adventurous.

I have sonic pi running on the pi, i just cant see the arduino which is connected via usb and not getting midi signals to it.

Yes, that is because Sonic Pi on a RP4 was not released by me and the MIDI functionality is sadly broken. You either need to use an older Pi running Stretch or use a PC or Mac.

any chance this will be remedied?

@wro Please read this post I linked to above: MIDI out on RPI4

I am going to try and make a video today showing how to build Sonic Pi 3.2 on a Raspberry Pi 4 this afternoon. With recent developments this is now a relatively easy process.

Also as has been mentioned elsewhere on in-thread, I do have a deb file that will install it with a simple double click onto Rasbian Buster. However I am delaying making this available until version 3.2.1 is released, as it addresses a memory leak problem in Sonic Pi which could impinge on Raspberry Pi with limited memory.

1 Like

that will be awesome

yes for sure that will be awesome but please understand that @robin.newman do all that fantastic job as a hobby. So please be patient :slight_smile:

Hi have you managed to get anywhere so far with these updates yet?

please share that video how to build Sonic Pi 3.2 on a Raspberry Pi 4

you can now download a .deb file to install on Raspberry Pi very easily and quickly so no need to build unless you want to.
see http://r.newman.ch/rpi/sonic-pi-3.2.2

1 Like

Hi

I’m getting an error after installation and running the update as recommenced

One or more ports not available is sonic pi running? this after I click on sonic pi get splash screen then error?

how do i attache the error log?

First thing, if you have been using the previous 3.1 version supplied with Raspbian Buster and have NOT restarted the computer it may be that a program called jackd is still running. Try restarting your Pi and the running version 3.2.2 again. If you still have problems the logs are contained in the folder .sonic-pi This is normally hidden, but you can make it visible from the View menu on the FileManager. Inside that folder is a folder named log The log files are all the files inside that folder (ignore the history subfolder) Of most interest will be the server-output.log scsynth.log gui.log erlang.log and server.errors.log The files can be opened by double clicking. You can copy and past the contents.

I uninstalled the previous version - I hope :slight_smile:
this is the log from the error box:
Sonic Pi Boot Error Report

System Information

  • Sonic Pi version: 3.2.2
  • OS: Raspbian GNU/Linux 10 (buster)

GUI Log

/home/pi/.sonic-pi/log/gui.log

[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -                            
[GUI] - {c9c9a991-71c0-4cf2-b73c-c41bd4fe29b5}
[GUI] - Discovering port numbers...
[GUI] - Detecting port numbers...
[GUI] - GUI listen to server port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Server listen to gui port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Server incoming OSC cues port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Scsynth port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Server send to GUI port 0
[GUI] -    port: 0 [Not Available]
[GUI] - GUI send to server port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Scsynth send port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Erlang router port 0
[GUI] -    port: 0 [Not Available]
[GUI] - OSC MIDI out port 0
[GUI] -    port: 0 [Not Available]
[GUI] - OSC MIDI in port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Websocket port 0
[GUI] -    port: 0 [Not Available]
[GUI] - Critical Error. One or more ports is not available.

Server Errors

/home/pi/.sonic-pi/log/server-errors.log

Failed to load the fast_osc c-extension, falling back to pure Ruby version
Overriding fast_osc c-extension FastOsc::decode_single_message, falling back to pure Ruby version
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-clear.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-clear.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory -- /usr/app/server/ruby/bin/task-register.rb (LoadError)

Server Output

/home/pi/.sonic-pi/log/server-output.log

Sonic Pi server booting...
Using protocol: udp
Detecting port numbers...
Send port: 4558
Listen port: 4557
  - OK
Scsynth port: 4556
  - OK
Scsynth send port: 4556
  - OK
OSC cues port: 4559
  - OK
Erlang port: 4560
  - OK
OSC MIDI out port: 4561
  - OK
OSC MIDI in port: 4562
  - OK
Booting server...


Booting Sonic Pi
----------------

Booting on Raspberry Pi
Jackd already running. Not starting another server...
Boot - Starting the SuperCollider server...
Boot - scsynth -u 4556 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/usr/app/server/native/extra-ugens/ -b 4096 -B 127.0.0.1
Boot - SuperCollider booted successfully.
Boot - Connecting to the SuperCollider server...
Boot - Sending /status to server: 127.0.0.1:4556
Boot - Receiving ack from scsynth
Boot - Server connection established
Studio - Initialised SuperCollider Audio Server v3.10.0
Studio - Resetting server
Studio - Studio - clearing scsynth
Studio - Studio - allocating audio bus
Studio - Studio - Create Base Synth Groups
Studio - Starting mixer
Studio - Starting scope
erl -noshell -pz "/usr/app/server/erlang" -s pi_server start 4560
Studio - Spawning o2m with:
    '/usr/app/server/native/osmid/o2m' -L -b -i 4561 -O 4562 -m 6
Studio - Spawning m2o with:
    '/usr/app/server/native/osmid/m2o' -b -o 4562 -m 6 'Sonic Pi'
Studio - Initialised MIDI subsystems
This is Sonic Pi v3.1 running on raspberry with ruby api 2.5.0.
Sonic Pi Server successfully booted.
Studio - Spawning o2m with:
    '/usr/app/server/native/osmid/o2m' -L -b -i 4561 -O 4562 -m 6
Studio - Spawning m2o with:
    '/usr/app/server/native/osmid/m2o' -b -o 4562 -m 6 'Sonic Pi'
Studio - Initialised MIDI subsystems
Exiting - shutting down scsynth server...
Sending /quit command to scsynth
Stopping OSC server...
Stopped OSC server...
Server is exiting.
Shutting down GUI...
Goodbye :-)

Scsynth Output

/home/pi/.sonic-pi/log/scsynth.log

# Starting SuperCollider 2020-03-17 15:54:55
Found 209 LADSPA plugins
*** ERROR: open directory failed '/usr/app/server/native/extra-ugens/': No such file or directory
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024
SuperCollider 3 server ready.
JackDriver: max output latency 42.7 ms

Process Log

/home/pi/.sonic-pi/log/processes.log




here are the logs

Starting SuperCollider 2020-03-17 15:54:55

Found 209 LADSPA plugins
*** ERROR: open directory failed ‘/usr/app/server/native/extra-ugens/’: No such file or directory
JackDriver: client name is ‘SuperCollider’
SC_AudioDriver: sample rate = 48000.000000, driver’s block size = 1024
SuperCollider 3 server ready.
JackDriver: max output latency 42.7 ms

Sonic Pi server booting…
Using protocol: udp
Detecting port numbers…
Send port: 4558
Listen port: 4557

  • OK
    Scsynth port: 4556
  • OK
    Scsynth send port: 4556
  • OK
    OSC cues port: 4559
  • OK
    Erlang port: 4560
  • OK
    OSC MIDI out port: 4561
  • OK
    OSC MIDI in port: 4562
  • OK
    Booting server…

Booting Sonic Pi

Booting on Raspberry Pi
Jackd already running. Not starting another server…
Boot - Starting the SuperCollider server…
Boot - scsynth -u 4556 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/usr/app/server/native/extra-ugens/ -b 4096 -B 127.0.0.1
Boot - SuperCollider booted successfully.
Boot - Connecting to the SuperCollider server…
Boot - Sending /status to server: 127.0.0.1:4556
Boot - Receiving ack from scsynth
Boot - Server connection established
Studio - Initialised SuperCollider Audio Server v3.10.0
Studio - Resetting server
Studio - Studio - clearing scsynth
Studio - Studio - allocating audio bus
Studio - Studio - Create Base Synth Groups
Studio - Starting mixer
Studio - Starting scope
erl -noshell -pz “/usr/app/server/erlang” -s pi_server start 4560
Studio - Spawning o2m with:
‘/usr/app/server/native/osmid/o2m’ -L -b -i 4561 -O 4562 -m 6
Studio - Spawning m2o with:
‘/usr/app/server/native/osmid/m2o’ -b -o 4562 -m 6 ‘Sonic Pi’
Studio - Initialised MIDI subsystems
This is Sonic Pi v3.1 running on raspberry with ruby api 2.5.0.
Sonic Pi Server successfully booted.
Studio - Spawning o2m with:
‘/usr/app/server/native/osmid/o2m’ -L -b -i 4561 -O 4562 -m 6
Studio - Spawning m2o with:
‘/usr/app/server/native/osmid/m2o’ -b -o 4562 -m 6 ‘Sonic Pi’
Studio - Initialised MIDI subsystems
Exiting - shutting down scsynth server…
Sending /quit command to scsynth
Stopping OSC server…
Stopped OSC server…
Server is exiting.
Shutting down GUI…
Goodbye :slight_smile:

[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {908d3b4d-1bce-4fc3-9193-1648f814a544}
[GUI] - Discovering port numbers…
[GUI] - Detecting port numbers…
[GUI] - GUI listen to server port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server listen to gui port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server incoming OSC cues port 0
[GUI] - port: 0 [Not Available]
[GUI] - Scsynth port 0
[GUI] - port: 0 [Not Available]
[GUI] - Server send to GUI port 0
[GUI] - port: 0 [Not Available]
[GUI] - GUI send to server port 0
[GUI] - port: 0 [Not Available]
[GUI] - Scsynth send port 0
[GUI] - port: 0 [Not Available]
[GUI] - Erlang router port 0
[GUI] - port: 0 [Not Available]
[GUI] - OSC MIDI out port 0
[GUI] - port: 0 [Not Available]
[GUI] - OSC MIDI in port 0
[GUI] - port: 0 [Not Available]
[GUI] - Websocket port 0
[GUI] - port: 0 [Not Available]
[GUI] - Critical Error. One or more ports is not available.
[GUI] - Aborting. Sorry about this.

sh: 1: erl: not found

Failed to load the fast_osc c-extension, falling back to pure Ruby version
Overriding fast_osc c-extension FastOsc::decode_single_message, falling back to pure Ruby version
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-clear.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-clear.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)
ruby: No such file or directory – /usr/app/server/ruby/bin/task-register.rb (LoadError)

Hmm. It certainly seems to have got something in a bit of a mess. Some of the error messages seem to be related to the 3.1 version and yet you seem to be also incorporating 3.2.2
I suggest the following.
Uninstall sp3.2.2 using
sudo apt purge sonic-pi-3.2.2

Uninstall sp 3.1
I would use the Recommended Software entry under the Preferences section of the Main Menu and untick Sonic Pi to do this.
Make sure your OS is up to date using
sudo apt update
sudo apt upgrade

Reinstall sonic Pi 3.2.2 by double clicking on the icon of the downloaded sonic-pi-3.2.2_1.armhf.deb file

Let me know how you get on.

pretty sure thats what i did 1st time.
Before I do this again - does this version now work with arduino usb is that now fixed?

I don’t know about arduino usb, but it certainly does see other interfaces like my midi keyboard. Version 3.1 (on Buster) does not however, as it doesn’t support midi at all.