Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
ivitopp
ivitopp's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
simple sound reactive ellipse (please help)
[5 Replies]
31-Mar-2013 11:38 AM
Forum:
Core Library Questions
hey all, im doing an art project but im new to code,
i need to make an ellipse start and expand each time a sound goes in pocessing
i already did the drawing based on a sketch from openprocessing, now i just need to make it start from sound and not from keypressed,
im using the minim library
here is my code:
ArrayList Circles = new ArrayList();
Circle D;
import ddf.minim.*; //minim audio input
Minim minim;
AudioInput in;
int s = 1700; // audio input sensivity
void setup(){
size(600,600);
smooth();
minim = new Minim(this);
minim.debugOn();
in = minim.getLineIn(Minim.MONO, 64);
}
void draw(){
background(0);
strokeWeight(3);
for (int i=0; i<Circles.size(); i++){
Circle D = (Circle) Circles.get(i);
D.run();
}
}
class Circle {
PVector pos;
color c;
float s;
int age;
Circle( PVector _pos, color _c, float _s ) {
pos = _pos;
c = _c;
s = _s;
}
void run() {
render();
age += 3;
if(age > 600) {
Circles.remove(this);
}
}
void render() {
stroke(255,255,255);
fill(255, 255, 255, 155-age*0.35);
ellipse( width/2, height/2, age*1.5, age*1.5 );
}
}
void keyPressed(){
Circle D = new Circle( new PVector(random(width), random(height)), color(100),0);
Circles.add(D);
}
void stop(){
in.close();
minim.stop();
super.stop();
}
thank you very much for your time!
i really apreciate all the help!
«Prev
Next »
Moderate user : ivitopp
Forum