Arduino interface to sonic pi

Hi, I have loaded sonic pi on rasberry pi 4 and connected arduino leonardo via usb to the pi.
Th arduino is setup to play midi notes.
Its not showing in the sonic pi and Im not sure what to do to get this to play with sonic pi on rasberry.
Please can someone help.

thank you.

Hi, welcome to our forums :slight_smile:

Unfortunately things are not currently amazing with the Raspberry Pi due to a number of funding and structural issues that happened over the past few years. This may be useful reading:

It should also be noted that @robin.newman recently put a lot of work in and offered the Raspberry Pi Foundation a fully-tested binary release (supporting OSC and MIDI) ready to roll out in Raspbian and they refused:

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=267638

1 Like

@robin.newman where can we get your deb package ? i could test on a rpi4 right now and make your work useful :slight_smile:

I think I’ll wait until 3.2.1 is released. It has significant improvements especially for a Pi with lower memory as some significant memory leaks have been patched. I don’t think this will be too long.

3 Likes

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