node-muse
The unofficial OSC message receiver for the Muse Brainwave Band made with Node.JS
Last updated 5 years ago by shapoc .
GPLv3 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-muse 
SYNC missed versions from official npm registry.

Node Muse

npm version Build Status

An NPM module which provides an event driven OSC message receiver for the Muse Brainwave Band.

This NPM module will create a server which automatically connects to the Muse, keeps the connection open and reconnects if necessary. During the open connection the server will receive all of the signals the Muse has to offer and translates them to neat little strings and objects. The open server offers an observer type pattern, allowing the user to subscribe to these signals in an event driven way.

How to install this?

$ npm install node-muse

Now what?

Require the module

As any other node module you can hereafter require it inside your node application. This will give you access to the two parts of which the module exists. The OSC receiver and the Muse message event system.

var nodeMuse = require("node-muse");

var Muse = nodeMuse.Muse;
var OSC = nodeMuse.OSC;

Open a connection

// Opens a muse server and waits for the muse to interact with it.
// Optionally it's possible to use the parameters connect( [HOST] , [PORT] );
// These default to 127.0.0.1 , 5002
nodeMuse.connect();

Most of the time, you won't be needing the OSC receiver and you will be talking directly to the Muse message event system. Therefore, you can also chain the connect function.

// Opens a muse server and waits for the muse to interact with it.
// Optionally it's possible to use the parameters connect( [HOST] , [PORT] );
// These default to 127.0.0.1 , 5002
// Returns the Muse object for easy use.
var Muse = nodeMuse.connect().Muse;

Once the server is waiting for the Muse to connect, it's probably wise to connect your Muse via Bluetooth. Whenever the Muse establishes a connection via Bluetooth, the Node Muse server will automatically pick it up and start to receive events from it.

Receive events

The entire thing is event driven and all you need to do from here is subscribe to these events.

Muse.on('connected', function(){
    // There's definitely a muse connected right now!
});

Muse.on('uncertain', function(){
    // For some reason, i'm not detecting the muse anymore at the moment...
    // Waiting for new signals to arrive...
})

Muse.on('disconnected', function(){
    // Nope, it's definitely not connected anymore...
});

Receiving data from the paths the Muse provides works the same way. You can find all the paths the Muse has to offer on Muse's developer resources page.

E.G.:

Muse.on('/muse/batt', function(){
    // I'm getting battery information every 10 seconds!
});

Muse.on('/muse/elements/blink', function(){
    // Staring contest getting serious...
});

Muse.on('/muse/eeg', function(){
    // Receiving EEG signals!
});

Etc...

More information

Even though you can receive configurations through a path (/muse/config) as well, this module also provides a simple config object.

// A configuration object containing information about the Muse connected.
Muse.config;

And that's about it really...

HALP

Examples are included in the examples folder.

Why on earth did you build this?

For my research on virtual reality sickness I needed some form of assurance whether the person I was testing with wasn't holding feelings back and acting tough. So I tried to use the Muse Headband to track down a disturbance in the force (brainwaves) on stressful moments.

Turns out, the default support and tools for the Muse Headband wasn't that great at that point. So I decided to build a simple node server capable of connecting to the muse and delivering messages from the muse in a friendly way.

How about a license of some sort?

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007

As seen here: GPLv3 License

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

4 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |