comedy tester
Maybe my final project was a really a way for comedians to test new material without getting their egos stomped on? You could record how many times people walked away...
!!!
Here is the code I am going to use for the demo:
import processing.video.*;
Movie myMovie;
int i ;
float t;
void setup() {
size(1600, 1000);
frameRate(50);
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
}
void draw() {
if (myMovie.available()){
myMovie.read();}
image(myMovie,0,0, 800, 600);
}
void mousePressed(){
t = myMovie.time();
if (t < 41.04) {
myMovie = new Movie(this, "JoeFullLoud.mov");
myMovie.play();
t = myMovie.time();
myMovie.jump(41.04);
i = 0;
i++;
return;}
if (i == 1) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(92.17);
delay (2060);
i = 2;
myMovie.jump(t);
return;}
if (i == 2) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(107.13);
delay (3060);
i = 3;
myMovie.jump(t);
return;}
if (i == 3) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(97.21);
delay (3280);
i = 4;
myMovie.jump(t);
return;}
if (i == 4) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(105.24);
delay (2010);
i = 5;
myMovie.jump(t);
return;}
if (i == 5) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(101.20);
delay (4040);
i = 6;
myMovie.jump(t);
return;}
if (i == 6) {
t = myMovie.time();
myMovie.stop();
myMovie.jump(114.10);
delay (2120);
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
}
Here is the code I was working on using the sensor:
import processing.serial.*;
Serial port;
float getByte = -1;
float oldByte = 0;
float difference = 0;
import processing.video.*;
Movie myMovie;
float mt = 0;
void setup() {
size(1600, 1000);
frameRate(50);
port = new Serial(this, Serial.list()[0], 9600);
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
}
void draw() {
if (myMovie.available()){
myMovie.read();}
image(myMovie,0,0, 1600, 1000);
}
void mousePressed(){
getByte = port.read();
myMovie.stop();
myMovie = new Movie(this, "JoeFullLoud.mov");
myMovie.play();
myMovie.jump(10.02);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500){
mt = myMovie.time();
myMovie.jump(92.17); //Where1
draw();
delay(2060);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(97.21);//Where3
draw();
delay(3280);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(94.24);//Where2
draw();
delay(2270);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(105.24);//Wait
draw();
delay(1190);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}}}}}}}}}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(97.21);//Where3
draw();
delay(3280);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(97.21);//Where3
draw();
delay(3280);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(94.24);//Where2
draw();
delay(2270);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(105.24);//Wait
draw();
delay(1190);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}}}}}}}}}}}
else{
myMovie.jump(69.15)//BangItOut2
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500){
mt = myMovie.time();
myMovie.jump(107.13);//I was talking
draw();
delay(3060);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(97.21);//Where3
draw();
delay(3280);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(97.21);//Where3
draw();
delay(3280);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(94.24);//Where2
draw();
delay(2270);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(105.24);//Wait
draw();
delay(1190);
getByte = port.read();
if (getByte < 100 || getByte > 1000 ){
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
getByte = port.read();
myMovie.jump(mt);
draw();
oldByte = getByte;
getByte = port.read();
difference = sqrt((oldByte - getByte) * (oldByte - getByte));
if (difference > 500) {
mt = myMovie.time();
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}
else {
myMovie.jump(115.10);//FuckOff
draw();
delay(2130);
myMovie.stop();
myMovie = new Movie(this, "WaitStill.mov");
myMovie.loop();
return;}}}}}}}}}}}}
}
Subscribe to:
Posts (Atom)