Trouble connecting Muse + Unity


#1

I’m having trouble connecting Muse with the provided Unity Example Project. I used the example which can be downloaded here but once i’ve done the steps it just keeps giving me an Object reference not set to an instance of an object at the first line that calls for the muse to respond (Debug.Log("Libmuse version = " + muse.getLibmuseVersion());).

I have the Muse IO open which says that Muse is waiting for a listening process. Once I start this using the MuseLab and connecting to port 5000 it recieves data. How do I make this work for Unity? Because I am stuck and can’t find any other example projects to test. Any help would be appreciated!

Some things to note:
I have the Muse 2014 Headband, am using Unity 5.5.0f3
I just want RAW data that I can put into a UI text object in unity


#2

Have since fixed this and got it to work sending raw data and recieving this in Unity using C#.


#3

Thank you for this information! Would you mind sharing the C# script you wrote to fix it?


#4

I have the same problem. Can you share you solved it please. Thank you!


#5

Yes, Luedrin, please share your solution!


#6

Not sure if people are still interested but this can be used to get data by using Muse-Lab as a middleman.

http://thomasfredericks.github.io/UnityOSC/

Step 1: Use the above project.
Step 2: IIn MuseLab, set a UDP outgoing connection to a port of your choice(Lets say 5005)
Step 3: in Unity, set the editor to receive data on that port(5005 if you are using that).
Step 4: In the incoming script, write code to set the values as needed. (I did it by using a global Config script that stores public variables that change every time there is an OSC input)
Step 5: Use the global variables to access Muse Data.

Using MuseLab allows you to only send packets that you need specifically, greatly aiding processing power.

I have used it to develop a VR application. Shoot me a message if you need help. It might not be the most elegant option, but this is a hacked together solution that works!


Libmuse support for desktop (Unity)
#7

I am seeing the same issue as the OP, where I get a nullreferenceexception: “Object reference not set to an instance of an object”.

Is there a public solution for this?

Thanks!


#9

Hi I am looking at this strategy for a VR application as well can I shoot you a message?


#10

Messaged you


#11

I’ve been having the same issue Object reference not set to an instance of an object as well. Any tips will be appreciated.