Live-Looper with touchOSC control

#21

@robin.newman, thanks a lot for you patience and help!

Yes, I do get the errors after sending osc messages from Sonic Pi:

Sonic Pi code:

use_osc "192.168.2.120", 9000
live_loop :test do
  osc "/rec/track1_play",1
  osc "/rec/track2_vol",0.5
  sleep 2
  osc "/rec/track1_play",0
  osc "/rec/track2_vol",0
  sleep 2
end

Sonic Pi-protocol:

=> Starting run 1
=> Defining fn :live_loop_test
{run: 1, time: 0.0}
 ├─ OSC -> 192.168.2.120, 9000, /rec/track1_play, [1]
 └─ OSC -> 192.168.2.120, 9000, /rec/track2_vol, [0.5]
{run: 1, time: 2.0}
 ├─ OSC -> 192.168.2.120, 9000, /rec/track1_play, [0]
 └─ OSC -> 192.168.2.120, 9000, /rec/track2_vol, [0]
=> Stopping all runs...
=> Stopping run 1
=> Completed run 1
=> All runs completed
=> Pausing SuperCollider Audio Server

Errors in erlang.log:

+--------------------------------+
+ This is the Sonic Pi IO Server +
+       Powered by Erlang        +
+     Listening on port 4560     +
+--------------------------------+

=ERROR REPORT==== 1-Nov-2017::20:13:45 ===
Error in process <0.33.0> with exit value:
{badarg,[{erlang,system_time,[nanosecond],[]},
         {osc,now,0,[{file,"osc.erl"},{line,54}]},
         {pi_server,send_later,7,[{file,"pi_server.erl"},{line,177}]}]}

=ERROR REPORT==== 1-Nov-2017::20:13:45 ===
Error in process <0.34.0> with exit value:
{badarg,[{erlang,system_time,[nanosecond],[]},
         {osc,now,0,[{file,"osc.erl"},{line,54}]},
         {pi_server,send_later,7,[{file,"pi_server.erl"},{line,177}]}]}

=ERROR REPORT==== 1-Nov-2017::20:13:47 ===
Error in process <0.35.0> with exit value:
{badarg,[{erlang,system_time,[nanosecond],[]},
         {osc,now,0,[{file,"osc.erl"},{line,54}]},
         {pi_server,send_later,7,[{file,"pi_server.erl"},{line,177}]}]}

=ERROR REPORT==== 1-Nov-2017::20:13:47 ===
Error in process <0.36.0> with exit value:
{badarg,[{erlang,system_time,[nanosecond],[]},
         {osc,now,0,[{file,"osc.erl"},{line,54}]},
         {pi_server,send_later,7,[{file,"pi_server.erl"},{line,177}]}]}
Polyrhythmic Drum Generator for Sonic Pi
Possibility to start a buffer from another buffer
#22

ON final possibility. At one time the fast_osc binary was giving problems, and I reverted to disabling that by changing a line.
I see from my server errors log that I still hve it disabled

Overriding fast_osc c-extension FastOsc::decode_single_message, falling back to pure Ruby version

I can’t remember where I disabled it, and have to go now, but will check and let you know later.

#23

Found the change
in the vendor fast_osc folder open fast_osc.rb
Then change line 38 to
if true #ENV['FAST_OSC_USE_FALLBACK'] == "true"
This forces it to ignore using fastosc
sp still works OK

#24

Yes, no more erlang errors. But does not affect the initial problem: No osc messages from Sonic Pi.

#25

Another simple test to try;
can you send osc messages to yourself using

use_osc "localhost",4559

live_loop :tx do
  use_real_time
  osc "/test"
  sleep 1
end

live_loop :rx do
  use_real_time
  sync "/osc/test"
  puts "received"
end

Also if you have access to another Sonic Pi machine (perhaps a raspberry pi?) can you send messages to and from that?

#26

Did check with Mac (SP 3.0) and Linux (SP 3.0 and 3.0.1). Turns out, that I can both receive and send osc messages when using SP 3.0; now also working with touchOSC. My checkout of SP 3.0.1 does receive but not send osc messages.

Many thanks to you @robin.newman. Especially the last tip lead me to this - preliminary - solution.

Should I create an issue about that on Github, or are these kind of transient issues not worthwhile to mention?

1 Like
#27

I assume your 3.0.1 (maybe post 3.01?) build is on Linux, in which case I don’t think it helps to put it on github just now.
I reverted to fast_osc on my Mac and it worked fine there without giving erlang errors. I think the problem initially rose on RPi, and I’ll need to check if it is disabled there or not. There were worse crashing errors during development of SP3 related to this.
Glad it is working for you on 3.0 on LInux.
As I said earlier, the problems I’ve had are with commits AFTER 3.0.1 release as detailed previously, and I think I told Sam about them.