video luminance array...beginner...
in
Core Library Questions
•
2 years ago
I am really new to Processing and have too many ideas sometimes...I am simply trying to take a video cam frame from capture.read() (I'd like to stick to the core library's for now because I have so much to learn... ), and divide that in to an array. For each address I want to determine the x,y pos of the average 0-255 luminance (a single pixel or small averaged grouping, probably..)
...that gets used (hopefully) to send information to this bit of code (in progress...)
void playsound() {
// load audio sample
player = minim.loadFile(s, 2048);
out = minim.getLineOut();
out.printControls();
mouseXY = new PVector(mouseX, mouseY);
centerpoint = new PVector(x + w/2, y + h/2);
d = PVector.dist(centerpoint, mouseXY);
float val = map(d, 0, 800, -3, -80);
out.setGain(val);
player.loop();
println(d);
println(val);
}
// load audio sample
player = minim.loadFile(s, 2048);
out = minim.getLineOut();
out.printControls();
mouseXY = new PVector(mouseX, mouseY);
centerpoint = new PVector(x + w/2, y + h/2);
d = PVector.dist(centerpoint, mouseXY);
float val = map(d, 0, 800, -3, -80);
out.setGain(val);
player.loop();
println(d);
println(val);
}
which is currently supposed to be using the centrepoint of each of my grid cells (array) and the mouseXY position (this to become the pixelXY pos tracked in my question above); I calculate the distance between those points and use that value to control the gain (which I'm understanding to be the best way to control the 'volume' of each sample). The problem right now is that set up this way its also playing all the samples at once with no perceptable change in levels...more stuff to figure out
i guess that's a lot...as you can see i am very new to this but would really appreciate any pointers or assistance as i try to learn to make art with code - my specific problem right now is video processing to get an array of moving pixel coordinates. I have sampled a lot of code in the past and now that I'm trying to learn to control my own direction with it more, it seems unusually difficult.
thanks to all who have helped before - this forum is truly an undertaking of good things, and sorry for the long post!
1