Created
March 24, 2014 12:35
-
-
Save ravicious/9739293 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ddf.minim.*; | |
Minim minim; | |
AudioPlayer song; | |
PImage korwin; | |
float counter; | |
float rotateValue; | |
void setup() | |
{ | |
size(512, 512); | |
minim = new Minim(this); | |
// specify 512 for the length of the sample buffers | |
// the default buffer size is 1024 | |
song = minim.loadFile("song.mp3", 512); | |
song.play(); | |
korwin = loadImage("korwin.png"); | |
counter = 0; | |
} | |
void draw() | |
{ | |
background(0); | |
stroke(255); | |
translate(width/2, height/2); | |
// the values in the buffers are normalized | |
// they have values between -1 and 1 | |
rotateValue = song.left.get(0) % PI; | |
counter = counter + rotateValue; | |
rotate(counter); | |
imageMode(CENTER); | |
image(korwin, 0, 0); | |
translate(-korwin.width/2, -korwin.height/2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment