# Live-Looper with touchOSC control

**URL:** <https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363>\
**Category:** \[P\] Patreon Support\
**Created:** [October 31, 2017, 4:37pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363 "2017-10-31T16:37:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 31, 2017, 4:37pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/1 "2017-10-31T16:37:10Z")

</div>

Hi,

I did a first prototype of my [planned live looper](http://in-thread.sonic-pi.net/t/using-touchosc-with-sonic-pi/275/18?u=martin) with touchOSC control and I ran into some questions I have not been able to solve on my own yet.

There are several occasions I would like to sent feedback from `Sonic Pi` to `touchosc` but I did not manage to do that. I am under the impression that it is possible to set the state of a toggle button (including the visual feedback of a highlighted button) from Sonic Pi. E. g. I have a button with the path `/rec/track1_arm`:

```ruby
live_loop :track1 do
  use_real_time
  c = sync "/osc/rec/track1_arm"
  set :track, c[0]
end

```

The button either returns `1.0` or `0.0`. I tried to set the value of this button in Sonic Pi with:

```ruby
osc_send "192.168.2.150", 9000,"/rec/track1_arm",0

```

(Of course touchOSC is set to receive on Port 9000 and my cellphone has the IP 192.168.2.150.)

This did not work. What am I doing wrong?

Also: Am I actually right, that touchOSC will respond and change the interface according to the values set? It would also be nice to have a feedback about the actual recording time via the LEDs touchosc provides as an interface object.

I case you are interested, here is the prototype so far:

- the looper is split up in two files: `lib-live-looper-touchosc.rb` (residing on my harddrive) and
- `live_looper_touchosc.sps`, the control script which can be conveniently loaded via a shortcut
- the prototype just records (and plays back) _one_ track
- the general idea is to arm a track (where track/loop length is set in the control script), which can be done by the green toogle buttons
- once armed you can tell Sonic Pi to actually record with the Go-button (wich just evaluates the lib-file)
- the recording will start with the next loop cycle
- once you recorded it’ll start play back in the next loop cycle
- via touchosc you can also set the playback amp and you can toggle if the track is played at all (this also requires to press the Go-button as the code has to be evaluated)

As I said, just a prototype. Probably things will change and hopefully get better.

**lib** (stored as a file):

```ruby
# Basic live looper library with touchOSC control
# filename: lib-live-looper-touchosc.rb

use_bpm get(:my_bpm)
t1 = buffer[:track1, get(:track1_len)]

defonce :track_one_vol do
  set :track1_vol, 1
end

live_loop :metro do
  sample :elec_blip, amp: get(:metro_vol), rate: 0.895
  sleep 4
end

live_loop :track1 do
  use_real_time
  c = sync "/osc/rec/track1_arm"
  set :track, c[0]
end

live_loop :track1_vol do
  use_real_time
  c = sync "/osc/rec/track1_vol"
  set :track1_vol, c[0]
end

# Record track 1
if get(:track) == 1.0
  in_thread sync: :metro do
    with_fx :record, buffer: t1 do
      live_audio :audio_in, stereo: true
    end
  end
end

live_loop :track1_play do
  use_real_time
  c = sync "/osc/rec/track1_play"
  set :track1_play, c[0]
end

# Replay Track(s)
live_loop :play_track1, sync: :metro do
  stop if get(:track1_play) == 0.0
  sample t1, amp: get(:track1_vol)
  sleep get(:track1_len)
end

```

**`controler`** (to be loaded and executed in a buffer):

```ruby
# FIXME: most of that not yet used...
set :metro_vol, 0.5
set :my_bpm, 120
set :playback_master, 10
set :rec_level, 2
set :track1_len, 8
set :track2_len, 16
set :track3_len, 8
set :track4_len, 8

live_loop :setup do
  use_real_time
  p = sync "/osc/rec/go"
  puts "---------- #{p} --------------"
  if p[0] > 0 then
    
   # adjust this to where the file lib-live-looper-touchosc.rb
   # is on your harddrive; I did set up a function for that in init.rb 
    run_file live_looper_touchosc 
    
    if get(:track) == 0 then
      puts "-----------------------------------------"
      puts ""
      puts ""
      puts " No Track armed. "
      puts " "
      puts " "
      puts "-----------------------------------------"
    else
      puts "-----------------------------------------"
      puts ""
      puts ""
      puts " Prepare for recording on TRACK No. #{get(:track)} ..."
      puts " "
      puts " "
      puts "-----------------------------------------"
    end
  end
end

```

**touchosc-layout** `sonicpi-live-looper.touchosc` (how you can transfer to touchosc and use it as a custom layout has @robin.newman thankfully [explained in a video](https://www.youtube.com/watch?v=uzAB_Iy38mQ&feature=youtu.be) (about 4’40) ):

 ![touchosc](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/1X/2d9c01e3fd58f86703817c2abf56d8a64a6056bb.png)

```ruby
<?xml version="1.0" encoding="UTF-8"?>
<layout version="16" mode="3" w="320" h="540" orientation="horizontal">
  <tabpage name="dHJhY2sxX3ZvbA==" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false" >
    <control name="dHJhY2sxX2FybQ==" x="20" y="25" w="40" h="40" color="orange" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazFfYXJt" type="toggle" local_off="false" ></control>
    <control name="dHJhY2syX2FybQ==" x="100" y="25" w="40" h="40" color="orange" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazJfYXJt" type="toggle" local_off="false" ></control>
    <control name="dHJhY2szX2FybQ==" x="180" y="25" w="40" h="40" color="orange" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazNfYXJt" type="toggle" local_off="false" ></control>
    <control name="dHJhY2s0X2FybQ==" x="260" y="25" w="40" h="40" color="orange" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazRfYXJt" type="toggle" local_off="false" ></control>
    <control name="bGFiZWwy" x="26" y="34" w="28" h="25" color="yellow" type="labelh" text="MQ==" size="20" background="false" outline="false" ></control><control name="bGFiZWwz" x="106" y="33" w="28" h="25" color="yellow" type="labelh" text="Mg==" size="20" background="false" outline="false" ></control>
    <control name="bGFiZWw0" x="186" y="34" w="28" h="25" color="yellow" type="labelh" text="Mw==" size="20" background="false" outline="false" ></control><control name="bGFiZWw1" x="266" y="34" w="28" h="25" color="yellow" type="labelh" text="NA==" size="20" background="false" outline="false" ></control>
    <control name="Z28=" x="20" y="383" w="280" h="45" color="yellow" scalef="0.0" scalet="1.0" osc_cs="L3JlYy9nbw==" type="push" local_off="false" sp="true" sr="true" ></control>
    <control name="bGFiZWw2" x="110" y="395" w="80" h="25" color="yellow" type="labelh" text="R08=" size="26" background="false" outline="false" ></control>
    <control name="dHJhY2sxX3ZvbA==" x="20" y="96" w="40" h="220" color="green" scalef="0.0" scalet="3.0" osc_cs="L3JlYy90cmFjazFfdm9s" type="faderv" response="absolute" inverted="true" centered="false" ></control>
    <control name="dHJhY2syX3ZvbA==" x="100" y="96" w="40" h="220" color="green" scalef="0.0" scalet="3.0" osc_cs="L3JlYy90cmFjazJfdm9s" type="faderv" response="absolute" inverted="true" centered="false" ></control>
    <control name="dHJhY2szX3ZvbA==" x="180" y="96" w="40" h="220" color="green" scalef="0.0" scalet="3.0" osc_cs="L3JlYy90cmFjazNfdm9s" type="faderv" response="absolute" inverted="true" centered="false" ></control>
    <control name="dHJhY2s0X3ZvbA==" x="260" y="96" w="40" h="220" color="green" scalef="0.0" scalet="3.0" osc_cs="L3JlYy90cmFjazRfdm9s" type="faderv" response="absolute" inverted="true" centered="false" ></control>
    <control name="dHJhY2sxX3BsYXk=" x="20" y="329" w="40" h="40" color="green" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazFfcGxheQ==" type="toggle" local_off="false" ></control>
    <control name="bGFiZWw3" x="26" y="338" w="28" h="25" color="yellow" type="labelh" text="MQ==" size="20" background="false" outline="false" ></control>
    <control name="dHJhY2syX3BsYXk=" x="100" y="329" w="40" h="40" color="green" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazJfcGxheQ==" type="toggle" local_off="false" ></control>
    <control name="dHJhY2szX3BsYXk=" x="180" y="329" w="40" h="40" color="green" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazNfcGxheQ==" type="toggle" local_off="false" ></control>
    <control name="dHJhY2s0X3BsYXk=" x="260" y="329" w="40" h="40" color="green" scalef="0.0" scalet="1.0" osc_cs="L3JlYy90cmFjazRfcGxheQ==" type="toggle" local_off="false" ></control>
    <control name="bGFiZWw4" x="106" y="338" w="28" h="25" color="yellow" type="labelh" text="Mg==" size="20" background="false" outline="false" ></control>
    <control name="bGFiZWw5" x="186" y="337" w="28" h="25" color="yellow" type="labelh" text="Mw==" size="20" background="false" outline="false" ></control>
    <control name="bGFiZWwxMA==" x="266" y="338" w="28" h="25" color="yellow" type="labelh" text="NA==" size="20" background="false" outline="false" ></control>
    <control name="bGFiZWwxMQ==" x="13" y="1" w="112" h="25" color="yellow" type="labelh" text="QXJtIGZvciBSZWNvcmRpbmc=" size="10" background="false" outline="false" ></control>
    <control name="bGFiZWwxMg==" x="-10" y="71" w="112" h="25" color="green" type="labelh" text="UGxheWJhY2s=" size="10" background="false" outline="false" ></control>
  </tabpage>
</layout>

```

---

<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:** [October 31, 2017, 5:22pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/2 "2017-10-31T17:22:50Z")

</div>

Hmm It should be able to alter the button value. I loaded in your layout (once I had updated my TouchOSC editor to the latest version which you are using) and did a simple test here.  
I tried

```ruby
use_osc "192.168.1.240",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

```

with my iPad TouchOSC on 192.168.1.240 listening on port 9000 and it worked as expected switching the pushbutton on and off and moving the volume slider as well, so not sure what is happening with you.  
You should see a red indicator flashing top right on the cellphone screen as the OSC messages are received. If it isn’t you have a comms problem.

I’ll download your full code and have a play later.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 31, 2017, 5:44pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/3 "2017-10-31T17:44:46Z")

</div>

Hi Robin,

thanks you are having a look. I tested with your example. No change.

Here is a screenshot of my touchosc setting for osc messages (I am a bit confused that it says 'Found Hosts (0))

![touchosc](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/1X/1f446e3f637a476c1dc7ce8e1ac82e3db4a61953.png)

Sending from touchosc to SP works without any problem. (Yesterday I did also transfer the layout from the editor and the host was found automatically; today I had to provide the IP.)

---

<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:** [October 31, 2017, 5:57pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/4 "2017-10-31T17:57:49Z")

</div>

Hmm that is different from the screen I get on my iPad. Are you running on an Android? Also I don’t have the line with entry ZeroConfName  
FoundHosts is a line I get when switched to sync setting on the editor. It should show up a value then, but I think it is OK that it is 0 when working normally. Are you using your phone as an access point or just attaching it to your network like a normal PC?  
I’ll try with TouchOSC on my iPhone and see hw that behaves.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 31, 2017, 6:14pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/5 "2017-10-31T18:14:05Z")

</div>

- Yes, running on Adroid.
- Did see a ‘Found Host’ while working with the editor (as I said: at least yesterday)
- phone is attached the network like the laptop (found that very convenient 😉 ) …
- … but I will check if there is a difference if I use it as access point)

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 31, 2017, 6:27pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/6 "2017-10-31T18:27:00Z")

</div>

Seems to be no difference between ‘phone and laptop linked via wifi’ and ‘phone as access point and laptop linked via usb’.

---

<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:** [October 31, 2017, 6:37pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/7 "2017-10-31T18:37:31Z")

</div>

I just tried on my iPhone. Initially it didn’t work, and couldn’t seen any hosts for transfer. I had TouchOSC Bridge disabled, (shouldn’t be needed here), but enabled it and found that it had a different host IP set. When I set this to the ip of the Sonic Pi machine then it began to work, and I transferred the layout there, and it also works (different IP to the iPad but otherwise same set up).

I suspect your cell is Android, and the interface may be slightly different.

---

<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:** [October 31, 2017, 6:53pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/8 "2017-10-31T18:53:42Z")

</div>

Have you tried comms between the phone TouchOSC and something else? Worth running the puredata example form the documentation which can test both ways I think.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [October 31, 2017, 7:03pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/9 "2017-10-31T19:03:47Z")

</div>

Hi Robin,

I can’t check right now, but tomorrow.

I do not have touchOSC bridge. It is the equivalent to the `touchosc2midi` python script [I ran but don’t need](http://in-thread.sonic-pi.net/t/using-touchosc-with-sonic-pi/275/20?u=martin), right? If yes, there is no IP that could be configured there…

Can’t install PD on Linux. It requires/installs aubio4.1; after installing Sonic Pi refuses to run. Did this a few days ago and it took me a while to realize what was going on.

Initially I checked with `oscdump` (but this does only check one direction). There’ll be probably something else with wich I can send osc… I’ll let you know.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [November 1, 2017, 10:41am UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/10 "2017-11-01T10:41:23Z")

</div>

> [@Martin](#):
>
> I can’t check right now, but tomorrow.

Found a commandline tool with which I can send osc from my linux box ([`send_osc`](https://www.unix.com/man-page/debian/1/send_osc/)). The phone does not receive anything. Tried the same also with [Control](https://play.google.com/store/apps/details?id=com.charlieroberts.Control&hl=de), same result.

I guess you are right and it is a communication problem linked to my Android (with EMUX)j or WLAN. Did also some unsuccessful Google search concerning this one-way-communication.

Could it be that my router passes osc messages just one way? Is there an Android setting blocking incomming osc messages?

But, also without communication backwards to the phone the live looper is usable.

---

<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:** [November 1, 2017, 3:46pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/11 "2017-11-01T15:46:25Z")

</div>

I have no knowledge of Android so can’t help here. Maybe you could raise something on the [hexler.net](http://hexler.net) site forum?  
Have you checked that Sonic Pi can send OSC successfully on your system, to another receiving program? eg on ubuntu could use [https://apps.ubuntu.com/cat/applications/pyliblo-utils/](https://apps.ubuntu.com/cat/applications/pyliblo-utils/)

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [November 1, 2017, 4:13pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/12 "2017-11-01T16:13:39Z")

</div>

> [@robin.newman](#):
>
> Have you checked that Sonic Pi can send OSC successfully on your system, to another receiving program?

That is actually a very good idea. I did try to send from Sonic Pi with:

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

```

as well as:

```ruby
use_osc "localhost", 9000
live_loop :test do
  osc "/rec/track1_play",1
  sleep 2
  osc "/rec/track1_play",0
  sleep 2
end

```

and listened with `oscdump`. Nothing received.

But I _can send_ with `send_osc` and listen with `osc_dump`.

I do get a repeating error in the `erlang.log`:

```ruby
Error in process <0.136.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}]}]}
udp server timeout:69
udp server timeout:70  

```

I have also an error in `osmid\_o2m.log:

```ruby
sh: 1: [my_sp_install_path]/app/server/native/linux/osmid/o2m-L: not found

```

Maybe this is a hint?

---

<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:** [November 1, 2017, 4:18pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/13 "2017-11-01T16:18:51Z")

</div>

both the erlang osc files and osmid have had updates which may not have been flagged on the SP github site. Might be worth rebuilding the erlang beam files using erlc and also checking you have the latest osmid binaries.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [November 1, 2017, 5:17pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/14 "2017-11-01T17:17:28Z")

</div>

Did recompile the erlang files and compiled the lates osmid binaries.

Still the same error messages in the logs. Does it make sense to create an issue at Github? I do not know.

Same result concerning osc messages. Sonic Pi does not seem to send them out.

---

<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:** [November 1, 2017, 5:44pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/15 "2017-11-01T17:44:27Z")

</div>

Are you building the very latest from SP github repro or the release settings for 3.0.1?  
There IS an issue that I have found with the latest which prevents Mac from working. It is because of commits on 16th September Erlang -use -noshell flag when starting process and osmid \_teach o2m to use loopback network. These both stopped Mac from working. If you manually change them back (no need to rebuild aprt from redoing erlc for the relevant erlang file). See if that helps. I think they were put in to try and improve Windows version behaviour.  
The full numbers for the commits were  
51570a3d413df9e07a0246da3e6442e6b1559ec5  
and  
0c1e9e402463f09c4b0f7a7f66475b6d46148817

This may be your problem.

NB SEE NEXT POST FOR A CORRECTION

---

<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:** [November 1, 2017, 5:53pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/16 "2017-11-01T17:53:58Z")

</div>

OOPS I think I put the wrong ERLANG change commit. IT should be the one  
Erlang - tech scheduler to only listen on loopback network  
number dedc9ea6cfbf6e8c6d02e48196c5cb23c93e0b55  
NOT the one I mentioned for Erlang above. It has the same date.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [November 1, 2017, 5:59pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/17 "2017-11-01T17:59:15Z")

</div>

I am a bit embarrassed to ask: I guess you are advising me to go back to a previous commit (better the 2 that you mentioned), fetch the erlang related files (`pi_server.erl` and `osc.erl`) and exchange these in my 3.0.1 installation (which acctually is the commit about two weeks ago), right?

If yes, I haven’t done this before so ~~I don’t know how this works…~~ I will follow this ressource:

> <https://stackoverflow.com/questions/7832770/how-to-get-certain-commit-from-github-project>

---

<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:** [November 1, 2017, 6:10pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/18 "2017-11-01T18:10:22Z")

</div>

You could do that, but In my case I just looked at what the commits did, which were very simple changes and I edited the two files directly.  
The two changes are in studio.rb line 695 was changed from

```ruby
o2m_spawn_cmd = "'#{osmid_o2m_path}'" + " -b -i #{@midi_osc_out_port} -O #{@midi_osc_in_port} -m 6"

```

to

```ruby
o2m_spawn_cmd = "'#{osmid_o2m_path}'" + "-L -b -i #{@midi_osc_out_port} -O #{@midi_osc_in_port} -m 6"

```

Change it back again

and  
in pi\_server.erl line 69

```ruby
{ok, Socket} = gen_udp:open(Port, [binary]),

```

was changed to

```ruby
{ok, Socket} = gen_udp:open(Port, [binary, {ip, loopback}]),

```

again change it back again, but in this case you will then have to rebuild it using  
`erlc pi_server.rlc` to produce an updated pi\_server.beam file

The studio.rb file is in /app/server/sonicpi/lib/sonicpi

If you want you can keep the original files elsewhere.

---

<div class="post-metadata">

**Author:** ![Martin](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/martin/32/157_2.png) [@Martin](https://in-thread.sonic-pi.net/u/Martin)\
**Post date:** [November 1, 2017, 6:29pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/19 "2017-11-01T18:29:32Z")

</div>

Ok, that was clear. Done.

The message from `osmid_o2m.log` obviously is gone now. But I get still the errors in the `erlang.log` (I did `erlc` the file `pi_server.erl`):

```ruby
=ERROR REPORT==== 1-Nov-2017::19:27:35 ===
Error in process <0.216.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}]}]}

```

Did _you_ get rid of these?

---

<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:** [November 1, 2017, 7:06pm UTC](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363/20 "2017-11-01T19:06:06Z")

</div>

I don’t get this erlang error. If you are still not getting the exteranl OSC messages from Sonic PI working then I suggest it may be worth raising it as an error on github, (the error message you are getting. Can you ascertain WHEN it occurs? Is it as a result of an osc message sent from SP?

Also perhaps I’ll ask @samaaron to comment on this thread The error messages certainly looks like something is being delayed.

[Next page](https://in-thread.sonic-pi.net/t/live-looper-with-touchosc-control/363.md?page=2)
