Trying to get this example working (vector soundwaves)

edited July 2017 in Library Questions

Pretty neat idea I found at this link:

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);



  • That's not all the code. The author has only included a sample to illustrate their process.

    You also need to look into the basics of processing sketches first as you are missing the setup(), draw() and most, if not all of the initialisations.

    Best of luck.

Sign In or Register to comment.