Lyric Flow

For many centuries, the human race has undergone many negative social changes and affiliations. People fight battles they don’t believe in, they are greedy, they degrade others, and they tend to take and take without a thought of giving. This is a short digital interactive project that allows you to be encompassed by words. These words are from the song “Lost” by Avenged Sevenfold, and they slowly move with your body and arrange to form some of the lyrics to the song: “Centuries pass and still the same. War in our blood, some things never change. Fighting for land and personal gain…”

import gab.opencv.*;
import processing.video.*;
import java.awt.*;

Capture camera;
OpenCV opencv;
PFont font;
float speed = 10;

// Text location on axiis
float x1 = -100;
float x2 = 1380;
float x3 = -200;
float x4 = 1800;
float x5 = 1500;
float x6 = -1300;
float x7 = 1400;
float x8 = -50;
float x9 = 2000;
float x10 = -300;
float x11 = -500;
float x12 = 1550;
float x13 = -1000;
float x14 = 3000;
float x15 = 2500;
float x16 = -700;
float x17 = 2300;
float x18 = -250;
float x19 = 2800;
float x20 = 3200;
void setup() {
size(1280, 720);
smooth();
//frameRate(30);
camera = new Capture(this, 1280, 720, 30);
opencv = new OpenCV(this, 1280, 720);
opencv.loadCascade(OpenCV.CASCADE_FULLBODY);
//opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
camera.start();

//String[] fontList = PFont.list();
//printArray(fontList);
//font = loadFont(“STBaoli-SC-Regular-48.vlw”);
//font = loadFont(“HoboStd-48.vlw”);
font = loadFont(“AvenirNextCondensed-Medium-48.vlw”);
}
void captureEvent(Capture camera) {
camera.read();
}
void draw() {
opencv.loadImage(camera);
image(camera, 0, 0);
//filter(INVERT);

noStroke();
fill(65, 105, 225);
textAlign(CENTER, CENTER);
textFont(font);
textSize(25);

text(“CENTURIES”, x1, 130);
text(“PASS”, x2, 160);
text(“AND”, x3, 190);
text(“STILL”, x4, 220);
text(“THE”, x5, 250);
text(“SAME”, x6, 280);
text(“WAR”, x7, 310);
text(“IN”, x8, 340);
text(“OUR”, x9, 370);
text(“BLOOD,”, x10, 400);
text(“SOME”, x11, 430);
text(“THINGS”, x12, 460);
text(“NEVER”, x13, 490);
text(“CHANGE”, x14, 520);
text(“FIGHTING”, x15, 550);
text(“FOR”, x16, 580);
text(“LAND”, x17, 610);
text(“AND”, x18, 640);
text(“PERSONAL”, x19, 670);
text(“GAIN”, x20, 700);

// Normal Direction
x1 += speed;
x2 -= speed;
x3 += speed;
x4 -= speed;
x5 -= speed;
x6 += speed;
x7 -= speed;
x8 += speed;
x9 -= speed;
x10 -= speed;
x11 += speed;
x12 -= speed;
x13 += speed;
x14 -= speed;
x15 -= speed;
x16 += speed;
x17 -= speed;
x18 += speed;
x19 -= speed;
x20 -= speed;

noFill();
// noStroke();
stroke(255, 0, 0);
strokeWeight(30);
Rectangle[] body = opencv.detect();
println(body.length);
for (int i = 0; i < body.length; i++) {
println(body[i].x + “,” + body[i].y);
rect(body[i].x, body[i].y, body[i].width, body[i].height);

// Normal Direction
if (x1 >= body[i].x) {
x1 -= speed;
}
if (x2 <= body[i].x) {
x2 += speed;
}
if (x3 >= body[i].x) {
x3 -= speed;
}
if (x4 <= body[i].x) {
x4 += speed;
}
if (x5 <= body[i].x) {
x5 += speed;
}
if (x6 >= body[i].x) {
x6 -= speed;
}
if (x7 <= body[i].x) {
x7 += speed;
}
if (x8 >= body[i].x) {
x8 -= speed;
}
if (x9 <= body[i].x) {
x9 += speed;
}
if (x10 <= body[i].x) {
x10 += speed;
}
if (x11 >= body[i].x) {
x11 -= speed;
}
if (x12 <= body[i].x) {
x12 += speed;
}
if (x13 >= body[i].x) {
x13 -= speed;
}
if (x14 <= body[i].x) {
x14 += speed;
}
if (x15 <= body[i].x) {
x15 += speed;
}
if (x16 >= body[i].x) {
x16 -= speed;
}
if (x17 <= body[i].x) {
x17 += speed;
}
if (x18 >= body[i].x) {
x18 -= speed;
}
if (x19 <= body[i].x) {
x19 += speed;
}
if (x20 <= body[i].x) {
x20 += speed;
}
}
}

// Referenced code from the OpenCV edge detection library

This entry was posted in Interactive, Non Time Based and tagged , . Bookmark the permalink.

Leave a comment