Interactive Authoring – Visual Music

An interactive  Fast Fourier Transform of the music track Firestorm (Original Mix) by Far Too Loud. This FFT was created in Processing using the Minim library.

Coding:
import ddf.minim.*;
import ddf.minim.analysis.*;

Minim minim;
AudioPlayer song;
FFT fft;

void setup()
{
size(512, 512);
minim = new Minim(this);
song = minim.loadFile(“Firestorm (Original Mix).mp3”, 512);
song.play();
fft = new FFT(song.bufferSize(), song.bufferSize());
}

void draw()
{
background(0);
fft.forward(song.mix);
for (int i = 0; i < song.left.size() – 1; i++)
{
stroke(128, 0, 0);//dark red
line(i, 256 + song.left.get(i+1)*300/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*100);
stroke(153, 0, 0);
line(i, 256 + song.left.get(i+1)*285/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*95);
stroke(178, 0, 0);
line(i, 256 + song.left.get(i+1)*270/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*90);
stroke(204, 0, 0);
line(i, 256 + song.left.get(i+1)*255/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*85);
stroke(255, 0, 0);//red
line(i, 256 + song.left.get(i+1)*240/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*80);
stroke(255, 26, 0);
line(i, 256 + song.left.get(i+1)*225/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*75);
stroke(255, 51, 0);
line(i, 256 + song.left.get(i+1)*210/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*70);
stroke(255, 77, 0);
line(i, 256 + song.left.get(i+1)*195/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*65);
stroke(255, 102, 0);
line(i, 256 + song.left.get(i+1)*180/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*60);
stroke(255, 128, 0);//orange
line(i, 256 + song.left.get(i+1)*165/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*55);
stroke(255, 153, 0);
line(i, 256 + song.left.get(i+1)*150/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*50);
stroke(255, 179, 0);
line(i, 256 + song.left.get(i+1)*135/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*45);
stroke(255, 204, 0);
line(i, 256 + song.left.get(i+1)*120/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*40);
stroke(255, 230, 0);
line(i, 256 + song.left.get(i+1)*105/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*35);
stroke(255, 255, 0);//yellow
line(i, 256 + song.left.get(i+1)*90/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*30);
stroke(255, 255, 51);
line(i, 256 + song.left.get(i+1)*75/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*25);
stroke(255, 255, 102);
line(i, 256 + song.left.get(i+1)*60/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*20);
stroke(255, 255, 153);
line(i, 256 + song.left.get(i+1)*45/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*15);
stroke(255, 255, 204);
line(i, 256 + song.left.get(i+1)*30/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*10);
stroke(255, 255, 255);//white
line(i, 256 + song.left.get(i+1)*15/(1+mouseX/100), i+1, 256 + song.left.get(i+1)*5);
}
}

Advertisements
This entry was posted in Time-Based and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s