Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Trying to get this example working (vector soundwaves)

$
0
0

Pretty neat idea I found at this link: https://issuu.com/iuritrombini/docs/remix_revealing_unintended_arrangem

Basically using a soundwave to generate vector points which are then connected with lines.

I'd love to try and modify this to then create some kind of mesh or solid which can then be exported and finally 3d printed.

I have tried transcribing the code from the pdf on the webpage but I'm getting a bunch of errors.

Quite new to processing was wondering if anyone can help me get it working? Thanks

import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;


Audio-player player;
player = minim.loadFile("audio.mp3");
for(int i = 0; i < player.mix.size() - 1;i++){
  if(hvalue < abs(player.mix.get(i))){
    hvalue = abs(player.mix.get(i));
  }
}
if(hvalue > threshold){
  float xp = random(-300,300);
  float yp = random(-300,300);
  float zp = random(-300,300);
  points.add(new PVector(xp,yp,zp));
}

PVector newcoor = points.get(i);
xr = xr + newcoor.x;
yr = yr + newcoor.y;
zr = zr + newcoor.z;

for( int j = 0; j < points.size(); j++){
  PVector coor1 = points.get(i);
  PVector coor2 = points.get(j);

  line(coor1.x,coor1.y,coor1.z,coor2.x,coor2.y,coor2.z);
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles