Tuesday, December 14, 2004

Documentation

Here is the application we filled out for the show, regarding context and purpose of the project:

Description

Punching bags are for exercise and stress relief. This punching bag indicates your progress with solid colors and sounds chosen to refelect intensity of punches.

We wanted to do something with exercise and a sense of humor. Initially we thought about baseball and other sports, but focused on boxing because it's something that everyone can do and is familiar with.

Audience
ITP Students and visitors who want to take out all their frustrations, tech and otherwise. Users can slap at it, punch the hell out it, kick it, etc.
User Scenario
Users will approach the piece, and if they choose to hit it, will get an immediate response. As they punch, they may realize that there is a color-coded system for advancement. They will also enjoy the spectacle of punching the bag and changing the colors and sounds.

Project References, Research and Literature
Boxers historically get a mixed rap. While Mohammed Ali is a great of the sport and a timeless winner, Tyson is a more notorious character.

Rocky won best film in the 1980's signifying its universal appeal. Boxing today draws crowds in Vegas and afar, woman now participate too.

Having tested the interactive punching bag, we received really positive feedback from students in the PComp lounge and Commons Area.


We demonstrated the punching bag Tuesday night for the pcomp projects presentation scheduled in the Japanese Room.

Here is Wlodek's excellent documentation for the project.

As soon as I can get it off of the two PCs, I'll post here the Illustrator source files and gifs for the graphics. I think that redundancy for pcomp projects is important considering that machines on occasion crap out.

We ended up using neither the crossover nor video in Processing; less is more.

The class demonstration went very well, Andrew invited 3 guests Alison, Colin, and a film maker to give us unbiased evaluation. Their main comment was to use the sound trigger more effectively, but otherwise they enjoyed using it.

Monday, December 06, 2004

12/3 Working Code - Testing Comments

We are getting bad values from the Piezo, possibly because of long wires to the bread board causing interference.

Here is the latest Processing Code:

// CODE
// SONIA V2.5 -- Audio Live Stream.
//http://www.pitaru.com/sonia/
//Goal is to capture audio data and parse into if/then
statements //Note the Sonia code folder goes into the
sketch folder
//web site to
scrape:http://www.dhs.gov/dhspublic/display?theme=29
//sounds: http://www.findsounds.com/ISAPI/search.dll

//Settings for display of color images
int picDislayTime =400; //time imageis
displayed in milliseconds

int numOfPics = 5; //number of
images in image array for colors
BImage[] colors = new BImage[numOfPics]; //new array
of up for displaying color photos
int whichImage = 0; //to display
appropriate image
boolean showing = false; //for
checking whether or not time of the images displayed
has elapsed
int startTime; //variable
for timer
float previousLevel = 0; //to check
previous mic input
float meterData = 0;

//settings for display of homepage image
int introDisplayTime = 30000; //time after
last sensor input that "homepage" image gets displayed
BImage start; //the "home
page" image
int waitingTime; //
boolean waiting = false;

//settings for playing sounds
int numOfSounds = 5; //a sound
for each color
Sample[] thunder = new Sample[numOfSounds]; //array to
hold each sound

//serial piezo
float piezo = 0;

float combinedAverageData = 0;

void setup()
{
beginSerial(); // Default start serial at 9600
baud
serialWrite(65); //sent message to pic to
begin serial communication

Sonia.start(this); // Start Sonia engine.
LiveInput.start(256); // Start LiveInput and
return 256 FFT frequency bands.

size(800,600);

for(int j=1 ; j<6 ; j++)
{
colors [j-1] = loadImage ("color" + j + ".gif");
thunder[j-1] = new Sample("thunder"+ j + ".wav");
}
start = loadImage("homepict.gif");
startTime = millis();
background (0);
}

void loop()
{
soundShow(); //Show appropriate image based on
input from microphone

if (showing)
{
image(colors[whichImage], 0, 0);
}
if ((millis() - startTime > picDislayTime))
{
showing = false;
}

intro(); //display homepage image if no
input is received from sensors
}
void soundShow()//Show image based on input from
microphone
{
meterData = 250 * LiveInput.getLevel(Sonia.LEFT);
combinedAverageData = (meterData + piezo)/2;

for(int i = 100 ; i > 10 ; i-=20)
{
int j = i/20;

if (!showing)
{
if (combinedAverageData > i)
{
whichImage = j - 1;
thunder[j-1].play();
showing = true;
startTime = millis();
previousLevel = i + 20;

println (meterData+ " " +piezo+ "
"+combinedAverageData);
}
}
}
}

void intro()
{

if ((combinedAverageData < 10) && (!waiting))
{
waiting = true;
waitingTime = millis();
}
else if (combinedAverageData >= 10) {
waiting = false;
}
if ((millis() - waitingTime > introDisplayTime) &&
(waiting))
{
waiting = false;
image(start, 300, 0);

}
}
void serialEvent() //automatic serial listener
{
piezo = serial; // save messages to variable
"piezo"
serialWrite(65); // send message to PIC
}

// Safely close the sound engine upon Browser
shutdown.
public void stop(){
Sonia.stop();
super.stop();
}