SocketError on midi_note_on

Hi all

I just tried to control my (new) HW synth via USB Midi. The setup I have is a Behringer Neutron (USB to Mac), an Arturia Keystep (USB to Mac, MIDI-OUT to MIDI-IN on Neutron). I can play the Neutron from the Keystep via Midi (no problem).

SonicPi sees both the Keystep and the Neutron as Midi devices:

 /midi/arturia_keystep_32/4/1/note_on  [76, 25]
 /midi/neutron/6/1/note_on  [76, 25]
 /midi/arturia_keystep_32/4/1/note_off  [76, 64]
 /midi/neutron/6/1/note_off  [76, 64]

When I try to control the Neutron from sonic-pi, I get the following error:

midi_note_on :e3, 50
Runtime Error: [buffer 0, line 2] - SocketError
Thread death!
getaddrinfo: nodename nor servname provided, or not known
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:45:in `send'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:45:in `send_ts'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/core.rb:650:in `__osc_send'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:1523:in `__midi_send_timed'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:1519:in `__midi_send_timed_pc'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:327:in `block (2 levels) in midi_note_on'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:326:in `each'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:326:in `block in midi_note_on'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:325:in `each'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/lang/midi.rb:325:in `midi_note_on'
workspace_zero:2:in `block (2 levels) in __spider_eval'
/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/runtime.rb:1043:in `block (2 levels) in __in_thread'

The Mac -> USB -> Midi -> Neutron connection works fine (I can use Ableton to send Midi via USB to the Neutron)

I’m using SonicPi 3.1

Here’s the ‘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
----------------

Boot - Booting on OS X
Boot - Checkout audio rates on OSX:
Boot - Input audio rate: 48000.0
Boot - Output audio rate: 48000.0
Boot - Sample rates match, we may continue to boot...
Boot - Starting the SuperCollider server...
Boot - /Applications/Sonic Pi.app/app/server/native/scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 16 -o 16 -U /Applications/Sonic Pi.app/app/server/native/supercollider/plugins/ -b 4096 -B 127.0.0.1
Started [27284] [-] /Applications/Sonic Pi.app/app/server/native/scsynth -u 4556 -a 1024 -m 131072 -D 0 -R 0 -l 1 -i 16 -o 16 -U /Applications/Sonic Pi.app/app/server/native/supercollider/plugins/ -b 4096 -B 127.0.0.1 [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27284
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.9.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
"/Applications/Sonic Pi.app/app/server/native/ruby/bin/ruby" "/Applications/Sonic Pi.app/app/server/native/erlang/erl" -noshell -pz "/Applications/Sonic Pi.app/app/server/erlang" -s pi_server start 4560
Started [27286] [-] /Applications/Sonic Pi.app/app/server/native/erlang/dist/bin/beam.smp -- -root /Applications/Sonic Pi.app/app/server/native/erlang/dist -progname erl -- -home /Users/jcf -- -noshell -pz /Applications/Sonic Pi.app/app/server/erlang -s pi_server start 4560 [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27286
Studio - Spawning o2m with:
    '/Applications/Sonic Pi.app/app/server/native/osmid/o2m' -L -b -i 4561 -O 4562 -m 6
Started [27289] [-] /Applications/Sonic Pi.app/app/server/native/osmid/o2m -L -b -i 4561 -O 4562 -m 6 [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27289
Studio - Spawning m2o with:
    '/Applications/Sonic Pi.app/app/server/native/osmid/m2o' -b -o 4562 -m 6 'Sonic Pi'
Started [27291] [-] /Applications/Sonic Pi.app/app/server/native/osmid/m2o -b -o 4562 -m 6 Sonic Pi [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27291
Studio - Initialised MIDI subsystems
This is Sonic Pi v3.1 running on osx with ruby api 2.5.0.
Sonic Pi Server successfully booted.
Studio - Pausing SuperCollider Audio Server
Studio - Pausing SuperCollider Audio Server
Studio - Pausing SuperCollider Audio Server


Clearing pids: ["27289"]

Clearing [27289]
  -- command /Applications/Sonic Pi.app/app/server/native/osmid/o2m -L -b -i 4561 -O 4562 -m 6
  -- removing /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27289
  -- politely killing 27289
  -- politely killing 27289
  -- politely killing 27289
  -- force killing 27289
  -- force killing 27289
  -- force killing 27289
  -- force killing 27289
  -- force killing 27289
  -- unable to kill 27289

Finished clearing pids



Clearing pids: ["27291"]

Clearing [27291]
  -- command /Applications/Sonic Pi.app/app/server/native/osmid/m2o -b -o 4562 -m 6 Sonic Pi
  -- removing /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27291
  -- politely killing 27291
  -- politely killing 27291
  -- politely killing 27291
  -- force killing 27291
  -- force killing 27291
  -- force killing 27291
  -- force killing 27291
  -- force killing 27291
  -- unable to kill 27291

Finished clearing pids

Studio - MIDI Subsystems stopped.
Studio - Spawning o2m with:
    '/Applications/Sonic Pi.app/app/server/native/osmid/o2m' -L -b -i 4561 -O 4562 -m 6
Started [27329] [-] /Applications/Sonic Pi.app/app/server/native/osmid/o2m -L -b -i 4561 -O 4562 -m 6 [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27329
Studio - Spawning m2o with:
    '/Applications/Sonic Pi.app/app/server/native/osmid/m2o' -b -o 4562 -m 6 'Sonic Pi'
Started [27331] [-] /Applications/Sonic Pi.app/app/server/native/osmid/m2o -b -o 4562 -m 6 Sonic Pi [-] /var/folders/0_/n8thfj757ks6sf2hms305mqr0000gn/T/sonic-pi-pids/27331
Studio - MIDI Subsystems started.
Studio - Pausing SuperCollider Audio Server
Exiting - shutting down scsynth server...
Sending /quit command to scsynth
Stopping OSC server...
Stopped OSC server...
Server is exiting.
Shutting down GUI...
Goodbye :-)

and here the server-errors.log

/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
/Applications/Sonic Pi.app/app/server/ruby/vendor/sys-proctable-1.1.3/lib/darwin/sys/proctable.rb:163: warning: constant ::Fixnum is deprecated
OSC handler exception for address: /exit
getaddrinfo: nodename nor servname provided, or not known
["/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:40:in `send'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:40:in `send'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/runtime.rb:407:in `__osc_flush!'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/runtime.rb:400:in `__stop_jobs'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/runtime.rb:849:in `__exit'", "/Applications/Sonic Pi.app/Contents/MacOS/../../app/server/ruby/bin/sonic-pi-server.rb:227:in `block in <main>'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:92:in `block in start_listener'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:72:in `loop'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:72:in `start_listener'", "/Applications/Sonic Pi.app/app/server/ruby/lib/sonicpi/osc/udp_server.rb:35:in `block in initialize'"]

I’m on OS 10.13.6

Any ideas?

cheers
jens-christian

Some thoughts.

You haven’t altered the midi setup AFTER starting Sonic Pi?
If so you must press the Reset-Midi button on the IO preference tab in Sonic Pi (no harm in doing sop anyway).

What does the io tab midi device list show?

Using midi_note_on :e3, 50
will try to send to all ports and every channel.
Have you tried using use_midi_defaults
to set the port “neutron” and channel you wish to use?
(I assume here that “neutron” is the port name that SP is recognizing…see the IO device list)
eg

use_midi_defaults port:"neutron",channel: 1
midi_note_on :e3, 50

Thanks Robin

sorry for not stating that before: Yes. I tried all the combinations with port, channel and use_midi_defaults. I also reset the midi configuration for good measure.
To my (untrained) eye, it seems to be a more fundamental problem with some service from SonicPI (MIDI) not being available and listening.

cheers
jc

Try turning on the OSC system and then restart sonic pi. IIRC that’s the error I’d get if I turned off OSC and then restarted SPi.

That didn’t help either - I tried all combinations of switching on/off the Midi and OSC subsystems and restarting SonicPi. I guess I will have to dive into the Ruby Code myself :slight_smile: