I was not entirely sure what the concept of this lab was, but I think we had to do something with audio? So I kept it simple and just rendered a set-up that included a dancing banana as my cursor, a discoball at the top and a dance floor. The background color was controlled by mousePressed and would change every time I clicked. And then finally I just loaded Dancing Queen by ABBA as the audio file to accompany my banana man.

This is a story about blowing bubbles. I’m doing something similar for Computational Media so I thought this would be a nice supplement to that. Basically a boy is running around the park and he finds a vendor selling bubble blowy things and buys one and blows bubbles.

Basically, started with the Example sketch called AnalyzeSound. Changed the jingle file to be “Wake me Up” by Avicii. Then I changed the color of the visual by tying the color to the average frequency of the song. This was a little complicated and required setting up the frequency in an array. On top of that I merged in the slider we used in another lab to control the blue-green color change.

Here’s the code:

/**
* This sketch demonstrates how to use an FFT to analyze
* the audio being generated by an AudioPlayer.
* <p>
* FFT stands for Fast Fourier Transform, which is a
* method of analyzing audio that allows you to visualize
* the frequency content of a signal. You’ve seen
* visualizations like this before in music players
* and car stereos.
*/

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

Minim minim;
AudioPlayer jingle;
FFT fft;

float average;

Slider slider = new Slider(100,70,300,20);

void setup()
{
size(512, 400, P3D);

minim = new Minim(this);

// specify that we want the audio buffers of the AudioPlayer
// to be 1024 samples long because our FFT needs to have
// a power-of-two buffer size and this is a good size.
jingle = minim.loadFile(“jingle.mp3”, 1024);

// loop the file indefinitely
jingle.loop();

// create an FFT object that has a time-domain buffer
// the same size as jingle’s sample buffer
// note that this needs to be a power of two
// and that it means the size of the spectrum will be half as large.
fft = new FFT( jingle.bufferSize(), jingle.sampleRate() );

}

void draw()
{
background(0);
stroke(255);

slider.sliderSet();

// perform a forward FFT on the samples in jingle’s mix buffer,
// which contains the mix of both the left and right channels of the file
fft.forward( jingle.mix );

//jingle.setVolume(slider.sliderValue);

// println(jingle.getVolume());
float[] allVals = new float[0];

for(int i = 0; i < fft.specSize(); i++)

{

// draw the line for frequency band i, scaling it up a bit so we can see it
line( i, height, i, height – (fft.getBand(i)+0.5)*30 );
strokeWeight(3);
float a = map(fft.getBand(i),0,1,0,255);
stroke(average,average*1.8,average+slider.sliderValue);

Our animation is mainly about how to be a good student in college. We include it in the lyrics of a song similar to the one in Sita Sings the Blues. We also make several people or robots singing, dancing and making different movements.

We are sure that our animation will be super fun and especially the song is awesome!!!