How to respond with each point seperate in the spiral

edited June 2016 in Library Questions

Hello together, i am a student from Germany and my english isn´t the best. Sorry for that. I need your help for a project named visual music. I havent so much experience in processing, so i hope you can help me.

My code interprets data from cSound with Processing. The code works, but now i want to change the colour and size values of each generated point in my spiral. It should change them in addiction to the imported data ( int circle_color_r, circle_color_g, circle_color_b and float value). Here is my (Processing)code. Do you have a solution for me?

import netP5.*;
import oscP5.*;
OscP5 oscP5;
NetAddress myRemoteLocation;

int circle_color_r ;
int circle_color_g ;
int circle_color_b ;
float ang=0;
int mx,my;
float value;
float size;

void setup(){
  size(500,500);
  background(0);
  frameRate(100);
  mx=width/2;
  my=height/2;
  oscP5 = new OscP5(this,12000); //Portangabe  
}

void draw(){
  strokeWeight(size); //stärke der Punkte
  rect(0,0,width,height);
  float ray=0.2;
  ang-=1.1; //Winkelgeschwindigkeit

  for(int i=0;i<650;i++){
    ray*=1.0022;
    ray+=0.2;
    float maxray = ray*1.1;//streuung
    float a = radians(ang+i);

    stroke(circle_color_r, circle_color_g, circle_color_b); 
    point(mx+ cos(a)*random(ray,maxray),my+sin(a)*random(ray,maxray)); 
  }
   this.size = value*10;
   saveFrame();
 }
void oscEvent(OscMessage theOscMessage) {
   if(theOscMessage.checkAddrPattern("/freq")==true)
  {
   value = theOscMessage.get(0).floatValue();
  print(value);
  }
  if(theOscMessage.checkAddrPattern("/color")==true)
  {
   circle_color_r = theOscMessage.get(0).intValue();
   circle_color_g = theOscMessage.get(1).intValue();
   circle_color_b = theOscMessage.get(2).intValue();
print(circle_color_r);
  } 
}
Sign In or Register to comment.