Arduino interface to sonic pi

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.

redid as suggested and same error?
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] - {34837899-d852-45fa-ba1c-e62d2f5ffa40}
[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




how else can I remove Sonic Pi v3.1, if thats the problem , as Ive done as you said?

I’ve just carried out the following procedure on my Pi4 running Raspbian Buster.

sudo apt update
sudo apt upgrade
sudo apt purge sonic-pi
sudo apt purge sonic-pi-3.2.2
sudo apt autoremove

Then EITHER double click on the icon of the file sonic-pi-3.2.2_1.armhf.deb

OR start a terminal in the folder where the file is located and do

sudo apt install ./sonic-pi-3.2.2_1.armhf.deb

This should end up with a working SP 3.2.2

EDIT
I wonder if you had sonic-pi-3.2.1 installed as well at any time. my first .deb file). If so you should definitely purge that too as it is not happy to have both 3.2.1 and 3.2.2 installed at the same time. 3.1 and either 3.2.1 or 3.2.2 together is OK, but not recommended.

Hi, did as you suggested but no luck - very frustrating the previous version ran just couldnt connect see the midi arduino. now this version wont even install same error message - can you not see from the logs what the cause is?

logs:
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:

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

[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {7be15894-1341-49db-b867-41a954401280}
[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)

Well this log shows you are using version 3.1 NOT version 3.2.2
So you still seem to have that installed somehow. Also it seems to be trying to access fast-osc which is not used or installed by 3.2.2

Do you have an icon Sonic Pi 3.2.2 on your Main Menu Programming section as shown in the pictorial installtion document on https://r.newman.ch/rpi/sonic-pi-3.2.2

The installed 3.2.2 should reside in a folder at /opt/sonic-pi-3.2.2
You can try running it directly from there using
/opt/sonic-pi-3.2.2/bin/sonic-pi to see if it works called directly.

Otherwise do you have a fresh SD card on which you can install Buster and try that, uninstalling the existing Sonic Pi and installing 3.2.2 as per the installation instructions? I have the 3.2.2 version installed on about 8 different cards and running on Pi4, Pi3 and Pi2 computers without problem using these instructions.

i ran it from the directory and gives the same error.?
how can i remove 3.1 Ive used the commands you gave me - i dont have a another sd card to use at this lockdown stage of life:)

I can share your sense of frustration. It all seems a bit odd.

Just to double check what is running, could you delete all the log files manually inside the .sonic-pi/log folder (you can leave the history subfolder intact). Then rerun SP 3.2.2 and check the new log files which should be generated. Check whether they still refer to Sonic Pi 3.1.
check whether
sudo dpkg -l | grep sonic-pi
lists any sonic-pi packages
if so use sudo apt remove <package name> to remove them

also worth doing a
sudo apt autoremove
after this, get rid of other packages freed up and not needed after the removal.

Also worth uninstalling 3.2.2 and checking that it has disappeared from /opt
I suppose one other possibility is that your downloaded .debfile was corrupted. You could try downloading a fresh one and installing that.

Other than these it is difficult to work out just what is going on on your installation.
Another thought
what does cat /etc/rpi-issue
give on your Pi.
If running latest should be Raspberry Pi reference 2020-02-05

only version is
pi@raspberrypi:~ $ sudo dpkg -l | grep sonic-pi
ii sonic-pi-3.2.2 1:3.2.1 armhf Sonic Pi - The Live Coding Music Synth for Everyone.
pi@raspberrypi:~ $
Ive deleted the folder .sonic and uninstalled 3.2.2
re installing again

didint work?!

only 1 log this time
[GUI] - Welcome to the Sonic Pi GUI
[GUI] - ===========================
[GUI] -
[GUI] - {ffa1ad66-26b5-431b-94a7-a57cb2762fd8}
[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.

That gives me something to work on. I’ll do some digging. I am beginning to wonder if I’ve missed a dependency which is normally installed, but which has been deleted on your system. I’ll get back when I have something.
EDIT

I think it’s missing ruby!

try
sudo apt install ruby ruby-dev
then re-run SP3.2.2

yep! that fixed it - it opens now, now to next step and see if it sees my arduino midi

guess i had to be the test bencher

Well thank you very much, as its found a glaring potential problem. I’ll fix the .deb dependencies and post version 3.2.2_2 to replace 3.2.2_1
Glad we got there eventually. Let me know how it goes with Arduino.

1 Like

will do - appreciate your help so far!

1 Like

Hi see the new version is out that was quick! :grinning:
what if any pointers or tips can you suggest to have sonic pi see my arduino midi? basically want to trigger sounds or notes depending on the midi key pressed.
what is the process to interface the 2?

1 Like

Not sure how your arduino midi is set up.

Out of the box Sonic Pi on a Pi4 will see midi devices which use usb to connect midi like a midi keyboard. I also have a pisound board that has standard 5pin din sockets for midi in and out and it will work with those.
I came across this arduino project which might be useful to you.

Although I have an arduino uno lurking around somewhere it is not something I have tried with it. I have however built a touch sensitive “keyboard” input using gpio pins and a python OSC server to send data to Sonic Pi which is another possibility.

Can you give more details of what exactly your setup is?