Hi everyone!
I really love sketches like these two:
They are based off the noise function in processing, but I would like to try and change them to work off music files.
Using Minim to play an audio file, I’ve tried swapping “noise” in the line to the output of an audio file, but can’t get the syntax to work- it keeps generating various errors. Here’s what I tried:
Original-
“vertex(x,y-i+ (noise(x*.01, (frameCount*.01), i*.01 )300))"
My attempts-
"vertex(x,y-i+ (player.left.get(x.01, (frameCount*.01), i*.01 )300))"
"vertex(x,y-i+ (player.bufferSize(x.01, (frameCount*.01), i*.01 )*300))”
Does anyone know how I can do this, so that the sketch generates similar patterns based on an audio file rather than noise? Or is this simply not possible?
Here’s more of the code from that sketch:
void draw()
{
background(255);
noFill();
stroke(0,100);
for(int i = 0; i < 100; i+=1.5)
{
beginShape();
vertex(0,height);
for(int x = 0; x < width; x+=5)
{
//noise always return a number between 0,1
vertex(x,y-i+ (noise(x*.01, (frameCount*.01), i*.01 )*300));
}
vertex(width, height);
endShape();
}
}