# OSC tutorial clarification

**URL:** <https://in-thread.sonic-pi.net/t/osc-tutorial-clarification/9064>\
**Category:** Support, Help & Resources\
**Created:** [July 22, 2024, 3:25am UTC](https://in-thread.sonic-pi.net/t/osc-tutorial-clarification/9064 "2024-07-22T03:25:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vomitHatSteve](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@vomitHatSteve](https://in-thread.sonic-pi.net/u/vomitHatSteve)\
**Post date:** [July 22, 2024, 3:25am UTC](https://in-thread.sonic-pi.net/t/osc-tutorial-clarification/9064/1 "2024-07-22T03:25:21Z")

</div>

So I’m trying to get the 4.x version working in a headless mode (ubuntu 24.04, no gui). I’ve managed to get the daemon running and prevented it from auto-terminating

But I can’t get it to run SP code from there.

From what I can figure, this should work:

```ruby
require "osc/osc"
client = SonicPi::OSC::UDPClient.new("localhost", SPIDER_LISTEN_TO_GUI_PORT)
client. send("/run-code", TOKEN, "play 60")
# or maybe?
client.send("/run-code", TOKEN, "SOMEPREFIXplay 60")

```

Right? What am I missing here?

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:** [July 22, 2024, 7:51am UTC](https://in-thread.sonic-pi.net/t/osc-tutorial-clarification/9064/2 "2024-07-22T07:51:46Z")

</div>

Hi there @vomitHatSteve

as this is a dev question - the best place to ask this kind of question is on GitHub via an issue: [Issues · sonic-pi-net/sonic-pi · GitHub](https://github.com/sonic-pi-net/sonic-pi/issues)

That way we get to keep these forums specifically for using the app rather than developing the app (or adjacent tools).

However, that said, I think there’s a good chance you’re sending your `TOKEN` as a string rather than a 32 bit integer. Could you try check to see if you’re sending it as an integer?

Happy to help further over on GitHub if necessary!

---

<div class="post-metadata">

**Author:** ![vomitHatSteve](https://avatars.discourse-cdn.com/v4/letter/v/eb8c5e/32.png) [@vomitHatSteve](https://in-thread.sonic-pi.net/u/vomitHatSteve)\
**Post date:** [July 24, 2024, 12:50pm UTC](https://in-thread.sonic-pi.net/t/osc-tutorial-clarification/9064/3 "2024-07-24T12:50:46Z")

</div>

> [@vomitHatSteve](#):
>
> `client.send("/run-code", TOKEN, "SOMEPREFIXplay 60")`

Thank you. It’s possible my actual code was treating it as a string, yes. But the test code is definitely using an int.

I will take it over to Github to investigate further tho.
