Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
gat123
gat123's Profile
1
Posts
0
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
minim audio question for art istallation
[1 Reply]
08-Aug-2011 11:35 PM
Forum:
Core Library Questions
hi to everyone!
I'm a beginner in processing and I need a sketch that simply change background from white to black when microphone detect a sound.
So when microphone detect a sound, processing draw a black rect that have same high and width of canvas.
I think that I've to use minim audio, I found on web this code, but I need something different. Thanks a lot
import ddf.minim.*;
Minim minim;
AudioInput in;
void setup()
{ size(512, 200, P3D);
minim = new Minim(this);
minim.debugOn();
// get a line in from Minim, default bit depth is 16
in = minim.getLineIn(Minim.STEREO, 512); }
void draw() { background(0); stroke(255); // draw the waveforms
for(int i = 0; i < in.bufferSize() - 1; i++) {
line(i, 50 + in.left.get(i)*50, i+1, 50 + in.left.get(i+1)*50);
line(i, 150 + in.right.get(i)*50, i+1, 150 + in.right.get(i+1)*50);
}
}
void stop() {
// always close Minim audio classes when you are done with them
in.close(); minim.stop();
super.stop();
}
«Prev
Next »
Moderate user : gat123
Forum