<div dir="ltr"><div dir="ltr">thanks very much everybody! this is quite helpful. at the moment i'm not requiring a bi-directional communication - i'm only using [netreceive -u -b] and not [netsend]. but it is very good to know of this behavior, because at some point i'll likely want some sort of way that PD can tell the application information for callback or verification purposes.</div><div dir="ltr"><div><br></div><div>@ Michael (or whoever want to use Unity with PD in a network configuration) - i have tried numerous (about 5) Unity - OSC solutions. many if not most do not obviously seem to have iOS or Android build support, but only work in the Editor. the one with the most depth and capability for build support (not to mention numerous example scenes) that i've encountered is extOSC, available on the Asset Store for free and of course downloadable via Github:</div><div><a href="https://github.com/Iam1337/extOSC">https://github.com/Iam1337/extOSC</a><br></div><div><br></div><div>i started in TouchOSC and then went to Lemur, but ultimately i needed a completely customized interface that neither tool could work with involving manipulating 3D objects. plus i've had a lot of experience dealing with Unity and none at all in Lemur. depending on your needs openFrameworks might be a better choice, esp for 2D interfaces. but if you want game controller or VR device support or using a 3D interface, i think of Unity as better optimized, certainly with better Metal support than oFX.</div><div><br></div><div>@everyone re: the [netsend -u -b] bug. if and when i do use this i will be using a different port number than the port i'm using for [netreceive -u -b], but this seems to mean that if PD sends UDP data back to Unity in this manner then do i need to reopen the connection to that port every time i send data? </div><div><br></div><div>i did have a fair amount of issues getting OSC to work properly - either PD or Unity would tell me the IP was already in use or Sockets.Net in Unity said the connection was refused. i did find out that the majority of errors were caused in Unity by the toolkit using the same port for sending and receiving. making them different port numbers helped immensely, but getting the port assignment to be forgotten about was a bit tricky and i'm still not 100% sure i've solved it. certainly i would say that [netreceive <portnumber> -u -b] does not seem to work as reliably as sending a [listen <portnumber> (  message at loading or via manual triggering, so i'll likely add a button or something to make sure the connection is solid. </div><div><br></div><div>@Dan - i'll look into your rc vanilla abstraction solutions - thanks!<br></div><div><br></div><div>best,</div><div>scott</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 10, 2019 at 8:49 AM Christof Ressi <<a href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">> i think roman made an error report about this [netreceive -u -b] beahviour already.<br>
<br>
<a href="https://github.com/pure-data/pure-data/issues/373" rel="noreferrer" target="_blank">https://github.com/pure-data/pure-data/issues/373</a><br>
<br>
> Gesendet: Sonntag, 10. Februar 2019 um 15:36 Uhr<br>
> Von: "michael strohmann" <<a href="mailto:itsnotfair9@gmail.com" target="_blank">itsnotfair9@gmail.com</a>><br>
> An: "Scott R. Looney" <<a href="mailto:scottrlooney@gmail.com" target="_blank">scottrlooney@gmail.com</a>><br>
> Cc: PD-List <<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>><br>
> Betreff: Re: [PD] trying to set up OSC between Unity and PD via [netreceive] or [iemnet/udpreceive]<br>
><br>
> HI Scott, <br>
> i do a similar thing - send OSC from the LEMUR app to pd and vice versa.<br>
> Lemur sends osc and to receive it in pd works fine with <br>
> [netreceive -u -b] <br>
> |<br>
> [oscparse]<br>
> |<br>
> [list trim]<br>
> |<br>
> [route whatever the message]<br>
> <br>
> there seem to be a odd behaviour with [netsend -u -b] though.<br>
> according the UDP protocol a message should be broadcast to an IP adress regardless if the receiving end is actually listening.<br>
> this bi-directionality is redarded only with TCP.<br>
> <br>
> however, in [netsend -u -b] once the receive leaves the network the connection is closed, and you need to reconnect to the device in order to send messages.<br>
> so i connect to the device every second, to make sure that it receives messages upon re-entry to the wlan-network<br>
> (i also need to send the status of the patch on a regular basis, so that all devices are up to date…)<br>
> <br>
> my patch (quite simple file playback in response to sensor input) worked fine, but i had occasional crashes / freezes with “watchdog singaling pd” (i run pd-0.48 on RaspberryPi B+)<br>
> since pd writes “connecting to port “ to the console everytime i connect - which is every second - after a couple of hours/days is filled the RAM and caused some misbeavior.<br>
> <br>
> the solution - and i hope it really fixes the freezes also in the long run - was to send the standard error to dev/null like so:<br>
> puredata -stderr 2>/dev/null path/to/patch.pd<br>
> <br>
> i think roman made an error report about this [netreceive -u -b] beahviour already.<br>
> <br>
> <br>
> <br>
> i actually also wanted to use UNITY for sending OSC, but could not find time to work it out, so pls let me know it you found how to do it…<br>
> <br>
> Cheers!<br>
> Michael<br>
> <br>
> > On 10 Feb 2019, at 10:56, Scott R. Looney <<a href="mailto:scottrlooney@gmail.com" target="_blank">scottrlooney@gmail.com</a>> wrote:<br>
> > <br>
> > OK thanks Christof! [oscparse] seems to do the trick, and formats it as a list that i can break up. and it seems i have [netreceive] working properly after all, so that was my error thinking it was broken. it is a bit picky and seems to work better if i send it a message as to what port to listen to rather than defining it as an argument initially. <br>
> > <br>
> > <br>
> > <br>
> > On Sun, Feb 10, 2019 at 1:03 AM Christof Ressi <<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a> <mailto:<a href="mailto:christof.ressi@gmx.at" target="_blank">christof.ressi@gmx.at</a>>> wrote:<br>
> > > > > patch with their [udpreceive] which worked fine. trying that same<br>
> > > > > patch in PD however, made all the data print out as integer ASCII<br>
> > > > > values rather than Unicode text characters. i tried two other Unity<br>
> > > > > OSC projects and they behaved the same way.<br>
> > > > ><br>
> > > > > so, at the least, i need a convenient way to change all the ASCII<br>
> > > > > integer numbers in a data stream to ASCII characters.<br>
> > <br>
> > IIRC, in max, updreceive outputs osc messages while in the Pd objects iemnet/udpreceive or [netreceive -u -b] output the raw udp packet as a list of bytes. You need another object to parse the data. Pd vanilla has [oscparse], but personally i prefer the mrpeach/unpackOSC resp. osc/unpackOSC externals.<br>
> > <br>
> > > Gesendet: Sonntag, 10. Februar 2019 um 09:39 Uhr<br>
> > > Von: "Scott R. Looney" <<a href="mailto:scottrlooney@gmail.com" target="_blank">scottrlooney@gmail.com</a> <mailto:<a href="mailto:scottrlooney@gmail.com" target="_blank">scottrlooney@gmail.com</a>>><br>
> > > An: pd-list <<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a> <mailto:<a href="mailto:pd-list@lists.iem.at" target="_blank">pd-list@lists.iem.at</a>>><br>
> > > Betreff: Re: [PD] trying to set up OSC between Unity and PD via [netreceive] or [iemnet/udpreceive]<br>
> > ><br>
> > > nope - doesn't work. absolutely no output at all from [netreceive -u -b]<br>
> > > whereas i do get results from [iemnet/udpreceive]. i'm pretty convinced<br>
> > > that on the Mac anyway the UDP functionality of [netreceive] is basically<br>
> > > broken, at least in regards to responding to .Net's Sockets UDP sending<br>
> > > methods anyway.<br>
> > > <br>
> > > On Sun, Feb 10, 2019 at 12:20 AM Roman Haefeli <<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a> <mailto:<a href="mailto:reduzent@gmail.com" target="_blank">reduzent@gmail.com</a>>> wrote:<br>
> > > <br>
> > > > The equivalent to [iemnet/udpreceive] is [netreceive -u -b].<br>
> > > ><br>
> > > > Roman<br>
> > > ><br>
> > > > On Sat, 2019-02-09 at 23:40 -0800, Scott R. Looney wrote:<br>
> > > > > hey folks, i'm trying to set up a OSC communication between Unity and<br>
> > > > > PD. the eventual goal is that an iOS app will be sending data to PD<br>
> > > > > to control various parameters. this isn't a libpd issue as i do not<br>
> > > > > want to run a PD patch in Unity. i only want the remote<br>
> > > > > communication.<br>
> > > > ><br>
> > > > > so far i've tried Kalimba which works perfectly with [netreceive] in<br>
> > > > > the Unity Editor. it looks like this is because it uses TCP and not<br>
> > > > > UDP for its connection. however due to its age (6 years or so)  the<br>
> > > > > resulting Xcode project does not build correctly. i'm assuming it's<br>
> > > > > likely an old libpd issue, but not sure.<br>
> > > > ><br>
> > > > > so, i've tried a few other OSC Unity based projects and none of them<br>
> > > > > work with [netreceive] in any way (including in UDP mode). i did find<br>
> > > > > a few that work with [iemnet/udpreceive]. one of them had a demo Max<br>
> > > > > patch with their [udpreceive] which worked fine. trying that same<br>
> > > > > patch in PD however, made all the data print out as integer ASCII<br>
> > > > > values rather than Unicode text characters. i tried two other Unity<br>
> > > > > OSC projects and they behaved the same way.<br>
> > > > ><br>
> > > > > so, at the least, i need a convenient way to change all the ASCII<br>
> > > > > integer numbers in a data stream to ASCII characters. ideally i'd<br>
> > > > > love to have a Unity OSC demo that can send data to PD reliably,<br>
> > > > > using TCP or UDP. any help appreciated!<br>
> > > > > _______________________________________________<br>
> > > > > <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> <mailto:<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a>> mailing list<br>
> > > > > UNSUBSCRIBE and account-management -><br>
> > > > > <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a> <<a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>><br>
> > > > _______________________________________________<br>
> > > > <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> <mailto:<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a>> mailing list<br>
> > > > UNSUBSCRIBE and account-management -><br>
> > > > <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a> <<a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>><br>
> > > ><br>
> > > _______________________________________________<br>
> > > <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> <mailto:<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a>> mailing list<br>
> > > UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a> <<a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>><br>
> > ><br>
> > <br>
> > <br>
> > <br>
> > _______________________________________________<br>
> > <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> <mailto:<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a>> mailing list<br>
> > UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a> <<a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a>><br>
> > _______________________________________________<br>
> > <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
> > UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
> <br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
><br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>