Media Controller – Stephanie Anderson 003

The Process

For this week’s recitation, I was starting ambitious and was originally going to create a program that would allow me to adjust the tint of a picture using a light sensor. I was going to make boundaries using different ranges of the light and then try and adjust the tint on a smoother scale. The first problem that I ran into was that the light sensor I checkout required a special bread board which I was not familiar with. The next attempt at using a light sensor included using the one given to us in our kit. Unfortunately, I was not successful in this venture either. I ended up creating a program that allowed me to control the speed of a video with a potentiometer. In theory, this should have been pretty simple, but it took me a while to figure out how to write all the code that I needed. 

I ran into problems with being able to manipulate the speed of the video. I figured out that the issue was that I needed to switch two lines of code:  myMovie.loop() and myMovie.speed(). When I switched these lines in my setup() function then I was able to manually adjust the speed for the video. After this, I ran into another problem where I was unable to variablize the speed function. I originally made my own class, but then I realized that was ineffective. I was not able to call the class I created in the setup() function. I ended up creating a while loop that allowed me to have the sensorValue from the Ardunio potentiometer to manipulate the speed of the video. 

ARDUNIO CODE:

// IMA NYU Shanghai
// Interaction Lab
// This code sends one value from Arduino to Processing

void setup() {
Serial.begin(9600);
}

void loop() {
int sensorValue = analogRead(A0) / 4;
Serial.write(sensorValue);
map(sensorValue, 0, 255, 0, 10);
// too fast communication might cause some latency in Processing
// this delay resolves the issue.
Serial.print(sensorValue);
delay(10);
}

////////////////////////////////////////////////////

PROCESSING CODE:

import processing.video.*;
import processing.serial.*;
Serial myPort;
int sensorValue;

Movie myMovie;
void setup() {
size(700 , 1100);
frameRate(200);
myMovie = new Movie(this, “lilydumb.mp4”);
// myMovie.play();
myMovie.loop();

while(sensorValue> 0){
int x = sensorValue;

myMovie.speed(x);

}

printArray(Serial.list());

myPort = new Serial(this, Serial.list()[ 2 ], 9600);

}

void fastness(int x){
while(sensorValue > 0){
x = sensorValue;

}
}

void draw() {
if (myMovie.available()) {
myMovie.read();
}

image(myMovie, 0, 0);

while ( myPort.available() > 0) {
sensorValue = myPort.read();
}
println(sensorValue);//This prints out the values from Arduino
}

VIDEO:

https://drive.google.com/open?id=1kAzAEmWEq-JeKoO3K3kIbpL3thKqEagZ

After reading through the article, “Computer Vision for Artists and Designers,” by Levin, it made me think about some of the presentations from the past weekend from the “Machine Art” workshops. Simone spoke very passionately about his belief that  machines are only as smart as we make them. In the article, Levin articulates the power of the machine, but says how, in the past, the power of machines have been predominately used by the military and other government powers. Levin does mention, however, that the rise of modern technology has led to more open-sourcing and more community efforts on home-made projects.  I think this concept that he is referencing here is why I love working with Ardunio and Processing so much. They both have such diverse communities that include people of all backgrounds who are willing to anyone who presents a problem. Taking open-ended questions like our recitation and using our imagination to come up with projects that will be helpful is the magic of design and the benefit of engineering. 

Sources:

Levin, G. “Computer Vision for Artists and Designers: Pedagogic Tools and Techniques for Novice Programmers”. Journal of Artificial Intelligence and Society, Vol. 20.4. Springer Verlag, 2006. Reas, Casey and Fry, Ben. Processing: A Programming Handbook for Visual Designers and Artists. MIT Press, 9/2007. ISBN: 978­026218262. 

Leave a Reply