playMaker

Author Topic: Can playmaker support OSC? like touchosc?  (Read 22159 times)

elbows

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #15 on: March 01, 2012, 04:42:47 PM »
OK I think your problem is because I only provided example Actions which could picked OSC messages which have either 1 or 3 float values, and you need one that receives 2 float values in a message.

The attached action should do what you want, I just tested it with the xy-pad in touchosc.

With this one you need to create 2 PlayMaker Float variables and tell the Get Osc Two Floats Action to use one for the 'Store First Result' and the other for 'Store Second Result'.

EDIT - attachment removed as a newer version is available in a later post
« Last Edit: March 02, 2012, 03:33:11 PM by elbows »

kyy921

  • Junior Playmaker
  • **
  • Posts: 50
    • View Profile
    • 上海杉蔓数字科技
Re: Can playmaker support OSC? like touchosc?
« Reply #16 on: March 02, 2012, 05:03:30 AM »
yeah! the new 2float actions works very well, :)
another problem is when you switch to another tab, and the control with the unity3d will break

elbows

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #17 on: March 02, 2012, 10:30:36 AM »
Sorry about that. My code in PMOSC.cs that attempts to show you the last OSC Message Address & Values received was not very good, it did not like receiving OSC messages that had no value.

Please replace PMOSC.cs with the attached version which works properly.

Also note that when you don't need to see the incoming OSC Message Addresses & Values for debugging purposes, you should untick 'Debug Osc Messages' option in PMOSC for a slight increase in performance.

I should do the same checks inside the Actions really, will fix this soon, for now you are OK as long as you make sure to always pick an Action that listens for the same number of values in a particular OSC message as are actually being sent.

elbows

  • Playmaker Newbie
  • *
  • Posts: 15
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #18 on: March 02, 2012, 02:13:25 PM »
OK I really hated the fact that my implementation only allowed a particular OSC Message Address to be listened to by one PlayMaker Action simultaneously, this isn't foolproof enough. So I messed around with the Osc.cs code and managed to work around this issue, now you can listen for a particular OSC Message Address (e.g. /1/fader1) as many times as you like simultaneously in different Playmaker FSMs and it should work. Yay, thats a better fit for PlayMaker :) Requires more testing really but I will post it here, simply replace the files in your project with the ones attached to this post.

Also updated the Actions so that they check to make sure the right number of values came with the message they are receiving. Now if less values came through than the Action is designed to handle, the Action will not do anything with that message. If more values are received than they are designed to handle, then they use the ones they are designed to handle and ignore the rest.
« Last Edit: March 02, 2012, 02:19:30 PM by elbows »

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #19 on: May 30, 2012, 07:03:06 AM »
Hi Guys,

Will this set up work on the iOS per chance? I'd like to control Ableton live with it. Naturally, I'm not a C# coder. What would be the reality of getting this functionality together? Any advice much appreciated.

Drakon

rmd

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #20 on: April 10, 2013, 05:13:46 AM »
hey,

thanks for your implementation!
i tried to set it up, getting 3 floats from VDMX5 (lo, mid, hi) to unity over OSC.
the correct values show up in the debug section of the PMOSC.cs,
but the playmaker actions (get osc float) don't seem to be able to get the values.
(i'm on unity4 and pm 1.5.3)
any ideas? thanks.

eduardomarques

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #21 on: May 08, 2013, 01:10:54 AM »
This looks amazing. I'd love to get osc data in Unity.
I'm having trouble getting it to work though. Apparently no data is coming through. I'm sending data from processing to unity (a float) but i'm not getting any data in unity...
Has anyone tested it on the latest version of unity?

bicycler

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #22 on: May 09, 2013, 11:52:40 AM »
hey there, I also get the same problem, the correct values show up in the debug section of the PMOSC.sc, but nothing in the "get osc float", anybody can help? thanks


hey,

thanks for your implementation!
i tried to set it up, getting 3 floats from VDMX5 (lo, mid, hi) to unity over OSC.
the correct values show up in the debug section of the PMOSC.cs,
but the playmaker actions (get osc float) don't seem to be able to get the values.
(i'm on unity4 and pm 1.5.3)
any ideas? thanks.

Drakon

  • Playmaker Newbie
  • *
  • Posts: 21
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #23 on: May 23, 2013, 11:19:41 AM »
Can't wait to try it out! Any youtube clips of it  connecting with an Daw like Reaktor or VJ apps - Touch FTE, Max/Msp?

trashtrash

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #24 on: September 28, 2014, 09:34:16 PM »
Hi could someone help me I was using this system for a year with no problems but then I upgraded unity now whenever I try to get OSC in unity is give me NullReferenceException: Object reference not set to an instance of an object....please help I really need this to work soon

henrygordon

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #25 on: November 01, 2014, 09:17:16 PM »
Did you ever tried reverting the OCS to its default or remove it first and have it install again with the new update built-in? I have learned that after doing same idea from the games I am doing at http://www.igamesforgirls.com/cartoon.
« Last Edit: November 01, 2014, 09:25:12 PM by henrygordon »

Ubik3D

  • Playmaker Newbie
  • *
  • Posts: 22
    • View Profile
    • www.hypnorama.se
Re: Can playmaker support OSC? like touchosc?
« Reply #26 on: November 26, 2017, 04:12:53 PM »
I try to use the OSC scripts with 2017.2. It works in editor, but in build mode it does not recieve any OSC.

Can anyone help?

I get this error message in the editor:
Quote
ThreadAbortExceptionSystem.Net.Sockets.SocketException: The descriptor is not a socket
  at System.Net.Sockets.Socket.ReceiveFrom_nochecks_exc (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags, System.Net.EndPoint& remote_end, Boolean throwOnError, System.Int32& error) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket.ReceiveFrom_nochecks (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags, System.Net.EndPoint& remote_end) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.Socket.ReceiveFrom (System.Byte[] buffer, System.Net.EndPoint& remoteEP) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.UdpClient.Receive (System.Net.IPEndPoint& remoteEP) [0x00000] in <filename unknown>:0
  at UDPPacketIO.ReceivePacket (System.Byte[] buffer) [0x0003e] in /Users/Daniel/Atelje/Programmering/Unity Projekt/Unity 2017/2017-OSC-PLAYMAKER-FUNNEL/2017-OSC/Assets/Plugins/UDPPacketIO.cs:129
  at Osc.Read () [0x0001a] in /Users/Daniel/Atelje/Programmering/Unity Projekt/Unity 2017/2017-OSC-PLAYMAKER-FUNNEL/2017-OSC/Assets/Plugins/Osc.cs:210
UnityEngine.Debug:Log(Object)
Osc:Read() (at Assets/Plugins/Osc.cs:239)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15495
  • Official Playmaker Support
    • View Profile
Re: Can playmaker support OSC? like touchosc?
« Reply #27 on: December 01, 2017, 01:39:30 AM »
Hi,

 unfortunatly, It's not PlayMaker related and I have no experience with OSC myself, have you askled on Unity forum?

 Bye,

 Jean