/* Nils_Ecke
Konstantin_Gussmann
Soeren_Betker
Samuel_Baum
WS_16/17
Abschlussprojekt */
PGraphics a; PFont myFontRegular; PFont myFontBold;
import ddf.minim.*; import processing.pdf.*; import java.util.Calendar;
Minim minim; AudioPlayer lied; AudioMetaData meta;
int spacing = 10; int border = 1; int amplification = 40*80; int num = 50; int cutBack = 20000; int cutFront = 10000; int pos, counter;
float[] x = new float[num]; float[] y = new float[num];
void setup() { //size(595, 842); size(3508, 4961); a = createGraphics(3508, 4961);
minim = new Minim(this); //lied = minim.loadFile("OFTW.mp3", 4096); //lied = minim.loadFile("Shirley.mp3", 4096); lied = minim.loadFile("beat.mp3", 4096);
meta = lied.getMetaData();
lied.play(); lied.cue(cutFront);
a.strokeWeight(1); a.stroke(0, 5);
background(250); textAlign(CENTER, CENTER);
myFontRegular = loadFont("ACaslonPro-Regular-200.vlw"); myFontBold = loadFont("ACaslonPro-Bold-200.vlw"); }
void draw() {
// Frame
fill(220);
// endFrame
a.beginDraw();
a.noFill(); a.stroke(random(255), random(255), random(255)); a.beginShape(); x[0] = pos + border; y[0] = border; a.curveVertex(x[0], y[0]); for (int i = 0; i < num; i++) { x[i] = pos + border + lied.mix.get(i)*amplification; y[i] = map( i, 0, num, border, height-border ); a.curveVertex(x[i], y[i]); } x[num-1] = x[0]; y[num-1] = height-border; a.curveVertex(x[num-1], y[num-1]); a.endShape(); int skip = (lied.length() - cutFront - cutBack) / ((width-2*border) / spacing); if (pos + border < width-border) {
pos += spacing; } else { pos = 0; } position(); if (lied.isPlaying() == false) endRecord(); a.endDraw();
image(a, 0, 0, width, height);
fill(255, 0, 0);
textSize(180); textFont(myFontBold, 180); text(" " + meta.title(), width/2, height/2 ); text(" " + meta.author(), width/2, height/2+220);
fill(255); textSize(180); textFont(myFontBold, 180); text(" " + meta.title(), width/2, height/2 ); text(" " + meta.author(), width/2, height/2+220); } void position() { a.beginDraw(); int totalSeconds = (int)(lied.length()/1000) % 60; int totalMinutes = (int)(lied.length()/(1000*60)) % 60; int playheadSeconds = (int)(lied.position()/1000) % 60; int playheadMinutes = (int)(lied.position()/(1000*60)) % 60; String info = playheadMinutes + ":" + nf(playheadSeconds, 2 ) + "/" + totalMinutes + ":" + nf(totalSeconds, 2 ); println(info);
a.endDraw();
if (keyPressed == true) { if (key == 's') saveFrame("Poster");
if (lied.isPlaying() == false) { saveFrame("Poster_End"); } } }











