Visual Music Project

Video Link

Concept:

Music is like water in that it is constantly flowing and changing. These fluid and dynamic similarities between the two are what I wanted to capture within my program. I want the individual using it to be able to visualize their interpretation of the song playing.

Technical Aspects:

For the interactive part of this assignment, I allow the use of a tablet and the accompanying pen to essentially draw onto the background in the program. While the drawing is fairly linear, there is still a sense of freedom with the movement due to it being controlled by hand. The line is programmed to follow the mouse or in this case, the pen, as long as the pointer is in the program window. Changing the pressure you use when drawing will increase the size of the line being drawn. To refresh the background, the person using the program simply needs to press 1. To change the color of the line, you would press and hold ‘f’ for purple-blue and hold ‘d’ for red-orange. The speed at which the line follows the pointer is affected by how quickly the pointer is moved about the program window.

Program:

Processing

Code:

import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer song;

import seltar.motion.*;
Motion mf, m;

import codeanticode.tablet.*;
Tablet tablet;

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

minim = new Minim(this);
song = minim.loadFile(“The Secession.mp3”, 512);
song.play();

tablet = new Tablet(this);
mf = new Motion(width,height);
mf.setConstant(35);
m = new Motion(width,height);
m.setConstant(350);
background(0);
stroke(184,39,0);
smooth();
}

void draw()
{
if ((keyPressed == true) && (key == ‘1’)){
background(0);
}

if(keyPressed)
strokeWeight(mf.getDistance());
mf.followTo(mouseX,mouseY);
mf.move();

m.springTo(mf.getX(),mf.getY());
m.move();

mouseDragged(); {
//change color to blue-purple
if((keyPressed == true) && ((key == ‘f’)) || (key == ‘F’)) {
strokeWeight(50 * tablet.getPressure());
stroke(92,0,156);
line(mf.getX(), mf.getY(), m.getX(),m.getY());

fill(0,4,156);
stroke(0,4,156);
ellipse(m.getX(),m.getY(),m.getDistance(),m.getDistance());

} else {
// color orange-yellow
strokeWeight(50 * tablet.getPressure());
stroke(255,222,0);
line(mf.getX(), mf.getY(), m.getX(),m.getY());

fill(184,84,0);
stroke(255,102,0);
ellipse(m.getX(),m.getY(),m.getDistance(),m.getDistance());
}
if((keyPressed == true) && ((key == ‘d’)) || (key == ‘D’)) {
strokeWeight(50 * tablet.getPressure());
stroke(255,0,0);
line(mf.getX(), mf.getY(), m.getX(),m.getY());

fill(156,0,0);
stroke(156,0,0);
ellipse(m.getX(),m.getY(),m.getDistance(),m.getDistance());}

}
}

Libraries Used:

Minim, Motion, Tablet

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