AstroColorSound

This is a Processing sketch that returns colors and sounds corresponding to the astrological signs of the zodiac, in a fairly direct (and probably underwhelming) way. I have some ideas for developing more creative interactions, but for here and now I am documenting the correspondences and some simple code to interact with them.

AstroColorSound

Click the image to run the sketch in your browser (requires Java and JavaScript), or follow this link if that one is giving you trouble. You can view the source code here.

Below is a table of the correspondences I used and took from Case‘s Correlation of Sound and Color [1], which as far as I know he inherited from the Golden Dawn and the King Scale of Color.

Index Sign Color Dec Hex Sound Freq
1 Aries Red 255,0,0 FF0000 C 261.63
2 Taurus Red-Orange 255,64,0 FF4000 C# 277.18
3 Gemini Orange 255,128,0 FF8000 D 293.66
4 Cancer Orange-Yellow 255,192,0 FFC000 D# 311.13
5 Leo Yellow 255,255,0 FFFF00 E 329.63
6 Virgo Yellow-Green 128,192,0 80C000 F 349.23
7 Libra Green 0,128,0 008000 F# 369.99
8 Scorpio Green-Blue 0,128,128 008080 G 392
9 Sagittarius Blue 0,0,255 0000FF G# 415.30
10 Capricorn Blue-Violet 64,0,192 4000C0 A 440
11 Aquarius Violet 128,0,128 800080 A# 466.16
12 Pisces Violet-Red 192,0,64 C00040 B 493.88

The Colors

(The capitalized color names in the following paragraph refer to HTML color names. The mixes I made with this HTML color mixer.)

I had some options while mapping Case’s colors which were based on the RYB (subtractive) color model, to the RGB (additive) color space. I chose Green (008000) instead for Lime (00FF00) for green, and the middle of Red (FF0000) mixed with Blue (0000FF) for violet (= 800080, i.e. Purple), instead of Magenta (FF00FF). I could have used Aqua (00FFFF) for green-blue, or mixed Blue (0000FF) with the darker Green (008000) (= 004080), but instead chose the middle of Blue (0000FF) mixed with Lime (00FF00) to make my green-blue (008080). To make orange (FF4000), I used the middle of Red (FF0000) and Yellow (FFFF00).

If you have any ideas about the color correspondences in RGB/CYM space, please leave a comment below.

The Sounds

The sounds are generated by a monotone sine wave. I got the frequencies for the musical notes from this page.

Notes & References

  1. Paul Foster Case, Correlation of Sound and Color (Boston: The Hestia Publishing Co., 1931).

Processing + EPOC via OSC

Related articles: AffectCircles

How would you like to create interactive art that responds to your thoughts, moods, and facial expressions? Thanks to Mind Your OSCs and oscP5, interpreting the Emotiv EPOC‘s data within a Processing sketch (and by extension, Arduino) could not be easier, even with the consumer (i.e. most affordable) version of the EPOC. This effectively allows anyone to develop a great variety of (open-source, if desired) EPOC applications including physical computing, even if they have only the consumer headset [1].

Here is how it works. The EPOC headset and software read your neuroelectrical signals and interpret them as a set of predefined outputs that reflect your facial expressions, mood (excited, bored, meditative, etc.), and conscious intentions (see the EPOC docu for more info). Mind Your OSCs formats that output as a series of OSC messages, and sends them to a network port. Using oscP5, Processing can listen to that port and read any OSC messages that can then be parsed and their values assigned to variables that determine various interactions.

To begin, you need an Emotiv EPOC and the Mind Your OSCs application which you can download for free from the Emotiv store. If you want to experiment before committing to purchase the EPOC, you can download Emotiv’s SDK Lite for free, which includes an EPOC emulator and scripting tool called EmoComposer (also useful for testing interactions with Processing sketches without having the headset on). You also need to download and install Processing and the oscP5 library.

Connecting Processing to Mind Your OSCs

In the right-hand side of the Mind Your OSCs window, you can see the IP address and port number for data going out of Mind Your OSCs (connection info for data coming into Mind Your OSCs from the EPOC device or an emulator, etc., is displayed on the left-hand side of the window):

OSC Connection

In Processing’s setup() method, you set up a connection to the same port showing in Mind Your OSCs:

void setup() {
  //start oscP5, listening for incoming messages on port 7400
  //make sure this matches the port in Mind Your OSCs
  oscP5 = new OscP5(this, 7400);
}

Interpreting EPOC Events

Each OSC message sent from Mind Your OSCs has three parts:

  1. an Address Pattern in the form of /COG/PUSH (meaning Cognitiv suite → Push action, e.g.) [2]
  2. a Type Tag string that identifies the data type of the Argument (always ‘f’ for Mind Your OSCs, for floating point)
  3. one or more Arguments; for Mind Your OSC’s, always one argument, a floating point number between 0 and 1 that represents the value returned by the EPOC function identified by the Address Pattern

You can use the oscEvent() method to parse selected messages from Mind Your OSCs. Here is an example to select the messages corresponding to the Cognitiv suite’s (move) Left and Right actions, and assign their values to the variables left and right, respectively:

void oscEvent(OscMessage theOscMessage) {
  // check if theOscMessage has an address pattern we are looking for
  if(theOscMessage.checkAddrPattern("/COG/LEFT") == true) {
    // parse theOscMessage and extract the values from the OSC message arguments
    cogLeft = theOscMessage.get(0).floatValue();
  } else if (theOscMessage.checkAddrPattern("/COG/RIGHT") == true) {
    cogRight = theOscMessage.get(0).floatValue();
  }
}

Remember that even though the OSC messages from Mind Your OSCs have only one Argument each, OSC messages in general can have more than one, so they need to be treated like arrays. The statement left = theOscMessage.get(0).floatValue(); means “read the value at index 0 (i.e. the first and only value associated with a message sent from Mind Your OSCs) as a floating-point number, and assign it to the variable left.”

You can use oscP5’s plug() service to automatically forward select messages to your methods without having to parse them with oscEvent() (example).

Example Sketch

Here is an example Processing sketch that moves a circle left or right when the operator wearing the EPOC thinks, “move left,” or, “move right,” respectively (the Left and Right Cognitiv actions must be trained using the Emotiv software, prior to running the sketch).

ProcessingEpocOsc1 Screen Shot

/**
 * ProcessingEpocOsc1
 * by Joshua Madara, hyperRitual.com
 * demonstrates Processing + Emotiv EPOC via OSC
 * uses EPOC's Cognitiv Left and Right to move a circle
 * left or right
 */
 
import oscP5.*;
import netP5.*;

public float cogLeft = 0;
public float cogRight = 0;
int circleX = 240;

OscP5 oscP5;

void setup() {
  size(480, 360);
  frameRate(30);
  smooth();
  
  //start oscP5, listening for incoming messages on port 7400
  //make sure this matches the port in Mind Your OSCs
  oscP5 = new OscP5(this, 7400);
}

void draw() {
  background(0);
  
  // draw graph ticks
  int i;
  for (i = 1; i <= 11; i++) {
    stroke(map(i, 1, 11, 0, 255));
    float tickX = map(i, 1, 11, 60, 420);
    line(tickX, 250, tickX, 269);
    line(tickX, 310, tickX, 329);
  }
  noStroke();
  
  // draw bar graph
  drawBarGraph(cogLeft, 270);
  drawBarGraph(cogRight, 290);
  
  // determine whether to move circle left or right
  if((cogLeft >= 0.5) && (circleX >= 0)) {
    circleX -= 5;
  } else if ((cogRight >= 0.5) && (circleX <= 480)) {
    circleX += 5;
  }
  
  // draw circle
  fill(color(25, 249, 255));
  ellipse(circleX, 150, 90, 90);
}

void drawBarGraph(float cogVal, int barY) {
  if(cogVal >= 0.5) {
    fill(color(22, 255, 113));
  } else {
    fill(color(255, 0, 0));
  }
  float len = map(cogVal, 0.0, 1.0, 0, 360);
  rect(61, barY, len, 20);
}

void oscEvent(OscMessage theOscMessage) {
  // check if theOscMessage has an address pattern we are looking for
  if(theOscMessage.checkAddrPattern("/COG/LEFT") == true) {
    // parse theOscMessage and extract the values from the OSC message arguments
    cogLeft = theOscMessage.get(0).floatValue();
  } else if (theOscMessage.checkAddrPattern("/COG/RIGHT") == true) {
    cogRight = theOscMessage.get(0).floatValue();
  }
}

Spectacle of the Mind

Here is video footage from Spectacle of the Mind, a Global Mind Project performance featuring Stelarc, Domenico De Clario, and Jill Orr, all using EPOCs in multimedia performance art (albeit not with Processing or Arduino, but they are capable of similar things).

Notes & References

  1. You can do the same thing using GlovePIE, but it requires a developer edition of the EPOC, or better.
  2. The various Address Patterns are: /COG/NEUTRAL; /COG/PUSH; /COG/PULL; /COG/LIFT; /COG/DROP; /COG/LEFT; /COG/RIGHT; /COG/ROTATE_LEFT; /COG/ROTATE_RIGHT; /COG/ROTATE_CLOCKWISE; /COG/ROTATE_COUNTER_CLOCKWISE; /COG/ROTATE_FORWARD; /COG/ROTATE_REVERSE; /COG/DISAPPEAR; /AFF/Engaged/Bored; /AFF/Excitement; /AFF/Excitement Long Term; /AFF/Meditation; /AFF/Frustration; /EXP/WINK_LEFT; /EXP/WINK_RIGHT; /EXP/BLINK; /EXP/LEFT_LID; /EXP/RIGHT_LID; /EXP/HORIEYE; /EXP/VERTEYE; /EXP/SMILE; /EXP/CLENCH; /EXP/LAUGH; /EXP/SMIRK_LEFT; /EXP/SMIRK_RIGHT; /EXP/FURROW; /EXP/EYEBROW.

Magical Probability Calculator

Related articles: Psyleron REG-1 | Empirical Evidence of the Efficacy of Sex Magic?

Here is a Processing sketch that calculates magical probability per Peter Carroll’s first three equations of magic from Liber Kaos [1]:

  1. M = GL(1 − A)(1 − R)
  2. Pm = P + (1 − P) × M1/P
  3. Pm = P − P × M1/(1 − P)

Magical Probability Calculator

Edited (2016-01-13) to remove link to Java applet version since it no longer works predictably. Here is a somewhat improved version, also made with Processing, and here is a JavaScript version.

Operation

Use the blue sliders to manipulate the variables. The green and red bars show how natural (P)robability is adjusted by the amount of (M)agical power — (G)nosis and (L)ink increase magical power, (A)wareness and (R)esistance decrease it. The green bar shows magical influence on manifesting a desired outcome (→ 1.0); the red bar shows magical influence on preventing an undesired outcome (→ 0.0). Both bars become brighter as magical power increases.

Please use the comments section below to leave feedback or ask questions, or use the contact form.

Notes & References

  1. 1. Peter J. Carroll, Liber Kaos (Boston: Weiser Books, 1992) 41–51. In The Octavo, Carroll changed the formula for M to GLSB, i.e. Gnosis, Link, Subliminialization, and Belief, each from 0 to 1, and all multiplied together.

“We’re All Coders Now”

The good news is that — much as the “maker” set is learning how to build stuff — a grassroots movement is creating tools that let even liberal arts majors hack together a program.

This month’s issue of Wired includes an article (pdf) by Clive Thompson, about the need to teach young people (and adults!) computer programming skills, and the emergence of accessible programming languages such as Processing and Scratch, with which to do that. The article mentions Douglas Rushkoff‘s new book, Program or Be Programmed: Ten Commands for a Digital Age. Doug has been teaching an online course based on his book, at Maybe Logic Academy, which I would have taken if not for teaching my own online course at the same time.

2010.09.15 Update

I have been accepted to teach a six-week course in beginning interactive multimedia ritual design, at Arcanorium College, later this year or early next. Will post details as they develop.

I am working on a series of multimedia sketches titled Sleight-of-Mind Machines, that will demonstrate simple human-computer interactions for magic.

The Emotiv EPOC has been hacked (thanks to Larry for the heads-up). At least one or two of the Sleight-of-Mind Machines will feature the EPOC. I also have some plans to interface it with Processing via OSC packets.