Un trabajo realizado para la reinauguración del espacio cultural La Peluquería Bogotá. Es un performance que usa la detección del movimiento de la bailarina Violeta Rodríguez, la aplicación responde también al volúmen de la música.

Utilicé la librería JMyron para detectar el movimiento. El código completo lo puede ver al final de esta página.

Bailarina: Violeta Rodriguez
Programación: David León González
Música Original: Joan Sebastián Herrera
Técnica: Programación en Processing

import JMyron.*;
JMyron m;//a camera object
//**********************************************************
float ax;
float ay;
float fx;
float fy;
float son;
float fson;
//**********************************************************
float avx;
float avy;
float posx;
float posy;
float posxm;
float posym;
float rate;
float seg;

float alfa;

boolean chg;
import ddf.minim.*;
Minim minim;
AudioInput in;
//**********************************************************
void setup() {

seg = 4;
rate = 30;
int w = 640;
int h = 480;
size(w, h);
m = new JMyron();
m.start(w, h);
m.findGlobs(1);

m.minDensity(1); //minimum pixels in the glob required to result in a box
frameRate(rate);
minim = new Minim(this);
in = minim.getLineIn();
posx=0;
posy=0;
posxm=640;
posym=480;
}
void draw() {
m.trackColor(255, 0, 0, 155);
avx = width/(rate*seg);
avy = height/(rate*seg);

posx += avx;
posy += avy;
posxm -= avx;
posym -= avy;

if (posx>width) {
posx = 0;
}
if (posy>height) {
posy = 0;
}
if (posxm<0) {
posxm = width;
}
if (posym<0) {
posym = height;
}

stroke(80, 0, 0);

m.update();//update the camera view
//drawCamera();//draw the camera to the screen
int[] img = m.image();
int list[][][] = m.globPixels();
int[][] b = m.globBoxes();//get the center points
//**********************************************************

//**********************************************************
for (int i=0;i<b.length;i++) { //********************************************************** if (b[i][0]>width-50 && b[i][1]<50) {
chg = true;
}
if (b[i][0] chg = false;
}
//**********************************************************
println(chg);
//**************************PRUEBA********************************
/*if (chg == false) {
alfa = 5;
ax = b[i][0];
ay = b[i][1];
son = (in.left.get(0))*40;
strokeWeight(10);
point(ax,ay);
}*/
//**********************************************************
if (chg == false) {
alfa = 5;
ax = b[i][0];
ay = b[i][1];
son = (in.left.get(0))*40;
line(ax, ay, fx, fy);
line(ax, ay+son, fx, fy+fson);
line(ax, ay-son, fx, fy-fson);
line(ax, ay+son/2, fx, fy+fson/2);
line(ax, ay-son/2, fx, fy-fson/2);
}
//**********************************************************
if (chg == true) {
alfa = 30;
for (int e=0;e<list.length;e++) {
int[][] pixellist = list[e];
if (pixellist!=null) {
beginShape(POINTS);
for (int j=0; j<pixellist.length; j= j+300) {
strokeWeight(1);
//vertex( pixellist[j][0] , pixellist[j][1]);
stroke(80, 0, 0);
line(posx, 0, pixellist[j][0], pixellist[j][1]);
line(width, posy, pixellist[j][0], pixellist[j][1]);
line(0, posym, pixellist[j][0], pixellist[j][1]);
line(posxm, height, pixellist[j][0], pixellist[j][1]);
}
endShape();
}
}
}
}
fson = son;
fx = ax;
fy = ay;
fill(255, 255, 255, alfa);
rect(-10, -10, width+20, height+20);
}
//void drawCamera() {
//int[] img = m.image(); //get the normal image of the camera
//loadPixels();
//for (int i=0;i<width*height;i++) { //loop through all the pixels
//pixels[i] = img[i]; //draw each pixel to the screen
//}
//updatePixels();
//}
public void stop() {
m.stop();//stop the object
super.stop();
}