Search Unity

[Released] extOSC - Open Sound Control

Discussion in 'Assets and Asset Store' started by dr_ext, Oct 13, 2016.

  1. sweetclimusic

    sweetclimusic

    Joined:
    Nov 11, 2016
    Posts:
    12
    So i don't know what message 'Abelton Link' send, I think that is their own protocol. it's a protocol that will sync the beats between apps.
     
  2. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Okay, I checked what it is. Unfortunately extOSC does not support Ableton Link.
     
  3. DidierPorte

    DidierPorte

    Joined:
    Oct 25, 2016
    Posts:
    1
    Hi,

    Thanks for this great asset.
    But I encounter a problem during the build.
    I use informers to send/receive messages to the tablet, everything works great during runtime but after the build unity can only receive messages and does not send any.
    Any ideas ? Help would be greatly appreciated..

    Thanks,

    Unity 2018.2.1
    extOSC 1.12
    windows 10
     
  4. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, I already answer on your mail. Check spam folder.

    "This may be a problem with busy ports. That is, some application is already running on the port you need.

    Please send me a log file (But before set: OSCConsole.LogConsole = true; in any script in Awake method) and screenshot of OSC Receiver and OSC Transmitter from the editor."
     
  5. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
  6. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    extOSC - Open Sound Control Ver. 1.13 is Available:
    - Removed obsolete methods.
    - OSCConverter optimization. (~ZeroAllocation)
    - OSCReceiver updated Bind and Unbind methods.

    Asset Store: https://www.assetstore.unity3d.com/#!/content/72005 - FREE
    GitHub: https://github.com/iam1337/extOSC

    old logs:

    extOSC - Open Sound Control Ver. 1.12:

    - Added Unity 2018.3 and newer support.
    - Added Filter field in OSC Console.
    - Changed icons on OSC windows.

    extOSC - Open Sound Control Ver. 1.11:
    - Added OSCBundle.Create method.
    - Added OSCBundle(OSCPacket[]) constructor.
     
  7. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hi there! very nice looking package you have for sure. i'm trying to use it with Pure Data(PD) to control it from Unity (Pure Data is sort of like MaxMSPs uglier but free/opensource cousin - it uses visual patching). to get the OSC data i use special objects for this. so, i get nothing with the [netreceive] object which usually works with apps like TouchOSC for example, as well as an older library for Unity PD called Kalimba. i believe these tools are creating TCP connections, and [netreceive] is optimized for TCP (though it is supposed to be configurable to use UDP as well).

    i do get data from the [udpreceive] object, but all the data is represented as integer ASCII values, not the unicode characters. i've run into two other packages that behaved this way as well in PD.

    is there a way to get the data transmitted to PD as ASCII characters and not integer values? i did try it with Osculator and it shows up as text (although it doesn't print the 'Hello World!' message), but i'm not sure why it's malfunctioning in PD. maybe there's an option to use TCP instead of UDP? any help or advice appreciated!

    EDIT: i'm leaving this post up for others, but i've solved the issue it seems. Pure Data works a bit differently than MaxMSP. you can actually use [netreceive -u -b] (this means it's in UDP mode and looking for integer data) or the [udpreceive] external from the iemlib library, but in either case you'll need to use the [oscparse] object to convert the data to a list that can be understood in PD. [netreceive] won't do anything without it all, whereas [udpreceive] will print the integer ASCII values as well as a lot of spurious data (including a lot of bangs). putting [oscparse] directly after these objects will format the messages as a list of strings that PD can work with by using [route] and [unpack].

    anyway i know this will likely sound like a foreign language to some of you, but if anyone's interested in using PD with Unity (or in my case using Unity to control PD via OSC) this will get you most of the way there. it does appear that MaxMSP has a [udpreceive] object that automatically parses the OSC data so a separate message parsing object is not really needed. hope this is somewhat helpful!
     
    Last edited: Feb 10, 2019
    ricardopalmieri and dr_ext like this.
  8. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hi there - i followed this thread and maybe this might help? it doesn't use link but it can grab information from Ableton and send it as OSC data, which should then make it compatible with extOSC i believe:

    https://sonicbloom.net/en/livegrabber-to-sendreceive-osc-in-ableton-live/
     
    dr_ext likes this.
  9. sweetclimusic

    sweetclimusic

    Joined:
    Nov 11, 2016
    Posts:
    12
    Hi thanks, I have to bookmark this but sounds great.
     
  10. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
  11. Startec

    Startec

    Joined:
    Nov 10, 2015
    Posts:
    12
    This is a great project - thanks for this.
     
    Last edited: Apr 13, 2019
    dr_ext likes this.
  12. Startec

    Startec

    Joined:
    Nov 10, 2015
    Posts:
    12
    @ExT_rus if I want to use a slider, either the default Unity one or your GUI OSC slider, but I want that to send an integer - how should I convert the type?

    Checking "Whole Numbers" and setting the range from 0-255 keeps the value member a float and I do not see where to overwrite the Member type on the OSC Transmitter Informer script.
     
  13. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, parameter "Whole number" only removes the mantissa from the number.

    Unfortunately, extOSC has no component or method to send a value of type int instead of float. Within a few hours I will make this component for you.
     
  14. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Add this components in your project, and replace OSCTransmitterInformerFloat on OSCTransmitterInformerFloatToInt component.

    In future update i make it easer.
     

    Attached Files:

  15. Startec

    Startec

    Joined:
    Nov 10, 2015
    Posts:
    12
    Wow. Awesome support thank you @ExT_rus . Since OSC usually uses UDP is there any chance you might add multi-casting support?
     
  16. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Yes, I have plans to add Multicasting. But it will not be soon. For now I can suggest using Broadcasting: 255.255.255.255
     
    NikH and Startec like this.
  17. NikH

    NikH

    Joined:
    Dec 24, 2013
    Posts:
    14
    @ExT_rus thankyou for this awesome asset.

    Could you possibly explain how to create a 'map bundle'? I'm also getting the warning 'Create or load map bundle!' in the OSC Mapping tab.

    Thanks!
     
  18. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, you can create a MapBundle using the Create button in the OSCMapping tab:
     
    NikH and Startec like this.
  19. NikH

    NikH

    Joined:
    Dec 24, 2013
    Posts:
    14
    @ExT_rus t, thanks!!!

    In case you are open to giving some further advice, I'm having trouble connecting my received float messages to control rotation, scale, position in the Mapping scene. I've read through the documentation and watched your YouTube videos but the workflow hasn't quite clicked yet sorry.
    I've loaded your Mapping scene and am receiving messages (float values between 0 and 1) from a Wii remote connected to OSCulator (displaying in the OSC Console). OSCulator is transmitting on 10.1.1.167:7000 and the receiver settings in the OSC Manager are set the same. I can rotate the image using my mouse to control sliders. I've gone to UI Root > UI Panel > Background Image > Mapping Item and pasted the Message address I'm receiving from OSCulator (/wii/1/motion/angles/2) to replace /example/6/position. However, I'm not getting any change in image position on play mode. Sorry if this is basic but really would appreciate any directions.

    Thanks!
     
  20. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, look through OSCConsole if the message format matches the one you are replacing.

    The OSCMapping example uses OSCReceiverEventVector3, which means that the message must contain three float values.
     
    NikH likes this.
  21. NikH

    NikH

    Joined:
    Dec 24, 2013
    Posts:
    14
    Thanks @Ext-rus t, that did it!!
     
    dr_ext likes this.
  22. NikH

    NikH

    Joined:
    Dec 24, 2013
    Posts:
    14
    Hi @Ext-rus t, I'm receiving OSC float values and trying to assign them to a float variable, but stuck how to achieve this as 'message' is type OSCMessage. Is there a typical way to get the float value via script in extOSC?

    Thanks!



     
  23. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, you have two ways to get float value from OSCMessage:

    First Way:
    Code (CSharp):
    1. var value = message.Values[0].FloatValue;
    Second Way:
    Code (CSharp):
    1. var value = 0f;
    2.  
    3. // ToFloat() method get first float value and return it in "value" variable. If float value is not found method return false.
    4. if (message.ToFloat(out value))  
    5. {
    6.     Debug.Log(value);
    7.  
    8.     // TODO: code.
    9. }
     
    NikH likes this.
  24. NikH

    NikH

    Joined:
    Dec 24, 2013
    Posts:
    14
    Thanks very much, again @Ext-rus - that works perfectly!!
     
    dr_ext likes this.
  25. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hey there @ExT_rus, i love this tool - it's been very stable so far. i'm using it to send OSC to PureData(PD) and it works fine. but i cannot seem to configure it to properly receive from PD. to set sending properly using the [netsend] object in PD i chose UDP and binary format, and put the slashes in with a message formatter. but after one initial moment where it seemed to recognize it was getting a message, but it printed Errors in the Unity console saying 'Array Input was out of range' it basically just stopped responding completely. i did not see any messages besides the error that one time and nothing printed to the extOSC console under Receivers. my format for the Bind command is as follows:

    Code (CSharp):
    1.    private void Start()
    2.     {
    3.         if (Receiver != null)
    4.         {
    5.             Receiver.Bind("/*/*", MessageReceived);
    6.         }
    7.     }
    and MessageReceived just prints it out to Debug.Log like your script example.

    have you or anyone else used this for getting messages from PD (or even MaxMSP) into Unity? i'm just not sure how to format the sent message from PD back to Unity so extOSC recognizes it. there's also not a lot of examples or videos of extOSC receiving data from an external source (i found one on your channel but it still wasn't clear how the message was formatted). any help appreciated!

    ***UPDATE - bit on an update on this front. i found out that my setup in PD was definitely not correct. i fixed it and i checked it with an app called OSCshark. the sending to PD from extOSC used the following configuration to parse data formatted by extOSC into PD:
    https://www.dropbox.com/s/itwu7y7x9nii972/Unity-extOSC_sendingTo PD.png?dl=0

    so i set up a reverse order in order to format data as OSC and then send it. this approach works perfectly sending data to the OSCshark app and the messages show up properly formatted:
    https://www.dropbox.com/s/a1xhbsxro2gp2s6/PD-formatting-OSC_to_Unity-extOSC.png?dl=0

    i tried this with the OSCulator app and it shows the data coming in as well.

    however, they still do not seem to be correct sending data to the game engine. the extOSC console and the project console don't do anything that i can see. would be nice to know if there's configuration as to receiving format (binary, ASCII) and whether its using TCP or UDP. it appears extOSC uses UDP binary for its output but i'm not sure of the input. if it is using UDP and binary it seems to want a very different data packet format for external OSC input to show in the extOSC Console.
     
    Last edited: May 7, 2019
    NikH likes this.
  26. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, I do not really understand your problem. I recreated your scheme from PD, and checked its operation with extOSC, everything works correctly.



    Also i tried to receive extOSC messages in PD:



    extOSC used UDP sockets, and implements exactly the Open Sound Control protocol.If you work with text, make sure that it is formatted as ASCII.
     
  27. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    weird - i cannot get this to work for me with PD transmitting even in the version you're trying (which i assume is PurrData (PD L2ork). let me see if i've got this right. here's what i'm doing to test:

    in Unity go to start Scene
    go to Window>extOSC>OSC Console
    switch over to PD
    click [connect localhost 7001] - PD window says 'connecting to port 7001'
    change number box value in PD
    look over at OSC Console - nothing shows up

    my version of Unity is 2018.3, and i'm running extOSC on macOS 10.13.6. the version of extOSC i'm running is 1.13. could that be the issue? i see in the notes you added receive support for localhost later than 1.13 so that might be the problem. will test with IP only.

    UPDATE - yes that was the issue! i'll update to latest extOSC version. i figured it had to be something like that if your setup was the same as mine.
     
    Last edited: May 7, 2019
  28. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Yes, i use 1.14 and PurrData (PD L2ork), but this is weird, since between 1.13 and 1.14 there are no differences inside OSCNetworkBackend.

    I am glad that everything worked, in my free time I will look why PD did not work on 1.13.

    Thanks for using extOSC.
     
  29. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    extOSC - Open Sound Control Ver. 1.15 is Available:
    - Added Advanced options in OSCReceiver.
    - Added LocalHostMode property in OSCReceiver.
    - Added LocalHost property in OSCReceiver.
    - Updated Advanced options in OSCTransmitter.
    - Added LocalHostMode property in OSCTransmitter.
    - Removed FromReceiver option in LocalPortMode property in OSCTransmitter.
    - Update network backend.
    - Cleanup editor code.

    Asset Store: https://www.assetstore.unity3d.com/#!/content/72005 - FREE
    GitHub: https://github.com/iam1337/extOSC
     
  30. unity_fYL4oKABAFgXgQ

    unity_fYL4oKABAFgXgQ

    Joined:
    Mar 25, 2019
    Posts:
    2
    @ExT_rus First off, absolutely amazing tool, I'm new to unity but i quickly learned how I could include OSC into my projects with the included examples.
    I did encounter one problem that I'm not sure how to solve. When i'm in play mode I can send and receive the OSC messages but once I build and run it on my android phone, its no longer working. Is it something that I'm doing wrong?
    Thank you.
     
  31. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, thanks for using extOSC.

    If you send messages from an Android device to a PC, then you need to turn off the firewall on your PC, or unblock your application or Unity Editor in it.
     
  32. unity_fYL4oKABAFgXgQ

    unity_fYL4oKABAFgXgQ

    Joined:
    Mar 25, 2019
    Posts:
    2
    Thanks for the quick reply, My firewall is currently off on my mac and i was able to receive OSC messages when I used softwares like TouchOSC.

    Everything works when i try to play it in unity and also when i connect my android phone to unity with the Unity remote 5 app. When i try to use build and run is when it is no longer sending any more messages ( as far as I can tell from the receiving end )
     
  33. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hm, can you describe in more detail what and how you do with extOSC to my mail: ext@iron-wall.org
     
  34. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
  35. AlexiJohansen123

    AlexiJohansen123

    Joined:
    Apr 5, 2016
    Posts:
    17
    Thank you making and sharing this asset, it's very useful.

    I occasionally get an error though and it crashed my application:

    [OSCReceiver] Receive error: System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at extOSC.Core.Packers.OSCPackerFloat.BytesToValue (System.Byte[] buffer, System.Int32& index) [0x00001] in OSCPackerFloat.cs:28 ... the error continues.

    I'm on 2018.3.14f1
     
  36. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, what version of extOSC are you using? And what message are you sending?
     
  37. AlexiJohansen123

    AlexiJohansen123

    Joined:
    Apr 5, 2016
    Posts:
    17
    I am using the latest version.

    I am sending message from a Swift iOS Application. I have a bunch of different addresses, some have 3 floats, some have 4 floats, some have an Int and a float.
     
  38. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Okay, first, let's make sure that in versions.txt you have the latest update signed v1.17. And also I want to know what implementation of OSC you use on Swift?
     
    Last edited: Jun 24, 2019
  39. rayD8

    rayD8

    Joined:
    Mar 7, 2018
    Posts:
    32
    When I go to Window, there's no extOSC > Console Window listed.
    Any idea what's wrong?
     
  40. Startec

    Startec

    Joined:
    Nov 10, 2015
    Posts:
    12
    Hi @ExT_rus I just used your plugin on a critical event and it worked very well. How can I support this plugin? It was free on the app store but I'd like to throw you a few dollars.
     
  41. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Unfortunately for me it is not very convenient for technical reasons to receive donations. So the best variant would be: review in the Asset Store or Star in GitHub.
     
  42. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    It moved from Window to Tools tab.
     
    Last edited: Oct 20, 2019
  43. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, thank you for extOSC and the Playmaker actions.

    Not an emergency, but would you consider making an action for arrays?

    Screen Shot 2020-01-30 at 7.42.37 PM.png

    It seems to be the one signal I can't read with the existing PM actions.
     
  44. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, yeah I will consider adding OSC arrays in PlayMaker actions, but unfortunately not in the near future.
     
    wetcircuit likes this.
  45. karinagorzkowska

    karinagorzkowska

    Joined:
    Apr 17, 2018
    Posts:
    4
    Hi,
    I've got a huge problem and would be very grateful for your help. I'm using ExtOSC to send information about headset position between two Oculus Quests, but its not working. I'm sure I've got right IP adresses of quests, i'm sending everything through wi-fi and I stuck. My OSC Managers looks like this:
    1. Player 1 OSC Manager: https://ibb.co/4VRXmsH
    2.Player 2 OSC Manager: https://ibb.co/Ws0Nd3s
    Also, transmitters and receivers for players:
    Player one:
    https://ibb.co/r5fh5K1
    https://ibb.co/QH3f6pT
    Player two:
    https://ibb.co/XDsSD1c
    https://ibb.co/WVVKmc3
    I've used extosc with two Vive's lately and everything worked. I'm sure I've made some stupid mistake, but still I cannot solve it...
     
  46. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, first, make sure that you have disabled Firewall on your computer. And also try to change in Android Projects Settings - Internet Access on Require.

     
  47. karinagorzkowska

    karinagorzkowska

    Joined:
    Apr 17, 2018
    Posts:
    4
    Done that now, still doesnt work. Any other sugestions? Maybe I made some mistakes in OSC Manager :(
     
  48. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Try to enable "Close On Pause" in OSCReceiver and OSCTransmitter in Android Build.
     
  49. karinagorzkowska

    karinagorzkowska

    Joined:
    Apr 17, 2018
    Posts:
    4
    Still nothing. I think Im going crazy...
     
  50. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Ok, send me more info on mail: ext@iron-wall.org
    Logs from Unity and Oculus Quest (use adb). And make sure you have the correct ip.