sharpOSC example doesn't work


#1

Hi, I just had a Muse headband.

It worked fine when trying to receive data from the Muse Direct application.

And I want to receive data directly from the Muse using the C # language.

So, i tried to execute sharpOSC example source code in http://developer.choosemuse.com/research-tools-example/grabbing-data-from-museio-a-few-simple-examples-of-muse-osc-servers.

But it didn’t work.

How can i receive eeg data from Muse Headband using C# language in realtime


#2

Here’s the main code section from the app I use to test Muse Monitor

clearMessages();
// The cabllback function
HandleOscPacket callback = delegate (OscPacket packet)
{
    var messageReceived = (OscBundle)packet;
    OscBundle bundle = (OscBundle)packet;
    DateTime dt = SharpOSC.Utils.TimetagToDateTime(bundle.Timetag);
    foreach (OscMessage message in bundle.Messages)
    {
        String text;
        if (checkBoxUTC.Checked)
        {
            text = dt.ToString("yyyy-MM-dd HH:mm:ss.fff tt")+" UTC";
        }
        else
        {
            text = dt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss.fff tt")+" Local";
        }
        text += " " + message.Address;
        if (message.Arguments.Count > 0)
        {
            text += " [" + message.Arguments.First().ToString() + "]";
        }
        if (message.Arguments.Count > 1)
        {
            foreach (object obj in message.Arguments.Skip(1))
            {
                text += ", [" + obj.ToString() + "]";
            }
        }

        if (stream)
        {
            messages.Add(text);
        } else
        {
            if (messageDict.ContainsKey(message.Address))
            {
                messageDict[message.Address] = text;
            } else
            {
                messageDict.Add(message.Address, text);
            }
        }
    }
    
    updateMessageBox();
};
listener = new UDPListener(5000, callback);

#3

Thanks for replying.

I tried to get the packet using the sharpOSC library and it worked fine.

I used Muse Direct application for generating OSC packet.

But I don’t want to use Muse Direct application. I want an independent application that gets raw EEG data directly from the Muse Headband.

I want to implement the function that Muse Direct generates OSC packet.

How can i get information about it?


#4

If you don’t want to use the Interaxon SDK, you can connect directly to the headband over bluetooth.
See the example here by Alexandre Barachant