Team EEG2MAX Captain’s Log: A Sorrowful Yet Incredible Journey

Team: Danny, David, Jacob Ford, Marc Shifflett

Emotiv EPOC and Max

The goal: Create a software interface between the Emotiv EPOC and Max
using the Emotiv EPOC to control the Max signal processor.

David brought his Emotiv headset and the Max and the music. Danny
brought his C programming genius. Jacob his creative design logic and
Marc his enthusiasm to break things.

List of annoying issues we encountered early in the process:

  1. Emotive SDK cd not Mac compatible 🙂 So much for cross platform love.
  2. Dousing the saline to terminals is tedious. Tricky getting nodes
    to activate fully or as fully as possible. The were some nodes that
    never seemed to get the green light in the apps front-end head map
    display.
  3. Emotiv: training actions and movements
    1. This seems to be a bit of a black art. Needs to be more fully
      tested. Providing an accurate baseline might aid in the future
      refinement of control of the Max
    2. Discovered the ability to assign facial movements to keystrokes
      or mouse events.

We first set out to build a rudimentary app using the Emotiv SDK that
would recognize an EPOC parameter.

And here were the issues we encountered which in a nutshell can be
described simply as a cross-platform dev rabbit-hole. We slid down it
bravely.

  • Emotiv SDK initially complained that edk.dll which came with the
    SDK was not properly formatted. Copied original edk c# src file to
    fix.
  • Created an executable in Windows but conversion to .app on OSX
    fails with errors.
  • Tried open-source Mono to build an OSX .app but was aborted in
    favor of:

Emokit https://github.com/openyou/emokit The following is copied
verbatim from the emokit github project, just sayin.

“Emokit is a set of language for user space access to the
raw stream data from the Emotiv EPOC headset. Note that this will not
give you processed data, just the raw sensor data.”

  • Time over. Clock zero.

With no more time to waste we reaccessed, dialed back, and of course
quickly discovered an ArduinoToMax hack (see comment 1). So we
promptly revectored.

Perhaps this should be labeled ‘a new interim goal’: Remove the Emotiv
device entirely from the equation and using the serial data from the
Arduino hack the Max to use that serial data for sound output.
Building a working prototype might help inform an eventual Emotiv
hack.

Sound like a plan? Care to comment?

And now, Jacob’s Little Corner in which, while the other guys are getting MAX and EPOC to play nice, I try building something with a hacked Mindflex and Arduino that can hopefully be integrated into their project.

The other guys are deep into MAX MSP and are not to be interrupted, so I think I will go build something with the Mindflex Duel. Let us begin.

Soldiered and hacked, ready to go. Arduino library downloaded. Not working.

Bug 1: battery in backwards. Tends to do the trick. Success.

Working. Let’s see if I can get the cool Processing graph working.

Protip: If it does not work at first in Processing, you’ll need to change the serial index from the default of serial = new Serial(this, Serial.list()[0], 9600);. Read the beginning of error output from Processing and find the index number of your Arduino. For me, it was [8]. Then place that back in the line, like serial = new Serial(this, Serial.list()[8], 9600);.

My plan is now to code something in Arduino that will convert EEG patterns to mouse movements which could be picked up by MAX to play a theramin.

First sketch of an idea, what some might call a Goal: tell Arduino how to parse the serial lines coming from the Mindflex, and then extract two values I want, then convert those values to x and y mouse positions. I’m thinking meditation for y and low beta for x. That way, as you get into the music and your meditation values rise, the theramin will start playing a moody solo based upon your high beta brain activity.

But wait! After spending only an hour figuring out the best way to parse serial, I discovered the Brain Library already has methods to grab individual brainwave values. For example, readMeditation();.

New problem: the Mindflex is being finicky about connection strength and only intermittently feeding me Attention and Meditation values. So I might have to only work with high beta.

Double new problem: the Arduino Mouse library is just plain not working in my sketch. And it’s 7:20pm, so I might just have to put it on hold and write this. Maybe, just maybe, I’ll still procure a Mindflex headset as a prize.

Future goals:

  • Get Mouse working. Should just be something dumb I’m doing. Or not doing.
  • Make the sensor more sensitive and such, among other alliterations.
  • Be happy at myself for finally attending a hackathon. I didn’t feel clueless and there was pizza.

Marc Shifflett and team EEG2MAX

Advertisements

One response to “Team EEG2MAX Captain’s Log: A Sorrowful Yet Incredible Journey

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s