Coding: song

Song: Buckle ur Pants by Stamper

float u=255;
float g=255;
float Radius=155;
float russian=255;
float italian=255;
float french = 255;
float small = 30;
float med = 90;
float low = 150;

import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

import ddf.minim.*;

Minim minim;
AudioPlayer player;
AudioInput input;
AudioPlayer song;
BeatDetect beat;

void setup()
{
size(512, 200);
frameRate(60);
minim = new Minim(this);

song = minim.loadFile(“BUCKLE ur PANTS.mp3”, 512);
song.play();
beat = new BeatDetect();
ellipseMode(RADIUS);
Radius = 255;

}

void draw()
{
background(0,255,u);
stroke(255,g,0,150);
fill(4,g,123);
println(frameCount);
beat.detect(song.mix);
float a = map(Radius,u,g,60,20);
if(beat.isOnset()) Radius = 155;
{

Radius *=0.95;
if(Radius < 50) Radius = 50;
}
fill(u,0,g);
for(int i = 0; i < song.bufferSize() – 1; i++)
{

fill(0,0,0);
line(i,small+song.right.get(i)*small, i+1,small +song.right.get(i+1)*small);
line(i,med+song.right.get(i)*med, i+1,med +song.right.get(i+1)*med);
line(i,low+song.right.get(i)*low, i+1,low +song.right.get(i+1)*low);

for(float o = 8; o<width; o *=2.1) {
line(i,small+song.right.get(i)*small*o, o*i+1,small +song.right.get(i+1)*small);
}
}
fill(russian,italian,french);
for (int p = width; p>5; p -=20) {
fill(russian,italian,french);
ellipse(width/2,width/6,Radius,p);
fill(0,25,0);
}
ellipse(255,85,small,small);
stroke(italian, russian,french);
fill(french,italian,small);

u = random(255);
g= random(255);
Radius = random(155);
russian = random(255);
italian = random(200);
french = random(123);
small = random(30);

}

Advertisements
This entry was posted in Timebased 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