Search Unity

[Released] extOSC - Open Sound Control

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

  1. karinagorzkowska

    karinagorzkowska

    Joined:
    Apr 17, 2018
    Posts:
    4
    Okay, It works! Thanks for your help a lot, you're my OSC God <3
     
    dr_ext likes this.
  2. noel3d

    noel3d

    Joined:
    Apr 22, 2020
    Posts:
    4
    Hi I'm really struggling to get stuff going . I'm trying to do something really simple ,but I just can't seem to make it work. I'm using touch osc on iOS to send a single signal , this is no problem , receiving it is no problem , mapping a change value setting , not a problem , but as soon as I try to allocate that mapped data , I don't get anything. If I try adding missing values in the mapping console to simulate 3 set of data , the max out is overridden to a single default value.
    It sounds so stupid , I'm sure I'm missing something really basic ,but just can't seem to get it to work.
    All I want to do is map a OSCtouch slider value to a rotation / position or scale , from there I can start to figure things out . Surely it isn't that hard? Please help!
     
    dr_ext likes this.
  3. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, how are you doing this?
     
  4. noel3d

    noel3d

    Joined:
    Apr 22, 2020
    Posts:
    4
    Ok had another go last night , the fast track setup worked fine . I then tried substituting the control to TouchOSC. Everything is working correctly.
    The problem seems to be the osc from TouchOSC is only one value not a set of 3 , needed for vector control. No matter what I try unity only sees it as a single value set. Any ideas?
     
  5. noel3d

    noel3d

    Joined:
    Apr 22, 2020
    Posts:
    4
    The only way I seem able to get the TouchOSC data to format correctly for this is to put the OSC through Isadora and change it to a multi transmit out OSC with 3 sets of values instead of 1, that worked brilliantly!
     
  6. Sutee9

    Sutee9

    Joined:
    Mar 12, 2015
    Posts:
    6
    So I just downloaded extOSC, and I was trying to map incoming messages from an accelerometer to a transform, I thought that must be really basic. I checked the "Events" example, the "Mapping" example. When I look at the receiving items, I find "OSC Receiver Event Vector 3" Components, their OnReceive events are mapped to non-existing methods. For example, it says "Missing RectTransform.set_achoredPosition3D". Funny enough, it still works, but it cannot be changed in any ways.

    Also, I really wondered what type data type actually comes in? Is there some working examples for Unity 2019.2.6 or a more complete example explaining how all these things work together?

    I want: Receive a message with 3 floats, send them to my own programmed class (some "OnMessageReceived" method which is called if a message matches the address), and then get the values and process them.
     
  7. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, I apologize for my absence. You can do it using the code, but if I have time, I can make additional components that will work with three different addresses for Vector3.

    Thanks, i will try to fix this.

    You can see data types through OSC Console.

    In first examle ("Getting Started") you have an example code how to receive OSCMessages in code.
     
  8. Matiasbru

    Matiasbru

    Joined:
    Sep 1, 2015
    Posts:
    20
    Hi! I’m trying to send the position from a 3D object using the transmitter informer to Ableton Live using the Max/Msp plugin Livegrabber to receive the OSC data. Everything works as intended, but I realized I would need to receive the position values from X, Y and Z, not as a package but as separate/independent values. Is there any chance to send each vector value separately from each other?
    Thanks in advance, your plugin is amazing!
     
  9. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hello! Unfortunately, there is no quick solution for this, but in the near future I will create it.
     
  10. Matiasbru

    Matiasbru

    Joined:
    Sep 1, 2015
    Posts:
    20
    Thank you Vlad! It would be amazing to have the possibility to unpack these values directly on Unity!
    One more thing, I'm trying to send OSC from an Oculus Quest but isn't working. Any clue about this? Maybe the plugin is just not prepared for VR devices idk.
     
  11. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    I can’t say what exactly is the problem. Since everyone who came across this never answered me. But as far as I understand, this is related to Android Manifest and Network Premissions.
     
  12. Matiasbru

    Matiasbru

    Joined:
    Sep 1, 2015
    Posts:
    20
    Thank you for your quick response!

    You were right!!!
    I solved by adding these two lines outside the application tag in the AndroidManifest.xml

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    Thanks!!!
     
    dr_ext likes this.
  13. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, unfortunately I’m busy in the near future, and can’t do a big update for extOSC. So I made you a small component that sends Vector3 separately:
     

    Attached Files:

  14. dfarjoun

    dfarjoun

    Joined:
    Aug 6, 2017
    Posts:
    42
    Hi,
    You look to have the most complete solution out there, but I'm kinda lost for now. :)

    Today I'm able to use touchDaw app in order to control a music software or even graphic software.

    My question is if with this asset I will be able to create my own "touch daw" where I can create my desired user interface to control a specific software that receives midi messages.
    Or is it just to receive the messages inside the game?

    I'm struggling to send the message via Unity to the software.
    So I don't know if it's possible. If I should build. If I can control other software in the same computer (like I'm trying to do now). I tried to build for android, but couldn't receive the message. I saw that the message was being sent with the console. But maybe I'm not understanding correctly how to send the messages to the device's IP.
    PS: I'm using mac.

    Thanks for your attention!
     
  15. dfarjoun

    dfarjoun

    Joined:
    Aug 6, 2017
    Posts:
    42
    If you don't mind another question:
    Is it possible with this tool to control via smartphone a build of the game?
    For example: Have the controls via smartphone and a game running on the computer and receiving the commands from the smartphone.
    Thanks again! :)
     
  16. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, unfortunately extOSC is an implementation of the OSC protocol, not Midi, so you cannot control applications using midi via extOSC, but if the application uses the OSC protocol, then using the built-in new UI components you can make your application you can make an OSC control panel.

    Yes, you can easily make a "remote controller" via extOSC and OSC-protocol.
     
  17. dfarjoun

    dfarjoun

    Joined:
    Aug 6, 2017
    Posts:
    42
    Hi, Thanks for the clarification!!

    At least I know it's possible. Now I need to understand how! :)

    Is there any tutorial available for this OSC control Panel?
    I'm really lost for now to understand how to make my computer receive this information.

    I can easily get the information from another OSC app as the connection is recognised automatically.
    Any guidance, here? (sorry for the newbie questions)
     
  18. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Unfortunately, all I can provide are examples that are located here: "Assets/extOSC/Examples/".

    The main components you need are OSCTransmitter and OSCReceiver.

    OSCReceiver - accepts messages configured for a specific port (Local Port property). Use to receive data from the application.

    OSCTransmitter - sends messages to a specific address and port (Remote Host and Remote Port). Use it to send data to the applications you need. (Some applications do not know how to work with bundles, so I advise you to release the "Use Bundle" button.)

    To create both of these components
    - "Hierarchy> Create> extOSC> OSC Manager".
    There are also components for quickly creating a UI. (They can be seen in the example: "8) UI").
     
  19. Nacherdj

    Nacherdj

    Joined:
    Aug 12, 2020
    Posts:
    8
    Hello;

    My name is Reuben and I am from London. I am a master's student and I am finishing my dissertation or thesis project. First, I would like to thank you for your great work and for sharing it with us. I do have a question that I am pretty sure you can help me with.

    I am building an open-source head rotation tracker with a teensy board and a GY85 with an accelerometer, gyroscope, and magnetometer. I am using Max/MSP to send the angles with Euler or quaternion. What I would like to do is take the rotation of my head to control the rotation camera of the player to move around like VR. I think I am very close to achieving but I am stuck at the moment.
    How could I take the information from the head tracker using OSC to receive it in Unity using your scripts? I am going to attach a couple of screenshots you will understand better what I am missing.

    Thank you very much in advance and I look forward to hearing from you.
    Best regards.
     

    Attached Files:

    dr_ext likes this.
  20. pavethem

    pavethem

    Joined:
    Feb 22, 2019
    Posts:
    5
    I wonder if anyone has managed to get this to work with the Hololens 2. Maybe it works different from the original Hololens or maybe it's an issue with more recent versions of Unity, but I can't get the Hololens to receive UDP messages with etxOSC. When starting the app, the debugger also throws the exception specified at line 59 of OSCStandaloneManager two times. Maybe this is part of the issue?

    Edit: The twice part is likely because I have two Receivers in my scene
     
    Last edited: Nov 27, 2020
    dr_ext likes this.
  21. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi! Unfortunately, I have no idea how Hololence 2 works now, does it still use UWP? And what version of Unity do you have?

    extOSC should not use OSCStandaloneManager for Hololens (first model) as it uses UWP. Perhaps some defines changed in Unity or Microsoft totally changed the sdk for Hololens 2. It would be very cool if you could help me fix this exception.
     
  22. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, I made some changes on GitHub. Try now to build your project with a new version of extOSC.
     
  23. wesselb

    wesselb

    Joined:
    May 29, 2018
    Posts:
    6
    Hi!
    I'm trying to send OSC messages from my iOS app to my laptop. but for some reason there's nothing coming through on the 'listener' side and the Xcode console says this: no route to host
    Screenshot 2020-12-09 at 16.19.50.png
    Anyone has an idea what this means? in the unity editor extOSC it works great, but when try it on my iPhone I cannot get it to work.
     
  24. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, I see this for the first time, are the devices on the same local network?
     
  25. wesselb

    wesselb

    Joined:
    May 29, 2018
    Posts:
    6
    Yeah the networks the same. I made also made a test with sending an url over with 'www' in unity.
    Screenshot 2020-12-16 at 16.46.42.png
    the error I receive with this is 'no internet connection'. maybe both Osc and www encounter the same problem?

    Could this have something to do with iOS 14? When I try an osc app from the app store, the app first asks me to give permission before the osc works. when I don't give permissions the osc doesn't work.
    Screenshot 2020-12-16 at 16.54.47.jpg

    But the thing is that my unity app doesn't ask for those permissions. Can this be something that causes the problem?
     
  26. wesselb

    wesselb

    Joined:
    May 29, 2018
    Posts:
    6
    Ok cool I fixed the problem. This was turned off. It's in the project settings in unity.
    Screenshot 2020-12-17 at 11.48.19.png
     
    dr_ext likes this.
  27. mklitsner

    mklitsner

    Joined:
    Nov 2, 2018
    Posts:
    6
    Does this work on webgl?
     
  28. mercuriales666

    mercuriales666

    Joined:
    Jun 29, 2020
    Posts:
    2
    Hi,

    First of all thanks for your package, works great for a lot of applications !

    I am trying to use it for a connexion between a NGIMU, a PC and a Hololens 2.
    The Transmitter from the Hololens 2 to a PC works great.

    The Receiver (on the Hololens 2, receiving a /quaternion channel from the NGIMU) works great for about 40 seconds and then suddenly freeze. Probably the connexion closing ? If I restart the app, it works again. I receive no error message. So something causes the receiver to close after that amout of seconds but I cannot figure out what, especially knowing that the transmitter works great.

    I am using Unity 2019.4.15f1 recommended by Windows for the Hololens 2.

    Do you have any idea what might causes such trouble ? I've been searching for days but I'm not familiar with UWP.
    Alternatively, for UWP, is there a way to check if the connexion is open and re-open it if has been closed ?

    Thanks in advance for any help
     
  29. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, unfortunately, I haven't tested webgl, but I think it probably doesn't.

    Unfortunately, I don't have Hololens at my disposal to check, but I will try to look at it soon. In the meantime, try on the OSCTransmitter and OSCReceiver (on the Hololens app) activate - "Close On Pause".
     
  30. mercuriales666

    mercuriales666

    Joined:
    Jun 29, 2020
    Posts:
    2
    I've tried but doesn't change the issue.
    Anyway, I've resigned myself to to a close/connect every 5 seconds. I don't like it but it seems to be working great.

    Thanks for your response
     
  31. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    I once heard about such a problem, but unfortunately I do not have Hololens and similar devices for testing. I will try to figure it out in the near future.
     
  32. kroepelklick

    kroepelklick

    Joined:
    Feb 9, 2021
    Posts:
    1
    Hi and many thanks for this great tool,

    I have troubles with special characters like ä,ö,ü.
    • extOSC is set to ASCII
    • messages are formatted as ASCII (checked with wire shark)
    Unfortunately I only get question marks in both ways, when I try to send with extOSC (via the debugger) and when I try to receive with extOSC (in my own script). Other components of the project work with this characters, so I guess it's not a global thing.

    I would very much appreciate your help.

    All Best
     
  33. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, as i know ä,ö,ü not included in ASCII range. OSC protocol by default use only ASCII for strings, but extOSC support UTF-8, this will help you send characters like this, but then strings will not work in applications where they are converted to ASCII.
     
  34. potter3366

    potter3366

    Joined:
    Oct 15, 2009
    Posts:
    65
    Any ideas how to set Remote Port for OSCTransmitter using UI Input Field in runtime?
     
    dr_ext likes this.
  35. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    hello everyone,
    i am rather new in unity and script world . for a project with a friend we would like to drive y OSC :
    - scene change bys osc
    - drive the opacity of a gameobject ( like the material of a cube ) and make it disapear
    - drive the enable/disable of a game object

    anybody can send some clue on how to do this ?
    thx a lot
     
  36. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    i am now able to desactive an object ...but impossible to reactivate it ! any clue ?
     
  37. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    things are ok now ...trying to send color to drive the alpha channel now ? color info on osc are the same format as vector 3?
     
  38. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    OK ...how to access the alpha channel of a material in the renderer via osc ? i am stuck ! thks a lot !
     
  39. stf51

    stf51

    Joined:
    Mar 25, 2021
    Posts:
    8
    hello anybody knows how to send color (RGB alpha ) to unity /extosc ? to change the alpha channel of a material ?
    any example ?
    thx !
     
  40. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi,
    To send color - just create message with color value, and send it by OSCTransmitter.
    Code (CSharp):
    1. var message = new OSCMessage("/extosc");
    2. message.AddValue(OSCValue.Color(new Color(1,1,1,1)));
    3.  
    4. Transmitter.Send(message);
    To receive color, just use OSCReceiver.Bind.

    Code (CSharp):
    1. public OSCReceiver Receiver;
    2.  
    3. void Start()
    4. {
    5.     Receiver.Bind("/extosc", ReceivedMessage);
    6. }
    7.  
    8. void ReceivedMessage(OSCMessage message)
    9. {
    10.     if (message.ToColor(out var color))
    11.     {
    12.         // TODO: Code here
    13.     }
    14. }
     
  41. DieterLaser

    DieterLaser

    Joined:
    Jul 1, 2017
    Posts:
    7
    is anyone using it with unity 2021.1.7f1? I have no errors, but the OSC data doesn't seem to arrive. The project works fine in Unity 2020. Firewall is sorted out, too
     
    Last edited: May 25, 2021
  42. TheOriginalHansTheMan

    TheOriginalHansTheMan

    Joined:
    Jan 17, 2020
    Posts:
    4
    Hey I have a problem - sending data to Reaper works fine. I can receive data but not get any message even with the correct binded address. I can see that the message is in a package. Is it so that you first need to unpack a received package to get to the wanted message ?
     
    dr_ext likes this.
  43. TheOriginalHansTheMan

    TheOriginalHansTheMan

    Joined:
    Jan 17, 2020
    Posts:
    4
    Never mind got it working - didn't see that my address was overwritten in the Editor :(
    Thank you for an awesome package - I'm making VR interfaces to music software now thanks to your hard work!
     
    dr_ext likes this.
  44. sfm220220

    sfm220220

    Joined:
    Apr 11, 2021
    Posts:
    2
    Hello,

    I have "Work in Editor" activated in OSC manager, but selecting "Editor and Runtime" on a receiver component doesn't work. Any ideas?

    Thanks!
     
  45. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, "Work In Editor" only works when the component is open in the inspector.
     
  46. sfm220220

    sfm220220

    Joined:
    Apr 11, 2021
    Posts:
    2

    Thanks!
     
  47. MaxQuinonesSantander

    MaxQuinonesSantander

    Joined:
    Feb 20, 2020
    Posts:
    11
    Hello!

    Some know how to send from Max MSP to Unity Slider Values via Ext OSC ?
     
  48. dr_ext

    dr_ext

    Joined:
    Apr 8, 2014
    Posts:
    100
    Hi, unfortunately, I can't help with Max MSP, but on the Unity side, you just need to use the Float Event component configured as in the screenshot. And send a message with one float value to the specified address.
     
    MaxQuinonesSantander likes this.
  49. MaxQuinonesSantander

    MaxQuinonesSantander

    Joined:
    Feb 20, 2020
    Posts:
    11
     
  50. TakuyaBabuya

    TakuyaBabuya

    Joined:
    Dec 17, 2020
    Posts:
    9
    Hi,
    Thank you for the asset, the examples are very easy to understand and follow. I am trying to run the 13) Marshalling example, but it crashes the project. I'm using Unity 2020.3.19f1