TAD2011.02 Emotiv EPOC Video Recorder

Second TAD project (with video). [2013.12.09: the TAD website has been offline for a while now]

Emotiv EPOC Video Recorder

Here is the source code:

/**
 * EPOC Recorder 1
 * by Joshua Madara, hyperRitual.com
 * This sketch records graphical data from the Emotiv 
 * EPOC via OSC messages, as a .mov video file.
 */

import oscP5.*;
import processing.video.*;

// declare objects
OscP5 oscP5;
MovieMaker mm;
Format formatter;
PFont miniMono;
Date time;

int barColor = (color(255,0,0));

void setup() {
  size(320, 240);
  background(0);
  rectMode(CORNERS);
  
  // listen for OSC messages on port 7400
  oscP5 = new OscP5(this, 7400);
  
  // plug the messages from COG/PUSH to function makeFrame()
  oscP5.plug(this,"makeFrame","/COG/PUSH");
  
  // load MiniMono font
  miniMono = loadFont("MiniMono.vlw");
  textFont(miniMono);
  
  // format timestamp
  formatter = new SimpleDateFormat("HH:mm:ss:SSS");
  
  // Create MovieMaker object with size, filename,
  // framerate, compression codec and quality
  mm = new MovieMaker(this, width, height, "epoc_record.mov",
                       30, MovieMaker.H263, MovieMaker.LOSSLESS);
}

void draw() {
  // not used
}

// for each new event, add a frame to the video
void makeFrame(float pushValue) {
  background(0); // clear screen
  
  // update and draw timestamp and COG/PUSH value
  /* note that the time here is the local time when the 
  event is recorded, not a count-up timer that initiates 
  when recording begins, although that could be implemented */
  time = new Date();
  String timestamp = formatter.format(time);
  fill(255);
  text("Time: "+timestamp+"  Value: "+pushValue, 5, 10);
  
  // draw horizontal lines
  for (int i = 0; i <= 10; i++) {
    stroke(map(i, 0, 10, 255, 0));
    float yPos = map(i, 0, 10, 20, 220);
    line(100, yPos, 220, yPos);
  }
  
  // draw bar
  float barHeight = map(pushValue, 0, 1, 220, 20);
  noStroke();
  fill(barColor, 100);
  rect(width/2 - 20, 220, width/2 + 20, barHeight);
  
  // write pixels to video frame
  mm.addFrame();
}

// press space bar to finish the video
void keyPressed() {
  if (key == ' ') {
    mm.finish();
  }
}

TAD2011.01 Emotiv EPOC Data Logger

My first TAD project is a Processing sketch to log data from the Emotiv EPOC via OSC messages, to a tab-delimited text file.

import oscP5.*;

// declare objects
OscP5 oscP5;
PrintWriter output;
Format formatter;

void setup() {
  // listen for OSC messages on port 7400
  oscP5 = new OscP5(this, 7400);
  
  // create a file to log data to
  output = createWriter("epoc_log.txt");
  
  // format timestamp for the log entries
  formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss.SSS");
}

void draw() {
  // this sketch does not draw anything specific
}

// receive, parse, and write OSC data to the log file
void oscEvent(OscMessage theOscMessage) {
  Date date = new Date(); // get the current timestamp
  String dateTime = formatter.format(date); // format the timestamp
  String event = theOscMessage.addrPattern(); // get the message's address pattern
  float value = theOscMessage.get(0).floatValue(); // get the message's value
  output.println(dateTime+"\t"+event+"\t"+value); // write it all to the log file
}

// press any key to save the data
void keyPressed() {
  output.flush(); // write the remaining data
  output.close(); // finish the file
  exit(); // stop the program
}

This variation inserts the date into the file name, and only the time (instead of the date and time) into the log file.

/**
 * EPOC Logger 2
 * by Joshua Madara, hyperRitual.com
 * This sketch logs data from the Emotiv EPOC via
 * OSC messages, to a tab-delimited text file.
 */

import oscP5.*;

// declare objects
OscP5 oscP5;
PrintWriter output;
Format dateForm;
Format timeForm;

void setup() {
  // listen for OSC messages on port 7400
  oscP5 = new OscP5(this, 7400);
  
  // format datestamp for the file name
  dateForm = new SimpleDateFormat("yyyy_MM_dd");
  
  // format timestamp for the the log entries
  timeForm = new SimpleDateFormat("HH.mm.ss.SSS");
  
  // create a file to log data to
  Date date = new Date(); // get the current date
  String dateS = dateForm.format(date); // format the date
  output = createWriter("epoc_log_"+dateS+".txt"); // include the date in the file name
}

void draw() {
  // this sketch does not draw anything specific
}

// receive, parse, and write OSC data to the log file
void oscEvent(OscMessage theOscMessage) {
  Date time = new Date(); // get the current time
  String timeS = timeForm.format(time); // format the time
  String event = theOscMessage.addrPattern(); // get the message's address pattern
  float value = theOscMessage.get(0).floatValue(); // get the message's value
  output.println(timeS+"\t"+event+"\t"+value); // write it all to the log file
}

// press any key to save the data
void keyPressed() {
  output.flush(); // write the remaining data
  output.close(); // finish the file
  exit(); // stop the program
}

Google Ngram Viewer: Magick

Go to this link to see a graph of the occurrence of the word magick between years 1800 and 2008, as collected from the Google Books collection, courtesy of the Google Books Ngram Viewer. I suspect the bump around 1900 is due to Crowley. Links at the bottom of that page show you the individual books the word is found in, which are great for finding gems such as this:

The animal body is a description of Leyden phial, or magick battery, in one part of which there is an excess of electricity and in the other a deficiency. The conducting body communicates the fluid of the part where it is abundant to the part where it is defective; and in this passage of the electricity, the muscular contractions are obtained in the same way as the discharges that are produced by the Leyden phial or magick batteries. // Thomas Green Fessenden, The Modern Philosopher:
Or Terrible Tractoration! in Four Cantos, Most Respectfully Addressed to the Royal College of Physicians, London

Evocation and Invocation with EPOC

Related articles: FBLR Mind-Controlled Robot | Ideas for Experimenting with EPOC + Meta-Magick

Here are synopses for two exhibitions I am developing, that experiment with the Emotiv EPOC‘s ability to recognize state transitions corresponding to occult activity.

Evocation

A human actor evokes (i.e. draws out) an entity and projects it into a defined space such as the Triangle of Art in Solomonic evocation (see below). The actor wears an EPOC headset that, having been previously trained, recognizes her intention to project the entity, and signals the activation of a robot occupying the same space. The overall effect is of having magically evoked the spirit into the robot body. (I am not presently concerned with the robot’s subsequent behavior, but will elsewhere address magical behavior in robots, perhaps as addendum to this project.)

Triangle of Art
(thanks to Osiris for the image)

Invocation

This project was inspired by a scene from Ghostbusters: Louis Tully (played by Rick Moranis) has been possessed by Vinz Clortho, arrested by the New York City police, and delivered into the hands of Egon Spengler (played by Harold Ramis) who connects Louis-Vinz to an EEG-looking device capable of showing the demon within him on a sort of spectral (pun intended) analysis monitor. The project plays with the idea that who we are on the “inside” — our so-called spirit or soul — may appear differently to an observer than our “outside”/physical appearance to the same or other observers.

Vinz Clortho

A human actor wearing an EPOC headset is observed by a video camera that transmits a moving image of her profile to a viewing screen. She invokes (i.e. draws in) an entity, and her invocation is detected by the EPOC which alters the signal between the video camera and monitor, in a manner corresponding to the nature of the entity invoked. Alternatively, a still image of the actor’s face is projected and then switched to or morphed into the face of the entity during the invocation.