Lockman_200_Project_4

Below is all the documentation pertinent to the completion of myself and Aidan Bauer’s final project for New Media 200.

Here is the grant request form which I prepared and submitted.

NMD_DIGITAL_Grant_Request_Form_Page_1NMD_DIGITAL_Grant_Request_Form_Page_2NMD_DIGITAL_Grant_Request_Form_Page_3NMD_DIGITAL_Grant_Request_Form_Page_4NMD_DIGITAL_Grant_Request_Form_Page_5This document has a mysterious page six, which is included for thoroughness.

NMD_DIGITAL_Grant_Request_Form_Page_6

What follows is the proposal, proper, which I designed and wrote. Lockman-Bauer Project 4 Proposal Final (1)Lockman-Bauer Project 4 Proposal Final Page 2Lockman-Bauer Project 4 Proposal Final Page 3Lockman-Bauer Project 4 Proposal Final Page 4

As noted on page two of the grant proposal, a musical score of concept art for the full prototype can be found here. Note that the software outputs submotifs for complex movement interactions performed by two players across six channels of input, each. Output submotifs are mediated by movement speed, height above the ground, and relation to prior movements. This annotated concept score draws its tonalities from actual submotifs which appear frequently in traditional Capoeira songs.

As noted on page three of the grant proposal, one of our sources was an interview with Formado Gafanhoto, commonly known as Garrett Boardway. This Bangor Area Capoeira teacher has studied the art for nearly fifteen years now, under the tutelage of mestres from several Capoeira styles. Our full exclusive interview with him can be found below:

 

Lastly, the Processing Sketch which made the hardware work! Aidan largely programmed this using only a mouse clicking on a virtual keyboard, as the kinect tended to shut down his actual keyboard and none of our computers had enough USB ports to handle the Kinect, a mouse, and a keyboard. I pitched in here where I could, and my efforts included researching the SoundCipher Processing library.

import arb.soundcipher.*;
import arb.soundcipher.constants.*;
import SimpleOpenNI.*;

SoundCipher sc = new SoundCipher(this);
int[] scale = {57, 60, 60, 62, 64, 67, 67, 69, 72};

SimpleOpenNI context;
//SkeletonPoser pose;

color[] userClr = new color[]{ color(255,0,0),
color(0,255,0),
//color(0,0,255),
//color(255,255,0),
//color(255,0,255),
//color(0,255,255)
};
PVector com = new PVector();
PVector com2d = new PVector();

void setup() {
size(640,480);

context = new SimpleOpenNI(this);
if(context.isInit() == false)
{
println(“Can’t init SimpleOpenNI, maybe the camera is not connected!”);
exit();
return;
}

// enable depthMap generation
context.enableDepth();

//enable skeleton generation for all joints
context.enableUser();

// context.enableRGB();

//pose = new SkeletonKinect(context);

background(200,0,0);

stroke(0,0,255);
strokeWeight(3);
smooth();
}

void draw() {
context.update();
// draw depthImageMap
//image(context.depthImage(),0,0);
image(context.userImage(),0,0);

// draw the skeleton if it’s available
int[] userList = context.getUsers();
for(int i=0;i<userList.length;i++)
{
PVector check1 = getRightHand(userList[i]);
if(context.isTrackingSkeleton(userList[i]))
{
stroke(userClr[ (userList[i] – 1) % userClr.length ] );
drawSkeleton(userList[i]);
//PVector check1 = getRightHand(userList[i]);
PVector check2 = getRightHand(userList[i]);
PVector difference = PVector.sub(check1,check2);
if (difference.mag() >= 0.5) {
sc.instrument(10);
sc.playNote(60,120,0.5);
}

}

// draw the center of mass
if(context.getCoM(userList[i],com))
{
context.convertRealWorldToProjective(com,com2d);
stroke(100,255,0);
strokeWeight(1);
beginShape(LINES);
vertex(com2d.x,com2d.y – 5);
vertex(com2d.x,com2d.y + 5);

vertex(com2d.x – 5,com2d.y);
vertex(com2d.x + 5,com2d.y);
endShape();

fill(0,255,100);
text(Integer.toString(userList[i]),com2d.x,com2d.y);
}
}
}

void drawSkeleton(int userId)
{
// to get the 3d joint data
/*
PVector jointPos = new PVector();
context.getJointPositionSkeleton(userId,SimpleOpenNI.SKEL_NECK,jointPos);
println(jointPos);
*/

context.drawLimb(userId, SimpleOpenNI.SKEL_HEAD, SimpleOpenNI.SKEL_NECK);

context.drawLimb(userId, SimpleOpenNI.SKEL_NECK, SimpleOpenNI.SKEL_LEFT_SHOULDER);
context.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_SHOULDER, SimpleOpenNI.SKEL_LEFT_ELBOW);
context.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_ELBOW, SimpleOpenNI.SKEL_LEFT_HAND);

context.drawLimb(userId, SimpleOpenNI.SKEL_NECK, SimpleOpenNI.SKEL_RIGHT_SHOULDER);
context.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_SHOULDER, SimpleOpenNI.SKEL_RIGHT_ELBOW);
context.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_ELBOW, SimpleOpenNI.SKEL_RIGHT_HAND);

context.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_SHOULDER, SimpleOpenNI.SKEL_TORSO);
context.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_SHOULDER, SimpleOpenNI.SKEL_TORSO);

context.drawLimb(userId, SimpleOpenNI.SKEL_TORSO, SimpleOpenNI.SKEL_LEFT_HIP);
context.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_HIP, SimpleOpenNI.SKEL_LEFT_KNEE);
context.drawLimb(userId, SimpleOpenNI.SKEL_LEFT_KNEE, SimpleOpenNI.SKEL_LEFT_FOOT);

context.drawLimb(userId, SimpleOpenNI.SKEL_TORSO, SimpleOpenNI.SKEL_RIGHT_HIP);
context.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_HIP, SimpleOpenNI.SKEL_RIGHT_KNEE);
context.drawLimb(userId, SimpleOpenNI.SKEL_RIGHT_KNEE, SimpleOpenNI.SKEL_RIGHT_FOOT);
}

void onNewUser(SimpleOpenNI curContext, int userId)
{
println(“onNewUser – userId: ” + userId);
println(“\tstart tracking skeleton”);

curContext.startTrackingSkeleton(userId);

sc.playNote(60, 120, 0.5);
}

void onLostUser(SimpleOpenNI curContext, int userId)
{
println(“onLostUser – userId: ” + userId);
}

void onVisibleUser(SimpleOpenNI curContext, int userId)
{
println(“onVisibleUser – userId: ” + userId);
}

PVector getRightHand(int userID) {
PVector jointPos = new PVector();
PVector jointPos_Proj = new PVector();
context.getJointPositionSkeleton(userID,SimpleOpenNI.SKEL_RIGHT_HAND,jointPos);
context.convertRealWorldToProjective(jointPos,jointPos_Proj);
return jointPos_Proj;
}

void keyPressed()
{
switch(key)
{
case ‘ ‘:
context.setMirror(!context.mirror());
break;
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *