Working with MUSE
What is provide here is our current methodology for working with the Muse EEG headband. To the best of our knowledge, what is provided here works with all versions of Muse - the original Muse, Muse 1, Muse 2 (pictured above), and Muse S. To work with Muse, there are three principle steps described below: 1) Connecting to Muse, 2) Recording / Reading Muse data, and 3) Converting Muse data. Our analysis steps for processing Muse data are on a separate page which can be found HERE (MATLAB) and HERE (Brain Vision Analyzer).
1. Connecting to Muse
Muse EEG headbands transmit their data via Bluetooth. So, in order to see this data you need to establish a Bluetooth connection with a given Muse EEG headband. You can do that using BlueMuse or our own uvicMuse code (see below) which works on the Windows, OSX, and Linux operating systems.
On Windows, you will need to use THIS version of uvicMuse and a low energy BLED 112 USB dongle to stream data. A lot of times we get asked about which BLED 112 dongle to buy (there are a lot) - we currently recommend the Saberent USB 4.0 Bluetooth Micro Adapter.
If you are working with OSX or Linux you do not need a BLED dongle as THIS version of uvicMuse will pair directly with onboard Bluetooth on your laptop.
Note, you will need to have Python installed for BlueMuse or uvicMuse to work. See the notes on our GitHub. There are also some other Python packages which you need which are listed in the install instructions for both pieces of software.
BlueMuse and uvicMuse are programs that connects to Muse headsets and stream data utilizing the Lab-Streaming Layer (LSL) - a software package and protocol developed at UCSD. Note, uvicMuse also allows the streaming of data in the UDP format.
To summarize - BlueMuse and uvicMuse allow you to connect to a Muse headband and then stream the data out via UDP and/or the LSL formats.
The code and instructions for installing using BlueMuse can be found HERE.
The code and the Instructions for installing and using uvicMuse on OSX/Linux can be found HERE or with BLED on Windows HERE.
On Windows, you will need to use THIS version of uvicMuse and a low energy BLED 112 USB dongle to stream data. A lot of times we get asked about which BLED 112 dongle to buy (there are a lot) - we currently recommend the Saberent USB 4.0 Bluetooth Micro Adapter.
If you are working with OSX or Linux you do not need a BLED dongle as THIS version of uvicMuse will pair directly with onboard Bluetooth on your laptop.
Note, you will need to have Python installed for BlueMuse or uvicMuse to work. See the notes on our GitHub. There are also some other Python packages which you need which are listed in the install instructions for both pieces of software.
BlueMuse and uvicMuse are programs that connects to Muse headsets and stream data utilizing the Lab-Streaming Layer (LSL) - a software package and protocol developed at UCSD. Note, uvicMuse also allows the streaming of data in the UDP format.
To summarize - BlueMuse and uvicMuse allow you to connect to a Muse headband and then stream the data out via UDP and/or the LSL formats.
The code and instructions for installing using BlueMuse can be found HERE.
The code and the Instructions for installing and using uvicMuse on OSX/Linux can be found HERE or with BLED on Windows HERE.
2. Recording / Reading Muse Data
Recording Raw EEG Data
The easiest way to record Muse data is to use LSL's Lab Recorder software. Lab Recorder is an open source program that will see the LSL "stream" coming from BlueMuse or uvicMuse. In BlueMuse or uvicMuse you need to ensure that you select to stream data to LSL. Once done, you will see the Muse data stream in Lab Recorder it is easy to record Muse data by simply hitting record. A couple of things to note.
In sum, Lab Recorder works well and precompiled versions are available HERE for Windows, OSX, and Linux.
ERPs
You can do ERP research with Muse using Lab Recorder as it is possible to send event markers to Lab Recorder from both MATLAB and Python. To do this in MATLAB you need to do two things:
One, open the stream to LabRecorder to send markers:
lib = lsl_loadlib(); %Load LSL libraries
info = lsl_streaminfo(lib,'Markers','Markers',1,0,'cf_string','myuniquesourceid23443'); %Create marker stream
outlet = lsl_outlet(info); %Open connection to export markers
Two, you need to send a marker when events occur:
outlet.push_sample({num2str(marker)},0);
Full instructions on how to do this in MATLAB can be found HERE in software developed by Chad Williams and sample code he developed to do it is HERE. Chad's full instructions are HERE. Additionally, HERE is some sample code showing how this works in a simple visual oddball task.
Reading Muse Data
If you are not interested in using Lab Recorder or perhaps you want to develop BCI applications it is possible to read Muse data directly into MATLAB and Python using both UDP and LSL.
UDP
The instructions and code on how to read Muse data into MATLAB in realtime via UDP can be found HERE.
LSL
We do not have a fully developed resource for this but here is some sample code:
Open an inlet stream to read data:
lib = lsl_loadlib(); %Load LSL libraries
result = lsl_resolve_byprop(lib,'type','EEG'); %Resolve EEG stream
inlet = lsl_inlet(result{1}); %Open connection to the Muse Headband
Read a chunk of data:
[vec,ts] = inlet.pull_chunk(); %Pull chunk of data since last pull
More detailed instructions can be found on the LSL Github page HERE.
The easiest way to record Muse data is to use LSL's Lab Recorder software. Lab Recorder is an open source program that will see the LSL "stream" coming from BlueMuse or uvicMuse. In BlueMuse or uvicMuse you need to ensure that you select to stream data to LSL. Once done, you will see the Muse data stream in Lab Recorder it is easy to record Muse data by simply hitting record. A couple of things to note.
In sum, Lab Recorder works well and precompiled versions are available HERE for Windows, OSX, and Linux.
ERPs
You can do ERP research with Muse using Lab Recorder as it is possible to send event markers to Lab Recorder from both MATLAB and Python. To do this in MATLAB you need to do two things:
One, open the stream to LabRecorder to send markers:
lib = lsl_loadlib(); %Load LSL libraries
info = lsl_streaminfo(lib,'Markers','Markers',1,0,'cf_string','myuniquesourceid23443'); %Create marker stream
outlet = lsl_outlet(info); %Open connection to export markers
Two, you need to send a marker when events occur:
outlet.push_sample({num2str(marker)},0);
Full instructions on how to do this in MATLAB can be found HERE in software developed by Chad Williams and sample code he developed to do it is HERE. Chad's full instructions are HERE. Additionally, HERE is some sample code showing how this works in a simple visual oddball task.
Reading Muse Data
If you are not interested in using Lab Recorder or perhaps you want to develop BCI applications it is possible to read Muse data directly into MATLAB and Python using both UDP and LSL.
UDP
The instructions and code on how to read Muse data into MATLAB in realtime via UDP can be found HERE.
LSL
We do not have a fully developed resource for this but here is some sample code:
Open an inlet stream to read data:
lib = lsl_loadlib(); %Load LSL libraries
result = lsl_resolve_byprop(lib,'type','EEG'); %Resolve EEG stream
inlet = lsl_inlet(result{1}); %Open connection to the Muse Headband
Read a chunk of data:
[vec,ts] = inlet.pull_chunk(); %Pull chunk of data since last pull
More detailed instructions can be found on the LSL Github page HERE.
3. Converting Muse Data
If you have used Lab Recorder to record data then it is in the XDF format. There is some information HERE. To get XDF data into MATLAB you can use the conversion code HERE for EEGLAB format.
Additionally, to convert the data into an EEGLAB or Brain Vision Analyzer format you can use the code developed by Chad Williams HERE. Note, if you are trying to get the data into EEGLAB format convert to Brain Vision Analyzer and you will see that an EEGLAB structure variable EEG is created in MATLAB as a part of this process.
Additionally, to convert the data into an EEGLAB or Brain Vision Analyzer format you can use the code developed by Chad Williams HERE. Note, if you are trying to get the data into EEGLAB format convert to Brain Vision Analyzer and you will see that an EEGLAB structure variable EEG is created in MATLAB as a part of this process.