Project2

Attempt- 2 from Shelby Derck on Vimeo.

For this project I wanted use bright sky like colors to show the uplifting nature of the music and what I think of when listing to this song. I always imagine these varying types of skies as the lyrics change. I mostly stuck with the ellipse shape as it is smooth and natural compared to other shapes, complementing the song.

I used a drawing tablet as my external devise. The 4 buttons changed the background image while pressing down with the pen either controlled stroke weight like for the stars or changed the background to a new image. For two images the position of the pen also changed the color of the image.

Program:

//Tablet
import codeanticode.tablet.*;
Tablet tablet;
//Sound
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioPlayer play;
AudioPlayer song;
FFT fft;
BeatDetect beat;
float radius;
float eRadius;
int XE=20,YE=100;
int spaceing=40;
float eradius;
int s=40;

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

//Tablet
tablet = new Tablet(this);

//Sound
minim = new Minim(this);
song = minim.loadFile(“01 To the Sky.mp3”, 512);
fft = new FFT(song.bufferSize(), song.sampleRate());
beat = new BeatDetect();
}

void draw(){
noCursor();
background(#00F4FF);

fft.forward(song.mix);
beat.detect(song.mix);

//TabletButtons
if(key==CODED){
//LeftTopButton
//Sun
if(keyCode==16){
song.play();
ellipseMode(CENTER);
noCursor();
for(int i = 0; i < song.bufferSize() – 1; i=i+10){
beat.detect(song.mix);
float b = map(radius, 50, 100, 175, 200);
fill(#FFE603,b);
if ( beat.isOnset() ) radius = 20;
stroke(#FAFF00);
strokeWeight(2);
ellipse(width/2+song.right.get(i)*20, height/2+song.left.get(i)*20, radius, radius);
radius *= 0.80;
if ( radius < 10 ) radius = 400;
}
if(mousePressed==true){
ellipseMode(CENTER);
strokeWeight(20 * tablet.getPressure());
for(int i = 0; i < song.bufferSize() – 1; i=i+10){
beat.detect(song.mix);
float b = map(radius, 50, 100, 175, 200);
fill(#FFE603,b);
if ( beat.isOnset() ) radius = 20;
stroke(#FAFF00);
ellipse(width/2+song.right.get(i)*20, height/2+song.left.get(i)*20, radius, radius);
radius *= 0.80;
if ( radius < 10 ) radius = 400;
}
}
//Myth/Mistery
if(mousePressed==true && keyPressed==true){
ellipseMode(CENTER);
background(#FFB4F8);
for(int up=1; up<512; up=up+30){
beat.detect(song.mix);
float a = map(eradius, 100, 200, 240, 255);
fill(#FFFFB4,a);
noStroke();
if ( beat.isOnset()) eradius = 20;
ellipse(up, random(512), eradius*5, eradius*5);
ellipse(up,random(512), eradius*10, eradius*10);
eradius *= 0.20;
if ( eradius < 2 ) eradius = 5;
strokeWeight(2 * tablet.getPressure());
stroke(random(255),random(255),random(255));
}
for(int i = 0; i < song.bufferSize() – 1; i=i+10){
beat.detect(song.mix);
float b = map(radius, 50, 100, 175, 200);
fill(mouseX,(abs(mouseX-mouseY)),mouseY,b);//by bambang rahmantyo
if ( beat.isOnset() ) radius = 20;
stroke(random(255),random(255),random(255));
strokeWeight(2);
ellipse(width/2+song.right.get(i)*20, height/2+song.left.get(i)*20, radius, radius);
radius *= 0.80;
if ( radius < 10 ) radius = 400;
}
}//mousePressed
}//key=16
//LeftBottomButton
if(keyCode==18){
//SkyCircles
ellipseMode(RADIUS);
for(int up=1; up<512; up=up+30){
beat.detect(song.mix);
float a = map(eradius, 100, 200, 240, 255);
fill(#B4F9FF,a);
noStroke();
if ( beat.isOnset()) eradius = 50;
ellipse(up, random(512), eradius*5, eradius*5);
ellipse(up,random(512), eradius*10, eradius*10);
eradius *= 0.20;
if ( eradius < 2 ) eradius = 5;
}//for up

//DreamCircles
if(mousePressed==true){
background(#5F8BFF);
for(int up=1; up<512; up=up+30){
beat.detect(song.mix);
float a = map(eradius, 100, 200, 240, 255);
noStroke();
if ( beat.isOnset()) eradius = 80;
fill(#E8B4FF,a);
ellipse(up, random(512), eradius*10, eradius*10);
fill(#FFFFB4,a);
ellipse(up, random(512), eradius*5, eradius*5);
eradius *= 0.20;
if ( eradius < 2 ) eradius = 10;
}//for up
}//mousePressed
}//key=18

//RightTopButton
//StarSky
if(keyCode==157){
background(#0E1395);
fill(255,mouseX/5);
rect(0,0,512,512);
stroke(255);
strokeWeight(5 * tablet.getPressure());
line(50+song.right.get(300)*100, 60+song.left.get(300)*100, 50, 60);
line(124+song.right.get(300)*100, 150+song.left.get(300)*100, 124, 150);
line(225+song.right.get(300)*100, 35+song.left.get(300)*100, 225, 35);
line(80+song.right.get(300)*100, 400+song.left.get(300)*100, 80, 400);
line(220+song.right.get(300)*100, 460+song.left.get(300)*100, 220, 460);
line(60+song.right.get(300)*100, 250+song.left.get(300)*100, 60, 250);
line(150+song.right.get(300)*100, 350+song.left.get(300)*100, 150, 350);
line(200+song.right.get(300)*100, 200+song.left.get(300)*100, 200, 200);

line(350+song.right.get(300)*100, 60+song.left.get(300)*100, 350, 60);
line(424+song.right.get(300)*100, 150+song.left.get(300)*100, 424, 150);
line(490+song.right.get(300)*100, 35+song.left.get(300)*100, 490, 35);
line(380+song.right.get(300)*100, 400+song.left.get(300)*100, 380, 400);
line(470+song.right.get(300)*100, 460+song.left.get(300)*100, 470, 460);
line(261+song.right.get(300)*100, 350+song.left.get(300)*100, 261, 350);
line(450+song.right.get(300)*100, 250+song.left.get(300)*100, 450, 250);
line(300+song.right.get(300)*100, 200+song.left.get(300)*100, 300, 200);

stroke(random(255),random(255),random(255));
line(50+song.right.get(400)*150, 60+song.left.get(400)*150, 50, 60);
line(124+song.right.get(400)*150, 150+song.left.get(400)*150, 124, 150);
line(225+song.right.get(400)*150, 35+song.left.get(400)*150, 225, 35);
line(80+song.right.get(400)*150, 400+song.left.get(400)*150, 80, 400);
line(220+song.right.get(400)*150, 460+song.left.get(400)*150, 220, 460);
line(60+song.right.get(400)*150, 250+song.left.get(400)*150, 60, 250);
line(150+song.right.get(400)*150, 350+song.left.get(400)*150, 150, 350);
line(200+song.right.get(400)*150, 200+song.left.get(400)*150, 200, 200);

line(350+song.right.get(40)*100, 60+song.left.get(400)*100, 350, 60);
line(424+song.right.get(400)*100, 150+song.left.get(400)*100, 424, 150);
line(490+song.right.get(400)*100, 35+song.left.get(400)*100, 490, 35);
line(380+song.right.get(400)*100, 400+song.left.get(400)*100, 380, 400);
line(470+song.right.get(400)*100, 460+song.left.get(400)*100, 470, 460);
line(261+song.right.get(400)*100, 350+song.left.get(400)*100, 261, 350);
line(450+song.right.get(400)*100, 250+song.left.get(400)*100, 450, 250);
line(300+song.right.get(400)*100, 200+song.left.get(400)*100, 300, 200);
}//key=157

//RightBottomButton
//GrassForestFloor
if(keyCode==17){
fft.forward(song.mix);
fill(#2AA702);
noStroke();
rect(0,255,512,261);
for(int i = 0; i < fft.specSize(); i++){
for(int h=height/2; h<512; h=h+100){
strokeWeight(2);
stroke(#12E505);
line(i+20, h – fft.getBand(i)*10,i,h);
stroke(#13980B);
line(i+40,h – fft.getBand(i)*10,i,h);
line(i+80, h – fft.getBand(i)*10,i,h);
stroke(#12E505);
line(i,h,i+20, h – fft.getBand(i)*10);
stroke(#13980B);
line(i,h,i+40, h – fft.getBand(i)*10);
line(i,h,i+80, h – fft.getBand(i)*10);

stroke(#12E505);
line(512-i-20, h – fft.getBand(i)*10,512-i,h);
stroke(#13980B);
line(512-i-40, h – fft.getBand(i)*10,512-i,h);
line(512-i-80, h – fft.getBand(i)*10,512-i,h);
stroke(#12E505);
line(512-i,h,512-i-20, h – fft.getBand(i)*10);
stroke(#13980B);
line(512-i,h,512-i-40, h – fft.getBand(i)*10);
line(512-i,h,512-i-80, h – fft.getBand(i)*10);

stroke(#12E505);
line(i+20, height/2 – fft.getBand(i)*10,i,height/2);
stroke(#13980B);
line(i+40, height/2 – fft.getBand(i)*10,i,height/2);
line(i+80, height/2 – fft.getBand(i)*10,i,height/2);
stroke(#12E505);
line(i,height/2,i+20, height/2 – fft.getBand(i)*10);
stroke(#13980B);
line(i,height/2,i+40, height/2 – fft.getBand(i)*10);
line(i,height/2,i+80, height/2 – fft.getBand(i)*10);

stroke(#12E505);
line(512-i-20, height/2 – fft.getBand(i)*10,512-i,height/2);
stroke(#13980B);
line(512-i-40, height/2 – fft.getBand(i)*10,512-i,height/2);
line(512-i-80, height/2 – fft.getBand(i)*10,512-i,height/2);
stroke(#12E505);
line(512-i,height/2,512-i-20, height/2 – fft.getBand(i)*10);
stroke(#13980B);
line(512-i,height/2,512-i-40, height/2 – fft.getBand(i)*10);
line(512-i,height/2,512-i-80, height/2 – fft.getBand(i)*10);

}
}
//LightingStorm
if(mousePressed==true){
background(#7E7E7E);
fft.forward(song.mix);
for(int s = 0; s < song.bufferSize() – 1; s++){
stroke(#FEFF00);
line(50 + song.right.get(s)*50,s, 50 + song.right.get(s+1)*50, s+1);
line(250 + song.right.get(s)*50,s, 250 + song.right.get(s+1)*50, s+1);
line(150 + song.right.get(s)*50,s, 150 + song.right.get(s+1)*50, s+1);
line(350 + song.right.get(s)*50,s, 350 + song.right.get(s+1)*50, s+1);
line(450 + song.right.get(s)*50,s, 450 + song.right.get(s+1)*50, s+1);
float b = map(eradius,100,150,200,250);
fill(#B4B4B4,b);
noStroke();
ellipse(random(512),random(50),50,50);
float c = map(eradius,150,200,250,255);
fill(#B4B4B4,c);
ellipse(random(512),random(350)+400,100,100);
}
}//mousePressed
}//key==17
}//key=CODED
}//draw

Works Cited

  • Owl City.“To The Sky.” Legend of the Guardians: The Owls of Ga’Hoole

Soundtrack, Republic Records, 2010.

Advertisements

About dercks

Shelby is a student at Alfred State College in Digital Media and Animation.
This entry was posted in Interactive Authoring, 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