Skip to content

Instantly share code, notes, and snippets.

@mgm000
Created May 9, 2016 20:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgm000/d7d5e7cfaefa09885cf115c5f4b3c2e8 to your computer and use it in GitHub Desktop.
Save mgm000/d7d5e7cfaefa09885cf115c5f4b3c2e8 to your computer and use it in GitHub Desktop.
int x = 0;
int y = 0;
import ddf.minim.*;
import ddf.minim.signals.*;
Minim minim;
AudioPlayer mySound;
void setup() {
size(800, 800);
background(#e7e7e7);
noStroke();
rectMode(CENTER);
minim = new Minim(this);
mySound = minim.loadFile("song1.mp3");
mySound.play();
}
int n=0;
void draw() {
for (int i = 0; i <=0; i++) {
translate(width/2, height/2);
fill(random(255), random(255), random(255));
rect(i, i, mySound.left.get(i)*600, mySound.left.get(i)*600);
}
}
@edmorais
Copy link

Ou:

// ...
AudioInput mySound;

void setup() {
  // manter o resto até à linha 14
  mySound = minim.getLineIn(minim.MONO, 1024);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment