Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Muse 2016 EEG Headset JavaScript Library (using Web Bluetooth)

License

NotificationsYou must be signed in to change notification settings

urish/muse-js

Repository files navigation

Build Status

Muse 1, Muse 2, and Muse S EEG Headset JavaScript Library (using Web Bluetooth).

Running the demo app

yarnyarn start

and then openhttp://localhost:4445/

Usage example

import{MuseClient}from'muse-js';asyncfunctionmain(){letclient=newMuseClient();awaitclient.connect();awaitclient.start();client.eegReadings.subscribe(reading=>{console.log(reading);});client.telemetryData.subscribe(telemetry=>{console.log(telemetry);});client.accelerometerData.subscribe(acceleration=>{console.log(acceleration);});}main();

Using in node.js

You can use this library to connect to the Muse EEG headset from your node.js application.Use thebleat package which emulates the Web Bluetooth API on top ofnoble:

constnoble=require('noble');constbluetooth=require('bleat').webbluetooth;asyncfunctionconnect(){letdevice=awaitbluetooth.requestDevice({filters:[{services:[MUSE_SERVICE]}]});constgatt=awaitdevice.gatt.connect();constclient=newMuseClient();awaitclient.connect(gatt);awaitclient.start();// Now do whatever with muse client...}noble.on('stateChange',(state)=>{if(state==='poweredOn'){connect();}});

You can find a fully working example in themuse-lsl repo.

Auxiliary Electrode

The Muse 2016 EEG headsets contains four electrodes, and you can connect an additional Auxiliary electrode through the Micro USB port. By default, muse-js does not read data from the Auxiliary electrode channel. You can change this behavior and enable the Auxiliary electrode by setting theenableAux property totrue, just before calling theconnect method:

asyncfunctionmain(){letclient=newMuseClient();client.enableAux=true;awaitclient.connect();}

PPG (Photoplethysmography) / Optical Sensor

The Muse 2 and Muse S contain PPG/optical blood sensors, which this library supports. There are three signal streams, ppg1, ppg2, and ppg3. These are ambient, infrared, and red (respectively) on the Muse 2, and (we think, unconfirmed) infrared, green, and unknown (respectively) on the Muse S. To use PPG, ensure you enable it before connecting to a Muse. PPG is not present and thus will not work on Muse 1/1.5, and enabling it may have unexpected consequences.

To enable PPG:

asyncfunctionmain(){letclient=newMuseClient();client.enablePpg=true;awaitclient.connect();}

To subscribe and receive values from PPG, it's just like subscribing to EEG (seeUsage Example):

client.ppgReadings.subscribe((ppgreading)=>{console.log(ppgreading);});

Event Markers

For convenience, there is aneventMarkers stream included inMuseClient that you can use in order to introduce timestamped event markers into your project. Just subscribe toeventMarkers and use theinjectMarker method with the value and optional timestamp of an event to send it through the stream.

asyncfunctionmain(){letclient=newMuseClient();client.eventMarkers.subscribe((event)=>{console.log(event);});client.injectMarker("house")client.injectMarker("face")client.injectMarker("dog")}

Projects using muse-js

  • EEGEdu - Interactive Brain Playground.Source code using React, Polaris and chartjs.
  • EEG Explorer - Visual EEG readings from the Muse EEG Headset.Source code using Angular, Material Design and smoothie charts.

[8]ページ先頭

©2009-2025 Movatter.jp