npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-muse

v1.1.0

Published

An event driven OSC message receiver for the Muse Brainwave Band made with Node.JS.

Downloads

40

Readme

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