//import traer.physics.*; import SoniaHelper.*; import pitaru.sonia_v2_9.*; import processing.opengl.*; //import javax.media.opengl.*; class Circle { Circle() { } float x, y; float ox, oy; float size; float distance; int partnerIdx; int repelIdx; boolean connect; } int spectrumLength=2048; // Needs to be power of 2 int bandsteps; float maxdist,damperval; SoniaHelper ffthelper; int numCircles = 700; Circle[] circles; int numRepels = 2; vec3[] repelPos; PGraphicsOpenGL pgl; GL opengl; //GLU glu; //ParticleSystem physics; //Particle last; CG cg; void setup() { size( 800, 600, OPENGL ); // if enabled the screen will clear hint( ENABLE_OPENGL_4X_SMOOTH ); smooth(); /////////////////////////////////////////////////////////// // Start sonia sound library /////////////////////////////////////////////////////////// Sonia.start(this); // line input set up LiveInput.start(spectrumLength); LiveInput.useEnvelope( true, 2.4f ); // LiveInput.useEqualizer( true ); // SoniaHelper( int _n, int _nbands,boolean doAvg ) ffthelper=new SoniaHelper( spectrumLength, 256, false ); ffthelper.setMaxLimits( 200, 2000 ); damperval=0.5f; ffthelper.setDamper( damperval ); repelPos = new vec3[numRepels]; repelPos[0] = new vec3( width/2, 0, 0 ); repelPos[1] = new vec3( 0, height/2, 0 ); int i; circles = new Circle[numCircles]; randomSeed( 888 ); for( i=0; i 196 ) p.kill(); }*/ // // compute repulsion force // repulseForce(); // // draw each particle and connecting lines // fill( 255 ); for( i=0; i width+10 ) repelPos[i].x = -10; if( repelPos[i].y < -10 ) repelPos[i].y = height; if( repelPos[i].y > height ) repelPos[i].y = -10; } for( int j=0; j rad ) circles[i].size = rad; // if( circles[i].size < -rad ) circles[i].size = -rad; } } } void keyPressed() { if( key == 's' ) { saveFrame( "frame.tga" ); } } void stop() { super.stop(); }