# Arduino interface to sonic pi

**URL:** <https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459>\
**Category:** Support, Help & Resources\
**Created:** [March 17, 2020, 4:07pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459 "2020-03-17T16:07:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [March 17, 2020, 4:07pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/1 "2020-03-17T16:07:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 17, 2020, 6:47pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/2 "2020-03-17T18:47:12Z")

</div>

Hi, welcome to our forums 🙂

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:

> [@MIDI out on RPI4](http://in-thread.sonic-pi.net/t/midi-out-on-rpi4/3103/2):
>
> Hi, Unfortunately MIDI support is broken on the RPi4 or any Pi running Buster. It’s a long story, but essentially the Pi Foundation terminated my funding prematurely. Despite that, I still built and released version 3 of Sonic Pi for the Pi and delivered it to them for release on the Stretch version of Raspbian. Pi Trading then released the Buster version of Raspbian and included v2.1 of Sonic Pi - effectively silently downgrading all their users to a much older version of Sonic Pi without an…

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](https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=267638)

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [March 17, 2020, 9:07pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/3 "2020-03-17T21:07:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [March 17, 2020, 10:33pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/4 "2020-03-17T22:33:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [March 18, 2020, 7:10am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/5 "2020-03-18T07:10:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 18, 2020, 9:53am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/6 "2020-03-18T09:53:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [March 19, 2020, 7:20am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/7 "2020-03-19T07:20:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 19, 2020, 7:35am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/8 "2020-03-19T07:35:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [March 20, 2020, 11:57am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/9 "2020-03-20T11:57:25Z")

</div>

any chance this will be remedied?

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [March 20, 2020, 1:24pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/10 "2020-03-20T13:24:22Z")

</div>

@wro Please read this post I linked to above: [MIDI out on RPI4](http://in-thread.sonic-pi.net/t/midi-out-on-rpi4/3103/2)

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [March 20, 2020, 2:27pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/11 "2020-03-20T14:27:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [March 20, 2020, 2:39pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/12 "2020-03-20T14:39:31Z")

</div>

that will be awesome

---

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [March 20, 2020, 4:11pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/13 "2020-03-20T16:11:33Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [April 17, 2020, 2:07pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/14 "2020-04-17T14:07:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [April 17, 2020, 2:08pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/15 "2020-04-17T14:08:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [April 17, 2020, 5:59pm UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/16 "2020-04-17T17:59:15Z")

</div>

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](http://r.newman.ch/rpi/sonic-pi-3.2.2)

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [April 21, 2020, 9:13am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/17 "2020-04-21T09:13:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [April 21, 2020, 9:16am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/18 "2020-04-21T09:16:23Z")

</div>

how do i attache the error log?

---

<div class="post-metadata">

**Author:** ![robin.newman](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@robin.newman](https://in-thread.sonic-pi.net/u/robin.newman)\
**Post date:** [April 21, 2020, 9:24am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/19 "2020-04-21T09:24:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wro](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@wro](https://in-thread.sonic-pi.net/u/wro)\
**Post date:** [April 21, 2020, 9:27am UTC](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459/20 "2020-04-21T09:27:39Z")

</div>

# I uninstalled the previous version - I hope 🙂 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`**

```ruby
[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`**

```ruby
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`**

```ruby
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`**

```ruby
# 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`**

```ruby

```

[Next page](https://in-thread.sonic-pi.net/t/arduino-interface-to-sonic-pi/3459.md?page=2)
