Untitled Midterm

From Robert-Depot
Revision as of 15:36, 20 May 2010 by Rtwomey (talk | contribs) (Attempted code (womp womp...))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title

Sunflower thingamabob?

Description

  • Motivation

My artistic interests mainly revolve around more frivolous and care free aspects of life. In an effort to reflect these ideas in my midterm project, I propose to create an anthropomorphized flower sleeping in a garden.

  • Interactive paradigm

I would like to utilize a computer mic as the mode for interaction. The goal is to create a user interface that is as transparent as possible. I would like the visualization to appear as a logical index of user input. Basically the user would blow into the mic and the interaction would translate into "virtual" wind blowing onto the flower. Depending on volume and duration, the flower would experience a light breeze or gale force winds. I would also like to include varying facial expressions for the flower in response to the wind.

  • Technical Description

I would like to create the animations in flash and somehow incorporate them into processing.

Visualization

alt text

Documentation

Screenshots

Sun1.png Sun2.png Sun3.png Sun4.png Sun5.png Sun6.png

Attempted code (womp womp...)

import processing.video.*;

import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.signals.*;

Minim minim; AudioInput in; FFT fft;

float loudestFreqAmp = 0; float loudestFreq = 0; //int timerCounter = 0;


Movie myMovie, myMovie2; void setup() {

size(550, 400, P2D);
frameRate(30);

minim = new Minim(this);
minim.debugOn();
background(255);
myMovie = new Movie(this, "idle.mov");
 myMovie2 = new Movie(this, "light1.mov");
 myMovie2 = new Movie(this, "light1.mov");
 myMovie.loop();
noStroke();
// get a line in from Minim, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 1024);
fft = new FFT(in.bufferSize(), in.sampleRate());
}

void movieEvent(Movie myMovie2) {

 myMovie2.read();

} void draw()

 {
fft.window(FFT.HAMMING);
for(int i = 0; i < fft.specSize(); i++)
{
  // draw the line for frequency band i, scaling it by 4 so we can
  //see it a bit better
  //line(i, height, i, height - fft.getBand(i)*4);
  if (fft.getBand(i) > loudestFreqAmp && fft.getBand(i) > 25)
  {
    loudestFreqAmp = fft.getBand(i);
    loudestFreq = i * 4;
    //sine.setFreq(loudestFreq);
    fill(loudestFreq * 10, 255 - loudestFreq, loudestFreq * 20, 128 );
    if(loudestFreq > 25)
    {
      image(myMovie2,0,0);
    }
    //else

// { // ellipse(random(0,width), random(0,height), loudestFreqAmp, //loudestFreqAmp);

    }
    //timerCounter = 0;
  }
  image(myMovie,0,0);
}

// loudestFreqAmp = 0;

// draw the waveforms
/*  for(int i = 0; i < in.bufferSize() - 1; i++)
 {
 line(i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50);
 line(i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50);
 }*/

// fft.forward(in.mix); // timerCounter++; // if(timerCounter >= 90)

{
  //println("Clr screen");

// fill(255, 255, 255, (timerCounter - 2) * 2); // rect(0, 0, width, height);

}

//}

void stop() {

// always close Minim audio classes when you are done with them
in.close();
minim.stop();

super.stop();

}