NeuroSky ThinkGear technology digitizes analog electrical brainwaves to power the user-interface of games, education and investigative applications. A hurdle lies in distinguishing brain signal from the noise that comes from ambient electricity, muscle movement, etc. Such interferences are digitally filtered and eliminated. Raw brain signals are amplified and processed —delivering concise input to the device. Algorithms come from both NeuroSky as well as research institutions and universities, and currently include “attention”, “meditation,” and physical eyeblinks.
The MindWave device can be purchased from online retailers for approximately $80. Before using the device some software utilities will have be installed on the local machine, such as the MindWave Manager, which pairs the headset with a USB receiver called a dongle.
In addition, an open source utility, BrainOSC, needs to be downloaded and installed that converts the output of the MindWave to OSC.
Note that the IP address of the local machine needs to be used - localhost (127.0.0.1) does not seem to work if the machine is on a network. The port is set to the same port as specified in the Lingo code of the Adobe Director application that is receiving the OSC output. (In our demo we used port 3000).
Run the demo file OSCdecode.dir to inspect the data being sent by BrainOSC. There are 2 fields, "Last OSC Received" and "Full Trace". Note that the data is labeled.
From this demo we were able to construct our own application, by parsing the bundle and creating global variables of index items in the list. This allowed us to display those values in separate fields, or use the values to manipulate onscreen elements or trigger events, like playing a sound. The demo, MindWave.dir, is on the lab's fileserver in the 323 Groups directory, in the novel interfaces folder.
Here are the MindWave-specific data globals declared in the "Declare Globals" Lingo script:
Here is the parsing of the bundle in the on idle handler of the same script:
if (bundle.count = 16) then
signal_quality = bundle & RETURN
contact = bundle & RETURN
attention = bundle & RETURN
meditation = bundle & RETURN
raw = bundle & RETURN
blink = bundle & RETURN
total_activity = bundle & RETURN
delta = bundle & RETURN
theta = bundle & RETURN
alpha1 = bundle & RETURN
alpha2 = bundle & RETURN
beta1 = bundle & RETURN
beta2 = bundle & RETURN
gamma1 = bundle & RETURN
gamma2 = bundle & RETURN
member("signal_quality").text = signal_quality
member("contact").text = contact
member("attention").text = attention
member("meditation").text = meditation
member("raw").text = raw
member("blink").text = blink
member("total_activity").text = total_activity
member("delta").text = delta
member("theta").text = theta
member("alpha1").text = alpha1
member("alpha2").text = alpha2
member("beta1").text = beta1
member("beta2").text = beta2
member("gamma1").text = gamma1
member("gamma2").text = gamma2
This allows us to treat the values disceetly, to put them in separate fields, or to use the values to trigger events in the interface. Note that we check to see if the count of the items in the index equals 16 in a conditional statement, in case one of the values goes out of range, we loop back through the script until it is found again. If we don't do that the program will crash.
On a looping frame script we use the values to scale a sprite and to play a sound. The function value converts a string to a numerical value.
on exitFrame me
sprite(48).width = 200 * value(attention)
sprite(48).height = 200 * value(attention)
if (value(blink) > 0) then
go the frame
The demo file MindWave.dir and the supporting file BrainOSC are in Groups > 323 > Novel Inputs > MindWave on the file server.
Thanks to Ryan Walsh for assistance with this demo.