Visual Music – Visual Dubstep

https://vimeo.com/189203744

Visual Dubstep is a representation of how the music genre “Dubstep” affects me. Dubstep causes me to think differently. I look at things in a different way and often find alternative routes to solutions and generate interesting ideas. I implemented a slider to hide myself and allow a person to see the music without the image of myself beneath it. I chose a dubstep music piece for this demonstration because, like the program, Dubstep is music and sounds played in different ways than are normally done.

Coding for Visual Dubstep:

import processing.video.*;
import blobDetection.*;
import ddf.minim.*;
import gab.opencv.*;
import java.awt.Rectangle;
Minim minim;
AudioPlayer song;
OpenCV opencv;
Rectangle[] faces;

Capture cam;
BlobDetection theBlobDetection;
PImage img;
int PIvar = 300;

void setup() {
size(640, 480);
cam = new Capture(this, 640, 480, 30);
cam.start();
cam.loadPixels();

minim = new Minim(this);
song = minim.loadFile(“8 Bit Superhero.mp3”, 512);
song.play();
background(126);
noFill();
opencv = new OpenCV(this, width, height);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
}

void draw() {
cam.read();
//adjust PImage to change line effect
img = new PImage(PIvar, PIvar);
theBlobDetection = new BlobDetection(img.width, img.height);
theBlobDetection.setPosDiscrimination(true);
theBlobDetection.setThreshold(random(0.0f, 0.9f));//range of light detected
img.copy(cam, 0, 0, cam.width, cam.height, 0, 0, img.width, img.height);
theBlobDetection.computeBlobs(img.pixels);
//–refreshing of the “background”—–
noStroke();
fill(126, 126, 126, 15);
rect(0, 0, 640, 480);
//——–line weight——————-
opencv.loadImage(cam);
faces = opencv.detect();
for (int i = 0; i < faces.length; i++) {
strokeWeight((1+faces[i].x)/80);
}
//——————lines—————————-
Blob b;
EdgeVertex eA, eB;
for (int n=0; n<theBlobDetection.getBlobNb(); n++) {
b=theBlobDetection.getBlob(n);
{
stroke(random(255), random(255), random(255));
for (int m=0; m<b.getEdgeNb(); m++) {
eA = b.getEdgeVertexA(m);
eB = b.getEdgeVertexB(m);
line(eB.x*width, eA.y*height, eA.x*width, eB.y*height);
}
}
}
//draw end
}

Advertisements
This entry was posted in Time-Based and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s