INTERACTION DESIGN STUDIO
Alis Blog Processing and EEG

PROCESSING AND EEG PART 2

VISUALIZING DATA




In the first sketch, the task was to create a connection between Processing and Mindwave. We gathered the brainwave data packages through TGC Connector library and printed the values on the screen. Now we may start to play with these values and visualize them.

import neurosky.*;
import org.json.*;

ThinkGearSocket neuroSocket;

int attention, meditation, delta, theta, low_alpha, high_alpha, low_beta, high_beta, low_gamma, mid_gamma, sig, blinkStrength;

int diam = 0;
float centX, centY;

void setup() {
    frameRate(1);

    size(500, 500);

    ThinkGearSocket neuroSocket = new ThinkGearSocket(this);

    try {
        neuroSocket.start();
    }

    catch (Exception e) {
        println("Is ThinkGear running??");
    }

    smooth();
    centX = width/2;
    centY = height/2;
    noFill();
    strokeWeight(1);
}

void draw() {

    println("Attention: "+attention+" - Meditation: "+meditation);
    ellipse(centX, centY, (attention*3), (meditation*3));
}

...

 

Basically, every second, the ATTENTION and MEDITATION values are visualized with an ellipse drawn onto the stage. Y-axis is for Meditation Value and X-axis for Attention. If Attention value is higher than Meditation, the ellipse will be vertical whereas, on the contrary, the ellipse will be horizontal.

Neurosky Mindwave Processing Sketch 02

If we keep the sketch running for a while, a pattern starts to emerge by the changes in the value of Attention and Meditation levels. By playing and modifying the variables in the code, new ideas about generative patterns can be derived.

Neurosky Mindwave Processing Sketch 02

Sketch file can be downloaded from here:

Keep hacking 😉