How to stream live data from muse?

musemonitor

#1

Hi,
I want to write my own application with visual studio/matlab, and i use muse 2016.
I have Muse Monitor and i stream the data via Muse Lab.
But, how can i use the live data in matlab or other programs?
Thank you.


#2

If you want to write something in Visual Studio, I can highly recommend SharpOSC by Valdemar Erlingsson.

Here’s a some sample C#.Net code I wrote for testing Muse Monitor, to get you started:

HandleOscPacket callback = delegate (OscPacket packet)
{
    var messageReceived = (OscBundle)packet;
    OscBundle bundle = (OscBundle)packet;
    DateTime dt = SharpOSC.Utils.TimetagToDateTime(bundle.Timetag);
    
    String timeStamp;
    if (UTCdate)
    {
        timeStamp = dt.ToString("yyyy-MM-dd HH:mm:ss.fff tt")+" UTC";
    } else {
        timeStamp = dt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss.fff tt")+" Local";
    }
    
    foreach (OscMessage message in bundle.Messages)
    {
        String messageText = "";
        if (message.Arguments.Count > 0)
        {
            messageText += " [" + message.Arguments.First().ToString() + "]";
        }
        if (message.Arguments.Count > 1)
        {
            foreach (object obj in message.Arguments.Skip(1))
            {
                messageText += ", [" + obj.ToString() + "]";
            }
        }
        //TODO Render/Process: timeStamp messageText
    }
};
listener = new UDPListener(5000, callback);

#3

Thank you,
Do you have something for C++?
I have one more question , do i need to write a program for connectivity of muse to the PC?


#4

You have to use Muse Monitor to stream the data to the PC as Interaxon currently do not have any PC software to connect to the Muse 2016 device directly. You can use their windows SDK to write your own connector if you like, but note that bluetooth on the PC is extremely variable, I purchased 3 different bluetooth USB dongles before I found one that worked OK with the Muse SDK. I plan to release a PC version of Muse Monitor at some time in the future, but right now my free time between my family and day job is very limited for coding!

Regarding C++, I’m not sure sorry. I’ve not coded in pure C++ since '98! so I’m a little rusty on that! … however a quick Goole of “C++ OSC” resulted in oscpack by Ross Bencina. At a cursory glace it looks good, but I’ve not personally tested it.


#5

Please please please get muse monitor up for PC! That would be awesome.
Also do you know how to get live or pre recorded muse data into mat lab and have it graphed?


#6

I don’t have any plans for a PC app at this time, sorry.

The conversion question is answered here. I’ve heard that it’s also possible to stream OSC direct to Mat Lab, but I don’t have it myself, so I’m not sure on the procedure.


#7

I know this thread started in August last year, but InteraXon’s Muse Direct (http://developer.choosemuse.com/tools/windows-tools/musedirect) works with the 2016 Muse headband, which you can have send OSC data to Muse Lab or any other program listening for OSC.

And yeah… Bluetooth on Windows can be pretty frustrating. It took me forever to get my headband to connect to Muse Direct without it breaking my other bluetooth devices.