# Sending OSC to sonic pi from touchdesigner

**URL:** <https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503>\
**Category:** Support, Help & Resources\
**Created:** [January 30, 2023, 3:11pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503 "2023-01-30T15:11:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![HK800](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/hk800/32/2485_2.png) [@HK800](https://in-thread.sonic-pi.net/u/HK800)\
**Post date:** [January 30, 2023, 3:11pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/1 "2023-01-30T15:11:35Z")

</div>

Hi everyone,  
Has anyone hooked up a touch designer osc out chop with a sonic pi?  
I’m trying to send the values ​​of the touch designer to sonic pi with OSC but sonic pi can’t receieve OSC messages.  
Can anyone help me?

 ![recieve OSC](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/1/1a91d6f6b67f9fd411dd4c1b88af48ead9494731.png)  
 ![send OSC](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/e/ed49e1f462c388936ca2f971316f6e4796900296.png)

---

<div class="post-metadata">

**Author:** ![mrbombmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mrbombmusic/32/2282_2.png) [@mrbombmusic](https://in-thread.sonic-pi.net/u/mrbombmusic)\
**Post date:** [January 30, 2023, 5:28pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/2 "2023-01-30T17:28:45Z")

</div>

Hello @HK800! Welcome to the forum!

I do not have any experience specifically with TouchDesigner, but I have used Sonic Pi to send and receive OSC messages with several other applications.

Just some basic things to consider:

- Do you have the correct OSC port number for sending OSC messages to Sonic Pi on the TouchDesigner side? You can find this number in Preferences in Sonic Pi under the “IO” tab where it says “Incoming OSC Port” It is usually 4560, but it never hurts to check as I have seen it change occasionally. You should have this specific number included in TouchDesigner, so that it is sending the messgae to the correct place.  

- You should also check the “Cues” section of the IDE when sending OSC messages. Regardless of what code you might have to parse the incoming data in the OSC message, you will get a message that there was an OSC message received if it was correctly sent to Sonic Pi. If you aren’t seeing these types of messages, my assumption would be it is on the sending end of things, not Sonic Pi.  

- In my experience, in order to send or receive OSC messages from Sonic Pi to/from another application on my computer (p5.js, Hydra etc) I usually have to run a local server on my machine as well as some type of node bridge file that is usually provided by whoever developed the OSC library that works with that application  
Here are examples of the Github repos for using OSC for p5.js and Hydra. you’ll see they both include using a local server.  
Hydra OSC: [https://github.com/ojack/hydra-osc](https://github.com/ojack/hydra-osc)  
p5.js OSC: [https://github.com/genekogan/p5js-osc](https://github.com/genekogan/p5js-osc)  
You may want to look into how that might work with TouchDesigner. I took a quick look at the docs on the TouchDesinger webpage for [Out\_CHOP](https://derivative.ca/UserGuide/OSC_Out_CHOP) but being unfamiliar with this software, I wasn’t able to make too much sense of it.

- FInally, I did notice in your screen shot for TouchDesigner that the OSC message was “trigger/synth/n” but the “/n” was not part of the code in Sonic Pi. I don’t think this is probably your issue as you would still be seeing the incoming OSC messages in the Cues console that I mentioned earlier, but I figured it might be worth point out.

I hope that might provide you some help or direction to continue figuring this out.

---

<div class="post-metadata">

**Author:** ![Berke](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/berke/32/2439_2.png) [@Berke](https://in-thread.sonic-pi.net/u/Berke)\
**Post date:** [January 31, 2023, 3:39pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/3 "2023-01-31T15:39:48Z")

</div>

Hello @HK800, welcome to our family 🙂

I’ve tried that what you are talking about and made it before but belive me I dont remember how to do it now 😅 I suppose, I’ve made it with looking this thread, you should check this up.

> [@TouchDesigner with Sonic Pi?](https://in-thread.sonic-pi.net/t/touchdesigner-with-sonic-pi/2747):
>
> Has anyone tried hooking up TouchDesigner to generate visuals from OSC messages from SP? Just read about deadmau5’s new tour, and he’s using TD for generating visuals on the fly with his Cube v3. A video is worth a thousand words, so [here.](https://www.youtube.com/watch?v=x5p2bI9lKks) The dude is a coder, and I love the possibilities I’m seeing here. Just wondered if anyone here has played with TD?

I’ve also tried to control Ableton from Sonic pi and using TDA(its like plug in for connection Touchdesigner and Ableton) to contol Touchdesigner from Ableton. Again I dont remember how to that niether because all my ald project files are gone with my old laptop. But there is a way to do that and if I remember someday I’ll wrtie here 🙂

---

<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:** [February 2, 2023, 9:17pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/4 "2023-02-02T21:17:32Z")

</div>

I had a play with this. I can get Touch designer working both sending and receiving OSC messages with TouchOSC, but I can’t get Sonic Pi receiving OSC from it either on the local machine or on a remote machine. Not sure why. Sonic Pi will receive and send OSC messages to and from TouchOSC alright, so its rather odd. Looking at the log file on TouchOSC the OSC messages look OK.

---

<div class="post-metadata">

**Author:** ![HK800](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/hk800/32/2485_2.png) [@HK800](https://in-thread.sonic-pi.net/u/HK800)\
**Post date:** [February 6, 2023, 9:40am UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/5 "2023-02-06T09:40:30Z")

</div>

Hello @mrbombmusic !  
Thank you for all of your help.

The port number is correct between Sonic Pi and Touchdesigner.  
I checked Cue but I couldn’t find those types of message what you sent.

 ![cues](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/b/bf5037c86ec165dd4974a4fab5a640a37f9a9058.png)

Also I checked TouchDesigner webpage for Out Chop but I didn’t notice anything new.

Strangely, when I connect the Touch Designer to the 4560, the Sonic pi itself stops playing sound.  
I have to close the Touch Designer once, restart the Sonic Pi and finally the sound comes back.  
I think TouchOSC is working correctly , but Sonic Pi is not able to process the message for some reason.  
I’ll keep trying a little more…

---

<div class="post-metadata">

**Author:** ![loose\_knit](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@loose\_knit](https://in-thread.sonic-pi.net/u/loose_knit)\
**Post date:** [June 13, 2024, 4:49am UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/6 "2024-06-13T04:49:02Z")

</div>

Hello! Is anyone able to figure this out? I am still having trouble sending touchdesigner osc into sonic pi for some reason 🥲

---

<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:** [June 13, 2024, 10:33am UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/7 "2024-06-13T10:33:54Z")

</div>

Sorry - I’ve never used Touch Designer, but looking at this page it seems that it’s very possible that by default it sends non-standard OSC messages which if the case Sonic Pi likely can’t currently handle:

> **[oscoutDAT Class](https://derivative.ca/UserGuide/OscoutDAT_Class)**
>
> Derivative is a software company that offers TouchDesigner, a visual development platform.

Would it be possible to set `useNonStandardTypes=False` and see if that improves things?

---

<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:** [June 19, 2024, 8:19pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/8 "2024-06-19T20:19:05Z")

</div>

Ignore what I wrote before!

I downloaded Touch Designer and figured out how to send OSC. I then figured out why Sonic Pi was having trouble receiving the messages and it’s because it’s sending them as OSC bundles which wasn’t supported. I’ve now implemented it and have it working locally.

Therefore, the next release of Sonic Pi should support receiving messages from Touch Designer!

 ![Screenshot 2024-06-19 at 9.16.25 PM](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/2/2c619cdad94e07cde999211b150d1f83c3e0b36b.png)

---

<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:** [June 21, 2024, 4:30pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/9 "2024-06-21T16:30:10Z")

</div>

Thanks for this. Tested on my Mac and working well.

---

<div class="post-metadata">

**Author:** ![phillipsglow](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/phillipsglow/32/2819_2.png) [@phillipsglow](https://in-thread.sonic-pi.net/u/phillipsglow)\
**Post date:** [June 22, 2024, 7:59am UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/10 "2024-06-22T07:59:05Z")

</div>

Hello,  
Thanks for asking this question , I am also facing the same problem.

---

<div class="post-metadata">

**Author:** ![halloworld](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@halloworld](https://in-thread.sonic-pi.net/u/halloworld)\
**Post date:** [June 23, 2024, 6:00am UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/11 "2024-06-23T06:00:51Z")

</div>

thanks Sam this is great! Is there anything that I can code to make this work before the next release? Im working with @loose_knit on this 🙂

---

<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:** [June 23, 2024, 1:01pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/12 "2024-06-23T13:01:14Z")

</div>

If you build from latest source it will work. That’s what I did on my Mac and Raspberry Pi5

---

<div class="post-metadata">

**Author:** ![halloworld](https://avatars.discourse-cdn.com/v4/letter/h/cdc98d/32.png) [@halloworld](https://in-thread.sonic-pi.net/u/halloworld)\
**Post date:** [July 4, 2024, 12:09pm UTC](https://in-thread.sonic-pi.net/t/sending-osc-to-sonic-pi-from-touchdesigner/7503/13 "2024-07-04T12:09:29Z")

</div>

Thanks Robin! I’m not sure how to do this, I wasn’t getting any source or messages in Sonic Pi when trying to receive osc ☹ is there any code or screenshots to walkthrough what this process could look like?

Very grateful!

Warmly,  
Fetle
